Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-472

NPE when calling getSuperType() for a class that extends Object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.CR1
    • 1.0.0.Beta5
    • None
    • None

      When <i>res </i> is pointing to a Java file, the the following code throws a NPE on <i>cl.getSuperType()</i> when there is no explicit extends specified in the java source.

      JavaResource javaResource = (JavaResource) res.reify(JavaResource.class);
      try {
      if (javaResource.getJavaSource() instanceof JavaClass)

      { JavaClass cl = (JavaClass) javaResource.getJavaSource(); System.out.println(cl.getSuperType()); System.out.println(cl.getInterfaces()); }

      } catch (FileNotFoundException e)

      { e.printStackTrace(); }

              rdebusscher@gmail.com Rudy De Busscher (Inactive)
              rdebusscher@gmail.com Rudy De Busscher (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: