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 38464 - Multiple copies of the Java class open in the editor
Summary: Multiple copies of the Java class open in the editor
Status: VERIFIED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2004-01-07 02:26 UTC by asmotrich
Modified: 2008-12-22 22:57 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 asmotrich 2004-01-07 02:26:38 UTC
Double clicking on the Java class or its member in
the explorer or selecting the "Next compilation
error" icon on the tool bar results in the second
copy of the same class opened and positioned in
the editor. Problem appeared in the devbuild
200401051900 and is intermittent.
Comment 1 Marek Grummich 2004-01-15 16:36:31 UTC
I tried to reproduce a described bug in the current dev build
(200401141900), but I was  unsuccessful. I am marking the issue
'worksforme'. If you encountered issue in the recent builds again,
feel free to reopen it. 
Comment 2 asmotrich 2004-01-15 20:42:43 UTC
This issue is 100% reproducible with a caveat - bad arrangement of
mounted file systems. My directory structure is
/apps/myproject/src/com/myclass.java. It turns out I had CVS FS's
mounted in the following order: /apps/myproject and then it's relative
subdirectory src. The /apps/myproject was set to NOT participate in
execution, compilation, debugging and documentation and src providing
correct classpath was set to be included in compilation and debugging.
Nevertheless, IDE was grabbing the myclass.java from the first FS
ignoring those settings.

How to reproduce: using build 200401141900 open myclass.java in the
editor making sure it is selected from the second FS in the explorer,
make deliberate syntax error, compile it and get errors in the output
window and then hit Next Error in the toolbar - bingo, editor opens
the second copy of the myclass.java. (Caveat - I use Indirect Ant
Compilation, maybe that contributes to the confusion too).

How to circumvent: swap order of mounted filesystems: put src first
and /apps/myproject second and the problem disappears. Now IDE
consistently returns to the original myclass.java window.

I don't know how to properly classify this problem, but it should be
kept open in the low priority to provide a test case when the whole FS
and mounting and projects mechanism is revisited.

Kudos for creating such a great tool!
Comment 3 Petr Nejedly 2004-02-17 13:24:24 UTC
Hmm, I can only reproduce it in the case I first open the file through
 the non-classpath-matching-root filesystem.

If you open your source file through the correct filesystem (the one,
for which root=classpath entry, i.e. "/apps/myproject/src/"), it will
then always work regardless of the order of filesystems.

It is impossible to fix the problem with current design, because the
files are actually different to the IDE (the IDE doesn't know they
both represent the same file).
The IDE always tries to open a file matching package structure.

The 4.0 project impl won't lead you to overlapping mounts, so it would
be non-issue then (this problem is known for a long time and was
already considered for next projects implementation).
Comment 4 Marian Mirilovic 2004-03-18 07:54:43 UTC
verified