Skip to content

Commit 012576f

Browse files
committed
Merge branch '__rultor'
2 parents e7dc3a6 + 6158acb commit 012576f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,24 @@ void rejectsUppercaseAbbreviations() throws Exception {
692692
);
693693
}
694694

695+
@Test
696+
void rejectsHiddenParameters() throws Exception {
697+
final String file = "HiddenParameter.java";
698+
final Collection<Violation> results = this.runValidation(
699+
file, false
700+
);
701+
final String name = "HiddenFieldCheck";
702+
final String message = "'test' hides a field.";
703+
MatcherAssert.assertThat(
704+
results,
705+
Matchers.hasItems(
706+
new ViolationMatcher(
707+
message, file, "17", name
708+
)
709+
)
710+
);
711+
}
712+
695713
/**
696714
* CheckstyleValidator can allow IT as an uppercase abbreviation.
697715
*
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Hello.
3+
*/
4+
package foo;
5+
6+
/**
7+
* Hidden paramater test.
8+
* @since 1.0
9+
*/
10+
class HiddenParameter {
11+
private final String test = "";
12+
13+
/**
14+
* Some documentation for the function.
15+
* @param test Test
16+
*/
17+
void bar(final String test) { // error is here
18+
System.out.println("Hello: " + test);
19+
}
20+
}

0 commit comments

Comments
 (0)