Fixing a compile error requires closing an unrelated project [message #526772] |
Mon, 12 April 2010 17:00  |
Eclipse User |
|
|
|
I'm seeing a very odd problem with project references on the Java Build Path.
I have four somewhat related projects (among others). They are really just two projects, but two copies of each checked out from a specific SVN branch. Project "foo" has a project reference to "bar" in the Java Build Path. Project "fooX" has a project reference to "barX" in the Java Build Path. There are changes in "fooX" and "barX" that are related, such that "foo" and "bar" work together, and "fooX" and "barX" should work together, but "fooX" cannot work with "bar".
I have no compile errors in "foo", "bar", or "barX". There are several compile errors in "fooX" that make no sense at all. The errors occur on lines that are referencing methods in "barX", but the errors make it seem like it's actually referencing "bar" instead. In fact, when I click on the method call with the red underline and do "open declaration", it opens the file in the "bar" project, not "barX".
Even stranger, what I can do to work around this problem is to temporarily close project "bar". As soon as I close it, project "fooX" recompiles and the errors go away. When I go to the line that had the compile error and do "open declaration" again, it goes to the correct class in the "barX" project.
I will file a ticket for this in a few minutes, but I doubt I'll be able to build a repeatable test case for this outside of my environment.
|
|
|
Re: Fixing a compile error requires closing an unrelated project [message #526800 is a reply to message #526772] |
Mon, 12 April 2010 20:26   |
Eclipse User |
|
|
|
David M. Karr wrote:
> I'm seeing a very odd problem with project references on the Java Build
> Path.
>
> I have four somewhat related projects (among others). They are really
> just two projects, but two copies of each checked out from a specific
> SVN branch. Project "foo" has a project reference to "bar" in the Java
> Build Path. Project "fooX" has a project reference to "barX" in the
> Java Build Path. There are changes in "fooX" and "barX" that are
> related, such that "foo" and "bar" work together, and "fooX" and "barX"
> should work together, but "fooX" cannot work with "bar".
>
> I have no compile errors in "foo", "bar", or "barX". There are several
> compile errors in "fooX" that make no sense at all. The errors occur on
> lines that are referencing methods in "barX", but the errors make it
> seem like it's actually referencing "bar" instead. In fact, when I click
> on the method call with the red underline and do "open declaration", it
> opens the file in the "bar" project, not "barX".
>
> Even stranger, what I can do to work around this problem is to
> temporarily close project "bar". As soon as I close it, project "fooX"
> recompiles and the errors go away. When I go to the line that had the
> compile error and do "open declaration" again, it goes to the correct
> class in the "barX" project.
>
> I will file a ticket for this in a few minutes, but I doubt I'll be able
> to build a repeatable test case for this outside of my environment.
Check your output locations for the projects. If bar and barX share the
same output location, then one projects class files would over write the
class files of the other project.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03203 seconds