From: aclement Date: Thu, 25 Mar 2010 22:01:17 +0000 (+0000) Subject: 307120: field accesses in itds of private fields X-Git-Tag: V1_6_9M1~29 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9a6948be9bf548c28747d19a2547e04808ffbb64;p=aspectj.git 307120: field accesses in itds of private fields --- 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 1e4e3c355..62ea86f05 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 @@ -30,6 +30,9 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.aspectj.weaver.AjcMemberMaker; import org.aspectj.weaver.Lint; import org.aspectj.weaver.Member; +import org.aspectj.weaver.PrivilegedAccessMunger; +import org.aspectj.weaver.ReferenceType; +import org.aspectj.weaver.ReferenceTypeDelegate; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedMemberImpl; import org.aspectj.weaver.ResolvedType; @@ -63,6 +66,14 @@ public class PrivilegedHandler implements IPrivilegedHandler { checkWeaveAccess(key.getDeclaringType(), location); if (!baseField.alwaysNeedsAccessMethod(true)) accessors.put(key, ret); + // 307120 + ResolvedType rt = inAspect.factory.fromEclipse(baseField.declaringClass); + if (rt!=null) { + ReferenceTypeDelegate rtd = ((ReferenceType)rt).getDelegate(); + if (rtd instanceof EclipseSourceType) { + rt.addInterTypeMunger(new EclipseTypeMunger(inAspect.factory,new PrivilegedAccessMunger(key, true),inAspect.typeX,null), true); + } + } return ret; } @@ -89,9 +100,16 @@ public class PrivilegedHandler implements IPrivilegedHandler { ret = inAspect.factory.makeMethodBinding(AjcMemberMaker.privilegedAccessMethodForMethod(inAspect.typeX, key)); } checkWeaveAccess(key.getDeclaringType(), location); - // System.err.println(ret); - // Thread.dumpStack(); accessors.put(key, ret); +// if (!baseMethod.isConstructor()) { +// ResolvedType rt = inAspect.factory.fromEclipse(baseMethod.declaringClass); +// if (rt!=null) { +// ReferenceTypeDelegate rtd = ((ReferenceType)rt).getDelegate(); +// if (rtd instanceof EclipseSourceType) { +// rt.addInterTypeMunger(new EclipseTypeMunger(inAspect.factory,new PrivilegedAccessMunger(key, true),inAspect.typeX,null), true); +// } +// } +// } return ret; }