diff options
author | Andy Clement <aclement@pivotal.io> | 2018-04-18 13:15:22 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2018-04-18 13:15:22 -0700 |
commit | 836beab108ef4be8b59c1ad9c8596ce959bdf1c7 (patch) | |
tree | 9346f87088aceecb16fad6f3b70753235051f504 /org.aspectj.ajdt.core | |
parent | b2cb18ef127097ad2c258b9d061cc70b5fb19432 (diff) | |
download | aspectj-836beab108ef4be8b59c1ad9c8596ce959bdf1c7.tar.gz aspectj-836beab108ef4be8b59c1ad9c8596ce959bdf1c7.zip |
Support Java10
Diffstat (limited to 'org.aspectj.ajdt.core')
6 files changed, 23 insertions, 8 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java index 032719165..448618c11 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java @@ -832,11 +832,15 @@ public class BuildArgParser extends Main { } else if (arg.equals("-1.9")) { buildConfig.setBehaveInJava5Way(true); unparsedArgs.add("-1.9"); + } else if (arg.equals("-10")) { + buildConfig.setBehaveInJava5Way(true); + unparsedArgs.add("-10"); } else if (arg.equals("-source")) { if (args.size() > nextArgIndex) { String level = args.get(nextArgIndex).getValue(); if (level.equals("1.5") || level.equals("5") || level.equals("1.6") || level.equals("6") || level.equals("1.7") - || level.equals("7") || level.equals("8") || level.equals("1.8") || level.equals("9") || level.equals("1.9")) { + || level.equals("7") || level.equals("8") || level.equals("1.8") + || level.equals("9") || level.equals("1.9") || level.equals("10")) { buildConfig.setBehaveInJava5Way(true); } unparsedArgs.add("-source"); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java index 0590df712..f2a938c4e 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java @@ -56,9 +56,10 @@ public class AjMethodDeclaration extends MethodDeclaration { return classFile.generateMethodInfoAttributes(binding,extras); } + @Override protected int generateInfoAttributes(ClassFile classFile) { return generateInfoAttributes(classFile,false); - } + } protected void addDeclarationStartLineAttribute(List extraAttributeList, ClassFile classFile) { if ((classFile.codeStream.generateAttributes & ClassFileConstants.ATTR_LINES)==0) return; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java index 3355c94c9..fc0d42154 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java @@ -22,14 +22,12 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference; import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CodeStream; import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.Opcodes; import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowContext; import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo; -import org.aspectj.org.eclipse.jdt.internal.compiler.flow.InitializationFlowContext; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; @@ -59,9 +57,10 @@ import org.aspectj.weaver.UnresolvedType; */ public class InterTypeMethodDeclaration extends InterTypeDeclaration { public InterTypeMethodDeclaration(CompilationResult result, TypeReference onType) { - super(result, onType); + super(result, onType); } + @Override public void parseStatements(Parser parser, CompilationUnitDeclaration unit) { if (ignoreFurtherInvestigation) return; @@ -70,6 +69,7 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration { } } + @Override protected char[] getPrefix() { return (NameMangler.ITD_PREFIX + "interMethod$").toCharArray(); } @@ -91,6 +91,7 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration { super.analyseCode(classScope, flowContext, flowInfo); } + @Override public void resolve(ClassScope upperScope) { if (munger == null) ignoreFurtherInvestigation = true; @@ -119,6 +120,7 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration { super.resolve(upperScope); } + @Override public void resolveStatements() { checkAndSetModifiersForMethod(); if ((modifiers & ExtraCompilerModifiers.AccSemicolonBody) != 0) { @@ -196,6 +198,7 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration { } } + @Override public EclipseTypeMunger build(ClassScope classScope) { EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(classScope); @@ -241,6 +244,7 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration { return new AjAttribute.TypeMunger(munger); } + @Override public void generateCode(ClassScope classScope, ClassFile classFile) { if (ignoreFurtherInvestigation) { // System.err.println("no code for " + this); @@ -339,6 +343,7 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration { classFile.completeMethodInfo(binding,methodAttributeOffset, attributeNumber); } + @Override protected Shadow.Kind getShadowKindForBody() { return Shadow.MethodExecution; } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 975235918..c9ce44abf 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -997,7 +997,12 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour units[i] = moduleCU; } else { units[i] = new CompilationUnit(null, filenames[i], defaultEncoding, null, false, moduleName); - units[i].setModule(moduleCU); + // With Java 10 changes the modulebinding is fetched from the rootenvironment + // this.moduleBinding = rootEnvironment.getModule(this.module); + // rather than using the moduleCU: + // if (this.modCU != null) + // return this.moduleBinding = this.modCU.module(rootEnvironment); +// units[i].setModule(moduleCU); } // new CompilationUnit(null, fileName, encoding, this.destinationPaths[i], // shouldIgnoreOptionalProblems(this.ignoreOptionalProblemsFromFolders, fileName.toCharArray()), diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java index 8014e5ff7..30bc1165b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -2227,7 +2227,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe if (qualifiedNames.length < qualifiedStrings.elementSize) { qualifiedNames = null; } - char[][] simpleNames = ReferenceCollection.internSimpleNames(simpleStrings); + char[][] simpleNames = ReferenceCollection.internSimpleNames(simpleStrings, true); // if a well known name was found then we can skip over these if (simpleNames.length < simpleStrings.elementSize) { simpleNames = null; diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java index 302739e71..e88ae0251 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java @@ -91,7 +91,7 @@ public class AjcTestCase extends TestCase { + File.separator + "bcel-verifier.jar" - + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "asm" + File.separator + "asm-6.0.renamed.jar" + + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "asm" + File.separator + "asm-6.1.1.renamed.jar" // When the build machine executes the tests, it is using code built into jars rather than code build into // bin directories. This means for the necessary types to be found we have to put these jars on the classpath: |