forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#13345: Enable examples tests for ClassMemberImpliedM…
…odifierCheck
- Loading branch information
1 parent
b89afb9
commit 2e23e27
Showing
5 changed files
with
58 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
.../com/puppycrawl/tools/checkstyle/checks/modifier/classmemberimpliedmodifier/Example1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="TreeWalker"> | ||
<module name="ClassMemberImpliedModifier" /> | ||
</module> | ||
</module> | ||
*/ | ||
//non-compiled with javac: Compilable with Java17 | ||
package com.puppycrawl.tools.checkstyle.checks.modifier.classmemberimpliedmodifier; | ||
|
||
// xdoc section -- start | ||
public final class Example1 { | ||
static interface Address1 { | ||
} | ||
|
||
interface Address2 { // violation, 'Implied modifier 'static' should be explicit' | ||
} | ||
|
||
static enum Age1 { | ||
CHILD, ADULT | ||
} | ||
|
||
enum Age2 { // violation, 'Implied modifier 'static' should be explicit' | ||
CHILD, ADULT | ||
} | ||
|
||
public static record GoodRecord() {} | ||
// violation below, 'Implied modifier 'static' should be explicit' | ||
public record BadRecord() {} | ||
|
||
public static record OuterRecord() { | ||
static record InnerRecord1(){} | ||
// violation below, 'Implied modifier 'static' should be explicit' | ||
record InnerRecord2(){} | ||
} | ||
} | ||
// xdoc section -- end |
33 changes: 0 additions & 33 deletions
33
...s/com/puppycrawl/tools/checkstyle/checks/modifier/classmemberimpliedmodifier/Example1.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters