Skip to content

Commit c9d7634

Browse files
committed
#95 Upgrade to Checkstyle 8.12
1 parent cef3083 commit c9d7634

File tree

11 files changed

+64
-17
lines changed

11 files changed

+64
-17
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3+
<classpathentry exported="true" kind="lib" path="checkstyle-8.12-all.jar" sourcepath="checkstyle-checkstyle-8.12.zip"/>
34
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
45
<attributes>
56
<attribute name="maven.pomderived" value="true"/>
67
</attributes>
78
</classpathentry>
89
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
9-
<classpathentry kind="src" path="metadata/"/>
10-
<classpathentry kind="src" path="test"/>
11-
<classpathentry exported="true" kind="lib" path="checkstyle-8.11-all.jar" sourcepath="checkstyle-checkstyle-8.11.zip"/>
10+
<classpathentry kind="src" path="metadata"/>
11+
<classpathentry kind="src" path="test"/>
1212
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
1313
<classpathentry kind="output" path="target/classes"/>
1414
</classpath>

net.sf.eclipsecs.checkstyle/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ Export-Package: .,
4646
com.puppycrawl.tools.checkstyle.utils,
4747
org.apache.commons.beanutils;version="8.11.0"
4848
Bundle-ClassPath: .,
49-
checkstyle-8.11-all.jar
49+
checkstyle-8.12-all.jar
5050
Automatic-Module-Name: net.sf.eclipsecs.checkstyle
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
bin.includes = META-INF/,\
22
.,\
33
license/,\
4-
checkstyle-8.11-all.jar
4+
checkstyle-8.12-all.jar
55
jars.compile.order = .
66
source.. = metadata/

net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/blocks/checkstyle-metadata.xml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,27 +70,29 @@
7070
<description>%LeftCurly.ignoreEnums</description>
7171
</property-metadata>
7272
<property-metadata name="tokens" datatype="MultiCheck"
73-
default-value="INTERFACE_DEF,CLASS_DEF,ANNOTATION_DEF,ENUM_DEF,CTOR_DEF,METHOD_DEF,ENUM_CONSTANT_DEF,LITERAL_WHILE,LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_SYNCHRONIZED,LITERAL_SWITCH,LITERAL_DO,LITERAL_IF,LITERAL_ELSE,LITERAL_FOR,STATIC_INIT,OBJBLOCK,LAMBDA">
73+
default-value="ANNOTATION_DEF,CLASS_DEF,CTOR_DEF,ENUM_CONSTANT_DEF,ENUM_DEF,INTERFACE_DEF,LAMBDA,LITERAL_CASE,LITERAL_CATCH,LITERAL_DEFAULT,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_SWITCH,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,METHOD_DEF,OBJBLOCK,STATIC_INIT">
7474
<description>%LeftCurly.tokens</description>
7575
<enumeration>
76-
<property-value-option value="INTERFACE_DEF"/>
77-
<property-value-option value="CLASS_DEF"/>
7876
<property-value-option value="ANNOTATION_DEF"/>
79-
<property-value-option value="ENUM_DEF"/>
77+
<property-value-option value="CLASS_DEF"/>
8078
<property-value-option value="CTOR_DEF"/>
81-
<property-value-option value="METHOD_DEF"/>
8279
<property-value-option value="ENUM_CONSTANT_DEF"/>
80+
<property-value-option value="ENUM_DEF"/>
81+
<property-value-option value="INTERFACE_DEF"/>
8382
<property-value-option value="LAMBDA"/>
84-
<property-value-option value="LITERAL_WHILE"/>
85-
<property-value-option value="LITERAL_TRY"/>
83+
<property-value-option value="LITERAL_CASE"/>
8684
<property-value-option value="LITERAL_CATCH"/>
87-
<property-value-option value="LITERAL_FINALLY"/>
88-
<property-value-option value="LITERAL_SYNCHRONIZED"/>
89-
<property-value-option value="LITERAL_SWITCH"/>
85+
<property-value-option value="LITERAL_DEFAULT"/>
9086
<property-value-option value="LITERAL_DO"/>
91-
<property-value-option value="LITERAL_IF"/>
9287
<property-value-option value="LITERAL_ELSE"/>
88+
<property-value-option value="LITERAL_FINALLY"/>
9389
<property-value-option value="LITERAL_FOR"/>
90+
<property-value-option value="LITERAL_IF"/>
91+
<property-value-option value="LITERAL_SWITCH"/>
92+
<property-value-option value="LITERAL_SYNCHRONIZED"/>
93+
<property-value-option value="LITERAL_TRY"/>
94+
<property-value-option value="LITERAL_WHILE"/>
95+
<property-value-option value="METHOD_DEF"/>
9496
<property-value-option value="OBJBLOCK"/>
9597
<property-value-option value="STATIC_INIT"/>
9698
</enumeration>

