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 135547 - Miscellaneous problems occur if project refers to symbolic-links
Summary: Miscellaneous problems occur if project refers to symbolic-links
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P2 blocker (vote)
Assignee: Jiri Skrivanek
URL:
Keywords:
Depends on: 142629
Blocks: 134554 134771
  Show dependency tree
 
Reported: 2008-05-21 20:06 UTC by _ gtzabari
Modified: 2008-12-22 10:43 UTC (History)
2 users (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 _ gtzabari 2008-05-21 20:06:23 UTC
dev build 200805071203
Windows Vista

1) Create a project in Windows XP or older. The project contains paths to "C:\Documents and Settings\..."
2) Update to Windows Vista to simply copy project to such a machine
3) Load project
4) Random errors will occur (see below)

The problem is that Netbeans does not know that under Vista "c:\documents and settings" is an alias for "c:\users".

So far I've witnessed the following bugs as a result:

1) If I open a file from project A in the editor, then hit CTRL+SHIFT+1 Netbeans asks me "do you wish to open Project
A?" which is already open.
2) CTRL+click on a class opens the file in the wrong project (if two different projects contain the same filename)
3) I am unable to delete SVN files in projects referring to "c:\documents and settings"

I personally believe this is a JDK bug in that File.getCanonicalFile("c:\documents and settings") should return
File("c:\users"). I have filed a BugParade issue but Sun has yet to accept it. I will let you know once they reply. In
the meantime Netbeans should probably implement some workaround.
Comment 1 _ gtzabari 2008-05-21 20:08:49 UTC
BTW: Part of the problem with NTFS junctions and Vista symbolic-links is that they are read-only. If you try
manipulating "c:\documents and settings" instead of "c:\users" you will get an access error, which is probably
responsible for the SVN error I mentioned below.
Comment 2 _ gtzabari 2008-05-26 15:44:47 UTC
An initial response from Sun states that they plan on fixing this in Java7 with
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4313887

That's quite a while away. Please consider adding a workaround into Netbeans in the meantime.
Comment 3 _ gtzabari 2008-05-27 14:45:55 UTC
It's official, this issue won't be fixed until JSR-203/NIO2.
Comment 4 Tomas Zezula 2008-06-17 14:41:36 UTC
The project system is just a client (among others svn, java,...) of the netbeans file system API. If there should be some "workaround" of this problem it should 
be generic in this module, not done in each module separately.
Comment 5 Jiri Skrivanek 2008-08-02 09:05:39 UTC
I added a workaround to FileUtil. "C:\Documents and Settings" is mapped to "C:\Users" under Windows Vista. It should
solve all symptoms of this issue.

http://hg.netbeans.org/core-main/rev/f10f8bd64dfa
Comment 6 Quality Engineering 2008-08-02 15:58:07 UTC
Integrated into 'main-golden', available in build *200808021401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/f10f8bd64dfa
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #135547 - Mapping "C:\Documents and Settings" to "C:\Users" under Windows Vista. It is because it is only link to C:\Users but java.io canoot detect it. It should be fixed in JDK1.7.
Comment 7 _ gtzabari 2008-08-03 02:20:27 UTC
Sorry, any chance you can add all the Vista junction points mentioned here?
http://www.svrops.com/svrops/articles/jpoints.htm

At the very least you should probably map "My Documents" to "Documents" and other common directories users might use.
Comment 8 Jiri Skrivanek 2008-08-04 10:39:52 UTC
OK, I also added "My Documents", "My Pictures", and "My Music" to be translated. I don't think users might use other
files than ones under "\Documents and Settings\<user>\My Documents" in their NetBeans projects.

http://hg.netbeans.org/core-main/rev/cfeab83e2ae8
Comment 9 Quality Engineering 2008-08-05 16:33:52 UTC
Integrated into 'main-golden', available in build *200808051401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/cfeab83e2ae8
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #135547 - Also translate "My Documents", "My Pictures" and "My Music" under Windows Vista.
Comment 10 John Baker 2008-08-08 23:11:37 UTC
Was this fix make it into the beta branch?
Also someone needs to verify the fix.