mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 18:15:55 +00:00
[i777] shadowloader’s ‘find myself’ feature didn’t work if spaces were in the path due to lack of decoding a URL.
This commit is contained in:
1 parent
d8da2b9438
commit
2856702d77
2 files changed
+10
-1
No files matched your search
@@ -6,6 +6,7 @@ Lombok Changelog
|
||||
* FEATURE: New lombok annotation: `@UtilityClass`, for making utility classes (not instantiable, contains only static 'function' methods). See the [feature documentation](http://projectlombok.org/features/experimental/UtilityClass.html) for more information.
|
||||
* BUGFIX: The ant `delombok` task was broken starting with v1.16.0. Note that the task def class has been changed; taskdef `lombok.delombok.ant.Tasks$Delombok` instead of the old `lombok.delombok.ant.DelombokTask`. [Issue #775](https://code.google.com/p/projectlombok/issues/detail?id=775).
|
||||
* BUGFIX: `val` in javac would occasionally fail if used inside inner classes. This is (probably) fixed. [Issue #694](https://code.google.com/p/projectlombok/issues/detail?id=694).
|
||||
* BUGFIX: Starting with v1.16.0, lombok would fail to execute as an executable jar if it was in a path was spaced in it. [Issue #777](https://code.google.com/p/projectlombok/issues/detail?id=777).
|
||||
|
||||
### v1.16.0 "Candid Duck" (January 26th, 2015)
|
||||
* BUGFIX: `@ExtensionMethod` was broken in Eclipse using java 8. [Issue #742](https://code.google.com/p/projectlombok/issues/detail?id=742), [Issue #747](https://code.google.com/p/projectlombok/issues/detail?id=747)
|
||||
|
||||
@@ -24,9 +24,11 @@ package lombok.launch;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
@@ -114,7 +116,13 @@ class ShadowClassLoader extends ClassLoader {
|
||||
String sclClassUrl = ShadowClassLoader.class.getResource("ShadowClassLoader.class").toString();
|
||||
if (!sclClassUrl.endsWith(SELF_NAME)) throw new InternalError("ShadowLoader can't find itself.");
|
||||
SELF_BASE_LENGTH = sclClassUrl.length() - SELF_NAME.length();
|
||||
SELF_BASE = sclClassUrl.substring(0, SELF_BASE_LENGTH);
|
||||
String decoded;
|
||||
try {
|
||||
decoded = URLDecoder.decode(sclClassUrl.substring(0, SELF_BASE_LENGTH), "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new InternalError("UTF-8 not available");
|
||||
}
|
||||
SELF_BASE = decoded;
|
||||
}
|
||||
|
||||
if (SELF_BASE.startsWith("jar:file:") && SELF_BASE.endsWith("!/")) SELF_BASE_FILE = new File(SELF_BASE.substring(9, SELF_BASE.length() - 2));
|
||||
|
||||
Reference in new issue
Block a user