net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/imports/checkstyle-metadata.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ ImportOrder.name = Import Order Check
2727
ImportOrder.option = policy on the relative order between regular imports and static imports
2828
ImportOrder.ordered = whether imports within group should be sorted
2929
ImportOrder.separated = whether imports groups should be separated by, at least, one blank line
30+
ImportOrder.separatedStaticGroups = whether static import groups should be separated by, at least, one blank line or comment and aren't separated internally. (This property has effect only when the property option is is set to top or bottom.)
3031
ImportOrder.sortStaticImportsAlphabetically = whether static imports grouped by top or bottom option are sorted alphabetically or not
32+
ImportOrder.staticGroups = list of static import groups (every group identified either by a common prefix string, or by a regular expression enclosed in forward slashes (e.g. /regexp/).\nAll static imports, which does not match any group, falls into an additional group, located at the end.\nThus, the empty list of static groups (the default value) means one group for all static imports.\n(This property has effect only when the property option is set to top or bottom.)
3133
ImportOrder.useContainerOrderingForStatic = whether to use container ordering (Eclipse IDE term) for static imports or not
3234
ImportOrder.tokens = tokens to check
3335

net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/imports/checkstyle-metadata.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@
6666
<property-metadata name="separated" datatype="Boolean" default-value="false">
6767
<description>%ImportOrder.separated</description>
6868
</property-metadata>
69+
<property-metadata name="separatedStaticGroups" datatype="Boolean" default-value="false">
70+
<description>%ImportOrder.separatedStaticGroups</description>
71+
</property-metadata>
6972
<property-metadata name="caseSensitive" datatype="Boolean" default-value="true">
7073
<description>%ImportOrder.caseSensitive</description>
7174
</property-metadata>
75+
<property-metadata name="staticGroups" datatype="String">
76+
<description>%ImportOrder.staticGroups</description>
77+
</property-metadata>
7278
<property-metadata name="sortStaticImportsAlphabetically" datatype="Boolean"
7379
default-value="false">
7480
<description>%ImportOrder.sortStaticImportsAlphabetically</description>

net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/modifier/checkstyle-metadata.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@ Modifiers.group = Modifiers
77
RedundantModifier.desc = Checks for redundant modifiers in:\r\n<ol>\r\n<li>interface and annotation definitions,</li>\r\n<li>the final modifier on methods of final classes, and</li>\r\n<li>inner <code>interface</code> declarations that are declared as <code>static</code></li>\r\n</ol>\r\n<b>Rationale:</b> The Java Language Specification strongly discourages the usage of "public" and "abstract" for method declarations in interface definitions as a matter of style.<br/>\r\n<br/>\r\nVariables in interfaces and annotations are automatically public, static and final, so these modifiers are redundant as well.<br/>\r\n<br/>\r\nAs annotations are a form of interface, their fields are also automatically public, static and final just as their annotation fields are automatically public and abstract.<br/>\r\n<br/>\r\nFinal classes by definition can not be extended so the final modifier on the method of a final class is redundant.
88
RedundantModifier.name = Redundant Modifier
99
RedundantModifier.tokens = Tokens to check.
10+
11+
InterfaceMemberImpliedModifier.name = Interface Member Implied Modifier
12+
InterfaceMemberImpliedModifier.desc = Checks for implicit modifiers on interface members and nested types.<br/><br/>This check is effectively the opposite of RedundantModifier. It checks the modifiers on interface members, ensuring that certain modifiers are explicitly specified even though they are actually redundant.<br/><br/>Methods in interfaces are public by default, however from Java 9 they can also be private. This check provides the ability to enforce that public is explicitly coded and not implicitly added by the compiler.<br/><br/>From Java 8, there are three types of methods in interfaces - static methods marked with static, default methods marked with default and abstract methods which do not have to be marked with anything. From Java 9, there are also private methods marked with private. This check provides the ability to enforce that abstract is explicitly coded and not implicitly added by the compiler.<br/><br/>Fields in interfaces are always public static final and as such the compiler does not require these modifiers. This check provides the ability to enforce that these modifiers are explicitly coded and not implicitly added by the compiler.<br/><br/>Nested types within an interface are always public static and as such the compiler does not require the public static modifiers. This check provides the ability to enforce that the public and static modifiers are explicitly coded and not implicitly added by the compiler.
13+
InterfaceMemberImpliedModifier.violateImpliedPublicField = Control whether to enforce that public is explicitly coded on interface fields.
14+
InterfaceMemberImpliedModifier.violateImpliedStaticField = Control whether to enforce that static is explicitly coded on interface fields.
15+
InterfaceMemberImpliedModifier.violateImpliedFinalField = Control whether to enforce that final is explicitly coded on interface fields.
16+
InterfaceMemberImpliedModifier.violateImpliedPublicMethod = Control whether to enforce that public is explicitly coded on interface methods.
17+
InterfaceMemberImpliedModifier.violateImpliedAbstractMethod = Control whether to enforce that abstract is explicitly coded on interface methods.
18+
InterfaceMemberImpliedModifier.violateImpliedPublicNested = Control whether to enforce that public is explicitly coded on interface nested types.
19+
InterfaceMemberImpliedModifier.violateImpliedStaticNested = Control whether to enforce that static is explicitly coded on interface nested types.

net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/modifier/checkstyle-metadata.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,32 @@
3434
<message-key key="redundantModifier"/>
3535
</rule-metadata>
3636

37+
<rule-metadata name="%InterfaceMemberImpliedModifier.name" internal-name="InterfaceMemberImpliedModifier" parent="TreeWalker">
38+
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck"/>
39+
<description>%InterfaceMemberImpliedModifier.desc</description>
40+
<property-metadata name="violateImpliedPublicField" datatype="Boolean" default-value="true">
41+
<description>%InterfaceMemberImpliedModifier.violateImpliedPublicField</description>
42+
</property-metadata>
43+
<property-metadata name="violateImpliedStaticField" datatype="Boolean" default-value="true">
44+
<description>%InterfaceMemberImpliedModifier.violateImpliedStaticField</description>
45+
</property-metadata>
46+
<property-metadata name="violateImpliedFinalField" datatype="Boolean" default-value="true">
47+
<description>%InterfaceMemberImpliedModifier.violateImpliedFinalField</description>
48+
</property-metadata>
49+
<property-metadata name="violateImpliedPublicMethod" datatype="Boolean" default-value="true">
50+
<description>%InterfaceMemberImpliedModifier.violateImpliedPublicMethod</description>
51+
</property-metadata>
52+
<property-metadata name="violateImpliedAbstractMethod" datatype="Boolean" default-value="true">
53+
<description>%InterfaceMemberImpliedModifier.violateImpliedAbstractMethod</description>
54+
</property-metadata>
55+
<property-metadata name="violateImpliedPublicNested" datatype="Boolean" default-value="true">
56+
<description>%InterfaceMemberImpliedModifier.violateImpliedPublicNested</description>
57+
</property-metadata>
58+
<property-metadata name="violateImpliedStaticNested" datatype="Boolean" default-value="true">
59+
<description>%InterfaceMemberImpliedModifier.violateImpliedStaticNested</description>
60+
</property-metadata>
61+
<message-key key="interface.implied.modifier"/>
62+
</rule-metadata>
3763
</rule-group-metadata>
3864

3965
</checkstyle-metadata>

0 commit comments

Comments
 (0)