Author: rich
Date: Sun May 15 12:58:59 2005
New Revision: 170256
URL: http://svn.apache.org/viewcvs?rev=170256&view=rev
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-613 : ControlReferences
annotation causes apt exception with default value
tests: drt in controls, bvt in netui (WinXP)
BB: self (linux)
Modified:
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/ControlClientAnnotationProcessor.java
Modified:
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/ControlClientAnnotationProcessor.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/ControlClientAnnotationProcessor.java?rev=170256&r1=170255&r2=170256&view=diff
==============================================================================
---
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/ControlClientAnnotationProcessor.java
(original)
+++
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/ControlClientAnnotationProcessor.java
Sun May 15 12:58:59 2005
@@ -178,10 +178,13 @@
// Add each control type listed in the
ControlReferences annotation
AptAnnotationHelper controlAnnot = new
AptAnnotationHelper(controlMirror);
Collection<AnnotationValue> references =
(Collection<AnnotationValue>)controlAnnot.getObjectValue("value");
- for ( AnnotationValue av : references )
+ if ( references != null )
{
- TypeMirror crType = (TypeMirror)av.getValue();
- controlTypes.add( crType );
+ for ( AnnotationValue av : references )
+ {
+ TypeMirror crType = (TypeMirror)av.getValue();
+ controlTypes.add( crType );
+ }
}
}
}
@@ -434,20 +437,22 @@
Collection<AnnotationValue> references =
(Collection<AnnotationValue>)controlAnnot.getObjectValue("value");
- for ( AnnotationValue av : references )
+ if ( references != null )
{
- DeclaredType crType = (DeclaredType)av.getValue();
- if ( crType instanceof InterfaceType )
+ for ( AnnotationValue av : references )
{
- // Valid interface type decls must be annotated w/
@ControlInterface
- // or @ControlExtension.
- Declaration typeDecl = crType.getDeclaration();
- if ( typeDecl.getAnnotation(ControlInterface.class) == null &&
- typeDecl.getAnnotation(ControlExtension.class) == null )
- printError( t, "control.reference.bad.interfacetype" );
+ DeclaredType crType = (DeclaredType)av.getValue();
+ if ( crType instanceof InterfaceType )
+ {
+ // Valid interface type decls must be annotated w/
@ControlInterface
+ // or @ControlExtension.
+ Declaration typeDecl = crType.getDeclaration();
+ if ( typeDecl.getAnnotation(ControlInterface.class) ==
null &&
+ typeDecl.getAnnotation(ControlExtension.class) ==
null )
+ printError( t, "control.reference.bad.interfacetype"
);
+ }
}
}
-
}
/**