From dcaa2220671a30f541909b4008dfea8cedba2b0d Mon Sep 17 00:00:00 2001
From: Aleksandra Zolushkina Example: Ensuring that every class has a dedicated logger is an important step in providing a unified logging
+ implementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection. For example:
-Use the table below to specify logger class names.
-Classes which do not declare a field with the type of one of the classes specified, will be reported by this inspection.
+ Use the table in the Options section to specify logger class names.
+Classes which do not declare a field with the type of one of the specified classes will be reported by this inspection.
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/FieldCanBeMovedToSubclass.html b/plugins/InspectionGadgets/src/inspectionDescriptions/FieldCanBeMovedToSubclass.html
index 53e5dcdbfc1e..c03ac8306824 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/FieldCanBeMovedToSubclass.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/FieldCanBeMovedToSubclass.html
@@ -1,8 +1,8 @@
Since this inspection requires a global code analysis, it is available only from Code | Inspect Code or
+ Code | Analyze Code | Run Inspection by Name and it will not report in the editor.
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/ForeachStatement.html b/plugins/InspectionGadgets/src/inspectionDescriptions/ForeachStatement.html
index 772531f265c4..a0db7182b52f 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/ForeachStatement.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/ForeachStatement.html
@@ -1,20 +1,20 @@
Example: After the quick-fix is applied, the result looks like this: After the quick-fix is applied:
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/LoopWithImplicitTerminationCondition.html b/plugins/InspectionGadgets/src/inspectionDescriptions/LoopWithImplicitTerminationCondition.html
index ac5cd8cb6550..14d50b96fb50 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/LoopWithImplicitTerminationCondition.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/LoopWithImplicitTerminationCondition.html
@@ -1,15 +1,16 @@
Such an Removing the
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/MagicNumber.html b/plugins/InspectionGadgets/src/inspectionDescriptions/MagicNumber.html
index c279e26ee994..0975b4faba35 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/MagicNumber.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/MagicNumber.html
@@ -1,9 +1,9 @@
Using magic numbers can lead to unclear code, as well as errors if a magic
+number is changed in one location but remains unchanged not another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 0L, 1L, 2L,
+ 0.0, 1.0, 0.0F and 1.0F are not reported by this inspection. Example: A quick-fix is suggested to introduce a new constant: A quick-fix introduces a new constant:
- Use the first checkbox below to disable this inspection within
- Use the second checkbox below to ignore magic numbers in annotations.
-
- Use the third checkbox below to ignore magic numbers used as initial capacity when constructing
-
+ Configure the inspection: Such classes may cause confusion by breaking a common naming convention and
+ often indicate that the Example:
Quick-fix to rename the class is suggested only in the editor.. A quick-fix that renames such classes is available only in the editor. Such calls may result in subtle bugs, as the object is not guaranteed to be initialized before the method call occurs. Example: This inspection shares its functionality with: Only one inspection should be enabled at the same time to prevent duplicate warnings. Since JDK 1.5, it is recommended that you use Example: After the quick-fix is applied, the result looks like this: After the quick-fix is applied:
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/PreviewFeature.html b/plugins/InspectionGadgets/src/inspectionDescriptions/PreviewFeature.html
index 5c1973e09b2f..c6a73d5aafe6 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/PreviewFeature.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/PreviewFeature.html
@@ -1,16 +1,16 @@
A preview feature is a new feature of the Java language, Java Virtual Machine, or Java SE API that is fully specified, fully implemented,
- and yet impermanent. The notion of a preview feature is defined in JEP 12.
+ and is yet impermanent. The notion of a preview feature is defined in JEP 12.
- If a code depends on a preview feature it might stop compiling in the future JDK versions if the feature get no positive feedback and,
- hence, it either gets removed or changed.
+ If a piece of code depends on a preview feature, it might stop compiling in future JDK versions in case the feature gets no positive
+ feedback and gets removed or changed.
It's enabled only if the language level of the current project is a preview one. The inspection is enabled only if the language level of the current project is Preview. New in 2021.1 Even though they are often used to store collections of constant values, these fields nonetheless represent a security
+ hazard, as their contents may be modified even if the field is declared as Example:
- Use the table below to specify methods returning unmodifiable collections.
- Inspection reports inheritors of Serializable, which 'serialVersionUID' differs from default generated one. Reports inheritors of Serializable whose This can happen when custom scheme for 'serialVersionUID' used or when something in class really changed since previous
- 'serialVersionUID' change which can lead to problems during deserialization. This can happen when you use a custom scheme for
+Since this inspection requires a global code analysis, it is available only from Code | Inspect Code or
+ Code | Analyze Code | Run Inspection by Name and will not report in the editor.
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/SynchronizeOnValueBasedClass.html b/plugins/InspectionGadgets/src/inspectionDescriptions/SynchronizeOnValueBasedClass.html
index a5843e5a5af0..32c864c4b025 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/SynchronizeOnValueBasedClass.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/SynchronizeOnValueBasedClass.html
@@ -1,14 +1,16 @@
- For example, java.lang.Double is annotated with Since 2021.1 New in 2021.1 For example: Such test cases usually indicate unfinished code
+ or could be a refactoring leftover that should be removed. Example:
-Use the checkbox below to specify that test cases which have super classes with
-test methods should be ignored by this inspection.
-
+ Use the Ignore test cases which have superclasses with test methods option to ignore test cases which have super classes
+ with test methods.
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/ThrowFromFinallyBlock.html b/plugins/InspectionGadgets/src/inspectionDescriptions/ThrowFromFinallyBlock.html
index 0081b921cb73..84fe692698f2 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/ThrowFromFinallyBlock.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/ThrowFromFinallyBlock.html
@@ -1,8 +1,9 @@
While occasionally intended, such
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/UseOfConcreteClass.html b/plugins/InspectionGadgets/src/inspectionDescriptions/UseOfConcreteClass.html
index f8edbc72e992..6d552983169f 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/UseOfConcreteClass.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/UseOfConcreteClass.html
@@ -1,7 +1,7 @@
Declarations whose classes come from system or third-party libraries will not be reported by this inspection.
Casts, instanceofs, and local variables are not reported in
- Use the first checkbox below to ignore casts to abstract classes.
- Use the subsequent checkboxes to control contexts where the problem is reported.boolean expressions used twice that can be factorized, in order to reduce redundancy and improve the readability.
+Reports any boolean expressions used twice that can be factorized in order to reduce redundancy and improve readability of your code.
+
a && b || a && c
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutLogger.html b/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutLogger.html
index 29dfed20d72b..9c010eedce09 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutLogger.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/ClassWithoutLogger.html
@@ -1,8 +1,8 @@
-Reports classes which do not have a logger declared.
-Ensuring that every class has a dedicated logger is an important step in providing a unified logging
-implementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection.
+Reports classes which do not have a declared logger.
+
public class NoLoggerDeclared {
@@ -15,8 +15,8 @@ implementation for an application. Interfaces, enumerations, annotations, inner
for statements.
-Such for statements are not supported under Java 1.4 and older.
+Reports enhanced for statements.
+Such for statements are not supported by Java of version 1.4 and older.
+
-
for (int x: Arrays.asList(1, 2, 3)) {
System.out.println(x);
}
-
+
+
for (Iterator<Integer> iterator = Arrays.asList(1, 2, 3).iterator(); iterator.hasNext(); ) {
final int x = iterator.next();
System.out.println(x);
}
-while,
+do-while, and for
+loops that have the true constant as their
+only condition. At the same time, such loops can be still terminated by a containing
+if statement which can break out of the loop.
+if statement must be the first or the only statement
+in a while or for
+loop and the last or the only statement in a do-while loop.if statement and making its condition an explicit
+ loop condition simplifies the loop.
-
void checkFileSize(long bytes) {
@@ -12,7 +12,7 @@ number is changed in one code location but not another. The numbers 0, 1, 2, 3,
}
}
-
static final int MAX_SUPPORTED_FILE_SIZE = 1_048_576;
@@ -23,15 +23,14 @@ number is changed in one code location but not another. The numbers 0, 1, 2, 3,
}
hashCode() methods.
-Collection, Map,
- StringBuilder or StringBuffer objects.
-
+
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/NonExceptionNameEndsWithException.html b/plugins/InspectionGadgets/src/inspectionDescriptions/NonExceptionNameEndsWithException.html
index 59691f4795d0..b34520f1eeb4 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/NonExceptionNameEndsWithException.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/NonExceptionNameEndsWithException.html
@@ -1,11 +1,11 @@
-Reports non-hashCode() methods.Collection, Map,
+ StringBuilder or StringBuffer objects.exception classes whose names end with 'Exception'.
-Such classes may cause confusion by breaking a common naming convention, and
-are often the sign that developer forgot extends Exception clause.
+Reports non-exception classes whose names end with Exception.
+extends Exception clause is missing.
-public class NotStartedException {}
-
-Such calls may result in subtle bugs, as the object is not guaranteed to be initialized before the method call occurs.
+clone()readObject()readObjectNoData()
+
-This inspection shares functionality with:
+
+
abstract class Parent {
void someMethod() { }
}
@@ -25,13 +25,13 @@ Such calls may result in subtle bugs, as the object is not guaranteed to be init
@Override
void someMethod() { }
}
-
-
-Only one inspection should be enabled at the same time to prevent duplicate warnings.
+package.html files which are used for documenting packages.
-Since JDK 1.5 it is recommended to use package-info.java files instead, since such
-files can also contain package annotations. In this way, package-info.java becomes the
-sole repository for package level annotations and documentation.
+package-info.java files instead, as such
+files can also contain package annotations. This way, package-info.java becomes a
+ sole repository for package level annotations and documentation.package.html
+
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/PointlessIndexOfComparison.html b/plugins/InspectionGadgets/src/inspectionDescriptions/PointlessIndexOfComparison.html
index 30bcd44a1537..a53ed619dacb 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/PointlessIndexOfComparison.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/PointlessIndexOfComparison.html
@@ -1,8 +1,8 @@
-Reports pointless comparison with
-.indexOf() expression. An example of such an expression
-is comparing the result of .indexOf() with numbers less than -1.
+Reports an unnecessary comparison with
+
-
<html>
<body>
Documentation example.
</body>
</html>
-package-info.java
+
+package-info.java
+
/**
* Documentation example.
*/
package com.sample;
-.indexOf() expression. An example of such an expression
+is comparing the result of .indexOf() with numbers smaller than -1.
@PreviewFeature.
+Reports usages of the Preview Feature API: a set of elements that are annotated with @PreviewFeature.
public static Collection fields. Often used
-to store collections of constant values, these fields nonetheless represent a security
-hazard, as their contents may be modified, even if the field is declared as final.
+Reports modifiable public static Collection fields.
+final.
-
public static final List<String> EVENTS = new ArrayList<>();
@@ -10,7 +10,7 @@ hazard, as their contents may be modified, even if the field is declared as public static Collection fields initialized with these methods will not be reported.
+ Use the table in the Options section to specify methods returning unmodifiable collections.
+ public static collection fields initialized with these methods will not be reported.
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/SerializableCanHaveDefaultSerialUID.html b/plugins/InspectionGadgets/src/inspectionDescriptions/SerializableCanHaveDefaultSerialUID.html
index be5f6a287599..fb1cd6764189 100644
--- a/plugins/InspectionGadgets/src/inspectionDescriptions/SerializableCanHaveDefaultSerialUID.html
+++ b/plugins/InspectionGadgets/src/inspectionDescriptions/SerializableCanHaveDefaultSerialUID.html
@@ -1,8 +1,8 @@
serialVersionUID differs from the default generated ones.serialVersionUID or when something in the class changed since the previous
+ modification of serialVersionUID, which can lead to problems during deserialization.jdk.internal.ValueBased, so the following code will produce a compile-time warning
+ For example, java.lang.Double is annotated with jdk.internal.ValueBased, so the following code will
+ produce a compile-time warning:
+
+
Double d = 20.0;
synchronized (d) { ... } // javac warning
-abstract test cases which do not
-contain any test methods. Such test cases usually indicate unfinished code,
-or could be a refactoring leftover that should be removed.
-abstract test cases without any test methods.
+
-
public class CrucialTest {
@Before
@@ -13,10 +13,8 @@ or could be a refactoring leftover that should be removed.
}
throw statements inside of finally
-blocks. While occasionally intended, such throw statements may mask exceptions thrown from try-catch and thus
-tremendously complicate debugging.
+Reports throw statements inside finally
+blocks.
+throw statements may conceal exceptions thrown from try-catch and thus
+ tremendously complicate the debugging process.equals() method implementations.
@@ -26,8 +26,7 @@ Also, casts are not reported in clone() method implementations.
Use the subsequent options to control contexts where the problem is reported.
\ No newline at end of file diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/UseOfObsoleteDateTimeApiInspection.html b/plugins/InspectionGadgets/src/inspectionDescriptions/UseOfObsoleteDateTimeApiInspection.html index 65b4f7b895b1..9770e68a46cc 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/UseOfObsoleteDateTimeApiInspection.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/UseOfObsoleteDateTimeApiInspection.html @@ -1,9 +1,8 @@ -Reports any uses of java.util.Date, java.util.Calendar, java.util.GregorianCalendar, java.util.TimeZone, -and java.util.SimpleTimeZone. -While still supported, these classes were made obsolete by the JDK8 Date-Time API, and should probably -not be used in new development. +Reports usages ofjava.util.Date, java.util.Calendar, java.util.GregorianCalendar, java.util.TimeZone,
+and java.util.SimpleTimeZone.
+While still supported, these classes have been obsolete since JDK8 Date-Time API and should not be used in new development.