]> source.dussan.org Git - aspectj.git/commitdiff
Java7 merge - in progress
authoraclement <aclement>
Fri, 2 Dec 2011 00:56:44 +0000 (00:56 +0000)
committeraclement <aclement>
Fri, 2 Dec 2011 00:56:44 +0000 (00:56 +0000)
32 files changed:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectClinit.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AtAspectJAnnotationFactory.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/IfMethodDeclaration.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/InterTypeMethodDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/KnownFieldReference.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/Proceed.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjAST.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java
org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjASTTest.java
org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjASTTestCase.java

index ba5de1b90866fbd8ada076328673a70f4518032b..583a4a7737eb0204363f6d1f73abff9be1eddc9c 100644 (file)
@@ -50,7 +50,7 @@ public class BuildArgParser extends Main {
        private static boolean LOADED_BUNDLE = false;
 
        static {
-               Main.bundleName = BUNDLE_NAME;
+//             Main.bundleName = BUNDLE_NAME;
                ResourceBundleFactory.getBundle(Locale.getDefault());
                if (!LOADED_BUNDLE) {
                        LOADED_BUNDLE = true;
@@ -237,12 +237,12 @@ public class BuildArgParser extends Main {
 
                        setDebugOptions();
                        buildConfig.getOptions().set(options);
-               } catch (InvalidInputException iie) {
+               } catch (IllegalArgumentException iae) {
                        ISourceLocation location = null;
                        if (buildConfig.getConfigFile() != null) {
                                location = new SourceLocation(buildConfig.getConfigFile(), 0);
                        }
-                       IMessage m = new Message(iie.getMessage(), IMessage.ERROR, null, location);
+                       IMessage m = new Message(iae.getMessage(), IMessage.ERROR, null, location);
                        handler.handleMessage(m);
                }
                return buildConfig;
index d46012bc9b604a7476f02ff7776763ee56beebf9..91833c9e68e010080729cb5be5632a1c9bd02d33 100644 (file)
@@ -108,7 +108,7 @@ public class AccessForInlineVisitor extends ASTVisitor {
        }
 
        public void endVisit(FieldReference ref, BlockScope scope) {
-               ref.binding = getAccessibleField(ref.binding, ref.receiverType);
+               ref.binding = getAccessibleField(ref.binding, ref.actualReceiverType);
        }
 
        public void endVisit(MessageSend send, BlockScope scope) {
index cfbf9d8efbb6b31cef24c3a4523301b378020085..c5320f08a4964fffa55acf2f3dd3655493c3bd7c 100644 (file)
@@ -32,6 +32,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleTypeReference;
 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.codegen.CodeStream;
+import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.Opcodes;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
@@ -81,7 +82,7 @@ public class AdviceDeclaration extends AjMethodDeclaration {
                l.add(new EclipseAttributeAdapter(makeAttribute()));
                addDeclarationStartLineAttribute(l, classFile);
 
-               return classFile.generateMethodInfoAttribute(binding, false, l);
+               return classFile.generateMethodInfoAttributes(binding, l);
        }
 
        private AjAttribute makeAttribute() {
@@ -109,7 +110,7 @@ public class AdviceDeclaration extends AjMethodDeclaration {
                        TypeBinding argTb = extraArgument.binding.type;
                        TypeBinding expectedTb = upperScope.getJavaLangThrowable();
                        if (!argTb.isCompatibleWith(expectedTb)) {
-                               scope.problemReporter().typeMismatchError(argTb, expectedTb, extraArgument);
+                               scope.problemReporter().typeMismatchError(argTb, expectedTb, extraArgument,null);
                                ignoreFurtherInvestigation = true;
                                return;
                        }
@@ -190,7 +191,7 @@ public class AdviceDeclaration extends AjMethodDeclaration {
 
                classFile.generateMethodInfoHeader(binding);
                int methodAttributeOffset = classFile.contentsOffset;
-               int attributeNumber = classFile.generateMethodInfoAttribute(binding, false, AstUtil.getAjSyntheticAttribute());
+               int attributeNumber = classFile.generateMethodInfoAttributes(binding, AstUtil.getAjSyntheticAttribute());
                int codeAttributeOffset = classFile.contentsOffset;
                classFile.generateCodeAttributeHeader();
                CodeStream codeStream = classFile.codeStream;
@@ -219,7 +220,7 @@ public class AdviceDeclaration extends AjMethodDeclaration {
                        codeStream.load(type, index);
                        index += AstUtil.slotsNeeded(type);
                        if (type.isBaseType()) {
-                               codeStream.invokestatic(AjTypeConstants.getConversionMethodToObject(classScope, type));
+                               codeStream.invoke(Opcodes.OPC_invokestatic, AjTypeConstants.getConversionMethodToObject(classScope, type), null);
                        }
 
                        codeStream.aastore();
@@ -228,11 +229,11 @@ public class AdviceDeclaration extends AjMethodDeclaration {
                // call run
                ReferenceBinding closureType = (ReferenceBinding) binding.parameters[nargs - 1];
                MethodBinding runMethod = closureType.getMethods("run".toCharArray())[0];
-               codeStream.invokevirtual(runMethod);
+               codeStream.invoke(Opcodes.OPC_invokevirtual, runMethod, null);
 
                TypeBinding returnType = binding.returnType;
                if (returnType.isBaseType()) {
-                       codeStream.invokestatic(AjTypeConstants.getConversionMethodFromObject(classScope, returnType));
+                       codeStream.invoke(Opcodes.OPC_invokestatic, AjTypeConstants.getConversionMethodFromObject(classScope, returnType), null);
                } else {
                        codeStream.checkcast(returnType);
                }
@@ -240,7 +241,7 @@ public class AdviceDeclaration extends AjMethodDeclaration {
                codeStream.recordPositionsFrom(0, 1);
                classFile.completeCodeAttribute(codeAttributeOffset);
                attributeNumber++;
-               classFile.completeMethodInfo(methodAttributeOffset, attributeNumber);
+               classFile.completeMethodInfo(binding,methodAttributeOffset, attributeNumber);
        }
 
        // override
index 95ef3856b4dd3efd6bd517153cca819a7f7bff6d..8e9c04d16ec38d8435b37b53dc9f732e30e995da 100644 (file)
@@ -40,7 +40,7 @@ public class AjConstructorDeclaration extends ConstructorDeclaration {
                // add extra attributes into list then call 2-arg version of generateInfoAttributes...
                List extras = new ArrayList();
                addDeclarationStartLineAttribute(extras,classFile);
-               return classFile.generateMethodInfoAttribute(binding,false,extras);
+               return classFile.generateMethodInfoAttributes(binding,extras);
        }
        
        protected void addDeclarationStartLineAttribute(List extraAttributeList, ClassFile classFile) {
index 62bb6dce223cf0b1390296e3078b4fe19f526427..0590df7121a3ef8b8aa2cb2f6fa885eaff9eee92 100644 (file)
@@ -53,7 +53,7 @@ public class AjMethodDeclaration extends MethodDeclaration {
                if (addAjSynthetic) {
                        extras.add(new EclipseAttributeAdapter(new AjAttribute.AjSynthetic()));
                }
-               return classFile.generateMethodInfoAttribute(binding,false,extras);
+               return classFile.generateMethodInfoAttributes(binding,extras);
        }
        
        protected int generateInfoAttributes(ClassFile classFile) {
index 61f695931ee8c6299c577a2b125bcd0c75b6d720..07d779258e1fd773e14845111c457a93ce57be16 100644 (file)
@@ -20,6 +20,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants
 import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.BranchLabel;
 import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CodeStream;
 import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel;
+import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.Opcodes;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
@@ -57,11 +58,10 @@ public class AspectClinit extends Clinit {
                
                if (hasPre) {
                        final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope);
-
-                       codeStream.invokestatic(world.makeMethodBindingForCall(
+                       codeStream.invoke(Opcodes.OPC_invokestatic,world.makeMethodBindingForCall(
                                AjcMemberMaker.ajcPreClinitMethod(
                                        world.fromBinding(classScope.referenceContext.binding)
-                               )));
+                               )),null);
                }
                super.generateSyntheticCode(classScope, codeStream);
        }
@@ -73,11 +73,10 @@ public class AspectClinit extends Clinit {
                super.generatePostSyntheticCode(classScope, codeStream);
                if (hasPost) {
                        final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope);
-
-                       codeStream.invokestatic(world.makeMethodBindingForCall(
+                       codeStream.invoke(Opcodes.OPC_invokestatic,world.makeMethodBindingForCall(
                                AjcMemberMaker.ajcPostClinitMethod(
                                        world.fromBinding(classScope.referenceContext.binding)
-                               )));
+                               )),null);
                }
                
                if (initFailureField != null) {
@@ -91,7 +90,7 @@ public class AspectClinit extends Clinit {
                        // CHECK THIS...
                        codeStream.addVariable(new LocalVariableBinding("caughtException".toCharArray(),initFailureField.type,ClassFileConstants.AccPrivate,false));
                    codeStream.aload_0();
-                       codeStream.putstatic(initFailureField);
+                   codeStream.fieldAccess(Opcodes.OPC_putstatic, initFailureField, null);
                        endLabel.place();
                }
                
index 07b42e6ab2b87af3aba666989ef274254ea716d8..6c6376cfa37b262cb310cbda5f06262e43b61eb8 100644 (file)
@@ -38,6 +38,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants
 import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.BranchLabel;
 import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CodeStream;
 import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel;
+import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.Opcodes;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
@@ -67,6 +68,8 @@ import org.aspectj.weaver.patterns.PerFromSuper;
 import org.aspectj.weaver.patterns.PerSingleton;
 import org.aspectj.weaver.patterns.TypePattern;
 
+import com.sun.org.apache.xpath.internal.compiler.OpCodes;
+
 /**
  * Represents an aspect declaration.
  * 
@@ -428,9 +431,9 @@ public class AspectDeclaration extends TypeDeclaration {
                        List attrs = new ArrayList();
                        attrs.addAll(AstUtil.getAjSyntheticAttribute());
                        attrs.addAll(additionalAttributes);
-                       attributeNumber = classFile.generateMethodInfoAttribute(methodBinding, false, attrs);
+                       attributeNumber = classFile.generateMethodInfoAttributes(methodBinding, attrs);
                } else {
-                       attributeNumber = classFile.generateMethodInfoAttribute(methodBinding, false, AstUtil.getAjSyntheticAttribute());
+                       attributeNumber = classFile.generateMethodInfoAttributes(methodBinding, AstUtil.getAjSyntheticAttribute());
                }
 
                int codeAttributeOffset = classFile.contentsOffset;
@@ -460,7 +463,7 @@ public class AspectDeclaration extends TypeDeclaration {
                }
 
                attributeNumber++;
-               classFile.completeMethodInfo(methodAttributeOffset, attributeNumber);
+               classFile.completeMethodInfo(methodBinding,methodAttributeOffset, attributeNumber);
        }
 
        private void generatePerCflowAspectOfMethod(ClassFile classFile) {
@@ -468,8 +471,9 @@ public class AspectDeclaration extends TypeDeclaration {
                generateMethod(classFile, aspectOfMethod, new BodyGenerator() {
                        public void generate(CodeStream codeStream) {
                                // body starts here
-                               codeStream.getstatic(world.makeFieldBinding(AjcMemberMaker.perCflowField(typeX)));
-                               codeStream.invokevirtual(world.makeMethodBindingForCall(AjcMemberMaker.cflowStackPeekInstance()));
+                               codeStream.fieldAccess(Opcodes.OPC_getstatic,world.makeFieldBinding(AjcMemberMaker.perCflowField(typeX)),null);
+
+                               codeStream.invoke(Opcodes.OPC_invokevirtual,world.makeMethodBindingForCall(AjcMemberMaker.cflowStackPeekInstance()),null);
                                codeStream.checkcast(binding);
                                codeStream.areturn();
                                // body ends here
@@ -483,8 +487,8 @@ public class AspectDeclaration extends TypeDeclaration {
                generateMethod(classFile, hasAspectMethod, new BodyGenerator() {
                        public void generate(CodeStream codeStream) {
                                // body starts here
-                               codeStream.getstatic(world.makeFieldBinding(AjcMemberMaker.perCflowField(typeX)));
-                               codeStream.invokevirtual(world.makeMethodBindingForCall(AjcMemberMaker.cflowStackIsValid()));
+                               codeStream.fieldAccess(Opcodes.OPC_getstatic,world.makeFieldBinding(AjcMemberMaker.perCflowField(typeX)),null);
+                               codeStream.invoke(Opcodes.OPC_invokevirtual,world.makeMethodBindingForCall(AjcMemberMaker.cflowStackIsValid()),null);
                                codeStream.ireturn();
                                // body ends here
                        }
@@ -497,13 +501,13 @@ public class AspectDeclaration extends TypeDeclaration {
                                new BodyGenerator() {
                                        public void generate(CodeStream codeStream) {
                                                // body starts here
-                                               codeStream.getstatic(world.makeFieldBinding(AjcMemberMaker.perCflowField(typeX)));
+                                               codeStream.fieldAccess(Opcodes.OPC_getstatic,world.makeFieldBinding(AjcMemberMaker.perCflowField(typeX)),null);
                                                codeStream.new_(binding);
                                                codeStream.dup();
-                                               codeStream.invokespecial(new MethodBinding(0, "<init>".toCharArray(), TypeBinding.VOID, new TypeBinding[0],
-                                                               new ReferenceBinding[0], binding));
+                                               codeStream.invoke(Opcodes.OPC_invokespecial,new MethodBinding(0, "<init>".toCharArray(), TypeBinding.VOID, new TypeBinding[0],
+                                                               new ReferenceBinding[0], binding),null);
 
-                                               codeStream.invokevirtual(world.makeMethodBindingForCall(AjcMemberMaker.cflowStackPushInstance()));
+                                               codeStream.invoke(Opcodes.OPC_invokevirtual, world.makeMethodBindingForCall(AjcMemberMaker.cflowStackPushInstance()), null);
                                                codeStream.return_();
                                                // body ends here
                                        }
@@ -519,8 +523,8 @@ public class AspectDeclaration extends TypeDeclaration {
                                                // body starts here
                                                codeStream.new_(world.makeTypeBinding(AjcMemberMaker.CFLOW_STACK_TYPE));
                                                codeStream.dup();
-                                               codeStream.invokespecial(world.makeMethodBindingForCall(AjcMemberMaker.cflowStackInit()));
-                                               codeStream.putstatic(world.makeFieldBinding(AjcMemberMaker.perCflowField(typeX)));
+                                               codeStream.invoke(Opcodes.OPC_invokespecial,world.makeMethodBindingForCall(AjcMemberMaker.cflowStackInit()),null);
+                                               codeStream.fieldAccess(Opcodes.OPC_putstatic,world.makeFieldBinding(AjcMemberMaker.perCflowField(typeX)),null);
                                                codeStream.return_();
                                                // body ends here
                                        }
@@ -558,7 +562,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                                .makeTypeBinding(UnresolvedType.JL_EXCEPTION));
                                anythingGoesWrong.placeStart();
                                codeStream.aload_0();
-                               codeStream.invokestatic(world.makeMethodBindingForCall(AjcMemberMaker.perTypeWithinGetInstance(typeX)));
+                               codeStream.invoke(Opcodes.OPC_invokestatic,world.makeMethodBindingForCall(AjcMemberMaker.perTypeWithinGetInstance(typeX)),null);
                                codeStream.astore_1();
                                codeStream.aload_1();
                                codeStream.ifnonnull(instanceFound);
@@ -568,7 +572,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                codeStream.ldc(typeX.getName());
                                codeStream.aconst_null();
 
-                               codeStream.invokespecial(world.makeMethodBindingForCall(AjcMemberMaker.noAspectBoundExceptionInit2()));
+                               codeStream.invoke(Opcodes.OPC_invokespecial,world.makeMethodBindingForCall(AjcMemberMaker.noAspectBoundExceptionInit2()),null);
                                codeStream.athrow();
                                instanceFound.place();
                                codeStream.aload_1();
@@ -583,7 +587,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                codeStream.dup();
 
                                // Run the simple ctor for NABE
-                               codeStream.invokespecial(world.makeMethodBindingForCall(AjcMemberMaker.noAspectBoundExceptionInit()));
+                               codeStream.invoke(Opcodes.OPC_invokespecial,world.makeMethodBindingForCall(AjcMemberMaker.noAspectBoundExceptionInit()),null);
                                codeStream.athrow();
                        }
                });
@@ -601,7 +605,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                codeStream.ifeq(wrongType);
                                codeStream.aload_0();
                                codeStream.checkcast(interfaceType);
-                               codeStream.invokeinterface(world.makeMethodBindingForCall(AjcMemberMaker.perObjectInterfaceGet(typeX)));
+                               codeStream.invoke(Opcodes.OPC_invokeinterface,world.makeMethodBindingForCall(AjcMemberMaker.perObjectInterfaceGet(typeX)),null);
 
                                codeStream.dup();
                                codeStream.ifnull(popWrongType);
@@ -613,7 +617,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                wrongType.place();
                                codeStream.new_(world.makeTypeBinding(AjcMemberMaker.NO_ASPECT_BOUND_EXCEPTION));
                                codeStream.dup();
-                               codeStream.invokespecial(world.makeMethodBindingForCall(AjcMemberMaker.noAspectBoundExceptionInit()));
+                               codeStream.invoke(Opcodes.OPC_invokespecial,world.makeMethodBindingForCall(AjcMemberMaker.noAspectBoundExceptionInit()),null);
                                codeStream.athrow();
                                // body ends here
                        }
@@ -632,7 +636,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                codeStream.ifeq(wrongType);
                                codeStream.aload_0();
                                codeStream.checkcast(interfaceType);
-                               codeStream.invokeinterface(world.makeMethodBindingForCall(AjcMemberMaker.perObjectInterfaceGet(typeX)));
+                               codeStream.invoke(Opcodes.OPC_invokeinterface,world.makeMethodBindingForCall(AjcMemberMaker.perObjectInterfaceGet(typeX)),null);
                                codeStream.ifnull(wrongType);
                                codeStream.iconst_1();
                                codeStream.ireturn();
@@ -655,7 +659,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                BranchLabel leave = new BranchLabel(codeStream);
                                goneBang.placeStart();
                                codeStream.aload_0();
-                               codeStream.invokestatic(world.makeMethodBinding(AjcMemberMaker.perTypeWithinGetInstance(typeX)));
+                               codeStream.invoke(Opcodes.OPC_invokestatic,world.makeMethodBinding(AjcMemberMaker.perTypeWithinGetInstance(typeX)),null);
                                codeStream.ifnull(noInstanceExists);
                                codeStream.iconst_1();
                                codeStream.goto_(leave);
@@ -683,7 +687,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                codeStream.ifeq(wrongType); // XXX this case might call for screaming
                                codeStream.aload_0();
                                codeStream.checkcast(interfaceType);
-                               codeStream.invokeinterface(world.makeMethodBindingForCall(AjcMemberMaker.perObjectInterfaceGet(typeX)));
+                               codeStream.invoke(Opcodes.OPC_invokeinterface,world.makeMethodBindingForCall(AjcMemberMaker.perObjectInterfaceGet(typeX)),null);
                                // XXX should do a check for null here and throw a NoAspectBound
                                codeStream.ifnonnull(wrongType);
 
@@ -691,9 +695,9 @@ public class AspectDeclaration extends TypeDeclaration {
                                codeStream.checkcast(interfaceType);
                                codeStream.new_(binding);
                                codeStream.dup();
-                               codeStream.invokespecial(new MethodBinding(0, "<init>".toCharArray(), TypeBinding.VOID, new TypeBinding[0],
-                                               new ReferenceBinding[0], binding));
-                               codeStream.invokeinterface(world.makeMethodBindingForCall(AjcMemberMaker.perObjectInterfaceSet(typeX)));
+                               codeStream.invoke(Opcodes.OPC_invokespecial,new MethodBinding(0, "<init>".toCharArray(), TypeBinding.VOID, new TypeBinding[0],
+                                               new ReferenceBinding[0], binding),null);
+                               codeStream.invoke(Opcodes.OPC_invokeinterface,world.makeMethodBindingForCall(AjcMemberMaker.perObjectInterfaceSet(typeX)),null);
 
                                wrongType.place();
                                codeStream.return_();
@@ -715,7 +719,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                                ExceptionLabel exc = new ExceptionLabel(codeStream, world.makeTypeBinding(UnresolvedType.JL_EXCEPTION));
                                                exc.placeStart();
                                                codeStream.aload_0();
-                                               codeStream.getfield(world.makeFieldBinding(AjcMemberMaker.perTypeWithinWithinTypeField(typeX, typeX)));
+                                               codeStream.fieldAccess(Opcodes.OPC_getfield,world.makeFieldBinding(AjcMemberMaker.perTypeWithinWithinTypeField(typeX, typeX)),null);
                                                codeStream.areturn();
                                        }
                                });
@@ -731,19 +735,19 @@ public class AspectDeclaration extends TypeDeclaration {
                                codeStream.aload_0();
                                codeStream.ldc(NameMangler.perTypeWithinLocalAspectOf(typeX));
                                codeStream.aconst_null();
-                               codeStream.invokevirtual(new MethodBinding(0, "getDeclaredMethod".toCharArray(),
+                               codeStream.invoke(Opcodes.OPC_invokevirtual,new MethodBinding(0, "getDeclaredMethod".toCharArray(),
                                                world.makeTypeBinding(UnresolvedType.forSignature("Ljava/lang/reflect/Method;")), // return type
                                                new TypeBinding[] { world.makeTypeBinding(UnresolvedType.forSignature("Ljava/lang/String;")),
                                                                world.makeTypeBinding(UnresolvedType.forSignature("[Ljava/lang/Class;")) },
-                                               new ReferenceBinding[0], (ReferenceBinding) world.makeTypeBinding(UnresolvedType.JL_CLASS)));
+                                               new ReferenceBinding[0], (ReferenceBinding) world.makeTypeBinding(UnresolvedType.JL_CLASS)),null);
                                codeStream.astore_1();
                                codeStream.aload_1();
                                codeStream.aconst_null();
                                codeStream.aconst_null();
-                               codeStream.invokevirtual(new MethodBinding(0, "invoke".toCharArray(), world.makeTypeBinding(UnresolvedType.OBJECT),
+                               codeStream.invoke(Opcodes.OPC_invokevirtual,new MethodBinding(0, "invoke".toCharArray(), world.makeTypeBinding(UnresolvedType.OBJECT),
                                                new TypeBinding[] { world.makeTypeBinding(UnresolvedType.OBJECT),
                                                                world.makeTypeBinding(UnresolvedType.forSignature("[Ljava/lang/Object;")) },
-                                               new ReferenceBinding[0], (ReferenceBinding) world.makeTypeBinding(UnresolvedType.JAVA_LANG_REFLECT_METHOD)));
+                                               new ReferenceBinding[0], (ReferenceBinding) world.makeTypeBinding(UnresolvedType.JAVA_LANG_REFLECT_METHOD)),null);
                                codeStream.checkcast(world.makeTypeBinding(typeX));
                                codeStream.astore_2();
                                codeStream.aload_2();
@@ -766,12 +770,12 @@ public class AspectDeclaration extends TypeDeclaration {
 
                                                codeStream.new_(world.makeTypeBinding(typeX));
                                                codeStream.dup();
-                                               codeStream.invokespecial(new MethodBinding(0, "<init>".toCharArray(), TypeBinding.VOID, new TypeBinding[0],
-                                                               new ReferenceBinding[0], binding));
+                                               codeStream.invoke(Opcodes.OPC_invokespecial,new MethodBinding(0, "<init>".toCharArray(), TypeBinding.VOID, new TypeBinding[0],
+                                                               new ReferenceBinding[0], binding),null);
                                                codeStream.astore_1();
                                                codeStream.aload_1();
                                                codeStream.aload_0();
-                                               codeStream.putfield(world.makeFieldBinding(AjcMemberMaker.perTypeWithinWithinTypeField(typeX, typeX)));
+                                               codeStream.fieldAccess(Opcodes.OPC_putfield,world.makeFieldBinding(AjcMemberMaker.perTypeWithinWithinTypeField(typeX, typeX)),null);
                                                codeStream.aload_1();
                                                codeStream.areturn();
                                        }
@@ -810,17 +814,17 @@ public class AspectDeclaration extends TypeDeclaration {
                                 */
                                // body starts here (see end of each line for what it is doing!)
                                FieldBinding fb = world.makeFieldBinding(AjcMemberMaker.perSingletonField(typeX));
-                               codeStream.getstatic(fb); // GETSTATIC
+                               codeStream.fieldAccess(Opcodes.OPC_getstatic, fb, null);
                                BranchLabel isNonNull = new BranchLabel(codeStream);
                                codeStream.ifnonnull(isNonNull); // IFNONNULL
                                codeStream.new_(world.makeTypeBinding(AjcMemberMaker.NO_ASPECT_BOUND_EXCEPTION)); // NEW
                                codeStream.dup(); // DUP
                                codeStream.ldc(typeX.getNameAsIdentifier()); // LDC
-                               codeStream.getstatic(initFailureField); // GETSTATIC
-                               codeStream.invokespecial(world.makeMethodBindingForCall(AjcMemberMaker.noAspectBoundExceptionInitWithCause())); // INVOKESPECIAL
+                               codeStream.fieldAccess(Opcodes.OPC_getstatic,initFailureField,null);
+                               codeStream.invoke(Opcodes.OPC_invokespecial,world.makeMethodBindingForCall(AjcMemberMaker.noAspectBoundExceptionInitWithCause()),null); // INVOKESPECIAL
                                codeStream.athrow(); // ATHROW
                                isNonNull.place();
-                               codeStream.getstatic(fb); // GETSTATIC
+                               codeStream.fieldAccess(Opcodes.OPC_getstatic,fb,null);
                                codeStream.areturn(); // ARETURN
                                // body ends here
                        }
@@ -832,7 +836,7 @@ public class AspectDeclaration extends TypeDeclaration {
                generateMethod(classFile, hasAspectMethod, new BodyGenerator() {
                        public void generate(CodeStream codeStream) {
                                // body starts here
-                               codeStream.getstatic(world.makeFieldBinding(AjcMemberMaker.perSingletonField(typeX)));
+                               codeStream.fieldAccess(Opcodes.OPC_getstatic,world.makeFieldBinding(AjcMemberMaker.perSingletonField(typeX)),null);
                                BranchLabel isNull = new BranchLabel(codeStream);
                                codeStream.ifnull(isNull);
                                codeStream.iconst_1();
@@ -853,10 +857,10 @@ public class AspectDeclaration extends TypeDeclaration {
                                                // body starts here
                                                codeStream.new_(binding);
                                                codeStream.dup();
-                                               codeStream.invokespecial(new MethodBinding(0, "<init>".toCharArray(), TypeBinding.VOID, new TypeBinding[0],
-                                                               new ReferenceBinding[0], binding));
+                                               codeStream.invoke(Opcodes.OPC_invokespecial,new MethodBinding(0, "<init>".toCharArray(), TypeBinding.VOID, new TypeBinding[0],
+                                                               new ReferenceBinding[0], binding),null);
 
-                                               codeStream.putstatic(world.makeFieldBinding(AjcMemberMaker.perSingletonField(typeX)));
+                                               codeStream.fieldAccess(Opcodes.OPC_putstatic, world.makeFieldBinding(AjcMemberMaker.perSingletonField(typeX)), null);
                                                codeStream.return_();
                                                // body ends here
                                        }
@@ -870,7 +874,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                // body starts here
                                codeStream.aload_0();
                                AstUtil.generateParameterLoads(accessMethod.parameters, codeStream, 1);
-                               codeStream.invokespecial(factory.makeMethodBinding(method));
+                               codeStream.invoke(Opcodes.OPC_invokespecial,factory.makeMethodBinding(method),null);
                                AstUtil.generateReturn(accessMethod.returnType, codeStream);
                                // body ends here
                        }
@@ -894,10 +898,10 @@ public class AspectDeclaration extends TypeDeclaration {
                                        public void generate(CodeStream codeStream) {
                                                // body starts here
                                                if (Modifier.isStatic(field.getModifiers())) {
-                                                       codeStream.getstatic(fieldBinding);
+                                                       codeStream.fieldAccess(Opcodes.OPC_getstatic,fieldBinding,null);
                                                } else {
                                                        codeStream.aload_0();
-                                                       codeStream.getfield(fieldBinding);
+                                                       codeStream.fieldAccess(Opcodes.OPC_getfield,fieldBinding,null);
                                                }
 
                                                AstUtil.generateReturn(accessField.reader.returnType, codeStream);
@@ -911,11 +915,11 @@ public class AspectDeclaration extends TypeDeclaration {
                                                // body starts here
                                                if (Modifier.isStatic(field.getModifiers())) {
                                                        codeStream.load(fieldBinding.type, 0);
-                                                       codeStream.putstatic(fieldBinding);
+                                                       codeStream.fieldAccess(Opcodes.OPC_putstatic,fieldBinding,null);
                                                } else {
                                                        codeStream.aload_0();
                                                        codeStream.load(fieldBinding.type, 1);
-                                                       codeStream.putfield(fieldBinding);
+                                                       codeStream.fieldAccess(Opcodes.OPC_putfield,fieldBinding,null);
                                                }
 
                                                codeStream.return_();
@@ -934,9 +938,9 @@ public class AspectDeclaration extends TypeDeclaration {
                                                AstUtil.generateParameterLoads(accessMethod.parameters, codeStream);
 
                                                if (Modifier.isStatic(method.getModifiers())) {
-                                                       codeStream.invokestatic(factory.makeMethodBinding(method));
+                                                       codeStream.invoke(Opcodes.OPC_invokestatic,factory.makeMethodBinding(method),null);
                                                } else {
-                                                       codeStream.invokevirtual(factory.makeMethodBinding(method));
+                                                       codeStream.invoke(Opcodes.OPC_invokevirtual,factory.makeMethodBinding(method),null);
                                                }
 
                                                AstUtil.generateReturn(accessMethod.returnType, codeStream);
@@ -1135,7 +1139,7 @@ public class AspectDeclaration extends TypeDeclaration {
                }
                // may be unresolved if the aspect type binding was a BinaryTypeBinding
                if (innerTypeBinding instanceof UnresolvedReferenceBinding) {
-                       innerTypeBinding = BinaryTypeBinding.resolveType(innerTypeBinding, world.getLookupEnvironment(), true);
+                       innerTypeBinding = (ReferenceBinding)BinaryTypeBinding.resolveType(innerTypeBinding, world.getLookupEnvironment(), true);
                }
                if (innerTypeBinding == null) {
                        throw new IllegalStateException("Could not find inner type binding for '" + munger.getMemberTypeName() + "'");
index eb7810096c72f8e325ade02ac85103fcc27ae999..23c87479515235c8272f05dccc83cd9442eda310 100644 (file)
@@ -116,7 +116,7 @@ public class AstUtil {
        public static SingleNameReference makeLocalVariableReference(LocalVariableBinding binding) {
                SingleNameReference ret = new SingleNameReference(binding.name, 0);
                ret.binding = binding;
-               ret.codegenBinding = binding;
+//             ret.codegenBinding = binding;
                ret.constant = Constant.NotAConstant;
                ret.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits
                ret.bits |= Binding.VARIABLE;
@@ -126,7 +126,7 @@ public class AstUtil {
        public static SingleNameReference makeResolvedLocalVariableReference(LocalVariableBinding binding) {
                SingleNameReference ret = new SingleNameReference(binding.name, 0);
                ret.binding = binding;
-               ret.codegenBinding = binding;
+//             ret.codegenBinding = binding;
                ret.constant = Constant.NotAConstant;
                ret.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits
                ret.bits |= Binding.LOCAL;
@@ -300,7 +300,7 @@ public class AstUtil {
        }
 
        public static void replaceMethodBinding(MessageSend send, MethodBinding newBinding) {
-               send.binding = send.codegenBinding = newBinding;
+               send.binding =/* send.codegenBinding =*/ newBinding;
                send.setActualReceiverType(newBinding.declaringClass);
 
        }
index 965eef3a3bd8eb275daed386cca6e446118f6837..3a9d499f967f15ee4e9ef050a94709ea3c540ef0 100644 (file)
@@ -251,7 +251,7 @@ public class AtAspectJAnnotationFactory {
                NormalAnnotation ann = new NormalAnnotation(annType,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);
+               Expression modsExpr = IntLiteral.buildIntLiteral(Integer.toString(modifiers).toCharArray(),pos,pos);
                MemberValuePair[] mvps = new MemberValuePair[3];
                mvps[0] = new MemberValuePair("targetType".toCharArray(),pos,pos,targetExpr);
                mvps[1] = new MemberValuePair("name".toCharArray(),pos,pos,nameExpr);
index 65115429cbf4e8a128f8fbe2e101ce42cafd76c0..24e463fe31df29d9943642d42dc66e3e3ac46851 100644 (file)
@@ -38,7 +38,7 @@ public class IfMethodDeclaration extends AjMethodDeclaration {
        }
 
        protected int generateInfoAttributes(ClassFile classFile) {
-               return classFile.generateMethodInfoAttribute(binding, false, AstUtil.getAjSyntheticAttribute());
+               return classFile.generateMethodInfoAttributes(binding, AstUtil.getAjSyntheticAttribute());
        }
 
        public void resolveStatements() {
index 4c3eeff0672d45b3d84f6b77fb9547304b7544f0..e17aa5d3d3d72fcfd5a86f2c1707926d58568b04 100644 (file)
@@ -324,7 +324,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
                }
                addDeclarationStartLineAttribute(l,classFile);
 
-               return classFile.generateMethodInfoAttribute(binding, false, l);
+               return classFile.generateMethodInfoAttributes(binding, l);
        }
 
        protected abstract Shadow.Kind getShadowKindForBody();
index aa67fc2efcc791075eb052fb4708bbd34c37d6ab..d4f45dbc3b7ade0275ee1a11c81c85e9aed98a1b 100644 (file)
@@ -30,6 +30,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReturnStatement;
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement;
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
 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.lookup.ArrayBinding;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
@@ -323,8 +324,7 @@ public class InterTypeFieldDeclaration extends InterTypeDeclaration {
                }
                classFile.generateMethodInfoHeader(binding);
                int methodAttributeOffset = classFile.contentsOffset;
-               int attributeNumber = classFile.generateMethodInfoAttribute(binding, false,
-                               makeEffectiveSignatureAttribute(sig, isGetter ? Shadow.FieldGet : Shadow.FieldSet, false));
+               int attributeNumber = classFile.generateMethodInfoAttributes(binding, makeEffectiveSignatureAttribute(sig, isGetter ? Shadow.FieldGet : Shadow.FieldSet, false));
                int codeAttributeOffset = classFile.contentsOffset;
                classFile.generateCodeAttributeHeader();
                CodeStream codeStream = classFile.codeStream;
@@ -377,18 +377,18 @@ public class InterTypeFieldDeclaration extends InterTypeDeclaration {
 
                classFile.completeCodeAttribute(codeAttributeOffset);
                attributeNumber++;
-               classFile.completeMethodInfo(methodAttributeOffset, attributeNumber);
+               classFile.completeMethodInfo(binding,methodAttributeOffset, attributeNumber);
        }
 
        private void generateInterfaceReadBody(MethodBinding binding, MethodBinding readMethod, CodeStream codeStream) {
                codeStream.aload_0();
-               codeStream.invokeinterface(readMethod);
+               codeStream.invoke(Opcodes.OPC_invokeinterface,readMethod,null);
        }
 
        private void generateInterfaceWriteBody(MethodBinding binding, MethodBinding writeMethod, CodeStream codeStream) {
                codeStream.aload_0();
                codeStream.load(writeMethod.parameters[0], 1);
-               codeStream.invokeinterface(writeMethod);
+               codeStream.invoke(Opcodes.OPC_invokeinterface, writeMethod, null);
        }
 
        private void generateClassReadBody(MethodBinding binding, FieldBinding field, CodeStream codeStream) {
@@ -407,18 +407,18 @@ public class InterTypeFieldDeclaration extends InterTypeDeclaration {
                        PrivilegedFieldBinding fBinding = (PrivilegedFieldBinding) handler.getPrivilegedAccessField(field, null);
 
                        if (field.isStatic()) {
-                               codeStream.invokestatic(fBinding.reader);
+                               codeStream.invoke(Opcodes.OPC_invokestatic,fBinding.reader,null);
                        } else {
                                codeStream.aload_0();
-                               codeStream.invokestatic(fBinding.reader);
+                               codeStream.invoke(Opcodes.OPC_invokestatic,fBinding.reader,null);
                        }
                        return;
                }
                if (field.isStatic()) {
-                       codeStream.getstatic(field);
+                       codeStream.fieldAccess(Opcodes.OPC_getstatic,field,null);
                } else {
                        codeStream.aload_0();
-                       codeStream.getfield(field);
+                       codeStream.fieldAccess(Opcodes.OPC_getfield,field,null);
                }
        }
 
@@ -426,24 +426,23 @@ public class InterTypeFieldDeclaration extends InterTypeDeclaration {
                if (field.isPrivate() || !field.canBeSeenBy(binding.declaringClass.fPackage)) {
                        PrivilegedFieldBinding fBinding = (PrivilegedFieldBinding) Scope.findPrivilegedHandler(binding.declaringClass)
                                        .getPrivilegedAccessField(field, null);
-
                        if (field.isStatic()) {
                                codeStream.load(field.type, 0);
-                               codeStream.invokestatic(fBinding.writer);
+                               codeStream.invoke(Opcodes.OPC_invokestatic,fBinding.writer,null);
                        } else {
                                codeStream.aload_0();
                                codeStream.load(field.type, 1);
-                               codeStream.invokestatic(fBinding.writer);
+                               codeStream.invoke(Opcodes.OPC_invokestatic,fBinding.writer,null);
                        }
                        return;
                }
                if (field.isStatic()) {
                        codeStream.load(field.type, 0);
-                       codeStream.putstatic(field);
+                       codeStream.fieldAccess(Opcodes.OPC_putstatic,field,null);
                } else {
                        codeStream.aload_0();
                        codeStream.load(field.type, 1);
-                       codeStream.putfield(field);
+                       codeStream.fieldAccess(Opcodes.OPC_putfield,field,null);
                }
        }
 
index 0cf8dabe101dddab4a664927775c67d77cf5dca3..bd234dd03d5c4a5e35056ba61e0e17df0d5d5132 100644 (file)
@@ -24,6 +24,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclarat
 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.FlowInfo;
 import org.aspectj.org.eclipse.jdt.internal.compiler.flow.InitializationFlowContext;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
@@ -253,7 +254,7 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration {
                // the dispatch binding attributes will include the annotations from the 'binding'.
                // There is a chance that something else on the binding (e.g. throws clause) might
                // damage the attributes generated for the dispatch binding.
-               int attributeNumber = classFile.generateMethodInfoAttribute(binding, false, makeEffectiveSignatureAttribute(signature,
+               int attributeNumber = classFile.generateMethodInfoAttributes(binding, makeEffectiveSignatureAttribute(signature,
                                Shadow.MethodCall, false));
                int codeAttributeOffset = classFile.contentsOffset;
                classFile.generateCodeAttributeHeader();
@@ -291,12 +292,12 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration {
                }
                // TypeBinding type;
                if (methodBinding.isStatic())
-                       codeStream.invokestatic(methodBinding);
+                       codeStream.invoke(Opcodes.OPC_invokestatic,methodBinding,null);
                else {
                        if (methodBinding.declaringClass.isInterface()) {
-                               codeStream.invokeinterface(methodBinding);
+                               codeStream.invoke(Opcodes.OPC_invokeinterface, methodBinding, null);
                        } else {
-                               codeStream.invokevirtual(methodBinding);
+                               codeStream.invoke(Opcodes.OPC_invokevirtual, methodBinding, null);
                        }
                }
                AstUtil.generateReturn(dispatchBinding.returnType, codeStream);
@@ -311,7 +312,7 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration {
                }
                classFile.completeCodeAttribute(codeAttributeOffset);
                attributeNumber++;
-               classFile.completeMethodInfo(methodAttributeOffset, attributeNumber);
+               classFile.completeMethodInfo(binding,methodAttributeOffset, attributeNumber);
        }
 
        protected Shadow.Kind getShadowKindForBody() {
index 1fc25ef7584f459719ba6c30968ce697df3e699f..d0a61e2484c68abd17160a90ee99d5fd550bf4cb 100644 (file)
@@ -25,7 +25,7 @@ public class KnownFieldReference extends QualifiedNameReference {
 
        public KnownFieldReference(FieldBinding binding, int startPos,int endPos) {
                super(new char[][] {binding.name},new long[1], startPos, endPos);
-               this.binding = this.codegenBinding = binding;
+               this.binding = /*this.codegenBinding = */binding;
                this.constant = Constant.NotAConstant;
                this.actualReceiverType = binding.declaringClass;
                
@@ -36,7 +36,7 @@ public class KnownFieldReference extends QualifiedNameReference {
        //XXX handle source locations
        public KnownFieldReference(FieldBinding binding, long pos) {
                super(new char[][] {binding.name},new long[1],  0, 0);
-               this.binding = this.codegenBinding = binding;
+               this.binding = /*this.codegenBinding = */binding;
                this.constant = Constant.NotAConstant;
                this.actualReceiverType = binding.declaringClass;
                
index 315d06fa0caf30211dde2382cac570482c56dac5..6cf6527b67decc31bca2cdd42d2ad3377181f9bb 100644 (file)
@@ -9,8 +9,6 @@
  * Contributors: 
  *     PARC     initial implementation 
  * ******************************************************************/
-
-
 package org.aspectj.ajdt.internal.compiler.ast;
 
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
@@ -25,9 +23,10 @@ public class KnownMessageSend extends MessageSend {
 
        public KnownMessageSend(MethodBinding binding, Expression receiver, Expression[] arguments) {
                super();
-               this.binding = this.codegenBinding = binding;
+               this.binding = binding;
                this.arguments = arguments;
                this.receiver = receiver;
+               this.actualReceiverType = binding.declaringClass;
                this.selector = binding.selector;
                constant = Constant.NotAConstant;
        }
@@ -40,6 +39,7 @@ public class KnownMessageSend extends MessageSend {
                BlockScope scope,
                TypeBinding[] argumentTypes) {
                        // we've already resolved this
+               
        }
        
        public String toStringExpression() {
@@ -51,6 +51,7 @@ public class KnownMessageSend extends MessageSend {
                CodeStream codeStream,
                boolean valueRequired) {
                //System.out.println("about to generate: "  +this + " args: " + Arrays.asList(arguments));
+//             this.actualReceiverType = this.receiver.resolveType(currentScope);
                super.generateCode(currentScope, codeStream, valueRequired);
        }
 
index b9229657c01ac0dc663c8d422d2d7ca28caeb93a..6e628431a7335be627d2a887d925ab0a9126df5c 100644 (file)
@@ -46,7 +46,7 @@ public class Proceed extends MessageSend {
                this.selector  = parent.selector;
                this.arguments  = parent.arguments;
                this.binding  = parent.binding;
-               this.codegenBinding = parent.codegenBinding;
+               //this.codegenBinding = parent.codegenBinding;
                this.syntheticAccessor = parent.syntheticAccessor;
                this.expectedType = parent.expectedType;
 
@@ -72,7 +72,7 @@ public class Proceed extends MessageSend {
                }
                
                constant = Constant.NotAConstant;
-               binding = codegenBinding = aroundDecl.proceedMethodBinding;
+               binding =/* codegenBinding = */aroundDecl.proceedMethodBinding;
                
                this.actualReceiverType = binding.declaringClass;
                
@@ -163,7 +163,7 @@ public class Proceed extends MessageSend {
                        if (argType != null) {
                                TypeBinding paramType = binding.parameters[i];
                                if (!argType.isCompatibleWith(paramType)) {
-                                       scope.problemReporter().typeMismatchError(argType, paramType, arg);
+                                       scope.problemReporter().typeMismatchError(argType, paramType, arg,null);
                                }
                        }
                }
index 243fa0e850094c826e2892426421cb6a530f8e44..d633ebba2ea644f3067adfa02e91b5370604c3d1 100644 (file)
@@ -168,7 +168,7 @@ public class ProceedVisitor extends ASTVisitor {
                //System.err.println("replace static ref");
                NameReference receiver = (NameReference) call.receiver;
                receiver.binding = thisJoinPointStaticPartDecLocal; //thisJoinPointStaticPartDec;
-               receiver.codegenBinding = thisJoinPointStaticPartDecLocal;
+//             receiver.codegenBinding = thisJoinPointStaticPartDecLocal;
 
                call.binding.declaringClass =
                        (ReferenceBinding) thisJoinPointStaticPartDec.type;
index 11097ea5911f99415df8e9b40d4aa59a5ff5f926..96f0d32270bdaa608952c346883fa84a324e7c08 100644 (file)
@@ -83,10 +83,10 @@ public class SuperFixerVisitor extends ASTVisitor {
        public void endVisit(MessageSend call, BlockScope scope) {
                // System.out.println("endVisit: " + call);
                // an error has already occurred
-               if (call.codegenBinding == null)
+               if (call.binding/*codegenBinding*/ == null)
                        return;
 
-               MethodBinding superBinding = call.codegenBinding;
+               MethodBinding superBinding = call.binding/*codegenBinding*/;
                if (superBinding instanceof ProblemMethodBinding) {
                        return;
                }
index 9f4273fe336481e91ffe7493503d67dc75b095dc..994be09f3eb8441554481708221ccfa80d553425 100644 (file)
@@ -188,7 +188,7 @@ public class ThisJoinPointVisitor extends ASTVisitor {
 
                // System.err.println("replace static ref: " + receiver + " is " + System.identityHashCode(receiver));
                receiver.binding = thisJoinPointStaticPartDecLocal; // thisJoinPointStaticPartDec;
-               receiver.codegenBinding = thisJoinPointStaticPartDecLocal;
+//             receiver.codegenBinding = thisJoinPointStaticPartDecLocal;
 
                ReferenceBinding thisJoinPointStaticPartType = (ReferenceBinding) thisJoinPointStaticPartDec.type;
 
index 5afa9875cc86d65f48b98b0fc54083ea7ac1a013..c9c078c81e16de6abbf3d5bf5bdb038a4e307a5a 100644 (file)
@@ -1016,7 +1016,7 @@ public class EclipseFactory {
                        // } else {
                        // declaringElement = makeTypeBinding((UnresolvedType)tVar.getDeclaringElement());
                        // }
-                       tvBinding = new TypeVariableBinding(tv.getName().toCharArray(), declaringElement, tv.getRank());
+                       tvBinding = new TypeVariableBinding(tv.getName().toCharArray(), declaringElement, tv.getRank(),this.lookupEnvironment);
                        typeVariableToTypeBinding.put(tv.getName(), tvBinding);
 
                        if (tv.getSuperclass() != null
index 36ee073b639d075b34f31613eae4224faad69f52..e77c20a235230823885cf09b8a7a9c70c40bf36b 100644 (file)
@@ -182,7 +182,7 @@ public class EclipseTypeMunger extends ConcreteTypeMunger {
                }
                // may be unresolved if the aspect type binding was a BinaryTypeBinding
                if (innerTypeBinding instanceof UnresolvedReferenceBinding) {
-                       innerTypeBinding = BinaryTypeBinding.resolveType(innerTypeBinding, world.getLookupEnvironment(), true);
+                       innerTypeBinding = (ReferenceBinding)BinaryTypeBinding.resolveType(innerTypeBinding, world.getLookupEnvironment(), true);
                }
                // rb = new InterTypeMemberClassBinding(world, munger, aspectType, aspectTypeBinding, onType, munger.getMemberTypeName(),
                // sourceType);
index 616894deae4a9e236455485ac6b9de189d1a5727..4abbc51ba5d4482565574efbfd1ff7c02cf39818 100644 (file)
@@ -102,8 +102,8 @@ public class HelperInterfaceBinding extends SourceTypeBinding {
        private void generateMethod(ClassFile classFile, MethodBinding binding) {
                classFile.generateMethodInfoHeader(binding);
                int methodAttributeOffset = classFile.contentsOffset;
-               int attributeNumber = classFile.generateMethodInfoAttribute(binding);
-               classFile.completeMethodInfo(methodAttributeOffset, attributeNumber);
+               int attributeNumber = classFile.generateMethodInfoAttributes(binding);
+               classFile.completeMethodInfo(binding,methodAttributeOffset, attributeNumber);
        }
        
        
index f4e6e4df0e40c69d55d7a826eead67dcb574316a..11dbebee2fbefc89f79511c9899489e7c2869098 100644 (file)
@@ -87,7 +87,7 @@ public class InterTypeScope extends ClassScope {
                int aliased = (aliases == null ? -1 : aliases.indexOf(variableName));
                if (aliased != -1) {
                        if (aliased > sourceType.typeVariables.length || sourceType.typeVariables.length == 0) {
-                               TypeVariableBinding tvb = new TypeVariableBinding("fake".toCharArray(), null, 0);
+                               TypeVariableBinding tvb = new TypeVariableBinding("fake".toCharArray(), null, 0,this.environment());
                                tvb.superclass = getJavaLangObject();
                                tvb.fPackage = new PackageBinding(environment());
                                return tvb;
index ce57bfe4485cf42f39b925448e44120400ad215a..93c912a122be3b27cbad6d800cc1cb9394fc7945 100644 (file)
@@ -305,7 +305,9 @@ public class AjProblemReporter extends ProblemReporter {
                if (severity != ProblemSeverities.Ignore && DUMP_STACK) {
                        Thread.dumpStack();
                }
-               super.handle(problemId, problemArguments, messageArguments, severity, problemStartPosition, problemEndPosition,
+               super.handle(problemId, problemArguments, 
+                               0, // no message elaboration
+                               messageArguments, severity, problemStartPosition, problemEndPosition,
                                referenceContext, unitResult);
        }
 
@@ -357,7 +359,7 @@ public class AjProblemReporter extends ProblemReporter {
         * Overrides the implementation in ProblemReporter and is ITD aware. To report a *real* problem with an ITD marked @override,
         * the other methodMustOverride() method is used.
         */
-       public void methodMustOverride(AbstractMethodDeclaration method) {
+       public void methodMustOverride(AbstractMethodDeclaration method, int complianceLevel) {
 
                // ignore ajc$ methods
                if (new String(method.selector).startsWith("ajc$"))
@@ -389,7 +391,7 @@ public class AjProblemReporter extends ProblemReporter {
                        supertypeToLookAt = supertypeToLookAt.getSuperclass();
                }
                // report the error...
-               super.methodMustOverride(method);
+               super.methodMustOverride(method,complianceLevel);
        }
 
        private String typesAsString(boolean isVarargs, TypeBinding[] types, boolean makeShort) {
@@ -668,12 +670,12 @@ public class AjProblemReporter extends ProblemReporter {
                }
        }
 
-       public void duplicateMethodInType(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) {
+       public void duplicateMethodInType(SourceTypeBinding type, AbstractMethodDeclaration methodDecl, boolean equalParameters, int severity) {
                if (new String(methodDecl.selector).startsWith("ajc$interMethod")) {
                        // this is an ITD clash and will be reported in another way by AspectJ (173602)
                        return;
                }
-               super.duplicateMethodInType(type, methodDecl);
+               super.duplicateMethodInType(type, methodDecl, equalParameters, severity);
        }
 
        // pr246393 - if we are going to complain about privileged, we clearly don't know what is going on, so don't
index df537fa3669c9d448c501cc95eb9993dced337c2..dfa878d962eb21e5afc6e3d6f4544fd645c34e88 100644 (file)
@@ -80,6 +80,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem;
 import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
 import org.aspectj.org.eclipse.jdt.internal.compiler.env.INameEnvironment;
 import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IrritantSet;
 import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser;
 import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
 import org.aspectj.org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
@@ -845,7 +846,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
                bcelWorld.setXlazyTjp(buildConfig.isXlazyTjp());
                bcelWorld.setXHasMemberSupportEnabled(buildConfig.isXHasMemberEnabled());
                bcelWorld.setPinpointMode(buildConfig.isXdevPinpoint());
-               bcelWorld.setErrorAndWarningThreshold(buildConfig.getOptions().errorThreshold, buildConfig.getOptions().warningThreshold);
+               bcelWorld.setErrorAndWarningThreshold(buildConfig.getOptions().errorThreshold.isSet(24), buildConfig.getOptions().warningThreshold.isSet(24));
                BcelWeaver bcelWeaver = new BcelWeaver(bcelWorld);
                bcelWeaver.setCustomMungerFactory(customMungerFactory);
                state.setWorld(bcelWorld);
index f07be6fcc58e8580d470419b0a1868d8891a46ac..13d6f0ecececeee05f8cc759fc2edbd888e5d5f3 100644 (file)
@@ -16,6 +16,7 @@ import java.util.Map;
 
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
 import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IrritantSet;
 import org.aspectj.weaver.Constants;
 
 /**
@@ -49,16 +50,17 @@ public class AjCompilerOptions extends CompilerOptions {
        public static final String OPTION_GenerateJavaDocsInModel = "org.aspectj.ajdt.core.compiler.model.GenerateJavaDocsInModel";
        public static final String OPTION_Emacssym = "org.aspectj.ajdt.core.compiler.model.Emacssym";
 
+
        // constants for irritant levels
-       public static final long InvalidAbsoluteTypeName = ASTNode.Bit47L;
-       public static final long InvalidWildCardTypeName = ASTNode.Bit48L;
-       public static final long UnresolvableMember = ASTNode.Bit49L;
-       public static final long TypeNotExposedToWeaver = ASTNode.Bit50L;
-       public static final long ShadowNotInStructure = ASTNode.Bit51L;
-       public static final long UnmatchedSuperTypeInCall = ASTNode.Bit52L;
-       public static final long CannotImplementLazyTJP = ASTNode.Bit53L;
-       public static final long NeedSerialVersionUIDField = ASTNode.Bit54L;
-       public static final long IncompatibleSerialVersion = ASTNode.Bit55L;
+       public static final int InvalidAbsoluteTypeName = IrritantSet.GROUP2 | ASTNode.Bit8;
+       public static final int InvalidWildCardTypeName = IrritantSet.GROUP2 | ASTNode.Bit9;
+       public static final int UnresolvableMember = IrritantSet.GROUP2 | ASTNode.Bit10;
+       public static final int TypeNotExposedToWeaver = IrritantSet.GROUP2 | ASTNode.Bit11;
+       public static final int ShadowNotInStructure = IrritantSet.GROUP2 | ASTNode.Bit12;
+       public static final int UnmatchedSuperTypeInCall = IrritantSet.GROUP2 | ASTNode.Bit13;
+       public static final int CannotImplementLazyTJP = IrritantSet.GROUP2 | ASTNode.Bit14;
+       public static final int NeedSerialVersionUIDField = IrritantSet.GROUP2 | ASTNode.Bit15;
+       public static final int IncompatibleSerialVersion = IrritantSet.GROUP2 | ASTNode.Bit16;
 
        public boolean terminateAfterCompilation = false;
        public boolean xSerializableAspects = false;
@@ -128,7 +130,7 @@ public class AjCompilerOptions extends CompilerOptions {
         */
        public Map getMap() {
                Map map = super.getMap();
-               // now add AspectJ additional options
+               // now add AspectJ additional options           
                map.put(OPTION_ReportInvalidAbsoluteTypeName, getSeverityString(InvalidAbsoluteTypeName));
                map.put(OPTION_ReportInvalidWildcardTypeName, getSeverityString(InvalidWildCardTypeName));
                map.put(OPTION_ReportUnresolvableMember, getSeverityString(UnresolvableMember));
@@ -290,8 +292,9 @@ public class AjCompilerOptions extends CompilerOptions {
         * Add these warnings to the default set...
         */
        private void setAspectJWarningDefaults() {
-               super.warningThreshold = super.warningThreshold | InvalidAbsoluteTypeName | UnresolvableMember | TypeNotExposedToWeaver
-                               | UnmatchedSuperTypeInCall | CannotImplementLazyTJP | CompilerOptions.SwallowedExceptionInCatchBlock;
+               super.warningThreshold = new IrritantSet(super.warningThreshold);
+               super.warningThreshold.set(InvalidAbsoluteTypeName | UnresolvableMember | TypeNotExposedToWeaver
+                               | UnmatchedSuperTypeInCall | CannotImplementLazyTJP | CompilerOptions.SwallowedExceptionInCatchBlock);
        }
 
        /*
index 5e7f4a88d7398e2be09d1984a0b014a1deab80f6..e545814e9e1e7ffcefd5db015a09f15dda624aa2 100644 (file)
@@ -1314,7 +1314,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
                File sourceFile = new File(result.fileName());
                CompilationResult cr = result.result();
 
-               references.put(sourceFile, new ReferenceCollection(cr.qualifiedReferences, cr.simpleNameReferences));
+               references.put(sourceFile, new ReferenceCollection(cr.qualifiedReferences, cr.simpleNameReferences,cr.rootReferences));
 
                UnwovenClassFile[] unwovenClassFiles = result.unwovenClassFiles();
                for (int i = 0; i < unwovenClassFiles.length; i++) {
@@ -1936,7 +1936,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
                                existingCollection.addDependencies(typeNameDependencies);
                                return true;
                        } else {
-                               ReferenceCollection rc = new ReferenceCollection(null, null);
+                               ReferenceCollection rc = new ReferenceCollection(null, null, null);
                                rc.addDependencies(typeNameDependencies);
                                references.put(sourceFile, rc);
                                return true;
index f54f6921d8647f0521db005ef9ab6e73531d0c85..3d8a4627a644c3c16051c04df7d1d98c843372c4 100644 (file)
@@ -37,6 +37,10 @@ public class CompactTypeStructureRepresentation implements IBinaryType {
        char[] genericSignature;
        char[] superclassName;
        char[][] interfaces;
+       
+       char[] enclosingMethod;
+       
+       char[][][] missingTypeNames;
 
        // this is the extra state that enables us to be an IBinaryType
        char[] enclosingTypeName;
@@ -50,6 +54,7 @@ public class CompactTypeStructureRepresentation implements IBinaryType {
        IBinaryMethod[] binMethods;
        IBinaryNestedType[] memberTypes;
        IBinaryAnnotation[] annotations;
+       
 
        public CompactTypeStructureRepresentation(ClassFileReader cfr, boolean isAspect) {
 
@@ -59,7 +64,9 @@ public class CompactTypeStructureRepresentation implements IBinaryType {
                this.isMember = cfr.isMember();
                this.sourceFileName = cfr.sourceFileName();
                this.fileName = cfr.getFileName();
+               this.missingTypeNames = cfr.getMissingTypeNames();
                this.tagBits = cfr.getTagBits();
+               this.enclosingMethod = cfr.getEnclosingMethod();
                this.isBinaryType = cfr.isBinaryType();
                this.binFields = cfr.getFields();
                if (binFields == null) {
@@ -87,6 +94,10 @@ public class CompactTypeStructureRepresentation implements IBinaryType {
 
        }
 
+       public char[][][] getMissingTypeNames() {
+               return missingTypeNames;
+       }
+       
        public char[] getEnclosingTypeName() {
                return enclosingTypeName;
        }
@@ -98,6 +109,10 @@ public class CompactTypeStructureRepresentation implements IBinaryType {
        public char[] getGenericSignature() {
                return genericSignature;
        }
+       
+       public char[] getEnclosingMethod() {
+               return enclosingMethod;
+       }
 
        public char[][] getInterfaceNames() {
                return interfaces;
index 2b0bd0bfb9408bb108467ad47ea91f4050cc5a25..99580a8a63cc8e2d6e7e83a0bde34bca375d54fa 100644 (file)
@@ -89,7 +89,7 @@ public class AjAST extends AST {
                ast.setDefaultNodeFlag(ASTNode.ORIGINAL);
                BindingResolver resolver = null;
                if (isResolved) {
-                       resolver = new DefaultBindingResolver(compilationUnitDeclaration.scope, workingCopy.owner, new DefaultBindingResolver.BindingTables(), false);
+                       resolver = new DefaultBindingResolver(compilationUnitDeclaration.scope, workingCopy.owner, new DefaultBindingResolver.BindingTables(), false,true);
                        ast.setFlag(AST.RESOLVED_BINDINGS);
                } else {
                        resolver = new BindingResolver();
index 3082bf4b588f587db008a60807ec9a350a356c57..3a82cec5362946f6b1eef85692c21dc17713b2aa 100644 (file)
@@ -2352,7 +2352,7 @@ public class AjASTConverter extends ASTConverter {
                                }
                        }
                }
-               buildBodyDeclarations(typeDeclaration, typeDecl);
+               buildBodyDeclarations(typeDeclaration, typeDecl,org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.kind(typeDeclaration.modifiers) == org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.INTERFACE_DECL);
                if (this.resolveBindings) {
                        recordNodes(typeDecl, typeDeclaration);
                        recordNodes(typeName, typeDeclaration);
index 2537a968aac55fb68340d6a59a00db8a7696a73a..ced2ecd8f01ac6504e3670d7b267601dc6ca4492 100644 (file)
@@ -74,7 +74,7 @@ import org.aspectj.org.eclipse.jdt.core.dom.Type;
 import org.aspectj.org.eclipse.jdt.core.dom.TypeCategoryTypePattern;
 import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration;
 import org.aspectj.org.eclipse.jdt.core.dom.TypePattern;
-import org.aspectj.org.eclipse.jdt.internal.core.SourceRange;
+import org.aspectj.org.eclipse.jdt.core.SourceRange;
 
 /**
  * For each AspectJ ASTNode there is a test for:
index c864f0f7463f193165c6f1646d1430d85f9c961a..94d57c862b472c84c7307114f56013c18f46a714 100644 (file)
@@ -21,7 +21,7 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTParser;
 import org.aspectj.org.eclipse.jdt.core.dom.AjAST;
 import org.aspectj.org.eclipse.jdt.core.dom.AjASTVisitor;
 import org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;
-import org.aspectj.org.eclipse.jdt.internal.core.SourceRange;
+import org.aspectj.org.eclipse.jdt.core.SourceRange;
 
 public abstract class AjASTTestCase extends TestCase {