diff --git a/src/launch/lombok/launch/ShadowClassLoader.java b/src/launch/lombok/launch/ShadowClassLoader.java
index 72f006e8..36dd289c 100644
--- a/src/launch/lombok/launch/ShadowClassLoader.java
+++ b/src/launch/lombok/launch/ShadowClassLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2015 The Project Lombok Authors.
+ * Copyright (C) 2014-2018 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,9 +21,13 @@
*/
package lombok.launch;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URI;
@@ -36,14 +40,16 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import java.util.Vector;
import java.util.WeakHashMap;
-import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
/**
* The shadow classloader serves to completely hide almost all classes in a given jar file by using a different file ending.
@@ -66,6 +72,7 @@ import java.util.jar.JarFile;
*
* If no overrides are present, the load order is as follows:
*
First, if the resource is found in our own jar (trying ".SCL.sclSuffix" first for any resource request ending in ".class"), return that.
+ *
Next, check any jar files other than our own, loading them via this classloader, if they have a file META-INF/ShadowClassLoader that contains a line of text with sclSuffix.
*
Next, ask the parent loader.
*
*
@@ -110,9 +117,7 @@ class ShadowClassLoader extends ClassLoader {
if (!pe.endsWith("/")) pe = pe + "/";
this.parentExclusion.add(pe);
}
- if (highlanders != null) for (String hl : highlanders) {
- this.highlanders.add(hl);
- }
+ if (highlanders != null) for (String hl : highlanders) this.highlanders.add(hl);
if (selfBase != null) {
SELF_BASE = selfBase;
@@ -125,12 +130,7 @@ class ShadowClassLoader extends ClassLoader {
throw new RuntimeException("ShadowLoader can't find itself. SCL loader type: " + (cl == null ? "*NULL*" : cl.getClass().toString()));
}
SELF_BASE_LENGTH = sclClassStr.length() - SELF_NAME.length();
- String decoded;
- try {
- decoded = URLDecoder.decode(sclClassStr.substring(0, SELF_BASE_LENGTH), "UTF-8");
- } catch (UnsupportedEncodingException e) {
- throw new InternalError("UTF-8 not available");
- }
+ String decoded = urlDecode(sclClassStr.substring(0, SELF_BASE_LENGTH));
SELF_BASE = decoded;
}
@@ -148,11 +148,11 @@ class ShadowClassLoader extends ClassLoader {
}
}
}
-
+
private final Map mapJarPathToTracker = new HashMap();
private static final Map