aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2014-03-04 23:19:28 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2014-03-04 23:19:28 +0100
commit8eeafcc6444097bcf07bb0bb279511bfec9167af (patch)
tree0c7001fd2b75671f8a14c8f84f31e53cf7a13231 /src
parentf956ba1e337699206052a016da65f4f02ac6825b (diff)
parent6c1993659cd53f601520209771d116cb94e9b825 (diff)
downloadlombok-8eeafcc6444097bcf07bb0bb279511bfec9167af.tar.gz
lombok-8eeafcc6444097bcf07bb0bb279511bfec9167af.tar.bz2
lombok-8eeafcc6444097bcf07bb0bb279511bfec9167af.zip
Merge branch 'master' into configuration
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/javac/apt/Processor.java83
1 files changed, 40 insertions, 43 deletions
diff --git a/src/core/lombok/javac/apt/Processor.java b/src/core/lombok/javac/apt/Processor.java
index 5f28aa88..3d234541 100644
--- a/src/core/lombok/javac/apt/Processor.java
+++ b/src/core/lombok/javac/apt/Processor.java
@@ -161,48 +161,45 @@ public class Processor extends AbstractProcessor {
}
}
- private static class WrappingClassLoader extends ClassLoader {
- private final ClassLoader parent;
-
- public WrappingClassLoader(ClassLoader parent) {
- this.parent = parent;
- }
-
- public Class<?> loadClass(String name) throws ClassNotFoundException {
- return parent.loadClass(name);
- }
-
- public String toString() {
- return parent.toString();
- }
-
- public URL getResource(String name) {
- return parent.getResource(name);
- }
-
- public Enumeration<URL> getResources(String name) throws IOException {
- return parent.getResources(name);
- }
-
- public InputStream getResourceAsStream(String name) {
- return parent.getResourceAsStream(name);
- }
-
- public void setDefaultAssertionStatus(boolean enabled) {
- parent.setDefaultAssertionStatus(enabled);
- }
-
- public void setPackageAssertionStatus(String packageName, boolean enabled) {
- parent.setPackageAssertionStatus(packageName, enabled);
- }
-
- public void setClassAssertionStatus(String className, boolean enabled) {
- parent.setClassAssertionStatus(className, enabled);
- }
-
- public void clearAssertionStatus() {
- parent.clearAssertionStatus();
- }
+ private static ClassLoader wrapClassLoader(final ClassLoader parent) {
+ return new ClassLoader() {
+
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
+ return parent.loadClass(name);
+ }
+
+ public String toString() {
+ return parent.toString();
+ }
+
+ public URL getResource(String name) {
+ return parent.getResource(name);
+ }
+
+ public Enumeration<URL> getResources(String name) throws IOException {
+ return parent.getResources(name);
+ }
+
+ public InputStream getResourceAsStream(String name) {
+ return parent.getResourceAsStream(name);
+ }
+
+ public void setDefaultAssertionStatus(boolean enabled) {
+ parent.setDefaultAssertionStatus(enabled);
+ }
+
+ public void setPackageAssertionStatus(String packageName, boolean enabled) {
+ parent.setPackageAssertionStatus(packageName, enabled);
+ }
+
+ public void setClassAssertionStatus(String className, boolean enabled) {
+ parent.setClassAssertionStatus(className, enabled);
+ }
+
+ public void clearAssertionStatus() {
+ parent.clearAssertionStatus();
+ }
+ };
}
private void stopJavacProcessingEnvironmentFromClosingOurClassloader() {
@@ -211,7 +208,7 @@ public class Processor extends AbstractProcessor {
f.setAccessible(true);
ClassLoader unwrapped = (ClassLoader) f.get(processingEnv);
if (unwrapped == null) return;
- ClassLoader wrapped = new WrappingClassLoader(unwrapped);
+ ClassLoader wrapped = wrapClassLoader(unwrapped);
f.set(processingEnv, wrapped);
} catch (NoSuchFieldException e) {
// Some versions of javac have this (and call close on it), some don't. I guess this one doesn't have it.