summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2019-01-07 22:22:41 -0800
committerGeorge Fraser <george@fivetran.com>2019-01-07 22:22:41 -0800
commit297dd5f8fb1c72f5807595c3029acf40ce6afcd9 (patch)
treebc860dd810cfcfcfefe99b12265e4271ffa90f34
parentf6fc3a421ac4b51a43352da53f056e8c17b94647 (diff)
downloadjava-language-server-297dd5f8fb1c72f5807595c3029acf40ce6afcd9.zip
Can cause null pointer
-rw-r--r--src/main/java/org/javacs/WarnUnused.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/javacs/WarnUnused.java b/src/main/java/org/javacs/WarnUnused.java
index 18d352e..d69c1ea 100644
--- a/src/main/java/org/javacs/WarnUnused.java
+++ b/src/main/java/org/javacs/WarnUnused.java
@@ -43,7 +43,7 @@ class WarnUnused extends TreePathScanner<Void, Void> {
}
boolean isEmptyConstructor(MethodTree t) {
- return t.getParameters().isEmpty() && trees.getElement(getCurrentPath()).getKind() == ElementKind.CONSTRUCTOR;
+ return t.getParameters().isEmpty() && t.getReturnType() == null;
}
@Override