Created
July 15, 2015 21:02
-
-
Save cris-/945283dd40f1878521a0 to your computer and use it in GitHub Desktop.
com.ifedorenko.m2e.sourcelookup - issue #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/com.ifedorenko.m2e.sourcelookup/src/com/ifedorenko/m2e/sourcelookup/internal/SourceLookupActivator.java b/com.ifedorenko.m2e.sourcelookup/src/com/ifedorenko/m2e/sourcelookup/internal/SourceLookupActivator.java | |
index 0fcf8c0..07a3708 100644 | |
--- a/com.ifedorenko.m2e.sourcelookup/src/com/ifedorenko/m2e/sourcelookup/internal/SourceLookupActivator.java | |
+++ b/com.ifedorenko.m2e.sourcelookup/src/com/ifedorenko/m2e/sourcelookup/internal/SourceLookupActivator.java | |
@@ -12,6 +12,7 @@ package com.ifedorenko.m2e.sourcelookup.internal; | |
import java.io.File; | |
import java.io.IOException; | |
+import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.net.URL; | |
@@ -27,6 +28,8 @@ public class SourceLookupActivator | |
{ | |
public static final String PLUGIN_ID = "com.ifedorenko.m2e.sourcelookup"; | |
+ | |
+ private static final String DOUBLE_QUOTE = "\""; | |
private static SourceLookupActivator plugin; | |
@@ -92,7 +95,7 @@ public class SourceLookupActivator | |
public String getJavaagentString() | |
throws CoreException | |
{ | |
- return "-javaagent:" + getJavaagentLocation(); | |
+ return "-javaagent:" + DOUBLE_QUOTE + getJavaagentLocation() + DOUBLE_QUOTE; | |
} | |
public String getJavaagentLocation() | |
@@ -101,7 +104,9 @@ public class SourceLookupActivator | |
URL entry = getBundle().getEntry( "com.ifedorenko.m2e.sourcelookup.javaagent.jar" ); | |
try | |
{ | |
- return new File( FileLocator.toFileURL( entry ).toURI() ).getCanonicalPath(); | |
+ URL url = FileLocator.toFileURL( entry ); | |
+ URI uri = new URI(url.getProtocol(), url.getPath(), null); | |
+ return new File(uri).getCanonicalPath(); | |
} | |
catch ( IOException | URISyntaxException e ) | |
{ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment