summaryrefslogtreecommitdiffstats
path: root/weaver/src
diff options
context:
space:
mode:
authoraclement <aclement>2010-01-22 22:46:18 +0000
committeraclement <aclement>2010-01-22 22:46:18 +0000
commit58b93a22f9899c7b79da905b5d32a94c886a3549 (patch)
treed15a5312ff10c34bea72364dc212efd033957e99 /weaver/src
parent9fe3fe74251d625ae82dd58f4a05de63d12cc211 (diff)
downloadaspectj-58b93a22f9899c7b79da905b5d32a94c886a3549.tar.gz
aspectj-58b93a22f9899c7b79da905b5d32a94c886a3549.zip
299552: private ITD fields stay private in target (with unmangled name): all of it
Diffstat (limited to 'weaver/src')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java8
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java11
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java6
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelWorld.java4
4 files changed, 20 insertions, 9 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
index 80811d291..055acc41d 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
@@ -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();
+ }
}
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
index d5fa8c882..2f1c8d2d8 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
@@ -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++) {
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
index d21a2157f..c030e779e 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
@@ -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);
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
index 756f33dcc..4842315ae 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
@@ -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);
}
}