From 383586c70561ff30e6d0211d1bea23a99c800791 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 1 Aug 2009 16:22:37 +0200 Subject: There was a bug in the annotation builder for javac, which would trigger exceptions anytime you used a lombok annotation in implicit-value-parameter form (e.g: @Cleanup("release") instead of @Cleanup or @Cleanup(value="release"). Fixes issue #14 --- src/lombok/javac/HandlerLibrary.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lombok/javac/HandlerLibrary.java') diff --git a/src/lombok/javac/HandlerLibrary.java b/src/lombok/javac/HandlerLibrary.java index 7253cbaa..ff21bd3f 100644 --- a/src/lombok/javac/HandlerLibrary.java +++ b/src/lombok/javac/HandlerLibrary.java @@ -146,6 +146,7 @@ public class HandlerLibrary { /** Generates an error in the Messager that was used to initialize this HandlerLibrary. */ public void javacError(String message, Throwable t) { messager.printMessage(Diagnostic.Kind.ERROR, message + (t == null ? "" : (": " + t))); + if ( t != null ) t.printStackTrace(); } /** @@ -180,7 +181,9 @@ public class HandlerLibrary { } catch ( AnnotationValueDecodeFail fail ) { fail.owner.setError(fail.getMessage(), fail.idx); } catch ( Throwable t ) { - javacError(String.format("Lombok annotation handler %s failed", container.handler.getClass()), t); + String sourceName = "(unknown).java"; + if ( unit != null && unit.sourcefile != null ) sourceName = unit.sourcefile.getName(); + javacError(String.format("Lombok annotation handler %s failed on " + sourceName, container.handler.getClass()), t); } } -- cgit