You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Chris (JIRA)" <ji...@apache.org> on 2011/03/28 16:38:05 UTC

[jira] [Commented] (FELIX-1017) Generic types ignored when generating MANIFEST.MF

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

Chris commented on FELIX-1017:
------------------------------

Hi Stuart,

what exactly did you fix with last upgrade 0.0.357?

We have a similar issue and I'd like to hear your opinion. 
Shortened scenario:
Project with a service-api-module with pom that tells felix to create a MANIFEST.MF because we also use it in an Eclipse / equinox environment.
Felix omits import-package for a certain class 'Type' because no bytecode usage - (generic<Type>) erased.
Client fails to start because (a little bit complicated): Spring Bean creation there checks via org.aspectj.weaver.reflect... the generic type that it thinks it needs 'Type'.

My questions are: 
Is this fixed with your upgrade?
Is this more a bug of Spring checking too much?
We currently use a work-around declaring "Import-Package: Type" directly which is a little bit unsatisfactory since it could happen again any time and this 'bug' was hard to find.

Best regards,
Chris

> Generic types ignored when generating MANIFEST.MF
> -------------------------------------------------
>
>                 Key: FELIX-1017
>                 URL: https://issues.apache.org/jira/browse/FELIX-1017
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: Clovis Seragiotto
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> Generic information present in the bytecode is not considered when MANIFEST.MF is generated. In the following example, the package "a" is not included in the Import-Package list, which causes an Exception at runtime (TypeNotPresentException)
> package b;
> import java.lang.reflect.*;
> import a.A;
> public class B {
>     java.util.List<A> list;
>     public static void main(String[] args) {
>        for(Field f : B.class.getDeclaredFields()) {
>            ParameterizedType type = (ParameterizedType)f.getGenericType();
>            for(Type t : type.getActualTypeArguments()) {
>                System.out.println(t); // <--- java.lang.TypeNotPresentException: Type a.A not present
>            }
>        }
>     }
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira