Skip to content

Commit b172b50

Browse files
xdavidwugeorgewfraser
authored andcommitted
fix(WarnNotThrown): skip if there is no body
For native or abstract.
1 parent e033190 commit b172b50

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/org/javacs/markup/WarnNotThrown.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public Void visitCompilationUnit(CompilationUnitTree t, Map<TreePath, String> no
3636

3737
@Override
3838
public Void visitMethod(MethodTree t, Map<TreePath, String> notThrown) {
39+
// Skip on abstract or native
40+
if (t.getBody() == null) {
41+
return null;
42+
}
3943
// Create a new method scope
4044
var pushDeclared = declaredExceptions;
4145
var pushObserved = observedExceptions;

0 commit comments

Comments
 (0)