Skip to content

Commit

Permalink
For yegor256#982: Disabled CallSuperInConstructor rule.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulodamaso committed Feb 8, 2019
1 parent ef690f5 commit 3f678dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public static Collection<String[]> parameters() {
{"ExcessiveImports"},
{"PositionLiteralsFirstInComparisons"},
{"MissingSerialVersionUID"},
{"CallSuperInConstructor"},
}
);
}
Expand Down
20 changes: 0 additions & 20 deletions qulice-pmd/src/test/java/com/qulice/pmd/PmdValidatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -615,24 +615,4 @@ public void allowsDuplicateLiteralsInAnnotations() throws Exception {
)
).validate();
}

/**
* PmdValidator does not require constructor with super().
*
* @throws Exception If something wrong happens inside.
*/
@Test
public void dontRequireSuperInConstructor()
throws Exception {
final String file = "DontCallSuperInConstructor.java";
new PmdAssert(
file,
new IsEqual<>(true),
new IsNot<>(
new StringContains(
"CallSuperInConstructor"
)
)
).validate();
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package foo;

public final class DontCallSuperInConstructor {
public final class CallSuperInConstructor {

private final int number;
private final int other;

public DontCallSuperInConstructor(final int parameter) {
public CallSuperInConstructor(final int parameter) {
this(parameter, parameter * 2);
}

public DontCallSuperInConstructor(final int parameter, final int other) {
public CallSuperInConstructor(final int parameter, final int other) {
this.number = parameter;
this.another = other;
}
Expand Down

0 comments on commit 3f678dd

Please sign in to comment.