Fix for installation - now uses quotes instead of backslash-space, as backslash-space doesn't work in windows.

This commit is contained in:
Reinier Zwitserloot committed 2009-12-02 23:34:58 +01:00
1 parent 8ec48ec281
commit e3e8bb2e1d
1 file changed
+4 -5
@@ -83,9 +83,8 @@ public class NetbeansLocation extends IdeLocation {
}
private final String ID_CHARS = "(?:\\\\.|[^\"\\\\])*";
private final String ID_CHARS_NS = "(?:\\\\.|[^\"\\\\ ])*";
private final Pattern JAVA_AGENT_LINE_MATCHER = Pattern.compile(
"^\\s*netbeans_default_options\\s*=\\s*\"\\s*" + ID_CHARS + "(?<=[ \"])(-J-javaagent:" + ID_CHARS_NS + "lombok" + ID_CHARS_NS + "\\.jar)(?=[ \"])" + ID_CHARS +"\\s*\"\\s*(?:#.*)?$", Pattern.CASE_INSENSITIVE);
"^\\s*netbeans_default_options\\s*=\\s*\"\\s*" + ID_CHARS + "(?<=[ \"])(-J-javaagent:\\\\\"" + ID_CHARS + "lombok" + ID_CHARS + "\\.jar\\\\\")(?=[ \"])" + ID_CHARS +"\\s*\"\\s*(?:#.*)?$", Pattern.CASE_INSENSITIVE);
private final Pattern OPTIONS_LINE_MATCHER = Pattern.compile(
"^\\s*netbeans_default_options\\s*=\\s*\"\\s*" + ID_CHARS + "\\s*(\")\\s*(?:#.*)?$", Pattern.CASE_INSENSITIVE);
@@ -232,7 +231,7 @@ public class NetbeansLocation extends IdeLocation {
Matcher m = JAVA_AGENT_LINE_MATCHER.matcher(line);
if (m.matches()) {
newContents.append(line.substring(0, m.start(1)));
newContents.append("-J-javaagent:" + escapePath(canonical(lombokJar)));
newContents.append("-J-javaagent:\\\"" + canonical(lombokJar) + "\\\"");
newContents.append(line.substring(m.end(1)));
newContents.append(OS_NEWLINE);
continue;
@@ -241,7 +240,7 @@ public class NetbeansLocation extends IdeLocation {
m = OPTIONS_LINE_MATCHER.matcher(line);
if (m.matches()) {
newContents.append(line.substring(0, m.start(1)));
newContents.append(" ").append("-J-javaagent:" + escapePath(canonical(lombokJar)) +"\"");
newContents.append(" ").append("-J-javaagent:\\\"" + canonical(lombokJar) +"\\\"");
newContents.append(line.substring(m.end(1))).append(OS_NEWLINE);
continue;
}
@@ -272,7 +271,7 @@ public class NetbeansLocation extends IdeLocation {
}
return "If you start netbeans with custom parameters, you'll need to add:<br>" +
"<code>-J-javaagent:" + escapePath(canonical(lombokJar)) + "</code><br>" +
"<code>-J-javaagent:\\\"" + canonical(lombokJar) + "\\\"</code><br>" +
"as parameter as well.";
}