Skip to content

Commit 69802fc

Browse files
Calixteromani
authored andcommitted
Issue #207: update to Checkstyle 8.29
1 parent c08641c commit 69802fc

File tree

8 files changed

+27
-7
lines changed

8 files changed

+27
-7
lines changed

net.sf.eclipsecs.checkstyle/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry exported="true" kind="lib" path="checkstyle-8.28-all.jar" sourcepath="checkstyle-checkstyle-8.28.zip"/>
3+
<classpathentry exported="true" kind="lib" path="checkstyle-8.29-all.jar" sourcepath="checkstyle-checkstyle-8.29.zip"/>
44
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
55
<attributes>
66
<attribute name="maven.pomderived" value="true"/>

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.28.0"
4848
Bundle-ClassPath: .,
49-
checkstyle-8.28-all.jar
49+
checkstyle-8.29-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.28-all.jar
4+
checkstyle-8.29-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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
<property-value-option value="STATIC_INIT"/>
155155
<property-value-option value="INSTANCE_INIT"/>
156156
<property-value-option value="ANNOTATION_DEF"/>
157+
<property-value-option value="ENUM_DEF"/>
157158
</enumeration>
158159
</property-metadata>
159160
<message-key key="line.alone"/>

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ ArrayTrailingComma.name = Trailing Array Comma
55
AvoidInlineConditionals.desc = Detects inline conditionals. An example inline conditional is this:\r\n<pre>\r\nString a = getParameter("a");\r\nString b = (a==null || a.length<1) ? null : a.substring(1);\r\n</pre>\r\nRationale: Some developers find inline conditionals hard to read, so their company's coding standards forbids them.
66
AvoidInlineConditionals.name = Avoid Inline Conditionals
77

8+
AvoidNoArgumentSuperConstructorCall.desc = Checks if call to superclass constructor without arguments is present.
9+
AvoidNoArgumentSuperConstructorCall.name = Avoid No Argument Super Constructor Call
10+
811
Coding.group = Coding Problems
912

