You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/blocks/checkstyle-metadata.xml
Copy file name to clipboardExpand all lines: net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/coding/checkstyle-metadata.properties
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.
AvoidNoArgumentSuperConstructorCall.desc = Checks if call to superclass constructor without arguments is present.
9
+
AvoidNoArgumentSuperConstructorCall.name = Avoid No Argument Super Constructor Call
10
+
8
11
Coding.group = Coding Problems
9
12
10
13
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
ExplicitInitialization.onlyObjectReferences = whether only explicit initializations made to null for objects should be checked
35
38
36
-
FallThrough.checkLastCaseGroup = Whether we need to check last case group or not.
37
-
FallThrough.desc = Checks for fallthrough 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.
38
41
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.
40
43
41
44
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.
42
45
FinalLocalVariable.name = Final Local Variable
@@ -138,6 +141,9 @@ NoArrayTrailingComma.name = No Array Trailing Comma
138
141
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}
139
142
NoClone.name = No Clone
140
143
144
+
NoEnumTrailingComma.desc = Checks that enum definition does not contain a trailing comma.
145
+
NoEnumTrailingComma.name = No Enum Trailing Comma
146
+
141
147
NoFinalizer.desc = Verifies there are no <code>finalize()</code> methods defined in a class.
Copy file name to clipboardExpand all lines: net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/coding/checkstyle-metadata.xml
0 commit comments