From 964b82124dd92e91652925a450ab9208e41df601 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 2 Jun 2011 06:37:01 +0200 Subject: Eclipse handlers can now opt out of being run in diet-parse mode. Fixes Synchronized and SneakyThrows --- src/core/lombok/eclipse/EclipseASTVisitor.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/core/lombok/eclipse/EclipseASTVisitor.java') diff --git a/src/core/lombok/eclipse/EclipseASTVisitor.java b/src/core/lombok/eclipse/EclipseASTVisitor.java index 0c0e2d96..7f9faf43 100644 --- a/src/core/lombok/eclipse/EclipseASTVisitor.java +++ b/src/core/lombok/eclipse/EclipseASTVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright © 2009 Reinier Zwitserloot and Roel Spilker. + * Copyright © 2009-2011 Reinier Zwitserloot and Roel Spilker. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,6 +42,13 @@ import org.eclipse.jdt.internal.compiler.ast.TypeReference; * calling the appropriate visit and endVisit methods. */ public interface EclipseASTVisitor { + /** + * Return true if this handler should not be run in the diet parse phase. + * 'diet parse' is where method bodies aren't filled in yet. If you have a method-level annotation that modifies the contents of that method, + * return {@code true} here. Otherwise, return {@code false} here. + */ + boolean deferUntilPostDiet(); + /** * Called at the very beginning and end. */ @@ -112,6 +119,10 @@ public interface EclipseASTVisitor { private int indent = 0; private boolean printClassNames = false; + public boolean deferUntilPostDiet() { + return false; + } + /** * @param printContent if true, bodies are printed directly, as java code, * instead of a tree listing of every AST node inside it. -- cgit