Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » SourceFile attribute wrong when compiling with eclipse batch compiler
SourceFile attribute wrong when compiling with eclipse batch compiler [message #636982] Wed, 03 November 2010 12:19 Go to next message
Philippe Marschall is currently offline Philippe Marschall
Messages: 120
Registered: July 2009
Senior Member
Hi

We're experimenting with moving our build from javac to the Eclipse
batch compiler using Plexus [1]. Compilation works fine but source
attachments for the generated classes never work. The editor in JDT
always displays: "The source attachment does not contain the source for
the file FooAction.class". After comparing the byte code we discovered
that the SourceFile attribute has the full path to the file instead of
just the local name.

For example the Eclipse batch compiler would produce:
com/acme/FooAction.java

whereas javac would produce:
FooAction.java

I don't assume this a bug in the Eclipse batch compiler but rather in
the integration [2] [3]. You don't happen to have any pointers on where
to start looking?

[1] http://plexus.codehaus.org/plexus-components/plexus-compiler /
[2]
http://fisheye.codehaus.org/browse/plexus/plexus-components/ tags/plexus-compiler-1.8/plexus-compilers/plexus-compiler-ec lipse/src/main/java/org/codehaus/plexus/compiler/eclipse/Ecl ipseJavaCompiler.java?r=HEAD
[3]
http://fisheye.codehaus.org/browse/plexus/plexus-components/ tags/plexus-compiler-1.8/plexus-compilers/plexus-compiler-ec lipse/src/main/java/org/codehaus/plexus/compiler/eclipse/Sou rceCodeLocator.java?r=HEAD


Cheers
Philippe
Re: SourceFile attribute wrong when compiling with eclipse batch compiler [message #637781 is a reply to message #636982] Mon, 08 November 2010 15:14 Go to previous messageGo to next message
Olivier Thomann is currently offline Olivier Thomann
Messages: 518
Registered: July 2009
Senior Member
Could you please open a bug report against JDT/Core with a source file and the corresponding .class files attached to it so that we can investigate it ?

I tried quickly to produce a .class file from a compilation unit inside a package and the source attribute looks ok.

So this is either a bug in the Plexus compiler or due to some specific settings.
--
Olivier
Re: SourceFile attribute wrong when compiling with eclipse batch compiler [message #637969 is a reply to message #637781] Tue, 09 November 2010 08:43 Go to previous message
Philippe Marschall is currently offline Philippe Marschall
Messages: 120
Registered: July 2009
Senior Member
On 11/08/2010 09:14 PM, Olivier Thomann wrote:
> Could you please open a bug report against JDT/Core with a source file
> and the corresponding .class files attached to it so that we can
> investigate it ?
>
> I tried quickly to produce a .class file from a compilation unit inside
> a package and the source attribute looks ok.
>
> So this is either a bug in the Plexus compiler or due to some specific
> settings.

It's a Plexus bug, not a JDT bug. We backported tycho-compiler-jdt and
everything is working fine now.

Cheers
Philippe
Previous Topic:Subscribe to marker/decoration service in navigator
Next Topic:eclipse memory setting
Goto Forum:
  


Current Time: Tue Jul 22 05:20:32 EDT 2014

Powered by FUDForum. Page generated in 0.02439 seconds