Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Mar 13, 2024
2 parents e7dc3a6 + 6158acb commit 012576f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Expand Up @@ -692,6 +692,24 @@ void rejectsUppercaseAbbreviations() throws Exception {
);
}

@Test
void rejectsHiddenParameters() throws Exception {
final String file = "HiddenParameter.java";
final Collection<Violation> results = this.runValidation(
file, false
);
final String name = "HiddenFieldCheck";
final String message = "'test' hides a field.";
MatcherAssert.assertThat(
results,
Matchers.hasItems(
new ViolationMatcher(
message, file, "17", name
)
)
);
}

/**
* CheckstyleValidator can allow IT as an uppercase abbreviation.
*
Expand Down
@@ -0,0 +1,20 @@
/*
* Hello.
*/
package foo;

/**
* Hidden paramater test.
* @since 1.0
*/
class HiddenParameter {
private final String test = "";

/**
* Some documentation for the function.
* @param test Test
*/
void bar(final String test) { // error is here
System.out.println("Hello: " + test);
}
}

0 comments on commit 012576f

Please sign in to comment.