felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stuart McCulloch (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-3638) Missing package import for annotation default value
Date Wed, 07 Nov 2012 19:48:12 GMT

    [ https://issues.apache.org/jira/browse/FELIX-3638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492643#comment-13492643
] 

Stuart McCulloch commented on FELIX-3638:
-----------------------------------------

Logged upstream as https://github.com/bndtools/bnd/issues/292 (bnd is the library that analyzes
the class files and computes the generated imports) 
                
> Missing package import for annotation default value
> ---------------------------------------------------
>
>                 Key: FELIX-3638
>                 URL: https://issues.apache.org/jira/browse/FELIX-3638
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.3.7
>            Reporter: Harald Wellmann
>         Attachments: FELIX-3638.zip
>
>
> For the following annotation class in an OSGi bundle
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ ElementType.TYPE, ElementType.METHOD })
> public @interface Transactional
> {
>     @Nonbinding Class<? extends Annotation>[] qualifier() default Any.class;
> }
> maven-bundle-plugin fails to generate the package import for javax.enterprise.inject.Any,
the default value of the annotation method.
> At runtime, this leads to a non-descriptive exception 
> Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
>         at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:673)
~[na:1.7.0_04]
>         at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:480)
~[na:1.7.0_04]
>         at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306)
~[na:1.7.0_04]
>         at java.lang.reflect.Method.getDefaultValue(Method.java:726) ~[na:1.7.0_04]
>         at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:117)
~[na:1.7.0_04]
>         at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:84)
~[na:1.7.0_04]
>         at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:221)
~[na:1.7.0_04]
>         at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)
~[na:1.7.0_04]
>         at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
~[na:1.7.0_04]
>         at java.lang.Class.initAnnotationsIfNecessary(Class.java:3089) ~[na:1.7.0_04]
>         at java.lang.Class.getDeclaredAnnotations(Class.java:3077) ~[na:1.7.0_04]
> which is hard to debug.
> The problem can be solved by adding an explicit Import-Package element to the plugin
configuration, but I don't see why the plugin can't figure this out by itself.
> The example is taken from Apache Deltaspike. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message