aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-01-21 01:10:50 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-01-21 01:10:50 +0100
commitef60d1af001204622b428e78894c967a9aee7e91 (patch)
treeba5767291b6fa7f4ea2e17d6a8e14d1c1e8dc74a /src/eclipseAgent/lombok
parentf153f1cda304d56f9b20cd5e39adf83e74067045 (diff)
downloadlombok-ef60d1af001204622b428e78894c967a9aee7e91.tar.gz
lombok-ef60d1af001204622b428e78894c967a9aee7e91.tar.bz2
lombok-ef60d1af001204622b428e78894c967a9aee7e91.zip
* Fixed running ecj tests within eclipse
Diffstat (limited to 'src/eclipseAgent/lombok')
-rw-r--r--src/eclipseAgent/lombok/launch/PatchFixesHider.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/eclipseAgent/lombok/launch/PatchFixesHider.java b/src/eclipseAgent/lombok/launch/PatchFixesHider.java
index 23774d0f..2472ca3c 100644
--- a/src/eclipseAgent/lombok/launch/PatchFixesHider.java
+++ b/src/eclipseAgent/lombok/launch/PatchFixesHider.java
@@ -74,9 +74,22 @@ final class PatchFixesHider {
/** These utility methods are only used 'internally', but because of transplant methods, the class (and its methods) still have to be public! */
public static final class Util {
+ private static ClassLoader shadowLoader;
+
public static Class<?> shadowLoadClass(String name) {
try {
- return Class.forName(name, true, Main.createShadowClassLoader());
+ if (shadowLoader == null) {
+ try {
+ Class.forName("lombok.core.LombokNode");
+ // If we get here, then lombok is already available.
+ shadowLoader = Util.class.getClassLoader();
+ } catch (ClassNotFoundException e) {
+ // If we get here, it isn't, and we should use the shadowloader.
+ shadowLoader = Main.createShadowClassLoader();
+ }
+ }
+
+ return Class.forName(name, true, shadowLoader);
} catch (ClassNotFoundException e) {
throw sneakyThrow(e);
}