Hi Rudy,<br><br>You&#39;re right: We don&#39;t yet have nested class support, and the top-level class is what should be returned, so I&#39;m a bit surprised that this is what is happening. Do you know if this problem is caused by the JavaParser API or by the forge Resources API?<br>
<br>Care to file an issue? Thanks!<br><br><a href="https://issues.jboss.org/browse/FORGE">https://issues.jboss.org/browse/FORGE</a> <br><br>~Lincoln<br><br><div class="gmail_quote">On Tue, Jan 31, 2012 at 10:06 AM, Rudy De Busscher <span dir="ltr">&lt;<a href="mailto:rdebusscher@gmail.com">rdebusscher@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<div><br></div><div>Seems that nested classes aren&#39;t handled correctly by forge.</div><div><br></div><div>If you have a java source file like this</div>
<div><br></div><div><pre><span>public</span> class CustomProjectStageHolder <span>implements</span> ProjectStageHolder
{
    <span>public</span> <span>static</span> <span>final</span> class CustomProjectStage <span>extends</span> ProjectStage
    {
        <span>private</span> <span>static</span> <span>final</span> <span>long</span> serialVersionUID = 1029094387976167179L;
    }

    <span>public</span> <span>static</span> <span>final</span> CustomProjectStage CustomProjectStage = <span>new</span> CustomProjectStage();
}</pre><pre><br></pre><pre><font face="arial, helvetica, sans-serif">And consider then following statements:</font></pre><pre><div><pre><font face="arial, helvetica, sans-serif">JavaResource javaResource = factory.getResourceFrom(new File(&quot;/path/to/file/RudyHolder.java&quot;)).reify(JavaResource.class);</font></pre>

<pre><font face="arial, helvetica, sans-serif">javaResource.getJavaSource().getQualifiedName();</font></pre><pre><font face="arial, helvetica, sans-serif"><br></font></pre><pre><font face="arial, helvetica, sans-serif">The javaResource is indeed pointing to the file, you can verify with javaResource.getFullyQualifiedName()</font></pre>
<pre><font face="arial, helvetica, sans-serif">But if you ask for the javaSource, as in the second statement, you get the nested class, CustomProjectStage in our example.</font></pre>
<pre><font face="arial, helvetica, sans-serif"><br></font></pre><pre><font face="arial, helvetica, sans-serif">Relation between JavaResource and JavaSource indicates that multiple classes per java file wasn&#39;t considered.  And isn&#39;t common for entity classes etc that have to be handled by Forge.</font></pre>

<pre><font face="arial, helvetica, sans-serif">So when there are no plans in supporting this in Forge, isn&#39;t it logic to return the main class, instead of the nested class?</font></pre><pre><font face="arial, helvetica, sans-serif"><br>
</font></pre><pre><font face="arial, helvetica, sans-serif">Thx for the clarification.</font></pre><pre><font face="arial, helvetica, sans-serif"><br>
</font></pre><pre><font face="arial, helvetica, sans-serif">Regards</font></pre><span class="HOEnZb"><font color="#888888"><pre><font face="arial, helvetica, sans-serif">Rudy</font></pre><pre><font face="arial, helvetica, sans-serif"><br>

</font></pre><pre>-- </pre></font></span></div></pre><span class="HOEnZb"><font color="#888888">Rudy De Busscher<br><a href="http://www.c4j.be" target="_blank">http://www.c4j.be</a><br>
<br>
</font></span></div>
<br>_______________________________________________<br>
forge-users mailing list<br>
<a href="mailto:forge-users@lists.jboss.org">forge-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-users" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>&quot;Keep it Simple&quot;<br>