From 255bd5907176cb5d2c4fb1cf6a9b48b14af0b4ba Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 20 Jun 2009 23:46:17 +0200 Subject: Due to a java bug, constants in enums don't work, so instead the default access level for @Getter and @Setter have now just been hardcoded in GetterHandler and SetterHandler. Added ability to look up the Node object for any given AST object on Node itself, as you don't usually have the AST object. Added toString() method generating to @Data, and this required some fancy footwork in finding if we've already generated methods, and editing a generated method to fill in binding and type resolutions. HandleGetter and HandleSetter have been updated to use these features. Exceptions caused by lombok handlers show up in the eclipse error log, but now, if they are related to a CompilationUnit, also as a problem (error) on the CUD - those error log entries are easy to miss! Our ASTs can now be appended to. When you generate a new AST node, you should add it to the AST, obviously. Getter/Setter have been updated to use this. --- src/lombok/eclipse/TransformEclipseAST.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/lombok/eclipse/TransformEclipseAST.java') diff --git a/src/lombok/eclipse/TransformEclipseAST.java b/src/lombok/eclipse/TransformEclipseAST.java index b56c594a..ccb29a8c 100644 --- a/src/lombok/eclipse/TransformEclipseAST.java +++ b/src/lombok/eclipse/TransformEclipseAST.java @@ -41,7 +41,7 @@ public class TransformEclipseAST { l = HandlerLibrary.load(); f = CompilationUnitDeclaration.class.getDeclaredField("$lombokAST"); } catch ( Throwable t ) { - Eclipse.error("Problem initializing lombok", t); + Eclipse.error(null, "Problem initializing lombok", t); disableLombok = true; } astCacheField = f; @@ -70,17 +70,12 @@ public class TransformEclipseAST { new TransformEclipseAST(existing).go(); } catch ( Throwable t ) { try { - String fileName = "(unknown)"; - if ( ast.compilationResult != null && ast.compilationResult.fileName != null ) { - fileName = new String(ast.compilationResult.fileName); - } - String message = "Lombok can't parse this source: " + t.toString(); - EclipseAST.addProblemToCompilationResult(fileName, ast, false, message, ast, 0, 0); + EclipseAST.addProblemToCompilationResult(ast, false, message, 0, 0); t.printStackTrace(); } catch ( Throwable t2 ) { - Eclipse.error("Can't create an error in the problems dialog while adding: " + t.toString(), t2); + Eclipse.error(ast, "Can't create an error in the problems dialog while adding: " + t.toString(), t2); } } } -- cgit