diff options
author | acolyer <acolyer> | 2005-12-13 19:42:17 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-12-13 19:42:17 +0000 |
commit | dc8360ec2717f4c54d1b2aa43309ac1d2807f7fb (patch) | |
tree | f3273695fd656fc123cc01b3456de9259e24c8e3 /aspectj5rt | |
parent | e6df15a4ab52c0448fd49335b0b6cf296cd955cf (diff) | |
download | aspectj-dc8360ec2717f4c54d1b2aa43309ac1d2807f7fb.tar.gz aspectj-dc8360ec2717f4c54d1b2aa43309ac1d2807f7fb.zip |
tests and fix for ITDS in AjTypeSystem
Diffstat (limited to 'aspectj5rt')
-rw-r--r-- | aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java | 31 |
1 files changed, 29 insertions, 2 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 440a139e2..54c500801 100644 --- a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java +++ b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java @@ -663,7 +663,13 @@ public class AjTypeImpl<T> implements AjType<T> { if (!f.getType().isInterface()) continue; if (!Modifier.isPublic(f.getModifiers()) || !Modifier.isStatic(f.getModifiers())) continue; if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)) { - for (Method itdM : f.getType().getDeclaredMethods()) { + Class itdSource = f.getType(); + try { + itdSource = f.get(null).getClass(); + } catch (IllegalAccessException ex) { + // + } + for (Method itdM : itdSource.getDeclaredMethods()) { if (!Modifier.isPublic(itdM.getModifiers()) && publicOnly) continue; InterTypeMethodDeclaration itdm = new InterTypeMethodDeclarationImpl( this, AjTypeSystem.getAjType(f.getType()), itdM @@ -676,9 +682,30 @@ public class AjTypeImpl<T> implements AjType<T> { } private void addAnnotationStyleITDFields(List<InterTypeFieldDeclaration> toList, boolean publicOnly) { - return; //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); + } + } + } + } } /* (non-Javadoc) |