[forge-issues] [JBoss JIRA] (FORGE-472) NPE when calling getSuperType() for a class that extends Object
Lincoln Baxter III (JIRA)
jira-events at lists.jboss.org
Wed Feb 1 14:50:49 EST 2012
[ https://issues.jboss.org/browse/FORGE-472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lincoln Baxter III reassigned FORGE-472:
----------------------------------------
Assignee: Rudy De Busscher
> 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
> Assignee: Rudy De Busscher
> Fix For: 1.0.0.CR1
>
>
> 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
More information about the forge-issues
mailing list