aboutsummaryrefslogtreecommitdiffstats
path: root/aspectj5rt/java5-src
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-12-14 00:53:28 +0000
committeracolyer <acolyer>2005-12-14 00:53:28 +0000
commit9825192b0f54682faa39b7467b55372b679db544 (patch)
tree26fe549e83746b4d2a5eefd11a7505a0c8f02114 /aspectj5rt/java5-src
parent7de52b422183b16f37dafa025c6307d503cf233f (diff)
downloadaspectj-9825192b0f54682faa39b7467b55372b679db544.tar.gz
aspectj-9825192b0f54682faa39b7467b55372b679db544.zip
fixes inefficient ordering of tests in SignaturePattern (that I inadvertantly introduced earlier), and corrects @DeclareParents impl in AJTypeSystem :- fields should NOT be shown, and nor should non-interface members.
Diffstat (limited to 'aspectj5rt/java5-src')
-rw-r--r--aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java36
-rw-r--r--aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/InterTypeMethodDeclarationImpl.java4
2 files changed, 7 insertions, 33 deletions
diff --git a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java
index 54c500801..482ccebb9 100644
--- a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java
+++ b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java
@@ -662,17 +662,12 @@ public class AjTypeImpl<T> implements AjType<T> {
for (Field f : clazz.getDeclaredFields()) {
if (!f.getType().isInterface()) continue;
if (!Modifier.isPublic(f.getModifiers()) || !Modifier.isStatic(f.getModifiers())) continue;
- if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)) {
- Class itdSource = f.getType();
- try {
- itdSource = f.get(null).getClass();
- } catch (IllegalAccessException ex) {
- //
- }
- for (Method itdM : itdSource.getDeclaredMethods()) {
+ if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)) {
+ for (Method itdM : f.getType().getDeclaredMethods()) {
if (!Modifier.isPublic(itdM.getModifiers()) && publicOnly) continue;
InterTypeMethodDeclaration itdm = new InterTypeMethodDeclarationImpl(
- this, AjTypeSystem.getAjType(f.getType()), itdM
+ this, AjTypeSystem.getAjType(f.getType()), itdM,
+ Modifier.PUBLIC
);
toList.add(itdm);
}
@@ -684,28 +679,7 @@ public class AjTypeImpl<T> implements AjType<T> {
private void addAnnotationStyleITDFields(List<InterTypeFieldDeclaration> toList, boolean publicOnly) {
//AV: I think it is meaningless
//@AJ decp is interface driven ie no field
- // AMC: private fields in the mixin type should show as ITDs private to the aspect...
- if (isAspect()) {
- for (Field f : clazz.getDeclaredFields()) {
- if (!f.getType().isInterface()) continue;
- if (!Modifier.isPublic(f.getModifiers()) || !Modifier.isStatic(f.getModifiers())) continue;
- if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)) {
- Class itdSource = f.getType();
- try {
- itdSource = f.get(null).getClass();
- } catch (IllegalAccessException ex) {
- //
- }
- for (Field itdF : itdSource.getDeclaredFields()) {
- if (!Modifier.isPublic(itdF.getModifiers()) && publicOnly) continue;
- InterTypeFieldDeclaration itdf = new InterTypeFieldDeclarationImpl(
- this, AjTypeSystem.getAjType(f.getType()), itdF
- );
- toList.add(itdf);
- }
- }
- }
- }
+ return;
}
/* (non-Javadoc)
diff --git a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/InterTypeMethodDeclarationImpl.java b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/InterTypeMethodDeclarationImpl.java
index 2ed2f89cf..eb085a055 100644
--- a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/InterTypeMethodDeclarationImpl.java
+++ b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/InterTypeMethodDeclarationImpl.java
@@ -47,8 +47,8 @@ public class InterTypeMethodDeclarationImpl extends InterTypeDeclarationImpl
this.baseMethod = itdInterMethod;
}
- public InterTypeMethodDeclarationImpl(AjType<?> decType, AjType<?> targetType, Method base) {
- super(decType,targetType,base.getModifiers());
+ public InterTypeMethodDeclarationImpl(AjType<?> decType, AjType<?> targetType, Method base, int modifiers) {
+ super(decType,targetType,modifiers);
this.parameterAdjustmentFactor = 0;
this.name = base.getName();
this.baseMethod = base;