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 232470 - Java projects in folders with quotes in name breaks Clean & Build
Summary: Java projects in folders with quotes in name breaks Clean & Build
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-09 22:40 UTC by cinderblock
Modified: 2013-07-12 02:30 UTC (History)
0 users

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 cinderblock 2013-07-09 22:40:16 UTC
If a Java project is stored in a folder which has a single quote (') as part of the folder's name (or any parent folder) and you try to "export" it with "Build & Clean", the path is not escaped and the build script throws an exception:

deps-jar:
Created dir: C:\Users\user\Desktop\Cam's Gitted\JavaApplication2\build
Updating property file: C:\Users\user\Desktop\Cam's Gitted\JavaApplication2\build\built-jar.properties
Created dir: C:\Users\user\Desktop\Cam's Gitted\JavaApplication2\build\classes
Created dir: C:\Users\user\Desktop\Cam's Gitted\JavaApplication2\build\empty
Created dir: C:\Users\user\Desktop\Cam's Gitted\JavaApplication2\build\generated-sources\ap-source-output
C:\Users\user\Desktop\Cam's Gitted\JavaApplication2\nbproject\build-impl.xml:926: The following error occurred while executing this line:
C:\Users\user\Desktop\Cam's Gitted\JavaApplication2\nbproject\build-impl.xml:268: unbalanced quotes in -Xbootclasspath/p:'C:\Users\user\Desktop\Cam's Gitted\JavaApplication2\${endorsed.classpath}'
BUILD FAILED (total time: 0 seconds)

Steps to reproduce:
1. Create a folder named "foo'bar" somewhere
2. In Netbeans, create a new Java project, stored in that "foo'bar" folder
3. Click "Clean & Build"

I suspect this will happen with any type of Java project, but I've only tried with an application. Also of note, this is on Windows, but any filesystem that supports quote characters in file names should have this problem.
Comment 1 Tomas Zezula 2013-07-10 08:59:51 UTC
The problem is that the single quote is a unescaped parameter delimiter.
The project path cannot contain such a name, only project display name can.
The New Project Wizard should remove the quote chars ' " from project folder name.
Comment 2 cinderblock 2013-07-10 09:04:29 UTC
I disagree.

What if the user only has write permissions to a folder with such a name?

This would also still happen if the project was created outside a folder with a "'", manually moved into one, opened in NB, and then built.
Comment 3 Tomas Zezula 2013-07-10 11:09:17 UTC
In this case it's a WONTFIX as Ant does not support it.
Comment 4 Tomas Zezula 2013-07-10 12:00:12 UTC
Fixed jet-main 3bd36e08aac5.
Partially fixed the basic project works fine due to Ant restrictions more complicated projects which are using -Xbootclasspath will not work. as the -Xbootclasspath: requires ' quoting.

For web project the issue #232507 created.
Comment 5 Quality Engineering 2013-07-12 02:30:04 UTC
Integrated into 'main-silver', will be available in build *201307112300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3bd36e08aac5
User: Tomas Zezula <tzezula@netbeans.org>
Log: #232470:Java projects in folders with quotes in name breaks Clean & Build