Note that there are some explanatory texts on larger screens.

plurals
  1. POGWT TypeOracle.getTypes does not return all types
    primarykey
    data
    text
    <p>I have a custom generator that generates code only for somes classes in my project. The following code is at the beginning of the <code>generate</code> method, and puts all the classes I will need to work on in the <code>clazzes</code> list</p> <pre><code>TypeOracle oracle = context.getTypeOracle(); JClassType markerInterfaceType = oracle.findType(MY_PARENT_CLASS.class.getName()); List&lt;JClassType&gt; clazzes = new ArrayList&lt;JClassType&gt;(); for (JClassType classType : oracle.getTypes()) { if (!classType.equals(markerInterfaceType) &amp;&amp; classType.isAssignableTo(markerInterfaceType)) { clazzes.add(classType); } } </code></pre> <p>This code has been unchanged for more than a year, but since last week it seems that a few classes are not taken into account by the generator.</p> <p>After some digging, i found that those classes are not even in the list returned by <code>oracle.getTypes()</code></p> <ul> <li>Those ignored classes are not newly created classes (some were left unchanged for several month)</li> <li>As far as i can tell, there is no way to differenciate a class that will be ignored from any other class</li> <li>No upgrade in our gwt version was made (some of us are using 2.5.0, others 2.5.1)</li> <li>No upgrade in packages used by those classes either</li> <li><code>oracle.findType(MISSING_CLASS.class.getName())</code> returns <code>null</code></li> <li>the problem appears only for some people, but not on the same classes</li> <li>renaming problematic classes seems to correct the problem </li> </ul> <p>My best guess would be that i have a cache problem somewhere, but i have no idea where to look.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload