Skip to content

Commit 379579a

Browse files
Calixteromani
authored andcommitted
Issue #197: update to Checkstyle 8.28
1 parent 8b7494b commit 379579a

File tree

11 files changed

+17
-27
lines changed

11 files changed

+17
-27
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.27-all.jar" sourcepath="checkstyle-checkstyle-8.27.zip"/>
3+
<classpathentry exported="true" kind="lib" path="checkstyle-8.28-all.jar" sourcepath="checkstyle-checkstyle-8.28.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.27.0"
4848
Bundle-ClassPath: .,
49-
checkstyle-8.27-all.jar
49+
checkstyle-8.28-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.27-all.jar
4+
checkstyle-8.28-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
@@ -153,6 +153,7 @@
153153
<property-value-option value="LITERAL_DO"/>
154154
<property-value-option value="STATIC_INIT"/>
155155
<property-value-option value="INSTANCE_INIT"/>
156+
<property-value-option value="ANNOTATION_DEF"/>
156157
</enumeration>
157158
</property-metadata>
158159
<message-key key="line.alone"/>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ NestedTryDepth.desc = Restricts nested try blocks to a specified depth (default
132132
NestedTryDepth.max = allowed nesting depth
133133
NestedTryDepth.name = Nested Try Depth
134134

135+
NoArrayTrailingComma.desc = Checks if array initialization does not contain a trailing comma.
136+
NoArrayTrailingComma.name = No Array Trailing Comma
137+
135138
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}
136139
NoClone.name = No Clone
137140

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,12 @@
386386
<message-key key="nested.try.depth" />
387387
</rule-metadata>
388388

389+
<rule-metadata name="%NoArrayTrailingComma.name" internal-name="NoArrayTrailingComma" parent="TreeWalker">
390+
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.checks.coding.NoArrayTrailingCommaCheck" />
391+
<description>%NoArrayTrailingComma.desc</description>
392+
<message-key key="no.array.trailing.comma" />
393+
</rule-metadata>
394+
389395
<rule-metadata name="%NoClone.name" internal-name="NoClone" parent="TreeWalker">
390396
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck" />
391397
<description>%NoClone.desc</description>

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,12 @@
147147
<property-metadata name="sortImportsInGroupAlphabetically" datatype="String">
148148
<description>%CustomImportOrder.sortImportsInGroupAlphabetically</description>
149149
</property-metadata>
150-
<message-key key="custom.import.order.line.separator" />
150+
<message-key key="custom.import.order" />
151151
<message-key key="custom.import.order.lex" />
152-
<message-key key="custom.import.order.nonGroup.import" />
152+
<message-key key="custom.import.order.line.separator" />
153153
<message-key key="custom.import.order.nonGroup.expected" />
154-
<message-key key="custom.import.order" />
154+
<message-key key="custom.import.order.nonGroup.import" />
155+
<message-key key="custom.import.order.separated.internally" />
155156
</rule-metadata>
156157
</rule-group-metadata>
157158

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,10 @@ JavadocMethod.allowedAnnotations = List of annotations that could allo
55
JavadocMethod.validateThrows = Allows validating throws tags.
66
JavadocMethod.allowMissingParamTags = Whether to ignore errors when a method has parameters but does not have matching param tags in the javadoc.
77
JavadocMethod.allowMissingReturnTag = Whether to ignore errors when a method returns non-void type does have a return tag in the javadoc.
8-
JavadocMethod.allowMissingThrowsTags = Whether to ignore errors when a method declares that it throws exceptions but does have matching throws tags in the javadoc.
9-
JavadocMethod.allowThrowsTagsForSubclasses = Whether to allow documented exceptions that are subclass of one of declared exception.
10-
JavadocMethod.allowUndeclaredRTE = Whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException.
118
JavadocMethod.desc = Checks the Javadoc of a method or constructor. By default, does not check for unused throws. To allow documented java.lang.RuntimeExceptions that are not declared, set property allowUndeclaredRTE to true. The scope to verify is specified using the Scope class and defaults to Scope.PRIVATE. To verify another scope, set property scope to a different scope.<br/>\r\nError messages about parameters and type parameters for which no param tags are present can be suppressed by defining property <code>allowMissingParamTags</code>. Error messages about exceptions which are declared to be thrown, but for which no throws tag is present can be suppressed by defining property <code>allowMissingThrowsTags</code>. Error messages about methods which return non-void but for which no return tag is present can be suppressed by defining property <code>allowMissingReturnTag</code>.<br/>\r\n<br/>\r\nJavadoc is not required on a method that is tagged with the <code>@Override</code> annotation. However under Java 5 it is not possible to mark a method required for an interface (this was <em>corrected</em> under Java 6). Hence Checkstyle supports using the convention of using a single <code>{@inheritDoc}</code> tag instead of all the other tags. For example, if the following method is implementing a method required by an interface, then the Javadoc could be done as: \r\n<pre>\r\n/** {@inheritDoc} */\r\npublic int checkReturnTag(final int aTagIndex,\r\n JavadocTag[] aTags,\r\n int aLineNo)\r\n</pre> \r\n
129
JavadocMethod.excludeScope = visibility scope where Javadoc comments are not checked
13-
JavadocMethod.logLoadErrors = This check may need to load exception classes mentioned in the @throws tag to check whether they are RuntimeExceptions. If loading the class fails, this property allows to control checkstyle's error handling. If set to false (the default) a classpath configuration problem is assumed and the TreeWalker stops operating on the class completely. If set to true, checkstyle assumes a typo or refactoring problem in the javadoc and logs the problem in the normal checkstyle report (potentially masking a configuration error).
1410
JavadocMethod.name = Method Javadoc
1511
JavadocMethod.scope = Visibility scope where Javadoc comments are checked.
16-
JavadocMethod.suppressLoadErrors = Controls whether to show class loading errors in the checkstyle report.
1712
JavadocMethod.tokens = Tokens to check.
1813

1914
JavadocPackage.allowLegacy = If set then allow the use of a package.html file.

0 commit comments

Comments
 (0)