diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-03-04 23:19:28 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-03-04 23:19:28 +0100 |
commit | 8eeafcc6444097bcf07bb0bb279511bfec9167af (patch) | |
tree | 0c7001fd2b75671f8a14c8f84f31e53cf7a13231 | |
parent | f956ba1e337699206052a016da65f4f02ac6825b (diff) | |
parent | 6c1993659cd53f601520209771d116cb94e9b825 (diff) | |
download | lombok-8eeafcc6444097bcf07bb0bb279511bfec9167af.tar.gz lombok-8eeafcc6444097bcf07bb0bb279511bfec9167af.tar.bz2 lombok-8eeafcc6444097bcf07bb0bb279511bfec9167af.zip |
Merge branch 'master' into configuration
-rw-r--r-- | doc/changelog.markdown | 2 | ||||
-rw-r--r-- | src/core/lombok/javac/apt/Processor.java | 83 |
2 files changed, 42 insertions, 43 deletions
diff --git a/doc/changelog.markdown b/doc/changelog.markdown index 472aa0f5..65958ba5 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -6,11 +6,13 @@ Lombok Changelog * PLATFORM: Added support for Eclipse Luna. [Issue #609](https://code.google.com/p/projectlombok/issues/detail?id=609) * PLATFORM: Initial JDK8 support for eclipse's alpha support in kepler. [Issue #597](https://code.google.com/p/projectlombok/issues/detail?id=597) * FEATURE: The various `@Log` annotations now support the `topic` parameter, which sets the logger's name. The default remains the fully qualified type name of the class itself. [Issue #632](https://code.google.com/p/projectlombok/issues/detail?id=632). +* BUGFIX: Using lombok with IntelliJ and the IBM JDK would result in NPEs during initialization. [Issue #648](https://code.google.com/p/projectlombok/issues/detail?id=648), [IntelliJ plugin issue #74](https://code.google.com/p/lombok-intellij-plugin/issues/detail?id=74). * BUGFIX: Eclipse quickfix _Surround with try/catch block_ didn't work inside `@SneakyThrows` annotated methods [Issue #438](https://code.google.com/p/projectlombok/issues/detail?id=438). * BUGFIX: Eclipse refactoring _Extract Local Variable_ didn't work inside `@SneakyThrows` annotated methods [Issue #633](https://code.google.com/p/projectlombok/issues/detail?id=633). * BUGFIX: {Netbeans} @SneakyThrows would lead to unused import and break refactorings [Issue #471](https://code.google.com/p/projectlombok/issues/detail?id=471). * BUGFIX: Eclipse Organize Imports would generate error: AST must not be null [Issue #631](https://code.google.com/p/projectlombok/issues/detail?id=631). * BUGFIX: Copying javadoc to getters / setters / withers would copy non-relevant sections too. [Issue #585](https://code.google.com/p/projectlombok/issues/detail?id=585). +* ENHANCEMENT: Lombok used to ship with [JNA](http://en.wikipedia.org/wiki/Java_Native_Access). It added over 800k to the size of lombok.jar and could mess with usage of JNA in your local environment, especially in eclipse. [Issue #647](https://code.google.com/p/projectlombok/issues/detail?id=647) * DETAIL: {Delombok} Inside enum bodies the delombok formatter didn't respect the emptyLines directive [Issue #629](https://code.google.com/p/projectlombok/issues/detail?id=629). * DETAIL: Use smaller primes (<127) for generating hashcodes [Issue #625](https://code.google.com/p/projectlombok/issues/detail?id=625) 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. |