diff options
-rw-r--r-- | build.xml | 5 | ||||
-rw-r--r-- | doc/changelog.markdown | 6 | ||||
-rw-r--r-- | src/core/lombok/bytecode/FixedClassWriter.java | 44 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/JavacHandlerUtil.java | 17 |
4 files changed, 18 insertions, 54 deletions
@@ -397,10 +397,7 @@ the common tasks and can be called on to run the main aspects of all the sub-scr </ant> </target> - <target name="maven" depends="version, dist, test" description="Build a maven artifact bundle."> - <ant antfile="buildScripts/website.ant.xml" target="javadoc" inheritAll="false"> - <property name="lombok.version" value="${lombok.version}" /> - </ant> + <target name="maven" depends="version, dist, test, javadoc" description="Build a maven artifact bundle."> <jar destfile="dist/lombok-${lombok.version}-javadoc.jar"> <fileset dir="doc/api" /> </jar> diff --git a/doc/changelog.markdown b/doc/changelog.markdown index d1743147..f06cd563 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -3,12 +3,14 @@ Lombok Changelog ### v0.10.9 (edge) * FEATURE: The combination of `@Delegate` and `@Getter` or `@Data` will now delegate to the result of a generated getter. [Issue #328](http://code.google.com/p/projectlombok/issues/detail?id=328) -* BUGFIX: When `@Delegate` would generate a method with type parameters of the type `T extends package.Class`, a dot would be prepended to the type name. [Issue #341](http://code.google.com/p/projectlombok/issues/detail?id=341) +* BUGFIX: In NetBeans the generated default constructor would still be generated even if Lombok also generated constructors. [Issue #326](http://code.google.com/p/projectlombok/issues/detail?id=326) +* BUGFIX: Some classes that contain @SneakyThrows would not compile (throw ClassFormatError). [Issue 339](http://code.google.com/p/projectlombok/issues/detail?id=339) +* BUGFIX: delombok: When `@Delegate` would generate a method with type parameters of the type `T extends package.Class`, a dot would be prepended to the type name. [Issue #341](http://code.google.com/p/projectlombok/issues/detail?id=341) * BUGFIX: @Getter and @Setter now generate deprecated methods for deprecated fields. Fixes [Issue #342](http://code.google.com/p/projectlombok/issues/detail?id=342) +* BUGFIX: @Delegate would not generate @Deprecated on methods marked deprecated in javadoc. Fixes [Issue #348](http://code.google.com/p/projectlombok/issues/detail?id=348) * BUGFIX: Using `val` with a type like `Outer<TypeArgs>.Inner` now works. [Issue #343](http://code.google.com/p/projectlombok/issues/detail?id=343) * BUGFIX: `@Getter(lazy=true)` where the variable type is a primitive and the initializing expression is of a different primitive type that would type coerce implicitly, i.e. ints can be assigned to longs without a cast, didn't work before. [Issue #345](http://code.google.com/p/projectlombok/issues/detail?id=345) * BUGFIX: `val` is no longer legal inside basic for loops (the old kind, not the foreach kind). These variables should rarely be final, and in practice it wasn't possible to delombok this code properly. [Issue #346](http://code.google.com/p/projectlombok/issues/detail?id=346) -* BUGFIX: @Delegate would not generate @Deprecated on methods marked deprecated in javadoc [Issue #348](http://code.google.com/p/projectlombok/issues/detail?id=348) * BUGFIX: PrettyCommentsPrinter now prints default clause of annotation methods. Fixes [Issue #350](http://code.google.com/p/projectlombok/issues/detail?id=350) ### v0.10.8 (January 19th, 2012) diff --git a/src/core/lombok/bytecode/FixedClassWriter.java b/src/core/lombok/bytecode/FixedClassWriter.java index 528bc79d..f18dc3a4 100644 --- a/src/core/lombok/bytecode/FixedClassWriter.java +++ b/src/core/lombok/bytecode/FixedClassWriter.java @@ -21,9 +21,6 @@ */ package lombok.bytecode; -import java.io.InputStream; -import java.util.Arrays; - import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; @@ -37,45 +34,10 @@ class FixedClassWriter extends ClassWriter { //environment with custom classloaders, such as Equinox. It's just an optimization; returning Object is always legal. try { return super.getCommonSuperClass(type1, type2); - } catch (Exception e) { + } catch (OutOfMemoryError e) { + throw e; + } catch (Throwable t) { return "java/lang/Object"; - } catch (ClassFormatError e) { - ClassLoader cl = this.getClass().getClassLoader(); - if (cl == null) cl = ClassLoader.getSystemClassLoader(); - String message = debugCheckClassFormatErrorIssue(cl, type1) + - debugCheckClassFormatErrorIssue(cl, type2); - throw new ClassFormatError(message); - } - } - - - // This is debug-aiding code in an attempt to find the cause of issue: - // http://code.google.com/p/projectlombok/issues/detail?id=339 - private static String debugCheckClassFormatErrorIssue(ClassLoader cl, String type) { - try { - Class.forName(type.replace('/', '.'), false, cl); - return String.format("Class.forName debug on %s: no issues\n", type); - } catch (ClassFormatError e) { - // expected - } catch (Throwable e) { - return String.format("Class.forName debug on %s: Exception: %s\n", type, e); - } - - try { - InputStream in = cl.getResourceAsStream(type + ".class"); - if (in == null) return String.format("Class.forName debug on %s: Can't find resource %s\n", type, type + ".class"); - try { - int[] firstBytes = new int[4]; - for (int i = 0; i < 4; i++) firstBytes[0] = in.read(); - if (firstBytes[0] == -1) return String.format("Class.forName debug on %s: file size is 0\n", type); - if (firstBytes[3] == -1) return String.format("Class.forName debug on %s: Less than 4 bytes in class file\n", type); - if (!Arrays.equals(new int[] {0xCA, 0xFE, 0xBA, 0xBE}, firstBytes)) return String.format("Class.forName debug on %s: no CAFEBABE: %s\n", type, Arrays.toString(firstBytes)); - return String.format("Class.forName debug on %s: No immediately obvious reason for failure found\n", type); - } finally { - in.close(); - } - } catch (Throwable e) { - return String.format("Class.forName debug on %s: Can't read as stream: %s\n", type, e); } } }
\ No newline at end of file diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java index 8803ca3d..fc7666ec 100644 --- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java +++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java @@ -36,11 +36,11 @@ import java.util.regex.Pattern; import lombok.AccessLevel; import lombok.Data; import lombok.Getter; +import lombok.core.AST.Kind; import lombok.core.AnnotationValues; +import lombok.core.AnnotationValues.AnnotationValue; import lombok.core.TransformationsUtil; import lombok.core.TypeResolver; -import lombok.core.AST.Kind; -import lombok.core.AnnotationValues.AnnotationValue; import lombok.experimental.Accessors; import lombok.javac.Javac; import lombok.javac.JavacNode; @@ -48,10 +48,6 @@ import lombok.javac.JavacNode; import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.code.TypeTags; import com.sun.tools.javac.tree.JCTree; -import com.sun.tools.javac.tree.TreeScanner; -import com.sun.tools.javac.tree.JCTree.JCLiteral; -import com.sun.tools.javac.tree.JCTree.JCModifiers; -import com.sun.tools.javac.tree.TreeMaker; import com.sun.tools.javac.tree.JCTree.JCAnnotation; import com.sun.tools.javac.tree.JCTree.JCAssign; import com.sun.tools.javac.tree.JCTree.JCClassDecl; @@ -59,15 +55,19 @@ import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; import com.sun.tools.javac.tree.JCTree.JCExpression; import com.sun.tools.javac.tree.JCTree.JCIdent; import com.sun.tools.javac.tree.JCTree.JCImport; +import com.sun.tools.javac.tree.JCTree.JCLiteral; import com.sun.tools.javac.tree.JCTree.JCMethodDecl; import com.sun.tools.javac.tree.JCTree.JCMethodInvocation; +import com.sun.tools.javac.tree.JCTree.JCModifiers; import com.sun.tools.javac.tree.JCTree.JCNewArray; import com.sun.tools.javac.tree.JCTree.JCStatement; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; +import com.sun.tools.javac.tree.TreeMaker; +import com.sun.tools.javac.tree.TreeScanner; +import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; import com.sun.tools.javac.util.Name; -import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; /** * Container for static utility methods useful to handlers written for javac. @@ -701,6 +701,9 @@ public class JavacHandlerUtil { JavacNode tossMe = typeNode.getNodeFor(def); if (tossMe != null) tossMe.up().removeChild(tossMe); type.defs = addAllButOne(type.defs, idx); + if (type.sym != null && type.sym.members_field != null) { + type.sym.members_field.remove(((JCMethodDecl)def).sym); + } break; } } |