]> source.dussan.org Git - aspectj.git/commitdiff
AspectJ6: picking up compiler interface changes
authoraclement <aclement>
Thu, 17 Jan 2008 00:27:21 +0000 (00:27 +0000)
committeraclement <aclement>
Thu, 17 Jan 2008 00:27:21 +0000 (00:27 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AtAspectJAnnotationFactory.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java

index bd0eb825fcf90f7a633097aebdbb012b15e69364..965eef3a3bd8eb275daed386cca6e446118f6837 100644 (file)
@@ -63,7 +63,7 @@ public class AtAspectJAnnotationFactory {
                NormalAnnotation atAspectAnnotation = new NormalAnnotation(orgAspectJLangAnnotationAspect,pos);
                if (!perclause.equals("")) {
                        // we have to set the value
-                       Expression perclauseExpr = new StringLiteral(perclause.toCharArray(),pos,pos);
+                       Expression perclauseExpr = new StringLiteral(perclause.toCharArray(),pos,pos,1);
                        MemberValuePair[] mvps = new MemberValuePair[1];
                        mvps[0] = new MemberValuePair(value,pos,pos,perclauseExpr);
                        atAspectAnnotation.memberValuePairs = mvps;
@@ -84,10 +84,10 @@ public class AtAspectJAnnotationFactory {
                long[] positions = new long[] {pos,pos,pos,pos,pos};
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
+               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
                MemberValuePair[] mvps = new MemberValuePair[2];
                mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
-               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
+               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1);
                mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
                ann.memberValuePairs = mvps;
                return ann;
@@ -98,10 +98,10 @@ public class AtAspectJAnnotationFactory {
                long[] positions = new long[] {pos,pos,pos,pos,pos};
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
+               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
                MemberValuePair[] mvps = new MemberValuePair[2];
                mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
-               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
+               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1);
                mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
                ann.memberValuePairs = mvps;
                return ann;
@@ -112,12 +112,12 @@ public class AtAspectJAnnotationFactory {
                long[] positions = new long[] {pos,pos,pos,pos,pos};
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
+               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
                MemberValuePair[] mvps = new MemberValuePair[3];
                mvps[0] = new MemberValuePair("pointcut".toCharArray(),pos,pos,pcExpr);
-               Expression argExpr = new StringLiteral(extraArgumentName.toCharArray(),pos,pos);
+               Expression argExpr = new StringLiteral(extraArgumentName.toCharArray(),pos,pos,1);
                mvps[1] = new MemberValuePair("returning".toCharArray(),pos,pos,argExpr);
-               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
+               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1);
                mvps[2] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
                ann.memberValuePairs = mvps;
                return ann;
@@ -128,12 +128,12 @@ public class AtAspectJAnnotationFactory {
                long[] positions = new long[] {pos,pos,pos,pos,pos};
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
+               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
                MemberValuePair[] mvps = new MemberValuePair[3];
                mvps[0] = new MemberValuePair("pointcut".toCharArray(),pos,pos,pcExpr);
-               Expression argExpr = new StringLiteral(extraArgumentName.toCharArray(),pos,pos);
+               Expression argExpr = new StringLiteral(extraArgumentName.toCharArray(),pos,pos,1);
                mvps[1] = new MemberValuePair("throwing".toCharArray(),pos,pos,argExpr);
-               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
+               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1);
                mvps[2] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
                ann.memberValuePairs = mvps;
                return ann;
@@ -144,10 +144,10 @@ public class AtAspectJAnnotationFactory {
                long[] positions = new long[] {pos,pos,pos,pos,pos};
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
+               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
                MemberValuePair[] mvps = new MemberValuePair[2];
                mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
-               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
+               Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1);
                mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
                ann.memberValuePairs = mvps;
                return ann;
@@ -158,10 +158,10 @@ public class AtAspectJAnnotationFactory {
                long[] positions = new long[] {pos,pos,pos,pos,pos};
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
+               Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
                MemberValuePair[] mvps = new MemberValuePair[2];
                mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
-               Expression argExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
+               Expression argExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1);
                mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argExpr);
                ann.memberValuePairs = mvps;
                return ann;     
@@ -173,8 +173,8 @@ public class AtAspectJAnnotationFactory {
                for (int i = 0; i < positions.length; i++) positions[i] = pos;
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression pcutExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
-               Expression msgExpr = new StringLiteral(message.toCharArray(),pos,pos);
+               Expression pcutExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
+               Expression msgExpr = new StringLiteral(message.toCharArray(),pos,pos,1);
                Expression isErrorExpr;
                if (isError) {
                        isErrorExpr = new TrueLiteral(pos,pos);
@@ -195,8 +195,8 @@ public class AtAspectJAnnotationFactory {
                for (int i = 0; i < positions.length; i++) positions[i] = pos;
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression targetExpression = new StringLiteral(childPattern.toCharArray(),pos,pos);
-               Expression parentsExpression = new StringLiteral(parentPatterns.toCharArray(),pos,pos);
+               Expression targetExpression = new StringLiteral(childPattern.toCharArray(),pos,pos,1);
+               Expression parentsExpression = new StringLiteral(parentPatterns.toCharArray(),pos,pos,1);
                Expression isExtendsExpression;
                if (isExtends) {
                        isExtendsExpression = new TrueLiteral(pos,pos);
@@ -217,8 +217,8 @@ public class AtAspectJAnnotationFactory {
                for (int i = 0; i < positions.length; i++) positions[i] = pos;
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression pcutExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
-               Expression exExpr = new StringLiteral(exceptionType.toCharArray(),pos,pos);
+               Expression pcutExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
+               Expression exExpr = new StringLiteral(exceptionType.toCharArray(),pos,pos,1);
                MemberValuePair[] mvps = new MemberValuePair[2];
                mvps[0] = new MemberValuePair("pointcut".toCharArray(),pos,pos,pcutExpr);
                mvps[1] = new MemberValuePair("exceptionType".toCharArray(),pos,pos,exExpr);
@@ -232,9 +232,9 @@ public class AtAspectJAnnotationFactory {
                for (int i = 0; i < positions.length; i++) positions[i] = pos;
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression pattExpr = new StringLiteral(patternString.toCharArray(),pos,pos);
-               Expression annExpr = new StringLiteral(annString.toCharArray(),pos,pos);
-               Expression kindExpr = new StringLiteral(kind.toCharArray(),pos,pos);
+               Expression pattExpr = new StringLiteral(patternString.toCharArray(),pos,pos,1);
+               Expression annExpr = new StringLiteral(annString.toCharArray(),pos,pos,1);
+               Expression kindExpr = new StringLiteral(kind.toCharArray(),pos,pos,1);
                MemberValuePair[] mvps = new MemberValuePair[3];
                mvps[0] = new MemberValuePair("pattern".toCharArray(),pos,pos,pattExpr);
                mvps[1] = new MemberValuePair("annotation".toCharArray(),pos,pos,annExpr);
@@ -249,8 +249,8 @@ public class AtAspectJAnnotationFactory {
                for (int i = 0; i < positions.length; i++) positions[i] = pos;
                TypeReference annType = new QualifiedTypeReference(typeName,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression targetExpr = new StringLiteral(targetTypeName,pos,pos);
-               Expression nameExpr = new StringLiteral(name,pos,pos);
+               Expression targetExpr = new StringLiteral(targetTypeName,pos,pos,1);
+               Expression nameExpr = new StringLiteral(name,pos,pos,1);
                Expression modsExpr = new IntLiteral(Integer.toString(modifiers).toCharArray(),pos,pos);
                MemberValuePair[] mvps = new MemberValuePair[3];
                mvps[0] = new MemberValuePair("targetType".toCharArray(),pos,pos,targetExpr);
@@ -271,7 +271,7 @@ public class AtAspectJAnnotationFactory {
                for (int i = 0; i < positions.length; i++) positions[i] = pos;
                TypeReference annType = new QualifiedTypeReference(name,positions);
                NormalAnnotation ann = new NormalAnnotation(annType,pos);
-               Expression valueExpr = new StringLiteral(annValue.toCharArray(),pos,pos);
+               Expression valueExpr = new StringLiteral(annValue.toCharArray(),pos,pos,1);
                MemberValuePair[] mvps = new MemberValuePair[1];
                mvps[0] = new MemberValuePair(value,pos,pos,valueExpr);
                ann.memberValuePairs = mvps;
index 955c835f7d635bdd110a9f9e70ac2ffbcdcd727e..4c3eeff0672d45b3d84f6b77fb9547304b7544f0 100644 (file)
@@ -32,6 +32,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleType
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleTypeReference;
 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.lookup.ClassScope;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
@@ -80,7 +81,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
        public InterTypeDeclaration(CompilationResult result, TypeReference onType) {
                super(result);
                setOnType(onType);
-               modifiers = AccPublic | AccStatic;
+               modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic;
        }
 
        public void setOnType(TypeReference onType) {
@@ -266,7 +267,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
                                String array_element = (String)typeVariableAliases.get(i);
                                SingleTypeReference str = new SingleTypeReference(array_element.toCharArray(),0);
                                TypeBinding tb = str.getTypeBindingPublic(classScope);
-                               if (tb!=null && !(tb instanceof ProblemReferenceBinding)) {
+                               if (tb!=null && !(tb instanceof ProblemReferenceBinding)) {// && !(tb instanceof TypeVariableBinding)) {
                                        scope.problemReporter().signalError(sourceStart,sourceEnd,
                                                        "Intertype declarations can only be made on the generic type, not on a parameterized type. The name '"+
                                                        array_element+"' cannot be used as a type parameter, since it refers to a real type.");
index eb3af61dc4e2d41893678272e7cb6e5a01f892ee..9e2f9a7ebdb35151f5642469cab6c8a3d64482a8 100644 (file)
@@ -304,8 +304,10 @@ public class InterTypeFieldDeclaration extends InterTypeDeclaration {
                
                // Build a half correct resolvedmember (makeResolvedMember understands tvars) then build a fully correct sig from it
                ResolvedMember sigtemp = world.makeResolvedMemberForITD(binding,onTypeBinding,interTypeScope.getRecoveryAliases());
+               UnresolvedType returnType = sigtemp.getReturnType();
+//             if (returnType.isParameterizedType() || returnType.isGenericType()) returnType = returnType.getRawType();
                ResolvedMember sig = new ResolvedMemberImpl(Member.FIELD,declaringType,declaredModifiers,
-                                                 sigtemp.getReturnType(),new String(declaredSelector),UnresolvedType.NONE);
+                                                 returnType,new String(declaredSelector),UnresolvedType.NONE);
                sig.setTypeVariables(sigtemp.getTypeVariables());
                
                NewFieldTypeMunger myMunger = new NewFieldTypeMunger(sig, null,typeVariableAliases);
@@ -315,7 +317,7 @@ public class InterTypeFieldDeclaration extends InterTypeDeclaration {
                        myMunger.getInitMethod(aspectType);
                this.selector = binding.selector = me.getName().toCharArray();
                this.realFieldType = this.binding.returnType;
-               this.binding.returnType = TypeBinding.VoidBinding;
+               this.binding.returnType = TypeBinding.VOID;
                //??? all other pieces should already match
                
                return new EclipseTypeMunger(world, myMunger, aspectType, this);
index 6dad0b35afe12e476fa6e477aa9dcfafc97a6b4d..9a457245e3ed3b0e231351e9f193c2bf205e4e43 100644 (file)
@@ -26,7 +26,9 @@ 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.TypeDeclaration;
 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.lookup.ClassScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
 import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser;
 import org.aspectj.weaver.AjAttribute;
@@ -193,7 +195,7 @@ public class PointcutDeclaration extends AjMethodDeclaration {
 
        public void resolveStatements() {
                if (isAbstract()) {
-                       this.modifiers |= AccSemicolonBody;
+                       this.modifiers |= ExtraCompilerModifiers.AccSemicolonBody;
                }
                
                
@@ -250,7 +252,7 @@ public class PointcutDeclaration extends AjMethodDeclaration {
                addVersionAttributeIfNecessary(classFile);
                
                if (generateSyntheticPointcutMethod) {
-                       this.binding.modifiers |= AccSynthetic;
+                       this.binding.modifiers |= ClassFileConstants.AccSynthetic;
                        super.generateCode(classScope,classFile);
                }
                return;