aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2009-12-02 01:51:50 +0100
committerRoel Spilker <r.spilker@gmail.com>2009-12-02 01:51:50 +0100
commit1f4fb2fb4885ad9c808a080fbbf63353042e08d1 (patch)
tree072d3f70ebec84435cd507886591e4b2cf38cf35 /src/core/lombok/javac
parentd2fc0df773912f8116bdcea88f4ded6343a13040 (diff)
downloadlombok-1f4fb2fb4885ad9c808a080fbbf63353042e08d1.tar.gz
lombok-1f4fb2fb4885ad9c808a080fbbf63353042e08d1.tar.bz2
lombok-1f4fb2fb4885ad9c808a080fbbf63353042e08d1.zip
Fixed #73 SneakyThrows without parameter did not default to Throwable.class
Added tests for SneakyThrows
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r--src/core/lombok/javac/handlers/HandleSneakyThrows.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/HandleSneakyThrows.java b/src/core/lombok/javac/handlers/HandleSneakyThrows.java
index 8a185e87..fda8805c 100644
--- a/src/core/lombok/javac/handlers/HandleSneakyThrows.java
+++ b/src/core/lombok/javac/handlers/HandleSneakyThrows.java
@@ -26,6 +26,7 @@ import static lombok.javac.handlers.JavacHandlerUtil.markAnnotationAsProcessed;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import lombok.SneakyThrows;
import lombok.core.AnnotationValues;
@@ -52,9 +53,9 @@ public class HandleSneakyThrows implements JavacAnnotationHandler<SneakyThrows>
@Override public boolean handle(AnnotationValues<SneakyThrows> annotation, JCAnnotation ast, JavacNode annotationNode) {
markAnnotationAsProcessed(annotationNode, SneakyThrows.class);
Collection<String> exceptionNames = annotation.getRawExpressions("value");
-
- List<JCExpression> memberValuePairs = ast.getArguments();
- if (memberValuePairs == null || memberValuePairs.size() == 0) return false;
+ if (exceptionNames.isEmpty()) {
+ exceptionNames = Collections.singleton("java.lang.Throwable");
+ }
java.util.List<String> exceptions = new ArrayList<String>();
for (String exception : exceptionNames) {