summaryrefslogtreecommitdiffstats
path: root/aspectj5rt
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-12-19 12:22:26 +0000
committeracolyer <acolyer>2005-12-19 12:22:26 +0000
commit4676acbde531b3c00f5572ff4053435e9ba9b1eb (patch)
tree965cf14b15fe462f62de90df4091c311b40d0e3c /aspectj5rt
parentbc1fcf9581621da51498b251f053b29fb70b9c05 (diff)
downloadaspectj-4676acbde531b3c00f5572ff4053435e9ba9b1eb.tar.gz
aspectj-4676acbde531b3c00f5572ff4053435e9ba9b1eb.zip
merge of changes from 1.5.0 branch into HEAD
Diffstat (limited to 'aspectj5rt')
-rw-r--r--aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java22
-rw-r--r--aspectj5rt/java5-src/org/aspectj/lang/annotation/DeclareParents.java10
2 files changed, 15 insertions, 17 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 482ccebb9..99f1e66ab 100644
--- a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java
+++ b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java
@@ -661,8 +661,10 @@ public class AjTypeImpl<T> implements AjType<T> {
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)) {
+ if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)) {
+ Class<org.aspectj.lang.annotation.DeclareParents> decPAnnClass = org.aspectj.lang.annotation.DeclareParents.class;
+ org.aspectj.lang.annotation.DeclareParents decPAnn = f.getAnnotation(decPAnnClass);
+ if (decPAnn.defaultImpl() == decPAnnClass) continue; // doesn't contribute members...
for (Method itdM : f.getType().getDeclaredMethods()) {
if (!Modifier.isPublic(itdM.getModifiers()) && publicOnly) continue;
InterTypeMethodDeclaration itdm = new InterTypeMethodDeclarationImpl(
@@ -951,21 +953,7 @@ public class AjTypeImpl<T> implements AjType<T> {
private void addAnnotationStyleDeclareParents(List<DeclareParents> toList) {
for (Field f : clazz.getDeclaredFields()) {
- if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareImplements.class)) {
- if (!f.getType().isInterface()) continue;
- org.aspectj.lang.annotation.DeclareImplements ann = f.getAnnotation(org.aspectj.lang.annotation.DeclareImplements.class);
- String parentType = f.getType().getName();
- DeclareParentsImpl decp = new DeclareParentsImpl(
- ann.value(),
- parentType,
- false,
- this
- );
- toList.add(decp);
- }
- if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)
- && Modifier.isStatic(f.getModifiers())
- && Modifier.isPublic(f.getModifiers())) {
+ if (f.isAnnotationPresent(org.aspectj.lang.annotation.DeclareParents.class)) {
if (!f.getType().isInterface()) continue;
org.aspectj.lang.annotation.DeclareParents ann = f.getAnnotation(org.aspectj.lang.annotation.DeclareParents.class);
String parentType = f.getType().getName();
diff --git a/aspectj5rt/java5-src/org/aspectj/lang/annotation/DeclareParents.java b/aspectj5rt/java5-src/org/aspectj/lang/annotation/DeclareParents.java
index e26e8c778..fe7267849 100644
--- a/aspectj5rt/java5-src/org/aspectj/lang/annotation/DeclareParents.java
+++ b/aspectj5rt/java5-src/org/aspectj/lang/annotation/DeclareParents.java
@@ -28,4 +28,14 @@ public @interface DeclareParents {
*/
String value();
+ /**
+ * Optional class defining default implementation
+ * of interface members (equivalent to defining
+ * a set of interface member ITDs for the
+ * public methods of the interface).
+ */
+ Class defaultImpl() default DeclareParents.class;
+
+ // note - a default of "null" is not allowed,
+ // hence the strange default given above.
}