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.
Netbeans dayly build 20080724 on Ubuntu Linux Once Eclipse project created and imported to NB on Linux, the default source package label is 'src' instead of 'Source Packages' as on Windows machine. Same for test roots 'test' instead of 'Test Packages'
ProjectFactorySupport.updateSourceRootLabels doesn't make any sense to me. First of all, we probably do not need to update labels at all - J2SEProjectGenerator.createProject already names the first root src.dir (test.src.dir for tests) automatically, and this will be displayed as "Source Packages" ("Test Packages" resp.). Even assuming this method should exist, its implementation is wrong. It first checks to see if a URL is a folder URL - which should only involve it ending with '/' (cannot possibly end with '\\'). Then it checks whether URL.file - i.e. the path component of the URL, beginning with the first '/' - happens to be the same as a disk file path. This can never be true on Windows, and will be true on Unix only if the path does not contain any URL metacharacters (e.g. SPACE). If so, the method sets the label to something similar to what SourceRoots.getRootDisplayName would have produced anyway (if not called on the first root of a given type). I would recommend the method (and its four call points) just be deleted.
The code in method is silly. It's been there since the riginal importer. I would amend it by replacing "String path = rootURLs[i].getFile();" with "String path = new File(rootURLs[i].toURI()).getPath();". The method is useful when NB project created during the import is stored outside of Eclipse folder. In such a case you end up with labels of source roots being fully qualified paths. Apart from first one which is called "Source Packages". Try it on that musicpinboard example which has three source roots. What method does is it use the same labels as Eclipse project. To me this is P4.
Integrated into 'main-golden', available in build *200808041401* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/c609b46664f1 User: David Konecny <dkonecny@netbeans.org> Log: #141553 - fixing URL path conversion
So it is fixed now?
Only code you questioned was fixed. I'm still not sure if it is desirable to implement this or not. For newly created NB project it make sense to show "Source Packages" because we create "src" folder and we want to present it to user as "Source Packages". In case of project imported from Eclipse it can be beneficial (to Eclipse user) to see source roots named as in Eclipse. In any case IMO this is low priority issue.
.
NetBeans.org Migration: changing resolution from LATER to WONTFIX