Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1017

Generic types ignored when generating MANIFEST.MF

    XMLWordPrintableJSON

Details

    Description

      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 }

      }
      }
      }

      Attachments

        Activity

          People

            mcculls Stuart McCulloch
            clovis_at Clovis Seragiotto
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: