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 254320 - IllegalArgumentException: NetBeansProjects\abcd
Summary: IllegalArgumentException: NetBeansProjects\abcd
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-12 16:06 UTC by ytn01
Modified: 2015-10-30 02:22 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 219121


Attachments
stacktrace (1.41 KB, text/plain)
2015-08-12 16:06 UTC, ytn01
Details
Proposed Patch (3.84 KB, patch)
2015-10-27 13:02 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ytn01 2015-08-12 16:06:44 UTC
This bug was originally marked as duplicate of bug 221550, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201508100002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.60-b23, Java(TM) SE Runtime Environment, 1.8.0_60-ea-b25
OS: Mac OS X

User Comments:
ytn01: 1. Renamed a Java Web Project via IDE
2. Invoked "move project" through project context menu
3. provided a destination path that includes special character "\abcd"

exception was thrown




Stacktrace: 
java.lang.IllegalArgumentException: NetBeansProjects\abcd
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.createFolderImpl(FolderObj.java:240)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj$2.call(FolderObj.java:324)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj$2.call(FolderObj.java:322)
   at org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem.runAsInconsistent(FileBasedFileSystem.java:122)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.createFolder(FolderObj.java:327)
   at org.netbeans.modules.project.uiapi.DefaultProjectOperationsImplementation.createFolder(DefaultProjectOperationsImplementation.java:640)
Comment 1 ytn01 2015-08-12 16:06:46 UTC
Created attachment 155303 [details]
stacktrace
Comment 2 Jaroslav Havlin 2015-08-13 07:46:17 UTC
Did the path with the special character already exist on your filesystem (and you selected it via Browse... button), or did you enter new Project Location manually?
Thank you.
Comment 3 ytn01 2015-08-28 15:15:40 UTC
(In reply to Jaroslav Havlin from comment #2)
> Did the path with the special character already exist on your filesystem
> (and you selected it via Browse... button), or did you enter new Project
> Location manually?
> Thank you.

I entered the path manually.
Comment 4 Jaroslav Havlin 2015-09-21 14:10:49 UTC
NetBeans currently does not support folders with backslashes (which is mainly because of portability of projects to other platforms, I suppose).

Although it is fine to have folder name with backslash character on Mac OS X, creating a folder with such name in NetBeans is forbidden.

What behavior would you expect?
 - 1) warning message that an invalid character was used in the path
 - 2) using the character as is (which is inconsistent with rest of NetBeans IDE)
 - 3) changing backslashes to forward slashes (if not on Windows)
 ...  something else

Thank you.
Comment 5 Jaroslav Havlin 2015-09-21 14:14:29 UTC
> NetBeansProjects\abcd
I guess that the intention was to create folder "abcd" under "NetBeansProjects".
So automatic conversion of (back)slash characters, depending on current platform, would be preferable for you?
Comment 6 ytn01 2015-09-21 14:18:16 UTC
(In reply to Jaroslav Havlin from comment #5)
> > NetBeansProjects\abcd
> I guess that the intention was to create folder "abcd" under
> "NetBeansProjects".
> So automatic conversion of (back)slash characters, depending on current
> platform, would be preferable for you?

I think showing a warning label to user that the input entered is invalid would be just fine. (in a similar manner as the warning we see when entering a project with a name that is already taken by another project in same directory; this shows a small warning label in red that a directory or a project with such name already exists under the specified directory)
Comment 7 Jaroslav Havlin 2015-10-27 13:02:45 UTC
Created attachment 156999 [details]
Proposed Patch
Comment 8 Jaroslav Havlin 2015-10-27 13:05:08 UTC
Attached patch contains a fix for module Project UI API.
Comment 9 Tomas Stupka 2015-10-29 09:46:19 UTC
jarda thanks

patch seems ok, feel free to integrate
Comment 10 Jaroslav Havlin 2015-10-29 09:59:30 UTC
(In reply to Tomas Stupka from comment #9)
> patch seems ok, feel free to integrate
Thank you, Tomas.
Integrated as http://hg.netbeans.org/core-main/rev/2e99ceb955d9.

> I think showing a warning label to user that the input entered is
> invalid would be just fine.
Thank you for reporting, ytn01.
Comment 11 Quality Engineering 2015-10-30 02:22:10 UTC
Integrated into 'main-silver', will be available in build *201510300002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2e99ceb955d9
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #254320: IllegalArgumentException: NetBeansProjects\abcd