diff options
Diffstat (limited to 'plugins/InspectionGadgets/src/inspectionDescriptions')
9 files changed, 52 insertions, 29 deletions
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/AmbiguousFieldAccess.html b/plugins/InspectionGadgets/src/inspectionDescriptions/AmbiguousFieldAccess.html index b0f698b74e7e..c8c714b78f40 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/AmbiguousFieldAccess.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/AmbiguousFieldAccess.html @@ -1,9 +1,9 @@ <html> <body> -Reports field accesses of a super class where a local variable, parameter or field of the same name is available -in the surrounding class. In this case a cursory reader of the code may think that a variable in the surrounding class is -accessed, when in fact a field from the super class is accessed. To make the intent of the code more clear it is recommended to add a -<b>this</b> qualifier to the field access call. +Reports ambiguous accesses of a super class field from an inner or anonymous class, where a local variable, parameter or field with identical name is available +in the surrounding code. In this situation a cursory examination of the code may suggest that an element in the surrounding code is +accessed, when in actual fact a field from the super class is accessed. To clarify the intent of the code it is recommended to add a +<b>super</b> qualifier to the field access. <p>Example: <pre><code> <b>class</b> X { diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/AmbiguousMethodCall.html b/plugins/InspectionGadgets/src/inspectionDescriptions/AmbiguousMethodCall.html index 47bb71c5aee4..e1384463c5e1 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/AmbiguousMethodCall.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/AmbiguousMethodCall.html @@ -1,10 +1,10 @@ <html> <body> -Reports any method calls to super methods where a method -with the same name is available in the surrounding class. In this case a cursory -reader of the code may think that a method in the surrounding class is -called, when in fact a method from the super class is called. To make the -intent of the code more clear it is recommended to add a +Reports ambiguous method calls to a super method from an inner or anonymous class, where a method +with identical name is available in the surrounding class. In this situation a cursory +examination of the code may suggest a method in the surrounding class is +called, when in actual fact a method from the super class is called. To clarify the +intent of the code it is recommended to add a <b>super</b> qualifier to the method call. <!-- tooltip end --> <p> diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/AnonymousInnerClassMayBeStatic.html b/plugins/InspectionGadgets/src/inspectionDescriptions/AnonymousInnerClassMayBeStatic.html index 9311966c365b..a0794ca5dfc8 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/AnonymousInnerClassMayBeStatic.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/AnonymousInnerClassMayBeStatic.html @@ -1,11 +1,10 @@ <html> <body> -This inspection is intended for J2ME and other highly resource constrained environments. -Applying the results of this inspection without consideration might have negative effects on code clarity and design. +Reports any anonymous classes which may safely be made into a named <b>static</b> inner class. +An anonymous class may be <b>static</b> if it doesn't explicitly reference its enclosing instance or local variables from its surrounding method. <p> -Reports any anonymous inner classes which may safely be made into a named -<b>static</b> inner class. An inner class may be static if it doesn't reference -its enclosing class instance or local variables. A static inner class uses slightly less memory. +A <b>static</b> inner class does not keep an implicit reference to its enclosing instance. +This prevents a common cause of memory leaks and uses less memory per instance of the class. <!-- tooltip end --> <p> diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/CStyleArrayDeclaration.html b/plugins/InspectionGadgets/src/inspectionDescriptions/CStyleArrayDeclaration.html index 6b8f3ff43b2a..7320abc37f19 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/CStyleArrayDeclaration.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/CStyleArrayDeclaration.html @@ -1,9 +1,18 @@ <html> <body> -Reports array declarations made using C-style syntax, with the array indicator attached to the variable, -rather than Java-style syntax, with the array indicator attached to the type. +Reports array declarations made using C-style syntax, +with the array indicator brackets positioned after the variable name or after the method parameter list. +For example: +<code><pre> + <b>public</b> String process(String value[])[] { + return value; + } +</pre></code> +Most code styles prefer Java-style array declarations, with the array indicator brackets attached to the type name. <!-- tooltip end --> <p> +Use the checkbox below to only report C-style array declaration of method return types. +<p> </body> </html>
\ No newline at end of file diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/DoubleBraceInitialization.html b/plugins/InspectionGadgets/src/inspectionDescriptions/DoubleBraceInitialization.html new file mode 100644 index 000000000000..e2cf8b607f66 --- /dev/null +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/DoubleBraceInitialization.html @@ -0,0 +1,13 @@ +<html> +<body> +Reports <a href="http://www.c2.com/cgi/wiki?DoubleBraceInitialization">Double Brace Initialization</a>. +Double brace initialization can cause memory leaks when used from a non-<b>static</b> context, +because the anonymous <b>class</b> created will maintain a reference to the surrounding object. +It has worse performance than regular initialization because of the additional class loading required. +It can cause <b>equals()</b> comparisons to fail, if the <b>equals()</b> method does not accept subclasses as parameter (see link above). +And finally, it cannot be combined with Java 7 diamond operator, because that cannot be used with anonymous classes. +<!-- tooltip end --> +<p> + <small>New in 14</small> +</body> +</html>
\ No newline at end of file diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/DoubleCheckedLocking.html b/plugins/InspectionGadgets/src/inspectionDescriptions/DoubleCheckedLocking.html index efa4d7a0ec34..e50edd8a9fc3 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/DoubleCheckedLocking.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/DoubleCheckedLocking.html @@ -6,9 +6,9 @@ discussion of double-checked locking and why it is unsafe, see ">http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a> <!-- tooltip end --> <p> -Use the checkbox below to ignore double-checked locking on volatile fields. Using -a volatile field for double-checked locking works correctly on virtual machines which -implement the new Java Memory Model. +Use the checkbox below to ignore double-checked locking on <b>volatile</b> fields. Using +a <b>volatile</b> field for double-checked locking works correctly on virtual machines which +implement the Java Memory Model. <p> </body> diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/InnerClassMayBeStatic.html b/plugins/InspectionGadgets/src/inspectionDescriptions/InnerClassMayBeStatic.html index 8d81ee6a4292..578f60b2d618 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/InnerClassMayBeStatic.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/InnerClassMayBeStatic.html @@ -1,8 +1,10 @@ <html> <body> -Reports any inner classes which may safely be made -<b>static</b>. An inner class may be static if it doesn't reference -its enclosing class instance. A static inner class uses slightly less memory. +Reports any inner classes which may safely be made <b>static</b>. +An inner class may be <b>static</b> if it doesn't reference its enclosing instance. +<p> +A <b>static</b> inner class does not keep an implicit reference to its enclosing instance. +This prevents a common cause of memory leaks and uses less memory per instance of the class. <!-- tooltip end --> <p> diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/NonThreadSafeLazyInitialization.html b/plugins/InspectionGadgets/src/inspectionDescriptions/NonThreadSafeLazyInitialization.html index f203aa949764..a1d87f3e9d1b 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/NonThreadSafeLazyInitialization.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/NonThreadSafeLazyInitialization.html @@ -1,16 +1,16 @@ <html> <body> -Reports static variables being lazily initialized -in an non-thread-safe manner. Lazy initialization of static variables should be done +Reports <b>static</b> variables being lazily initialized +in an non-thread-safe manner. Lazy initialization of <b>static</b> variables should be done in an appropriate synchronization construct, to prevent different threads from performing conflicting initialization. <p> -If applicable, quick-fix is suggested -which introduces static holder pattern described in +If applicable, a quickfix is suggested +which introduces the static holder pattern described in <a href="http://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom"> http://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom </a> -where the JVM guarantees thread-safety of such initializations. +where the JVM guarantees the thread-safety of such initializations. <!-- tooltip end --> <p> diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/PropertyValueSetToItself.html b/plugins/InspectionGadgets/src/inspectionDescriptions/PropertyValueSetToItself.html index c72e160a9b8c..60964e59716c 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/PropertyValueSetToItself.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/PropertyValueSetToItself.html @@ -1,8 +1,8 @@ <html> <body> -Reports calls on a setter with the value of same objects getter. +Reports calls on a setter with the value of the same object's getter. For example: <code>bean.setPayerId(bean.getPayerId());</code> -In regular circumstances this code is a no-op and probably not what was intented.. +In regular circumstances this code is a no-op and probably not what was intended. <!-- tooltip end --> <p> <small>New in 14</small> |