2008/5/28 Clement Escoffier <[EMAIL PROTECTED]>: > Hi, > > It is just an hypothesis, but the maven-bundle-plugin is based on BND which > is based on a bytecode analysis. The bytecode does not contain specific > instructions about generics. It's more a syntactic sugar. So, when > analyzed, > I'm pretty sure that generics are not detected as they are not present in > the classes. >
that's correct - the generic type parameters are erased by the compiler and don't appear in bytecode (this is also why generic parameters aren't available at runtime, unless you decide to subclass the generic type as a concrete type) however, you shouldn't need to import this package unless you actually use the type - otherwise the bytecode would reference the containing package do you have an example where the package is missing and this causes an exception at runtime? (if so please open a JIRA issue and attach the example project) Clement > > > -----Message d'origine----- > > De : Hampel, Michael [mailto:[EMAIL PROTECTED] > > Envoyé : mercredi 28 mai 2008 08:48 > > À : [email protected] > > Objet : maven-bundle-plugin and generics > > > > Hello, > > > > I have a class with a method > > > > public Collection<MyType> getJobs(Object jobProcessor) { > > return jobProcessor.getJobs(); > > } > > > > The class imports MyType. > > > > When I build the class with the maven-bundle-plugin the resulting > > Manifest is not adding the MyTypes package > > to its Import-Packages. > > > > When I add > > > > public Collection<MyType> getJobs(Object jobProcessor) { > > MyType mt = new MyType(); > > return jobProcessor.getJobs(); > > } > > > > then I have the package exporting MyType in the Manifest. > > > > Is this a limitation of the maven-bundle-plugin or bnd or is there > > another reason? > > > > Thanx in advance for any help, > > > > Michael > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Cheers, Stuart

