This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 226194 - NetBeans confuses different branches of the same project
Summary: NetBeans confuses different branches of the same project
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 7.3
Hardware: Macintosh Mac OS X
: P2 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-15 17:30 UTC by blake1024
Modified: 2013-03-11 15:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description blake1024 2013-02-15 17:30:31 UTC
When I use the F9 key to compile the Java file I am in the system builds some other project not even related to the Java file I am editing.  I also tried right-click on the Java file and I selected "Compile File" and it again build some other, unrelated project.
Comment 1 blake1024 2013-02-15 20:31:59 UTC
I think this problem is caused by something other - long standing - problem.  Basically, I have a project checked into an SVN repository.  I create a branch.  I checkout both the trunk & branch to two different (project) locations.  NetBeans has all sorts of problems with this.  If I run one program, get an error, and click on the error, it takes me to the code on the other branch.  NetBeans is confusing the two projects.
Comment 2 Milos Kleint 2013-02-21 08:23:46 UTC
what is the project type of the file's owning project? does it have any external source roots? (external to the project's basedirectory)


> I also tried
> right-click on the Java file and I selected "Compile File" and it again build
> some other, unrelated project.

This suggests that the file is owned by the other project, not the one you think it is.
Comment 3 blake1024 2013-02-21 14:53:44 UTC
It is a single Java/NetBeans project.  It was checked into a subversion repository.  A branch was created outside of NetBeans.  The branch was then checked out from within NetBeans as a separate project.  I now have two opened projects, one the trunk, and one the branch.  When I debug one I get a backtrace in the console window.  I click on the error link in the console and it brings up the source code to the other project - not the one I was debugging.

This aso causes the problem with the F9 - re-compile button.

This is a problem I've noticed for years.  Just never reported it before.
Comment 4 blake1024 2013-02-21 15:09:50 UTC
Also (see previous), everything works fine if I close one project and work with the other (regardless of which is the one and which is the other).

I don't know how to determine "project type".

I don't know how to tell of any source roots, however, both projects reference the same external NetBeans project in the Preferences / Libraries / Compile-time libraries section.  But, the flagged errors in question are not in that shared project (nor is it a parent of anything).  I don't think this is a factor.

I don't think the file is owned by another project since it was checked out as a stand-alone project. Also, everything works fine if I close the other project.
Comment 5 Milos Kleint 2013-03-11 15:26:55 UTC
(In reply to comment #3)
> It is a single Java/NetBeans project.  It was checked into a subversion
> repository.  A branch was created outside of NetBeans.  The branch was then
> checked out from within NetBeans as a separate project.  I now have two opened
> projects, one the trunk, and one the branch.  When I debug one I get a
> backtrace in the console window.  I click on the error link in the console and
> it brings up the source code to the other project - not the one I was
> debugging.

How do you trigger debugging? Attach debugger vs. Debug project/file?
In general it should be possible to review the debugger's source path at Window/Debugger/Sources window.


> 
> This aso causes the problem with the F9 - re-compile button.

Without external file ownership this should not be happening. Have you checked the ant output?  does it really execute on top of the other project? BTW you need Compile on save off to trigger a build.


> 
> This is a problem I've noticed for years.  Just never reported it before.


that would suggest that the problem or at least part of it is someplace in your setup. If it were a general problem, someone would have filed it years ago.

I attempted to reproduce (created a java project at Path A, outside  of IDE, copied to path B, opened both. never got problems in debugging or file compilation.

A sample project setup is of essense here. Without a way to reproduce, there is very little we can do. Closing as worksforme, please reopen with steps to reproduce or sample project demonstrating the problem.