aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/Singular.java2
-rw-r--r--src/eclipseAgent/lombok/launch/PatchFixesHider.java15
2 files changed, 15 insertions, 2 deletions
diff --git a/src/core/lombok/Singular.java b/src/core/lombok/Singular.java
index 7f22b008..15dec4a5 100644
--- a/src/core/lombok/Singular.java
+++ b/src/core/lombok/Singular.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2014 The Project Lombok Authors.
+ * Copyright (C) 2015 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
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);
}