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 29384 - Avoid to open two different projects with the same Id
Summary: Avoid to open two different projects with the same Id
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 3.x
Hardware: All Solaris
: P1 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords: API
Depends on: 30006
Blocks:
  Show dependency tree
 
Reported: 2002-12-06 23:06 UTC by Chris Webster
Modified: 2003-12-11 14:25 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Webster 2002-12-06 23:06:58 UTC
In the compilation unit test CompilerTest a
regression was caused by two ProjectMember's
co-existing. This is demonstrated in the
testPMSave test, this test is not independant so
this should be commented out. The actual failure
can be seen in the testGetCompilers test, where
the project member lookup is different from the
orginal project member lookup. This is causing a
unit test failure.
Comment 1 Chris Webster 2002-12-06 23:46:10 UTC
Line 173 of CompilerTest.java helps the problem (when I added this
assertion, everything seemed to work as expected), so you may want to
look at commenting this out. 
Comment 2 Vitezslav Stejskal 2002-12-10 17:34:57 UTC
Chris, I am sorry, but I can't reproduce the problem. Both testPMSave
and testGetCompilers pass on my machine (regardless of commented line
173).

Could you describe a bit what you observed? As I understood you got
two different lookups for single ProjectMember, right? Which assertion
failed? Thanks.
Comment 3 Chris Webster 2002-12-10 18:09:36 UTC
Hi Vita,
  I just committed a new version of the CompilerTest, the assertion
failure in this test is line 171 (the ProjectMembers are not the same
even though they should be). I get this failure just about every time
on my machine (Solaris 9, JDK 1.3.1_04). This is strange because the
ProjectMember's in this test are both strongly reachable. 
Comment 4 Vitezslav Stejskal 2003-01-16 16:18:57 UTC
Finally I caught it. The problem is that CompilerTest opens *new*
Projects instance before each test run (see setUp and Util.getProject
which mounts new filesystem and opens the project from new
FileObject). Since those Project instances have the same name the
ProjectMemberConvertor gets confused and returns ProjectMember from
wrong project when test asks for BuildTargetDependencies.

As a hotfix I've adde CompilerTest.tearDown method which closes the
project after each test. However, this is clear inconsistency in the
project infra and should be avoided somehow. I'll solve this properly
when implementing issue #30006 and issue #29810.
Comment 5 Vitezslav Stejskal 2003-02-27 22:56:46 UTC
Done. Projects infra forbids to open several projects with same unique
id. The IOException is thrown (annotated with message explaining
situation for the user).
Comment 6 Jan Becicka 2003-11-25 14:02:29 UTC
As described in
http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss the
current work on projects prototype has been stopped.

Marking issue as VERIFIED --->
Comment 7 Jan Becicka 2003-11-25 14:11:21 UTC
---> CLOSED