aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/lombok/core')
-rw-r--r--src/lombok/core/AST.java3
-rw-r--r--src/lombok/core/AnnotationValues.java21
-rw-r--r--src/lombok/core/LombokNode.java8
-rw-r--r--src/lombok/core/SpiLoadUtil.java2
4 files changed, 17 insertions, 17 deletions
diff --git a/src/lombok/core/AST.java b/src/lombok/core/AST.java
index 31b8f0fd..b1b5f3be 100644
--- a/src/lombok/core/AST.java
+++ b/src/lombok/core/AST.java
@@ -210,9 +210,8 @@ public abstract class AST<A extends AST<A, L, N>, L extends LombokNode<A, L, N>,
if (type instanceof ParameterizedType) {
Type component = ((ParameterizedType)type).getActualTypeArguments()[0];
return component instanceof Class<?> ? (Class<?>)component : Object.class;
- } else {
- return Object.class;
}
+ return Object.class;
}
/**
diff --git a/src/lombok/core/AnnotationValues.java b/src/lombok/core/AnnotationValues.java
index 8912ccd8..0408de85 100644
--- a/src/lombok/core/AnnotationValues.java
+++ b/src/lombok/core/AnnotationValues.java
@@ -202,18 +202,19 @@ public class AnnotationValues<A extends Annotation> {
Object defaultValue = method.getDefaultValue();
if (defaultValue == null) throw makeNoDefaultFail(v, method);
return defaultValue;
- } else return result;
- } else {
- if (result == null) {
- if (v.valueGuesses.size() == 1) {
- Object defaultValue = method.getDefaultValue();
- if (defaultValue == null) throw makeNoDefaultFail(v, method);
- return defaultValue;
- } else throw new AnnotationValueDecodeFail(v,
- "I can't make sense of this annotation value. Try using a fully qualified literal.", idx);
}
- Array.set(array, idx++, result);
+ return result;
+ }
+ if (result == null) {
+ if (v.valueGuesses.size() == 1) {
+ Object defaultValue = method.getDefaultValue();
+ if (defaultValue == null) throw makeNoDefaultFail(v, method);
+ return defaultValue;
+ }
+ throw new AnnotationValueDecodeFail(v,
+ "I can't make sense of this annotation value. Try using a fully qualified literal.", idx);
}
+ Array.set(array, idx++, result);
}
return array;
diff --git a/src/lombok/core/LombokNode.java b/src/lombok/core/LombokNode.java
index e4712313..c8ee4c00 100644
--- a/src/lombok/core/LombokNode.java
+++ b/src/lombok/core/LombokNode.java
@@ -125,8 +125,8 @@ public abstract class LombokNode<A extends AST<A, L, N>, L extends LombokNode<A,
* Also affects the underlying (Eclipse/javac) AST.
*/
@SuppressWarnings("unchecked")
- public L replaceWith(N newN, Kind kind) {
- L newNode = ast.buildTree(newN, kind);
+ public L replaceWith(N newN, Kind newNodeKind) {
+ L newNode = ast.buildTree(newN, newNodeKind);
newNode.parent = parent;
for (int i = 0; i < parent.children.size(); i++) {
if (parent.children.get(i) == this) ((List)parent.children).set(i, newNode);
@@ -227,8 +227,8 @@ public abstract class LombokNode<A extends AST<A, L, N>, L extends LombokNode<A,
* Does not change the underlying (javac/Eclipse) AST, only the wrapped view.
*/
@SuppressWarnings("unchecked")
- public L add(N newChild, Kind kind) {
- L n = ast.buildTree(newChild, kind);
+ public L add(N newChild, Kind newChildKind) {
+ L n = ast.buildTree(newChild, newChildKind);
if (n == null) return null;
n.parent = (L) this;
((List)children).add(n);
diff --git a/src/lombok/core/SpiLoadUtil.java b/src/lombok/core/SpiLoadUtil.java
index 3031576a..0a97af7e 100644
--- a/src/lombok/core/SpiLoadUtil.java
+++ b/src/lombok/core/SpiLoadUtil.java
@@ -123,7 +123,7 @@ public class SpiLoadUtil {
}
} finally {
try {
- in.close();
+ if (in != null) in.close();
} catch (Throwable ignore) {}
}
}