diff options
author | jhugunin <jhugunin> | 2003-01-08 02:16:12 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-01-08 02:16:12 +0000 |
commit | 8995a3a369a70a5d6122faee1f1783777c83b2ac (patch) | |
tree | 8affef726ed2cbf962186be42eaecbf292a9b538 /org.eclipse.jdt.core | |
parent | 91d9045736aa5705ad0289c0209474bac205aab7 (diff) | |
download | aspectj-8995a3a369a70a5d6122faee1f1783777c83b2ac.tar.gz aspectj-8995a3a369a70a5d6122faee1f1783777c83b2ac.zip |
propogating information needed for decent Xlint warnings when privileged
access is made to a type not exposed to the weaver
Diffstat (limited to 'org.eclipse.jdt.core')
5 files changed, 12 insertions, 8 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java index c32fa6cce..6be97d138 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java @@ -932,7 +932,7 @@ public class BlockScope extends Scope { if (methodBinding.canBeSeenBy(invocationSite, this)) { return methodBinding; } else if (handler != null) { - return handler.getPrivilegedAccessMethod(methodBinding); + return handler.getPrivilegedAccessMethod(methodBinding, (AstNode)invocationSite); } } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IPrivilegedHandler.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IPrivilegedHandler.java index 05488ee2d..b2921080a 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IPrivilegedHandler.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IPrivilegedHandler.java @@ -11,6 +11,8 @@ package org.eclipse.jdt.internal.compiler.lookup; +import org.eclipse.jdt.internal.compiler.ast.AstNode; + /** * This interface is used by SourceTypeBinding to provide a delegated lookup @@ -20,8 +22,8 @@ package org.eclipse.jdt.internal.compiler.lookup; */ public interface IPrivilegedHandler { - FieldBinding getPrivilegedAccessField(FieldBinding baseField); + FieldBinding getPrivilegedAccessField(FieldBinding baseField, AstNode location); - MethodBinding getPrivilegedAccessMethod(MethodBinding baseMethod); - void notePrivilegedTypeAccess(ReferenceBinding type); + MethodBinding getPrivilegedAccessMethod(MethodBinding baseMethod, AstNode location); + void notePrivilegedTypeAccess(ReferenceBinding type, AstNode location); } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java index 75a7662ae..cc0ca8531 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java @@ -70,7 +70,7 @@ public final boolean canBeSeenBy(ReferenceBinding receiverType, SourceTypeBindin //System.err.println("trying to see: " + new String(sourceName)); if (Scope.findPrivilegedHandler(invocationType) != null) { - Scope.findPrivilegedHandler(invocationType).notePrivilegedTypeAccess(this); + Scope.findPrivilegedHandler(invocationType).notePrivilegedTypeAccess(this, null); return true; } return false; @@ -155,7 +155,7 @@ public final boolean canBeSeenBy(Scope scope) { if (Scope.findPrivilegedHandler(invocationType) != null) { //System.err.println(" is privileged!"); - Scope.findPrivilegedHandler(invocationType).notePrivilegedTypeAccess(this); + Scope.findPrivilegedHandler(invocationType).notePrivilegedTypeAccess(this, null); return true; } return false; diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java index a277b2240..da9ff51ce 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java @@ -11,6 +11,7 @@ ******************************************************************************/ package org.eclipse.jdt.internal.compiler.lookup; +import org.eclipse.jdt.internal.compiler.ast.AstNode; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; @@ -184,7 +185,7 @@ public abstract class Scope IPrivilegedHandler handler = findPrivilegedHandler(invocationType()); if (handler != null) { //???System.err.println("privileged access: "); - return invocationType().privilegedHandler.getPrivilegedAccessMethod(exactMethod); + return invocationType().privilegedHandler.getPrivilegedAccessMethod(exactMethod, (AstNode)invocationSite); } } } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java index bfac0b428..a4106b478 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java @@ -16,6 +16,7 @@ import java.util.*; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.AssertStatement; +import org.eclipse.jdt.internal.compiler.ast.AstNode; import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; @@ -512,7 +513,7 @@ public FieldBinding getField(char[] fieldName, InvocationSite site, Scope scope) !ret.canBeSeenBy(this, site, scope)) { //System.err.println("privileged access: " + new String(fieldName)); - return handler.getPrivilegedAccessField(ret); + return handler.getPrivilegedAccessField(ret, (AstNode)site); } } return ret; |