]> source.dussan.org Git - aspectj.git/commitdiff
266420: incremental compile case
authoraclement <aclement>
Fri, 27 Feb 2009 22:00:24 +0000 (22:00 +0000)
committeraclement <aclement>
Fri, 27 Feb 2009 22:00:24 +0000 (22:00 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java

index 144327df779209d77f780bb29309738ed3cc79bf..31f50a573f4316c59695df2b0d71845c452e0833 100644 (file)
@@ -15,6 +15,7 @@ package org.aspectj.ajdt.internal.compiler.problem;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.lang.reflect.Modifier;
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -57,6 +58,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
 import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.weaver.AjcMemberMaker;
 import org.aspectj.weaver.ConcreteTypeMunger;
+import org.aspectj.weaver.ReferenceType;
 import org.aspectj.weaver.ResolvedMember;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.Shadow;
@@ -466,6 +468,19 @@ public class AjProblemReporter extends ProblemReporter {
                                                        if (privilegedHandler.definesPrivilegedAccessToField(fieldDecl.binding)) {
                                                                return;
                                                        }
+                                               } else if (theAspect instanceof ReferenceType) {
+                                                       // ResolvedMember rm = factory.makeResolvedMember(fieldDecl.binding);
+                                                       String fname = new String(fieldDecl.name);
+                                                       Collection/* ResolvedMember */privvies = ((ReferenceType) theAspect).getPrivilegedAccesses();
+                                                       // On an incremental compile the information is in the bcel delegate
+                                                       if (privvies != null) {
+                                                               for (Iterator iterator = privvies.iterator(); iterator.hasNext();) {
+                                                                       ResolvedMember priv = (ResolvedMember) iterator.next();
+                                                                       if (priv.getName().equals(fname)) {
+                                                                               return;
+                                                                       }
+                                                               }
+                                                       }
                                                }
                                        }
                                        checked.add(theAspect);
index b578e88c97f78239759c6f1b80c5d29b086c9f3c..cca9aa49d8ca7ee14edf0290af5aec269e02bc0f 100644 (file)
@@ -161,6 +161,8 @@ public class AjCompilerOptions extends CompilerOptions {
        public void set(Map optionsMap) {
                super.set(optionsMap);
                Object optionValue;
+               if ((optionValue = optionsMap.get(OPTION_ReportUnusedPrivateMember)) != null)
+                       updateSeverity(UnusedPrivateMember, optionValue);
                if ((optionValue = optionsMap.get(OPTION_ReportInvalidAbsoluteTypeName)) != null)
                        updateSeverity(InvalidAbsoluteTypeName, optionValue);
                if ((optionValue = optionsMap.get(OPTION_ReportInvalidWildcardTypeName)) != null)