1013
CovariantEquals.desc = Checks that classes that define a covariant equals() method also override method equals(java.lang.Object). Inspired by findbugs.<br/>\r\nRationale: Mistakenly defining a covariant equals() method without overriding method equals(java.lang.Object) can produce unexpected runtime behaviour.
@@ -33,10 +36,10 @@ ExplicitInitialization.desc = Checks if any class or object member explicitly in
3336
ExplicitInitialization.name = Explicit Initialization
3437
ExplicitInitialization.onlyObjectReferences = whether only explicit initializations made to null for objects should be checked
3538
36-
FallThrough.checkLastCaseGroup = Whether we need to check last case group or not.
37-
FallThrough.desc = Checks for fall through in switch statements. Finds locations where a <code>case</code> contains Java code - but lacks a <code>break, return, throw</code> or <code>continue</code> statement.<br/>\r\nThe check honors special comments to suppress the warning. By default the text "fallthru", "fall through", "fallthrough", "falls through" and "fallsthrough" are recognized (case sensitive). The comment containing this words must be a one-liner and must be on the last none-empty line before the <code>case</code> triggering the warning or on the same line before the <code>case</code> (urgly, but possible).\r\n<pre>\r\nswitch (i){\r\ncase 0:\r\n i++; // fall through\r\n\r\ncase 1:\r\n i++;\r\n // falls through\r\ncase 2: {\r\n i++;\r\n}\r\n// fallthrough\r\ncase 3:\r\n i++;\r\n/* fallthru */case 4:\r\n i++\r\n break;\r\n}\r\n</pre>\u0009\r\nNote: the check works in assumption that there is no unreachable code in the <code>case</code>.
39+
FallThrough.checkLastCaseGroup = Control whether the last case group must be checked.
40+
FallThrough.desc = Checks for fall-through in switch statements.
3841
FallThrough.name = Fall Through
39-
FallThrough.reliefPattern = Regular expression to match the relief comment that suppresses the warning about a fall through.
42+
FallThrough.reliefPattern = Define the RegExp to match the relief comment that suppresses the warning about a fall through.
4043
4144
FinalLocalVariable.desc = Checks that local variables that never have their values changed are declared final. The check can be configured to also check that unchanged parameters are declared final.<br/>\r\nWhen configured to check parameters, the check ignores parameters of interface methods and abstract methods.
4245
FinalLocalVariable.name = Final Local Variable
@@ -138,6 +141,9 @@ NoArrayTrailingComma.name = No Array Trailing Comma
138141
NoClone.desc = Checks that the clone method is not overridden from the Object class.<br/>\r\n<br/>\r\nRationale: The clone method relies on strange/hard to follow rules that do not work it all situations. Consequently, it is difficult to override correctly. Below are some of the rules/reasons why the clone method should be avoided.<br/>\r\nClasses supporting the clone method should implement the Cloneable interface but the Cloneable interface does not include the clone method. As a result, it doesn't enforce the method override.<br/>\r\nThe Cloneable interface forces the Object's clone method to work correctly. Without implementing it, the Object's clone method will throw a CloneNotSupportedException.<br/>\r\nNon-final classes must return the object returned from a call to super.clone(). \r\nFinal classes can use a constructor to create a clone which is different from non-final classes.<br/>\r\n<ul>\r\n<li>If a super class implements the clone method incorrectly all subclasses calling super.clone() are doomed to failure.</li>\r\n<li>If a class has references to mutable objects then those object references must be replaced with copies in the clone method after calling super.clone().</li>\r\n<li>The clone method does not work correctly with final mutable object references because final references cannot be reassigned.</li>\r\n<li>If a super class overrides the clone method then all subclasses must provide a correct clone implementation.</li>\r\n</ul>\r\nTwo alternatives to the clone method, in some cases, is a copy constructor or a static factory method to return copies of an object. Both of these approaches are simpler and do not conflict with final fields. The do not force the calling client to handle a CloneNotSuportException. They also are typed therefore no casting is necessary. Finally, they are more flexible since they can take interface types rather than concrete classes.<br/>\r\n<br/>\r\nSometimes a copy constructor or static factory is not an acceptable alternative to the clone method. The example below highlights the limitation of a copy constructor (or static factory). Assume Square is a subclass for Shape. \r\n<pre>\r\n Shape s1 = new Square();\r\n System.out.println(s1 instanceof Square); //true\r\n</pre>\r\n...assume at this point the code knows nothing of s1 being a Square that's the beauty of polymorphism but the code wants to copy the Square which is declared as a Shape, its super type... \r\n<pre>\r\n Shape s2 = new Shape(s1); //using the copy constructor\r\n System.out.println(s2 instanceof Square); //false\r\n</pre>\r\nThe working solution (without knowing about all subclasses and doing many casts) is to do the following (assuming correct clone implementation). \r\n<pre>\r\n Shape s2 = s1.clone();\r\n System.out.println(s2 instanceof Square); //true\r\n</pre>\r\nJust keep in mind if this type of polymorphic cloning is required then a properly implemented clone method may be the best choice.<br/>\r\n<br/>\r\nMuch of this information was taken from Effective Java: Programming Language Guide First Edition by Joshua Bloch pages 45-52. Give Bloch credit for writing an excellent book.<br/>\r\n<br/>\r\nThis check is almost exactly the same as the {@link NoFinalizerCheck}
139142
NoClone.name = No Clone
140143

144+
NoEnumTrailingComma.desc = Checks that enum definition does not contain a trailing comma.
145+
NoEnumTrailingComma.name = No Enum Trailing Comma
146+
141147
NoFinalizer.desc = Verifies there are no <code>finalize()</code> methods defined in a class.
142148
NoFinalizer.name = No Finalizer
143149

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
<message-key key="inline.conditional.avoid" />
1313
</rule-metadata>
1414

15+
<rule-metadata name="%AvoidNoArgumentSuperConstructorCall.name" internal-name="AvoidNoArgumentSuperConstructorCall"
16+
parent="TreeWalker">
17+
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.checks.coding.AvoidNoArgumentSuperConstructorCallCheck" />
18+
<description>%AvoidNoArgumentSuperConstructorCall.desc</description>
19+
<message-key key="super.constructor.call" />
20+
</rule-metadata>
21+
1522
<rule-metadata name="%CovariantEquals.name" internal-name="CovariantEquals" parent="TreeWalker">
1623
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck" />
1724
<description>%CovariantEquals.desc</description>
@@ -84,7 +91,7 @@
8491
<property-metadata name="checkLastCaseGroup" datatype="Boolean" default-value="false">
8592
<description>%FallThrough.checkLastCaseGroup</description>
8693
</property-metadata>
87-
<property-metadata name="reliefPattern" datatype="Regex" default-value="fallthru|falls? ?through">
94+
<property-metadata name="reliefPattern" datatype="Regex" default-value="falls?[ -]?thr(u|ough)">
8895
<description>%FallThrough.reliefPattern</description>
8996
</property-metadata>
9097
<message-key key="fall.through" />
@@ -398,6 +405,12 @@
398405
<message-key key="avoid.clone.method" />
399406
</rule-metadata>
400407

408+
<rule-metadata name="%NoEnumTrailingComma.name" internal-name="NoEnumTrailingComma" parent="TreeWalker">
409+
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.checks.coding.NoEnumTrailingCommaCheck" />
410+
<description>%NoEnumTrailingComma.desc</description>
411+
<message-key key="no.enum.trailing.comma" />
412+
</rule-metadata>
413+
401414
<rule-metadata name="%NoFinalizer.name" internal-name="NoFinalizer" parent="TreeWalker">
402415
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck" />
403416
<description>%NoFinalizer.desc</description>

0 commit comments

Comments
 (0)