]> source.dussan.org Git - aspectj.git/commitdiff
299552: private ITD fields stay private in target (with unmangled name): all of it
authoraclement <aclement>
Fri, 22 Jan 2010 22:46:18 +0000 (22:46 +0000)
committeraclement <aclement>
Fri, 22 Jan 2010 22:46:18 +0000 (22:46 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java

index 80811d291cea7b51c9e8d48ad5de21da279f091f..055acc41dd76a9a8e2d146d7b4a6e3e7e1a7aca1 100644 (file)
@@ -427,7 +427,8 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                        } else if (a instanceof AjAttribute.DeclareAttribute) {
                                declares.add(((AjAttribute.DeclareAttribute) a).getDeclare());
                        } else if (a instanceof AjAttribute.PrivilegedAttribute) {
-                               privilegedAccess = ((AjAttribute.PrivilegedAttribute) a).getAccessedMembers();
+                               AjAttribute.PrivilegedAttribute privAttribute = (AjAttribute.PrivilegedAttribute) a;
+                               privilegedAccess = privAttribute.getAccessedMembers();
                        } else if (a instanceof AjAttribute.SourceContextAttribute) {
                                if (getResolvedTypeX().getSourceContext() instanceof SourceContextImpl) {
                                        AjAttribute.SourceContextAttribute sca = (AjAttribute.SourceContextAttribute) a;
@@ -972,4 +973,9 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
        public void setExposedToWeaver(boolean b) {
                exposedToWeaver = b;
        }
+
+       @Override
+       public int getCompilerVersion() {
+               return wvInfo.getMajorVersion();
+       }
 }
index d5fa8c882c02257783418def49ae5e6b9b52bede..2f1c8d2d838ac89dd5ecc55babd60ec9fdb6ef33 100644 (file)
@@ -63,6 +63,7 @@ import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.WeaverMessages;
 import org.aspectj.weaver.WeaverStateInfo;
 import org.aspectj.weaver.World;
+import org.aspectj.weaver.AjAttribute.WeaverVersionInfo;
 import org.aspectj.weaver.model.AsmRelationshipProvider;
 import org.aspectj.weaver.patterns.DeclareAnnotation;
 import org.aspectj.weaver.patterns.Pointcut;
@@ -567,8 +568,10 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                if (onType.equals(gen.getType())) {
                        if (member.getKind() == Member.FIELD) {
                                // System.out.println("matched: " + gen);
-                               addFieldGetter(gen, member, AjcMemberMaker.privilegedAccessMethodForFieldGet(aspectType, member));
-                               addFieldSetter(gen, member, AjcMemberMaker.privilegedAccessMethodForFieldSet(aspectType, member));
+                               addFieldGetter(gen, member, AjcMemberMaker
+                                               .privilegedAccessMethodForFieldGet(aspectType, member, munger.shortSyntax));
+                               addFieldSetter(gen, member, AjcMemberMaker
+                                               .privilegedAccessMethodForFieldSet(aspectType, member, munger.shortSyntax));
                                return true;
                        } else if (member.getKind() == Member.METHOD) {
                                addMethodDispatch(gen, member, AjcMemberMaker.privilegedAccessMethodForMethod(aspectType, member));
@@ -1764,7 +1767,9 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                                gen.addMethodGen(mg1);
                        } else {
                                weaver.addInitializer(this);
-                               FieldGen fg = makeFieldGen(gen, AjcMemberMaker.interFieldClassField(field, aspectType));
+                               ResolvedMember newField = AjcMemberMaker.interFieldClassField(field, aspectType,
+                                               munger.version == NewFieldTypeMunger.VersionTwo);
+                               FieldGen fg = makeFieldGen(gen, newField);
 
                                if (annotationsOnRealMember != null) {
                                        for (int i = 0; i < annotationsOnRealMember.length; i++) {
index d21a2157f26638692d905e18ac85c80236fa6ed3..c030e779edd7cf9e662412207ad3345b05a2ecf0 100644 (file)
@@ -1689,7 +1689,7 @@ public class BcelWeaver {
                                didSomething = true;
                                ResolvedTypeMunger newAnnotationTM = new AnnotationOnTypeMunger(annoX);
                                newAnnotationTM.setSourceLocation(decA.getSourceLocation());
-                               onType.addInterTypeMunger(new BcelTypeMunger(newAnnotationTM, decA.getAspect().resolve(world)));
+                               onType.addInterTypeMunger(new BcelTypeMunger(newAnnotationTM, decA.getAspect().resolve(world)), false);
                                decA.copyAnnotationTo(onType);
                        }
                }
@@ -1749,7 +1749,7 @@ public class BcelWeaver {
                                        newParentMunger.setIsMixin(true);
                                }
                                newParentMunger.setSourceLocation(p.getSourceLocation());
-                               onType.addInterTypeMunger(new BcelTypeMunger(newParentMunger, xcutSet.findAspectDeclaringParents(p)));
+                               onType.addInterTypeMunger(new BcelTypeMunger(newParentMunger, xcutSet.findAspectDeclaringParents(p)), false);
                        }
                }
                return didSomething;
@@ -1764,7 +1764,7 @@ public class BcelWeaver {
                for (Iterator i = typeMungerList.iterator(); i.hasNext();) {
                        ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
                        if (!m.isLateMunger() && m.matches(onType)) {
-                               onType.addInterTypeMunger(m);
+                               onType.addInterTypeMunger(m, false);
                        }
                }
                CompilationAndWeavingContext.leavingPhase(tok);
index 756f33dcc9ed28cb450181ce52c88c68ae6b8c2d..4842315ae5d4611367a63b12d9373c8cf2f3232f 100644 (file)
@@ -748,7 +748,7 @@ public class BcelWorld extends World implements Repository {
                                ResolvedTypeMunger newParentMunger = new NewParentTypeMunger(newParent);
                                newParentMunger.setSourceLocation(p.getSourceLocation());
                                onType.addInterTypeMunger(new BcelTypeMunger(newParentMunger, getCrosscuttingMembersSet()
-                                               .findAspectDeclaringParents(p)));
+                                               .findAspectDeclaringParents(p)), false);
                        }
                }
                return didSomething;
@@ -775,7 +775,7 @@ public class BcelWorld extends World implements Repository {
                                didSomething = true;
                                ResolvedTypeMunger newAnnotationTM = new AnnotationOnTypeMunger(annoX);
                                newAnnotationTM.setSourceLocation(decA.getSourceLocation());
-                               onType.addInterTypeMunger(new BcelTypeMunger(newAnnotationTM, decA.getAspect().resolve(this)));
+                               onType.addInterTypeMunger(new BcelTypeMunger(newAnnotationTM, decA.getAspect().resolve(this)), false);
                                decA.copyAnnotationTo(onType);
                        }
                }