diff options
author | George Fraser <george@fivetran.com> | 2019-01-05 13:20:05 -0800 |
---|---|---|
committer | George Fraser <george@fivetran.com> | 2019-01-05 13:20:05 -0800 |
commit | 9d0a24f07815030b3a0738475f2084b152d78796 (patch) | |
tree | af22b724bdf34df84e5499926e33d6f42863a7ee /src | |
parent | 9b5383d79cb759b40f74a072c0e34debd253db83 (diff) | |
download | java-language-server-9d0a24f07815030b3a0738475f2084b152d78796.zip |
Warn on unused privates
Diffstat (limited to 'src')
-rw-r--r-- | src/test/java/org/javacs/WarningsTest.java | 3 | ||||
-rw-r--r-- | src/test/test-project/workspace/src/org/javacs/warn/Unused.java | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/test/java/org/javacs/WarningsTest.java b/src/test/java/org/javacs/WarningsTest.java index 7619f25..696eed2 100644 --- a/src/test/java/org/javacs/WarningsTest.java +++ b/src/test/java/org/javacs/WarningsTest.java @@ -31,7 +31,8 @@ public class WarningsTest { @Test public void unusedLocal() { server.reportErrors(List.of(FindResource.uri("org/javacs/warn/Unused.java"))); - assertThat(errors, hasItem("unused(5)")); + assertThat(errors, hasItem("unused(5)")); // int unusedLocal + assertThat(errors, hasItem("unused(8)")); // int unusedPrivate assertThat(errors, not(hasItem("unused(4)"))); } } diff --git a/src/test/test-project/workspace/src/org/javacs/warn/Unused.java b/src/test/test-project/workspace/src/org/javacs/warn/Unused.java index f03012d..94e04b7 100644 --- a/src/test/test-project/workspace/src/org/javacs/warn/Unused.java +++ b/src/test/test-project/workspace/src/org/javacs/warn/Unused.java @@ -4,4 +4,6 @@ class Unused { void test(int unusedParam) { int unusedLocal = 1; } + + private int unusedPrivate; }
\ No newline at end of file |