I think the problem (if it is one) is located in:
com.sun.codemodel.JCodeModel#ref(String fullyQualifiedClassName)
If called multiple times with the same fully qualified class name, it
returns new instances of JDirectClass every time.
Maybe there should be some kind of Map<String,JDirectClass> be introduced?
Thanks,
Johannes
On 06/15/2010 03:01 PM, Johannes Schneider wrote:
> On 06/15/2010 12:14 AM, Aleksei Valikov wrote:
>>> is it possible (and how) to add a static import for a method?
>
>> No, it's not possible. Imports are generated automatically; I don't
>> see any support for static imports in the source code.
>
> Bad luck. But it is not that important. Thanks.
>
> But I don't understand that magic related to imports completely. Most of
> the times imports are
> generated automatically. But for one of my classes, the fully qualified
> name is used for every occurrence.
> Is there any documentation when imports are generated and when it is not
> possible?
>
> Is it related to the classpath? Are only imports generated for classes
> that are in the classpath?
>
>
> Thanks,
>
> Johannes
>
>> Bye.
>> /lexi
>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_codemodel.dev.java.net
>> For additional commands, e-mail: users-help_at_codemodel.dev.java.net
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_codemodel.dev.java.net
For additional commands, e-mail: users-help_at_codemodel.dev.java.net
--
Johannes Schneider - blog.cedarsoft.com