diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/installer/lombok/installer/netbeans/NetbeansLocation.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/installer/lombok/installer/netbeans/NetbeansLocation.java b/src/installer/lombok/installer/netbeans/NetbeansLocation.java index 51acef3d..45aac274 100644 --- a/src/installer/lombok/installer/netbeans/NetbeansLocation.java +++ b/src/installer/lombok/installer/netbeans/NetbeansLocation.java @@ -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."; } |