Skip to main content


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 16:19 Go to next message
Philippe Marschall is currently offline Philippe MarschallFriend
Messages: 121
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 20:14 Go to previous messageGo to next message
Olivier Thomann is currently offline Olivier ThomannFriend
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 13:43 Go to previous message
Philippe Marschall is currently offline Philippe MarschallFriend
Messages: 121
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: Wed Apr 24 14:17:31 GMT 2024

Powered by FUDForum. Page generated in 0.04189 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top