Skip to content

Commit

Permalink
Enable javac -parameters flag (#1069)
Browse files Browse the repository at this point in the history
This enables Error Prone to discover more issues, e.g., we fix a couple
of `assertEquals` argument ordering issues.
  • Loading branch information
msridhar authored Nov 9, 2024
1 parent 1e9c754 commit 0a5fa0f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ subprojects { project ->
"-Xlint:deprecation",
"-Xlint:rawtypes",
"-Xlint:unchecked",
"-Werror"
"-Werror",
"-parameters",
]
options.errorprone {
// disable warnings in generated code; AutoValue code fails UnnecessaryParentheses check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void allDeclaredMethodsThrowIllegalStateException() {
Throwable cause = reflectionException.getCause();
assertThat(cause, instanceOf(IllegalStateException.class));
IllegalStateException exception = (IllegalStateException) cause;
assertEquals(exception.getMessage(), DummyOptionsConfig.ERROR_MESSAGE);
assertEquals(DummyOptionsConfig.ERROR_MESSAGE, exception.getMessage());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ public void testIllegalStateExceptionUsingReflection() throws Exception {

Throwable cause = exception.getCause();
assertThat(cause, instanceOf(IllegalStateException.class));
assertEquals(cause.getMessage(), ERROR);
assertEquals(ERROR, cause.getMessage());
}
}

0 comments on commit 0a5fa0f

Please sign in to comment.