|
|
Re: Accessing the GenModel nsUri [message #237041 is a reply to message #236894] |
Tue, 21 July 2009 05:12  |
Eclipse User |
|
|
|
Hi Alex,
Many thanks for your response. That's what I originally thought but when
I decompiled the .class from the jar, the value wasn't inlined in the
decompiled source. Then I thought that perhaps the compiler inlines it
but also maintains some metadata in the .class file which the decompiler
then uses to recover the name of the constant.
I've also confirmed that this is not the case with plain vanilla command
line javac so this must be an (unfortunate) optimization of the Eclipse
Java compiler. I'll look into this a bit more and let you know how it goes.
Cheers,
Dimitris
Alex Shatalin wrote:
> Hello Dimitris,
>
> In GMF 2.2 we've changed GMFGenPackage NS URI to
> http://www.eclipse.org/gmf/2009/GenModel.
>
> If you compile plugin with previouse version of GMF then constants will
> be inlined by Java compiler, so
> System.err.println(GMFGenPackage.eNS_URI);
>
> call will be represented as:
>
> System.err.println("http://www.eclipse.org/gmf/2008/GenModel");
>
> in bytecode. This is a reqson why you can see
> http://www.eclipse.org/gmf/2008/GenModel line printed with Gallileo 3.5
> by System.err.println(GMFGenPackage.eNS_URI); compiled in 3.4
>
> Be careful using static constants wich can be changed with plugin
> version...
>
> -----------------
> Alex Shatalin
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04376 seconds