From: aclement Date: Fri, 27 Feb 2009 22:00:24 +0000 (+0000) Subject: 266420: incremental compile case X-Git-Tag: pre268419~62 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b1b29a1ced5d3659cdb01ee30cf1f2858c2289f;p=aspectj.git 266420: incremental compile case --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java index 144327df7..31f50a573 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java @@ -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); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java index b578e88c9..cca9aa49d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java @@ -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)