]> source.dussan.org Git - aspectj.git/commitdiff
309743
authoraclement <aclement>
Mon, 19 Apr 2010 22:19:19 +0000 (22:19 +0000)
committeraclement <aclement>
Mon, 19 Apr 2010 22:19:19 +0000 (22:19 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AddAtAspectJAnnotationsVisitor.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.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

index 47089d172b05bc20e334efaf82b8ba4c266dd4a0..c2917ac93cc15987317f32279157f22a4cec32ac 100644 (file)
@@ -453,6 +453,8 @@ public class BuildArgParser extends Main {
 
                                        args.remove(args.get(nextArgIndex));
                                }
+                       } else if (arg.equals("-makeAjReflectable")) {
+                               buildConfig.setMakeReflectable(true);                           
                        } else if (arg.equals("-sourceroots")) {
                                if (args.size() > nextArgIndex) {
                                        List sourceRoots = new ArrayList();
index bef441f673ebd745317ae45d512155a2d9f394d8..2537c0356e14f8d0bd1c9184f914ca4f6f87d86e 100644 (file)
@@ -50,6 +50,7 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
        private boolean isXTerminateAfterCompilation;
        private boolean proceedOnError;
        private boolean inJava5Mode;
+       private boolean reflectable;
        private boolean noAtAspectJAnnotationProcessing;
        private IIntermediateResultsRequestor intermediateResultsRequestor;
        private IProgressListener progressListener;
@@ -85,6 +86,7 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
                        IOutputClassFileNameProvider outputFileNameProvider, IBinarySourceProvider binarySourceProvider,
                        Map fullBinarySourceEntries, /* fileName |-> List<UnwovenClassFile> */
                        boolean isXterminateAfterCompilation, boolean proceedOnError, boolean noAtAspectJProcessing,
+                       boolean reflectable,
                        AjState incrementalCompilationState) {
                this.compiler = compiler;
                this.isBatchCompile = isBatchCompile;
@@ -97,6 +99,7 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
                this.proceedOnError = proceedOnError;
                this.binarySourceSetForFullWeave = fullBinarySourceEntries;
                this.eWorld = eFactory;
+               this.reflectable= reflectable;
                this.inJava5Mode = false;
                this.noAtAspectJAnnotationProcessing = noAtAspectJProcessing;
                this.incrementalCompilationState = incrementalCompilationState;
@@ -129,7 +132,7 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
                if (inJava5Mode && !noAtAspectJAnnotationProcessing) {
                        ContextToken tok = CompilationAndWeavingContext.enteringPhase(
                                        CompilationAndWeavingContext.ADDING_AT_ASPECTJ_ANNOTATIONS, unit.getFileName());
-                       AddAtAspectJAnnotationsVisitor atAspectJVisitor = new AddAtAspectJAnnotationsVisitor(unit);
+                       AddAtAspectJAnnotationsVisitor atAspectJVisitor = new AddAtAspectJAnnotationsVisitor(unit,reflectable);
                        unit.traverse(atAspectJVisitor, unit.scope);
                        CompilationAndWeavingContext.leavingPhase(tok);
                }
index 853d9548d3ddc7bb7b695cabfc474c03ea1859ab..29fcf45bc07e445b01a9268ed186e21682aa6cda 100644 (file)
@@ -96,6 +96,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
        private boolean isXTerminateAfterCompilation;
        private boolean proceedOnError;
        private boolean inJava5Mode;
+       private boolean makeReflectable;
        private boolean noAtAspectJAnnotationProcessing;
        private IIntermediateResultsRequestor intermediateResultsRequestor;
        private IProgressListener progressListener;
@@ -138,7 +139,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
                        EclipseFactory eFactory, IIntermediateResultsRequestor intRequestor, IProgressListener progressListener,
                        IOutputClassFileNameProvider outputFileNameProvider, IBinarySourceProvider binarySourceProvider,
                        Map fullBinarySourceEntries, /* fileName |-> List<UnwovenClassFile> */
-                       boolean isXterminateAfterCompilation, boolean proceedOnError, boolean noAtAspectJProcessing,
+                       boolean isXterminateAfterCompilation, boolean proceedOnError, boolean noAtAspectJProcessing, boolean makeReflectable,
                        AjState incrementalCompilationState) {
                this.compiler = compiler;
                this.isBatchCompile = isBatchCompile;
@@ -152,6 +153,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
                this.binarySourceSetForFullWeave = fullBinarySourceEntries;
                this.eWorld = eFactory;
                this.inJava5Mode = false;
+               this.makeReflectable = makeReflectable;
                this.noAtAspectJAnnotationProcessing = noAtAspectJProcessing;
                this.incrementalCompilationState = incrementalCompilationState;
 
@@ -263,7 +265,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
                if (inJava5Mode && !noAtAspectJAnnotationProcessing) {
                        ContextToken tok = CompilationAndWeavingContext.enteringPhase(
                                        CompilationAndWeavingContext.ADDING_AT_ASPECTJ_ANNOTATIONS, unit.getFileName());
-                       AddAtAspectJAnnotationsVisitor atAspectJVisitor = new AddAtAspectJAnnotationsVisitor(unit);
+                       AddAtAspectJAnnotationsVisitor atAspectJVisitor = new AddAtAspectJAnnotationsVisitor(unit,makeReflectable);
                        unit.traverse(atAspectJVisitor, unit.scope);
                        CompilationAndWeavingContext.leavingPhase(tok);
                }
index 7606ed4461a814bc87c0f4f07c7025c55d05f856..79447f0ae68b95c377e433993c819417a56e90fb 100644 (file)
@@ -28,10 +28,12 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope
  */
 public class AddAtAspectJAnnotationsVisitor extends ASTVisitor {
 
+       private boolean makeReflectable;
        // private CompilationUnitDeclaration unit;
 
-       public AddAtAspectJAnnotationsVisitor(CompilationUnitDeclaration unit) {
+       public AddAtAspectJAnnotationsVisitor(CompilationUnitDeclaration unit, boolean makeReflectable) {
                // this.unit = unit;
+               this.makeReflectable= makeReflectable;
        }
 
        public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope scope) {
@@ -63,7 +65,9 @@ public class AddAtAspectJAnnotationsVisitor extends ASTVisitor {
                } else if (methodDeclaration instanceof DeclareDeclaration) {
                        ((DeclareDeclaration) methodDeclaration).addAtAspectJAnnotations();
                } else if (methodDeclaration instanceof InterTypeDeclaration) {
-                       ((InterTypeDeclaration) methodDeclaration).addAtAspectJAnnotations();
+                       if (makeReflectable) {
+                               ((InterTypeDeclaration) methodDeclaration).addAtAspectJAnnotations();
+                       }
                }
                return false;
        }
index 0d5ee2fcac2c6b8007590d72497563afadcdb8f5..75f8f5bb7401c6c01ffe6b381ab37974787af3ec 100644 (file)
@@ -410,6 +410,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
                setAddSerialVerUID(global.isAddSerialVerUID());
                setXmlConfigured(global.isXmlConfigured());
                setTiming(global.isTiming());
+               setMakeReflectable(global.isMakeReflectable());
        }
 
        void join(Collection local, Collection global) {
@@ -565,10 +566,18 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
        public void setXmlConfigured(boolean b) {
                options.xmlConfigured = b;
        }
+       
+       public void setMakeReflectable(boolean b) {
+               options.makeReflectable = b;
+       }
 
        public boolean isXmlConfigured() {
                return options.xmlConfigured;
        }
+       
+       public boolean isMakeReflectable() {
+               return options.makeReflectable;
+       }
 
        public boolean isXNotReweavable() {
                return options.xNotReweavable;
index 70addfa6649502048b5d6bae45d7c5eab5f9fe72..59879e3b3a03a6e969eedb649d5d64df95fa8f3c 100644 (file)
@@ -1383,14 +1383,14 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
                                        this, // IOutputFilenameProvider
                                        this, // IBinarySourceProvider
                                        state.getBinarySourceMap(), buildConfig.isTerminateAfterCompilation(), buildConfig.getProceedOnError(),
-                                       buildConfig.isNoAtAspectJAnnotationProcessing(), state);
+                                       buildConfig.isNoAtAspectJAnnotationProcessing(), buildConfig.isMakeReflectable(), state);
                } else {
                        return new AjCompilerAdapter(forCompiler, batchCompile, getBcelWorld(), getWeaver(), factory,
                                        getInterimResultRequestor(), progressListener,
                                        this, // IOutputFilenameProvider
                                        this, // IBinarySourceProvider
                                        state.getBinarySourceMap(), buildConfig.isTerminateAfterCompilation(), buildConfig.getProceedOnError(),
-                                       buildConfig.isNoAtAspectJAnnotationProcessing(), state);
+                                       buildConfig.isNoAtAspectJAnnotationProcessing(), buildConfig.isMakeReflectable(), state);
                }
        }
 
index 506f2e12330fae4604af7ac69b3c1d5380f7b46c..f07be6fcc58e8580d470419b0a1868d8891a46ac 100644 (file)
@@ -82,6 +82,7 @@ public class AjCompilerOptions extends CompilerOptions {
        public String xConfigurationInfo;
        public boolean addSerialVerUID = false;
        public boolean xmlConfigured = false;
+       public boolean makeReflectable = false;
 
        // these next four not exposed by IDEs
        public boolean generateModel = false;