summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-04-22 17:31:26 +0000
committerjhugunin <jhugunin>2003-04-22 17:31:26 +0000
commit73ae16b4cef983ab0ba6995504cd4f00ecf98a22 (patch)
tree5c18e23aac9a0495d3215cf2aa9ef0f6236cbdcd /org.aspectj.ajdt.core
parent7dcc9481d1b2715459903e8c36b1c8b22cbbf94d (diff)
downloadaspectj-73ae16b4cef983ab0ba6995504cd4f00ecf98a22.tar.gz
aspectj-73ae16b4cef983ab0ba6995504cd4f00ecf98a22.zip
fix for Bugzilla Bug 36673
VerifyError in privileged aspect
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java3
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java6
2 files changed, 7 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java
index a2bfe7d77..c053cab08 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java
@@ -54,6 +54,9 @@ public class PrivilegedFieldBinding extends FieldBinding {
public SyntheticAccessMethodBinding getAccessMethod(boolean isReadAccess) {
+ if (baseField.alwaysNeedsAccessMethod(isReadAccess)) {
+ return baseField.getAccessMethod(isReadAccess);
+ }
if (isReadAccess) return reader;
else return writer;
}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java
index f6b482b68..3343e0634 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java
@@ -43,16 +43,18 @@ public class PrivilegedHandler implements IPrivilegedHandler {
this.inAspect = inAspect;
}
- public FieldBinding getPrivilegedAccessField(FieldBinding baseField, AstNode location) {
+ public FieldBinding getPrivilegedAccessField(FieldBinding baseField, AstNode location) {
ResolvedMember key = inAspect.factory.makeResolvedMember(baseField);
if (accessors.containsKey(key)) return (FieldBinding)accessors.get(key);
FieldBinding ret = new PrivilegedFieldBinding(inAspect, baseField);
checkWeaveAccess(key.getDeclaringType(), location);
- accessors.put(key, ret);
+ if (!baseField.alwaysNeedsAccessMethod(true)) accessors.put(key, ret);
return ret;
}
public MethodBinding getPrivilegedAccessMethod(MethodBinding baseMethod, AstNode location) {
+ if (baseMethod.alwaysNeedsAccessMethod()) return baseMethod;
+
ResolvedMember key = inAspect.factory.makeResolvedMember(baseMethod);
if (accessors.containsKey(key)) return (MethodBinding)accessors.get(key);