[JBoss JIRA] (FORGE-472) NPE when calling getSuperType() for a class that extends Object
by Rudy De Busscher (JIRA)
Rudy De Busscher created FORGE-472:
--------------------------------------
Summary: NPE when calling getSuperType() for a class that extends Object
Key: FORGE-472
URL: https://issues.jboss.org/browse/FORGE-472
Project: Forge
Issue Type: Bug
Affects Versions: 1.0.0.Beta5
Reporter: Rudy De Busscher
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();
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira