to break lines"
+ },
+ "fullDescription": {
+ "text": "Reports blank lines in Javadoc comments. Blank lines in Javadoc may signal an intention split the text to different paragraphs. However, the Javadoc tool and IntelliJ IDEA will ignore them when rendering documentation comments. The quick-fix suggests to replace the blank line with a paragraph tag (). Example: 'class Main {\n /**\n * Doesn't do anything.\n *\n * Does absolutely nothing\n */\n void foo() {}\n }' After the quick-fix is applied: 'class Main {\n /**\n * Doesn't do anything.\n *
\n * Does absolutely nothing\n */\n void foo() {}\n }' New in 2022.1",
+ "markdown": "Reports blank lines in Javadoc comments.\n\n\nBlank lines in Javadoc may signal an intention split the text to different paragraphs. However, the Javadoc tool and IntelliJ IDEA will\nignore them when rendering documentation comments.\n\n\nThe quick-fix suggests to replace the blank line with a paragraph tag (\\
).\n\n**Example:**\n\n\n class Main {\n /**\n * Doesn't do anything.\n *\n * Does absolutely nothing\n */\n void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n /**\n * Doesn't do anything.\n *
\n * Does absolutely nothing\n */\n void foo() {}\n }\n\nNew in 2022.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavadocBlankLines",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 78,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UtilityClassWithPublicConstructor",
+ "shortDescription": {
+ "text": "Utility class with 'public' constructor"
+ },
+ "fullDescription": {
+ "text": "Reports utility classes with 'public' constructors. Utility classes have all fields and methods declared as 'static'. Creating a 'public' constructor in such classes is confusing and may cause accidental class instantiation. Example: 'public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }'",
+ "markdown": "Reports utility classes with `public` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating a `public`\nconstructor in such classes is confusing and may cause accidental class instantiation.\n\n**Example:**\n\n\n public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UtilityClassWithPublicConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TypeParameterExtendsFinalClass",
+ "shortDescription": {
+ "text": "Type parameter extends 'final' class"
+ },
+ "fullDescription": {
+ "text": "Reports type parameters declared to extend a 'final' class. Suggests replacing the type parameter with the type of the specified 'final' class since 'final' classes cannot be extended. Example: 'void foo() {\n List extends Integer> list; // Warning: the Integer class is a final class\n }' After the quick-fix is applied: 'void foo() {\n List list;\n }' This inspection depends on the Java feature 'Generics' which is available since Java 5.",
+ "markdown": "Reports type parameters declared to extend a `final` class.\n\nSuggests replacing the type parameter with the type of the specified `final` class since\n`final` classes cannot be extended.\n\n**Example:**\n\n\n void foo() {\n List extends Integer> list; // Warning: the Integer class is a final class\n }\n\nAfter the quick-fix is applied:\n\n\n void foo() {\n List list;\n }\n\nThis inspection depends on the Java feature 'Generics' which is available since Java 5."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TypeParameterExtendsFinalClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 149,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TrivialIf",
+ "shortDescription": {
+ "text": "Redundant 'if' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'if' statements that can be simplified to a single assignment, 'return', or 'assert' statement. Example: 'if (foo()) {\n return true;\n } else {\n return false;\n }' After the quick-fix is applied: 'return foo();' Configure the inspection: Use the Ignore chained 'if' statements option if you want to hide a warning for chained 'if' statements. For example, in the following code the warning will be hidden, but the quick-fix will still be available: 'if (condition1) return true;\n if (condition2) return false;\n return true;' Note that replacing 'if (isTrue()) assert false;' with 'assert isTrue();' may change the program semantics when asserts are disabled if condition has side effects. Use the Ignore 'if' statements with trivial 'assert' option if you want to hide a warning for 'if' statements containing only 'assert' statement in their bodies.",
+ "markdown": "Reports `if` statements that can be simplified to a single assignment, `return`, or `assert` statement.\n\nExample:\n\n\n if (foo()) {\n return true;\n } else {\n return false;\n }\n\nAfter the quick-fix is applied:\n\n\n return foo();\n\nConfigure the inspection:\n\nUse the **Ignore chained 'if' statements** option if you want to hide a warning for chained `if` statements.\n\nFor example, in the following code the warning will be hidden, but the quick-fix will still be available:\n\n\n if (condition1) return true;\n if (condition2) return false;\n return true;\n\nNote that replacing `if (isTrue()) assert false;` with `assert isTrue();` may change the program semantics\nwhen asserts are disabled if condition has side effects.\nUse the **Ignore 'if' statements with trivial 'assert'** option if you want to hide a warning for `if` statements\ncontaining only `assert` statement in their bodies."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantIfStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstanceGuardedByStatic",
+ "shortDescription": {
+ "text": "Instance member guarded by static field"
+ },
+ "fullDescription": {
+ "text": "Reports '@GuardedBy' annotations on instance fields or methods in which the guard is a 'static' field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance. Example: 'private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'",
+ "markdown": "Reports `@GuardedBy` annotations on instance fields or methods in which the guard is a `static` field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance.\n\nExample:\n\n\n private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstanceGuardedByStatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Concurrency annotation issues",
+ "index": 101,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BooleanMethodIsAlwaysInverted",
+ "shortDescription": {
+ "text": "Boolean method is always inverted"
+ },
+ "fullDescription": {
+ "text": "Reports methods with a 'boolean' return type that are always negated when called. A quick-fix is provided to invert and optionally rename the method. For performance reasons, not all problematic methods may be highlighted in the editor. Example: 'class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }' After the quick-fix is applied: 'class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }'",
+ "markdown": "Reports methods with a `boolean` return type that are always negated when called.\n\nA quick-fix is provided to invert and optionally rename the method.\nFor performance reasons, not all problematic methods may be highlighted in the editor.\n\nExample:\n\n\n class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }\n\nAfter the quick-fix is applied:\n\n\n class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BooleanMethodIsAlwaysInverted",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Data flow",
+ "index": 65,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AutoCloseableResource",
+ "shortDescription": {
+ "text": "AutoCloseable used without 'try'-with-resources"
+ },
+ "fullDescription": {
+ "text": "Reports 'AutoCloseable' instances which are not used in a try-with-resources statement, also known as Automatic Resource Management. This means that the \"open resource before/in 'try', close in 'finally'\" style that had been used before try-with-resources became available, is also reported. This inspection is meant to replace all opened but not safely closed inspections when developing in Java 7 and higher. Example: 'private static void foo() throws IOException {\n InputStream profile = Thread.currentThread().getContextClassLoader().getResourceAsStream(\"/someFile\");\n System.out.println(profile.read());\n }' Use the following options to configure the inspection: List subclasses of 'AutoCloseable' that do not need to be closed and should be ignored by this inspection. Note: The inspection will still report streams returned from the 'java.nio.file.Files' methods 'lines()', 'walk()', 'list()' and 'find()', even when 'java.util.stream.Stream' is listed to be ignored. These streams contain an associated I/O resource that needs to be closed. List methods returning 'AutoCloseable' that should be ignored when called. Whether to ignore an 'AutoCloseable' if it is the result of a method call. When this option is enabled, the results of factory methods will also be ignored. Whether the inspection should report if an 'AutoCloseable' instance is passed as a method call argument. If this option is enabled, the inspection assumes the resource is closed in the called method. Method calls inside a 'finally' block with 'close' in the name and an 'AutoCloseable' argument will not be ignored. Whether to ignore method references to constructors of resource classes. Whether to ignore methods that return a resource and whose name starts with 'get'. This can reduce false positives because most of the getters do not transfer the ownership of the resource, and their call sites are not responsible for closing the resource. This inspection depends on the Java feature 'Try-with-resources' which is available since Java 7.",
+ "markdown": "Reports `AutoCloseable` instances which are not used in a try-with-resources statement, also known as *Automatic Resource Management* .\n\n\nThis means that the \"open resource before/in `try`, close in `finally`\" style that had been used before\ntry-with-resources became available, is also reported.\nThis inspection is meant to replace all *opened but not safely closed* inspections when developing in Java 7 and higher.\n\n**Example:**\n\n\n private static void foo() throws IOException {\n InputStream profile = Thread.currentThread().getContextClassLoader().getResourceAsStream(\"/someFile\");\n System.out.println(profile.read());\n }\n\n\nUse the following options to configure the inspection:\n\n* List subclasses of `AutoCloseable` that do not need to be closed and should be ignored by this inspection. \n **Note** : The inspection will still report streams returned from the `java.nio.file.Files` methods `lines()`, `walk()`, `list()` and `find()`, even when `java.util.stream.Stream` is listed to be ignored. These streams contain an associated I/O resource that needs to be closed.\n* List methods returning `AutoCloseable` that should be ignored when called.\n* Whether to ignore an `AutoCloseable` if it is the result of a method call. When this option is enabled, the results of factory methods will also be ignored.\n* Whether the inspection should report if an `AutoCloseable` instance is passed as a method call argument. If this option is enabled, the inspection assumes the resource is closed in the called method. Method calls inside a `finally` block with 'close' in the name and an `AutoCloseable` argument will not be ignored.\n* Whether to ignore method references to constructors of resource classes.\n* Whether to ignore methods that return a resource and whose name starts with 'get'. This can reduce false positives because most of the getters do not transfer the ownership of the resource, and their call sites are not responsible for closing the resource.\n\nThis inspection depends on the Java feature 'Try-with-resources' which is available since Java 7."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "resource",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 134,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SingleStatementInBlock",
+ "shortDescription": {
+ "text": "Code block contains single statement"
+ },
+ "fullDescription": {
+ "text": "Reports control flow statements with a single statement in their code block and suggests removing the braces from the control flow statement body. Example: 'if (x > 0) {\n System.out.println(\"x is positive\");\n }' After the quick-fix is applied: 'if (x > 0) System.out.println(\"x is positive\");'",
+ "markdown": "Reports control flow statements with a single statement in their code block and suggests removing the braces from the control flow statement body.\n\nExample:\n\n\n if (x > 0) {\n System.out.println(\"x is positive\");\n }\n\nAfter the quick-fix is applied:\n\n\n if (x > 0) System.out.println(\"x is positive\");\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "SingleStatementInBlock",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TestCaseWithConstructor",
+ "shortDescription": {
+ "text": "TestCase with non-trivial constructors"
+ },
+ "fullDescription": {
+ "text": "Reports test cases with initialization logic in their constructors. If a constructor fails, the '@After' annotated or 'tearDown()' method won't be called. This can leave the test environment partially initialized, which can adversely affect other tests. Instead, initialization of test cases should be done in a 'setUp()' or '@Before' annotated method. Bad example: 'public class ImportantTest {\n private File file;\n\n public ImportantTest() throws IOException {\n file = File.createTempFile(\"xyz\", \".tmp\");\n }\n\n // ... tests go here\n }'",
+ "markdown": "Reports test cases with initialization logic in their constructors. If a constructor fails, the `@After` annotated or `tearDown()` method won't be called. This can leave the test environment partially initialized, which can adversely affect other tests. Instead, initialization of test cases should be done in a `setUp()` or `@Before` annotated method.\n\nBad example:\n\n\n public class ImportantTest {\n private File file;\n\n public ImportantTest() throws IOException {\n file = File.createTempFile(\"xyz\", \".tmp\");\n }\n\n // ... tests go here\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JUnitTestCaseWithNonTrivialConstructors",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 122,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReadObjectAndWriteObjectPrivate",
+ "shortDescription": {
+ "text": "'readObject()' or 'writeObject()' not declared 'private'"
+ },
+ "fullDescription": {
+ "text": "Reports 'Serializable' classes where the 'readObject' or 'writeObject' methods are not declared private. There is no reason these methods should ever have a higher visibility than 'private'. A quick-fix is suggested to make the corresponding method 'private'. Example: 'public class Test implements Serializable {\n public void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }' After the quick-fix is applied: 'public class Test implements Serializable {\n private void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }'",
+ "markdown": "Reports `Serializable` classes where the `readObject` or `writeObject` methods are not declared private. There is no reason these methods should ever have a higher visibility than `private`.\n\n\nA quick-fix is suggested to make the corresponding method `private`.\n\n**Example:**\n\n\n public class Test implements Serializable {\n public void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Test implements Serializable {\n private void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonPrivateSerializationMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 21,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantFileCreation",
+ "shortDescription": {
+ "text": "Redundant 'File' instance creation"
+ },
+ "fullDescription": {
+ "text": "Reports redundant 'File' creation in one of the following constructors when only 'String' path can be used: 'FileInputStream', 'FileOutputStream', 'FileReader', 'FileWriter', 'PrintStream', 'PrintWriter', 'Formatter'. Example: 'InputStream is = new FileInputStream(new File(\"in.txt\"));' After quick-fix is applied: 'InputStream is = new FileInputStream(\"in.txt\");' New in 2020.3",
+ "markdown": "Reports redundant `File` creation in one of the following constructors when only `String` path can be used: `FileInputStream`, `FileOutputStream`, `FileReader`, `FileWriter`, `PrintStream`, `PrintWriter`, `Formatter`.\n\nExample:\n\n\n InputStream is = new FileInputStream(new File(\"in.txt\"));\n\nAfter quick-fix is applied:\n\n\n InputStream is = new FileInputStream(\"in.txt\");\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantFileCreation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PointlessBooleanExpression",
+ "shortDescription": {
+ "text": "Pointless boolean expression"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary or overly complicated boolean expressions. Such expressions include '&&'-ing with 'true', '||'-ing with 'false', equality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified. Example: 'boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;' After the quick-fix is applied: 'boolean a = true;\n boolean b = x;\n boolean c = !x;' Configure the inspection: Use the Ignore named constants in determining pointless expressions option to ignore named constants when determining if an expression is pointless.",
+ "markdown": "Reports unnecessary or overly complicated boolean expressions.\n\nSuch expressions include `&&`-ing with `true`,\n`||`-ing with `false`,\nequality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified.\n\nExample:\n\n\n boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;\n\nAfter the quick-fix is applied:\n\n\n boolean a = true;\n boolean b = x;\n boolean c = !x;\n\n\nConfigure the inspection:\nUse the **Ignore named constants in determining pointless expressions** option to ignore named constants when determining if an expression is pointless."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PointlessBooleanExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ListenerMayUseAdapter",
+ "shortDescription": {
+ "text": "Class may extend adapter instead of implementing listener"
+ },
+ "fullDescription": {
+ "text": "Reports classes implementing listeners instead of extending corresponding adapters. A quick-fix is available to remove any redundant empty methods left after replacing a listener implementation with an adapter extension. Use the Only warn when empty implementing methods are found option to configure the inspection to warn even if no empty methods are found.",
+ "markdown": "Reports classes implementing listeners instead of extending corresponding adapters.\n\nA quick-fix is available to\nremove any redundant empty methods left after replacing a listener implementation with an adapter extension.\n\n\nUse the **Only warn when empty implementing methods are found** option to configure the inspection to warn even if no empty methods are found."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ListenerMayUseAdapter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RefusedBequest",
+ "shortDescription": {
+ "text": "Method does not call super method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that override a super method without calling it. This is also known as a refused bequest. Such methods may represent a failure of abstraction and cause hard-to-trace bugs. The inspection doesn't report methods overridden from 'java.lang.Object', except for 'clone()'. The 'clone()' method should by convention call its super method, which will return an object of the correct type. Example 1: 'class A {\n @Override\n public Object clone() {\n // does not call 'super.clone()'\n return new A();\n }\n }' Example 2: 'interface I {\n default void foo() {}\n }\n\n class A implements I {\n // warning on method when\n // 'Ignore 'default' super methods' is disabled\n @Override\n public void foo(){}\n }' Configure the inspection: Use the Only report when super method is annotated by option to ignore super methods marked with the annotations from the provided list. You can manually add annotations to the list. Use the Ignore empty super methods option to ignore super methods that are either empty or only throw an exception. Use the Ignore 'default' super methods option to ignore 'default' super methods from interfaces.",
+ "markdown": "Reports methods that override a super method without calling it. This is also known as a *refused bequest* . Such methods may represent a failure of abstraction and cause hard-to-trace bugs.\n\n\nThe inspection doesn't report methods overridden from `java.lang.Object`, except for `clone()`.\nThe `clone()` method should by convention call its super method,\nwhich will return an object of the correct type.\n\n**Example 1:**\n\n\n class A {\n @Override\n public Object clone() {\n // does not call 'super.clone()'\n return new A();\n }\n }\n\n**Example 2:**\n\n\n interface I {\n default void foo() {}\n }\n\n class A implements I {\n // warning on method when\n // 'Ignore 'default' super methods' is disabled\n @Override\n public void foo(){}\n }\n\nConfigure the inspection:\n\n* Use the **Only report when super method is annotated by** option to ignore super methods marked with the annotations from the provided list. You can manually add annotations to the list.\n* Use the **Ignore empty super methods** option to ignore super methods that are either empty or only throw an exception.\n* Use the **Ignore 'default' super methods** option to ignore `default` super methods from interfaces."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodDoesntCallSuperMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 149,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryReturn",
+ "shortDescription": {
+ "text": "Unnecessary 'return' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'return' statements at the end of constructors and methods returning 'void'. These statements are redundant and may be safely removed. This inspection does not report in JSP files. Example: 'void message() {\n System.out.println(\"Hello World\");\n return;\n }' After the quick-fix is applied: 'void message() {\n System.out.println(\"Hello World\");\n }' Use the Ignore in then branch of 'if' statement with 'else' branch option to ignore 'return' statements in the then branch of 'if' statements which also have an 'else' branch.",
+ "markdown": "Reports `return` statements at the end of constructors and methods returning `void`. These statements are redundant and may be safely removed.\n\nThis inspection does not report in JSP files.\n\nExample:\n\n\n void message() {\n System.out.println(\"Hello World\");\n return;\n }\n\nAfter the quick-fix is applied:\n\n\n void message() {\n System.out.println(\"Hello World\");\n }\n\n\nUse the **Ignore in then branch of 'if' statement with 'else' branch** option to ignore `return` statements in the then branch of `if` statements\nwhich also have an `else` branch."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryReturnStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PublicInnerClass",
+ "shortDescription": {
+ "text": "'public' nested class"
+ },
+ "fullDescription": {
+ "text": "Reports 'public' nested classes. Example: 'public class Outer {\n public static class Nested {} // warning\n public class Inner {} // warning\n public enum Mode {} // warning depends on the setting\n public interface I {} // warning depends on the setting\n }' Configure the inspection: Use the Ignore 'public' inner enums option to ignore 'public' inner enums. Use the Ignore 'public' inner interfaces option to ignore 'public' inner interfaces.",
+ "markdown": "Reports `public` nested classes.\n\n**Example:**\n\n\n public class Outer {\n public static class Nested {} // warning\n public class Inner {} // warning\n public enum Mode {} // warning depends on the setting\n public interface I {} // warning depends on the setting\n }\n\nConfigure the inspection:\n\n* Use the **Ignore 'public' inner enums** option to ignore `public` inner enums.\n* Use the **Ignore 'public' inner interfaces** option to ignore `public` inner interfaces."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PublicInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Encapsulation",
+ "index": 126,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonFinalGuard",
+ "shortDescription": {
+ "text": "Non-final '@GuardedBy' field"
+ },
+ "fullDescription": {
+ "text": "Reports '@GuardedBy' annotations in which the guarding field is not 'final'. Guarding on a non-final field may result in unexpected race conditions, as locks will be held on the value of the field (which may change), rather than the field itself. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock(); //not final guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'",
+ "markdown": "Reports `@GuardedBy` annotations in which the guarding field is not `final`.\n\nGuarding on a non-final field may result in unexpected race conditions, as locks will\nbe held on the value of the field (which may change), rather than the field itself.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock(); //not final guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonFinalGuard",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Concurrency annotation issues",
+ "index": 101,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CollectionAddedToSelf",
+ "shortDescription": {
+ "text": "Collection added to itself"
+ },
+ "fullDescription": {
+ "text": "Reports cases where the argument of a method call on a 'java.util.Collection' or 'java.util.Map' is the collection or map itself. Such situations may occur as a result of copy-paste in code with raw types. Example: 'ArrayList list = new ArrayList<>();\n list.add(list); // warning here\n return list.hashCode(); // throws StackOverflowError'",
+ "markdown": "Reports cases where the argument of a method call on a `java.util.Collection` or `java.util.Map` is the collection or map itself. Such situations may occur as a result of copy-paste in code with raw types.\n\n**Example:**\n\n\n ArrayList list = new ArrayList<>();\n list.add(list); // warning here\n return list.hashCode(); // throws StackOverflowError\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CollectionAddedToSelf",
+ "cweIds": [
+ 664,
+ 688
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarySuperQualifier",
+ "shortDescription": {
+ "text": "Unnecessary 'super' qualifier"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary 'super' qualifiers in method calls and field references. A 'super' qualifier is unnecessary when the field or method of the superclass is not hidden/overridden in the calling class. Example: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }' After the quick-fix is applied: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n foo();\n }\n }' Use the inspection settings to ignore qualifiers that help to distinguish superclass members access from the identically named members of the outer class. See also the following inspections: Java | Visibility | Access to inherited field looks like access to element from surrounding code Java | Visibility | Call to inherited method looks like call to local method",
+ "markdown": "Reports unnecessary `super` qualifiers in method calls and field references.\n\n\nA `super` qualifier is unnecessary\nwhen the field or method of the superclass is not hidden/overridden in the calling class.\n\n**Example:**\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n foo();\n }\n }\n\n\nUse the inspection settings to ignore qualifiers that help to distinguish superclass members access\nfrom the identically named members of the outer class.\n\n\nSee also the following inspections:\n\n* *Java \\| Visibility \\| Access to inherited field looks like access to element from surrounding code*\n* *Java \\| Visibility \\| Call to inherited method looks like call to local method*"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessarySuperQualifier",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsOnSuspiciousObject",
+ "shortDescription": {
+ "text": "'equals()' called on classes which don't override it"
+ },
+ "fullDescription": {
+ "text": "Reports 'equals()' calls on 'StringBuilder', 'StringBuffer' and instances of 'java.util.concurrent.atomic' package. The 'equals()' method is not overridden in these classes, so it may return 'false' even when the contents of the two objects are the same. If the reference equality is intended, it's better to use '==' to avoid confusion. A quick-fix for 'StringBuilder', 'StringBuffer', 'AtomicBoolean', 'AtomicInteger', 'AtomicBoolean' and 'AtomicLong' is available to transform into a comparison of contents. The quick-fix may change the semantics when one of the instances is null. Example: 'public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.equals(sb2); // Suspicious\n }' After the quick-fix is applied: 'public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.toString().equals(sb2.toString());\n }' New in 2017.2",
+ "markdown": "Reports `equals()` calls on `StringBuilder`, `StringBuffer` and instances of `java.util.concurrent.atomic` package.\n\nThe `equals()` method is not overridden in these classes, so it may return `false` even when the contents of the\ntwo objects are the same.\nIf the reference equality is intended, it's better to use `==` to avoid confusion.\nA quick-fix for `StringBuilder`, `StringBuffer`, `AtomicBoolean`, `AtomicInteger`, `AtomicBoolean` and `AtomicLong` is available to transform into a comparison of contents. The quick-fix may change the semantics when one of the instances is null.\n\nExample:\n\n\n public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.equals(sb2); // Suspicious\n }\n\nAfter the quick-fix is applied:\n\n\n public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.toString().equals(sb2.toString());\n }\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EqualsOnSuspiciousObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfPropertiesAsHashtable",
+ "shortDescription": {
+ "text": "Use of 'Properties' object as a 'Hashtable'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to the following methods on 'java.util.Properties' objects: 'put()' 'putIfAbsent()' 'putAll()' 'get()' For historical reasons, 'java.util.Properties' inherits from 'java.util.Hashtable', but using these methods is discouraged to prevent pollution of properties with values of types other than 'String'. Calls to 'java.util.Properties.putAll()' won't get reported when both the key and the value parameters in the map are of the 'String' type. Such a call is safe and no better alternative exists. Example: 'Object f(Properties props) {\n props.put(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.get(\"Hello\");\n }' After the quick-fix is applied: 'Object f(Properties props) {\n props.setProperty(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.getProperty(\"hello\");\n }'",
+ "markdown": "Reports calls to the following methods on `java.util.Properties` objects:\n\n* `put()`\n* `putIfAbsent()`\n* `putAll()`\n* `get()`\n\n\nFor historical reasons, `java.util.Properties` inherits from `java.util.Hashtable`,\nbut using these methods is discouraged to prevent pollution of properties with values of types other than `String`.\n\n\nCalls to `java.util.Properties.putAll()` won't get reported when\nboth the key and the value parameters in the map are of the `String` type.\nSuch a call is safe and no better alternative exists.\n\n**Example:**\n\n\n Object f(Properties props) {\n props.put(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.get(\"Hello\");\n }\n\nAfter the quick-fix is applied:\n\n\n Object f(Properties props) {\n props.setProperty(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.getProperty(\"hello\");\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfPropertiesAsHashtable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodCoupling",
+ "shortDescription": {
+ "text": "Overly coupled method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that reference too many other classes. Methods with too high coupling can be very fragile and should be probably split into smaller methods. Each referenced class is counted only once no matter how many times it is referenced. Configure the inspection: Use the Method coupling limit field to specify the maximum allowed coupling for a method. Use the Include couplings to java system classes option to count references to classes from 'java'or 'javax' packages. Use the Include couplings to library classes option to count references to third-party library classes.",
+ "markdown": "Reports methods that reference too many other classes. Methods with too high coupling can be very fragile and should be probably split into smaller methods.\n\nEach referenced class is counted only once no matter how many times it is referenced.\n\nConfigure the inspection:\n\n* Use the **Method coupling limit** field to specify the maximum allowed coupling for a method.\n* Use the **Include couplings to java system classes** option to count references to classes from `java`or `javax` packages.\n* Use the **Include couplings to library classes** option to count references to third-party library classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyCoupledMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 133,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AccessToStaticFieldLockedOnInstance",
+ "shortDescription": {
+ "text": "Access to 'static' field locked on instance data"
+ },
+ "fullDescription": {
+ "text": "Reports access to non-constant static fields that are locked on either 'this' or an instance field of 'this'. Locking a static field on instance data does not prevent the field from being modified by other instances, and thus may result in unexpected race conditions. Example: 'static String test;\n public void foo() {\n synchronized (this) {\n System.out.println(test); // warning\n }\n }' There is a quick-fix that allows ignoring static fields of specific types. You can manage those ignored types in the inspection options. Use the inspection options to specify which classes used for static fields should be ignored.",
+ "markdown": "Reports access to non-constant static fields that are locked on either `this` or an instance field of `this`.\n\n\nLocking a static field on instance data does not prevent the field from being\nmodified by other instances, and thus may result in unexpected race conditions.\n\n**Example:**\n\n\n static String test;\n public void foo() {\n synchronized (this) {\n System.out.println(test); // warning\n }\n }\n\n\nThere is a quick-fix that allows ignoring static fields of specific types.\nYou can manage those ignored types in the inspection options.\n\n\nUse the inspection options to specify which classes used for static fields should be ignored."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AccessToStaticFieldLockedOnInstance",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "VariableTypeCanBeExplicit",
+ "shortDescription": {
+ "text": "Variable type can be explicit"
+ },
+ "fullDescription": {
+ "text": "Reports local variables of the 'var' type that can be replaced with an explicit type. Example: 'var str = \"Hello\";' After the quick-fix is applied: 'String str = \"Hello\";' This inspection depends on the Java feature 'Local variable type inference' which is available since Java 10.",
+ "markdown": "Reports local variables of the `var` type that can be replaced with an explicit type.\n\n**Example:**\n\n\n var str = \"Hello\";\n\nAfter the quick-fix is applied:\n\n\n String str = \"Hello\";\n\nThis inspection depends on the Java feature 'Local variable type inference' which is available since Java 10."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "VariableTypeCanBeExplicit",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 10",
+ "index": 158,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java8ListSort",
+ "shortDescription": {
+ "text": "'Collections.sort()' can be replaced with 'List.sort()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls of 'Collections.sort(list, comparator)' which can be replaced with 'list.sort(comparator)'. 'Collections.sort' is just a wrapper, so it is better to use an instance method directly. This inspection depends on the Java feature 'Lambda methods in collections' which is available since Java 8.",
+ "markdown": "Reports calls of `Collections.sort(list, comparator)` which can be replaced with `list.sort(comparator)`.\n\n`Collections.sort` is just a wrapper, so it is better to use an instance method directly.\n\nThis inspection depends on the Java feature 'Lambda methods in collections' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java8ListSort",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 121,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ComparatorCombinators",
+ "shortDescription": {
+ "text": "'Comparator' combinator can be used"
+ },
+ "fullDescription": {
+ "text": "Reports 'Comparator' instances defined as lambda expressions that could be expressed using 'Comparator.comparing()' calls. Chained comparisons which can be replaced by 'Comparator.thenComparing()' expression are also reported. Example: 'myList.sort((person1, person2) -> person1.getName().compareTo(person2.getName()));\n\n myList2.sort((person1, person2) -> {\n int res = person1.first().compareTo(person2.first());\n if(res == 0) res = person1.second().compareTo(person2.second());\n if(res == 0) res = person1.third() - person2.third();\n return res;\n });' After the quick-fixes are applied: 'myList.sort(Comparator.comparing(Person::getName));\n\n myList2.sort(Comparator.comparing(Person::first)\n .thenComparing(Person::second)\n .thenComparingInt(Person::third));' This inspection depends on the Java feature 'Lambda expressions' which is available since Java 8.",
+ "markdown": "Reports `Comparator` instances defined as lambda expressions that could be expressed using `Comparator.comparing()` calls. Chained comparisons which can be replaced by `Comparator.thenComparing()` expression are also reported.\n\nExample:\n\n\n myList.sort((person1, person2) -> person1.getName().compareTo(person2.getName()));\n\n myList2.sort((person1, person2) -> {\n int res = person1.first().compareTo(person2.first());\n if(res == 0) res = person1.second().compareTo(person2.second());\n if(res == 0) res = person1.third() - person2.third();\n return res;\n });\n\nAfter the quick-fixes are applied:\n\n\n myList.sort(Comparator.comparing(Person::getName));\n\n myList2.sort(Comparator.comparing(Person::first)\n .thenComparing(Person::second)\n .thenComparingInt(Person::third));\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparatorCombinators",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 121,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsReplaceableByObjectsCall",
+ "shortDescription": {
+ "text": "'equals()' expression replaceable by 'Objects.equals()' expression"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that can be replaced with a call to 'java.util.Objects#equals'. Example: 'void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }' After the quick-fix is applied: 'void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }' Replacing expressions like 'a != null && a.equals(b)' with 'Objects.equals(a, b)' slightly changes the semantics. Use the Highlight expressions like 'a != null && a.equals(b)' option to enable or disable this behavior. This inspection only reports if the language level of the project or module is 7 or higher.",
+ "markdown": "Reports expressions that can be replaced with a call to `java.util.Objects#equals`.\n\n**Example:**\n\n\n void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }\n\nAfter the quick-fix is applied:\n\n\n void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }\n\n\nReplacing expressions like `a != null && a.equals(b)` with `Objects.equals(a, b)`\nslightly changes the semantics. Use the **Highlight expressions like 'a != null \\&\\& a.equals(b)'** option to enable or disable this behavior.\n\nThis inspection only reports if the language level of the project or module is 7 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "EqualsReplaceableByObjectsCall",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 7",
+ "index": 159,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbstractMethodCallInConstructor",
+ "shortDescription": {
+ "text": "Abstract method called during object construction"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'abstract' methods of the current class during object construction. A method is called during object construction if it is inside a: Constructor Non-static instance initializer Non-static field initializer 'clone()' method 'readObject()' method 'readObjectNoData()' method Such calls may result in subtle bugs, as object initialization may happen before the method call. Example: 'abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }' This inspection shares the functionality with the following inspections: Overridable method called during object construction Overridden method called during object construction Only one inspection should be enabled at once to prevent warning duplication.",
+ "markdown": "Reports calls to `abstract` methods of the current class during object construction.\n\nA method is called during object construction if it is inside a:\n\n* Constructor\n* Non-static instance initializer\n* Non-static field initializer\n* `clone()` method\n* `readObject()` method\n* `readObjectNoData()` method\n\nSuch calls may result in subtle bugs, as object initialization may happen before the method call.\n\n**Example:**\n\n\n abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }\n\nThis inspection shares the functionality with the following inspections:\n\n* Overridable method called during object construction\n* Overridden method called during object construction\n\nOnly one inspection should be enabled at once to prevent warning duplication."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbstractMethodCallInConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 33,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TailRecursion",
+ "shortDescription": {
+ "text": "Tail recursion"
+ },
+ "fullDescription": {
+ "text": "Reports tail recursion, that is, when a method calls itself as its last action before returning. Tail recursion can always be replaced by looping, which will be considerably faster. Some JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different performance characteristics on different virtual machines. Example: 'int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }' After the quick-fix is applied: 'int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }'",
+ "markdown": "Reports tail recursion, that is, when a method calls itself as its last action before returning.\n\n\nTail recursion can always be replaced by looping, which will be considerably faster.\nSome JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different\nperformance characteristics on different virtual machines.\n\nExample:\n\n\n int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "TailRecursion",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringEqualsEmptyString",
+ "shortDescription": {
+ "text": "'String.equals()' can be replaced with 'String.isEmpty()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'equals()' being called to compare a 'String' with an empty string. In this case, using '.isEmpty()' is better as it shows you exactly what you're checking. Example: 'void checkString(String s){\n if (\"\".equals(s)) throw new IllegalArgumentException();\n }' After the quick-fix is applied: 'void checkString(String s){\n if (s != null && s.isEmpty()) throw new IllegalArgumentException();\n }' '\"\".equals(str)' returns false when 'str' is null. For safety, this inspection's quick-fix inserts an explicit null-check when the 'equals()' argument is nullable. Use the option to make the inspection ignore such cases.",
+ "markdown": "Reports `equals()` being called to compare a `String` with an empty string. In this case, using `.isEmpty()` is better as it shows you exactly what you're checking.\n\n**Example:**\n\n\n void checkString(String s){\n if (\"\".equals(s)) throw new IllegalArgumentException();\n }\n\nAfter the quick-fix is applied:\n\n\n void checkString(String s){\n if (s != null && s.isEmpty()) throw new IllegalArgumentException();\n }\n\n\n`\"\".equals(str)` returns false when `str` is null. For safety, this inspection's quick-fix inserts an explicit\nnull-check when\nthe `equals()` argument is nullable. Use the option to make the inspection ignore such cases."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringEqualsEmptyString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PreviewFeature",
+ "shortDescription": {
+ "text": "Preview Feature warning"
+ },
+ "fullDescription": {
+ "text": "Reports usages of Preview Feature APIs, i.e. of a module, package, class, interface, method, constructor, field, or enum constant in the 'java.*' or 'javax.*' namespace annotated with '@PreviewFeature'. 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 is yet impermanent. The notion of a preview feature is defined in JEP 12. If some piece of code depends on a preview API, it may stop compiling in future JDK versions if the feature is changed or removed. The inspection only reports if the language level of the project or module is Preview. New in 2021.1",
+ "markdown": "Reports usages of Preview Feature APIs, i.e. of a module, package, class, interface, method, constructor, field, or enum constant in the `java.*` or `javax.*` namespace annotated with `@PreviewFeature`.\n\n\nA preview feature is a new feature of the Java language, Java Virtual Machine, or Java SE API that is fully specified, fully implemented,\nand is yet impermanent. The notion of a preview feature is defined in [JEP 12](https://openjdk.org/jeps/12).\n\n\nIf some piece of code depends on a preview API, it may stop compiling in future JDK versions if the feature is changed or removed.\n\nThe inspection only reports if the language level of the project or module is **Preview**.\n\nNew in 2021.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "preview",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Compiler issues",
+ "index": 160,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TooBroadThrows",
+ "shortDescription": {
+ "text": "Overly broad 'throws' clause"
+ },
+ "fullDescription": {
+ "text": "Reports 'throws' clauses with exceptions that are more generic than the exceptions that the method actually throws. Example: 'public void createFile() throws Exception { // warning: 'throws Exception' is too broad, masking exception 'IOException'\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }' After the quick-fix is applied: 'public void createFile() throws IOException {\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }' Configure the inspection: Use the Maximum number of hidden exceptions to warn field to ignore exceptions, that hide a larger number of other exceptions than specified. Use the Only warn on RuntimeException, Exception, Error or Throwable option to have this inspection warn only on the most generic exceptions. Use the Ignore exceptions declared on methods overriding a library method option to ignore overly broad 'throws' clauses in methods that override a library method. Use the Ignore exceptions which hide others but are themselves thrown option to ignore any exceptions that hide other exceptions but still may be thrown from the method body and thus are technically not overly broad.",
+ "markdown": "Reports `throws` clauses with exceptions that are more generic than the exceptions that the method actually throws.\n\n**Example:**\n\n\n public void createFile() throws Exception { // warning: 'throws Exception' is too broad, masking exception 'IOException'\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nAfter the quick-fix is applied:\n\n\n public void createFile() throws IOException {\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nConfigure the inspection:\n\n* Use the **Maximum number of hidden exceptions to warn** field to ignore exceptions, that hide a larger number of other exceptions than specified.\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions declared on methods overriding a library method** option to ignore overly broad `throws` clauses in methods that override a library method.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown from the method body and thus are technically not overly broad."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyBroadThrowsClause",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ImplicitSubclassInspection",
+ "shortDescription": {
+ "text": "Final declaration can't be overridden at runtime"
+ },
+ "fullDescription": {
+ "text": "Reports cases when your code prevents a class from being subclassed by some framework (for example, Spring or Hibernate) at runtime. Typical examples of necessary but impossible subclassing: 'final' classes marked with framework-specific annotations (for example, Spring '@Configuration') 'final', 'static' or 'private' methods marked with framework-specific annotations (for example, Spring '@Transactional') methods marked with framework-specific annotations inside 'final' classes The list of reported cases depends on the frameworks used.",
+ "markdown": "Reports cases when your code prevents a class from being subclassed by some framework (for example, Spring or Hibernate) at runtime.\n\nTypical examples of necessary but impossible subclassing:\n\n* `final` classes marked with framework-specific annotations (for example, Spring `@Configuration`)\n* `final`, `static` or `private` methods marked with framework-specific annotations (for example, Spring `@Transactional`)\n* methods marked with framework-specific annotations inside `final` classes\n\nThe list of reported cases depends on the frameworks used."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "ImplicitSubclassInspection",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 149,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectEqualsCanBeEquality",
+ "shortDescription": {
+ "text": "'equals()' call can be replaced with '=='"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'equals()' that can be replaced by '==' or '!=' expressions without a change in semantics. These calls can be replaced when they are used to compare 'final' classes that don't have their own 'equals()' implementation but use the default 'Object.equals()'. This replacement may result in better performance. There is a separate inspection for 'equals()' calls on 'enum' values: 'equals()' called on Enum value.",
+ "markdown": "Reports calls to `equals()` that can be replaced by `==` or `!=` expressions without a change in semantics.\n\nThese calls can be replaced when they are used to compare `final` classes that don't have their own `equals()` implementation but use the default `Object.equals()`.\nThis replacement may result in better performance.\n\nThere is a separate inspection for `equals()` calls on `enum` values: 'equals()' called on Enum value."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ObjectEqualsCanBeEquality",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JDBCPrepareStatementWithNonConstantString",
+ "shortDescription": {
+ "text": "Call to 'Connection.prepare*()' with non-constant string"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.sql.Connection.prepareStatement()', 'java.sql.Connection.prepareCall()', or any of their variants which take a dynamically-constructed string as the statement to prepare. Constructed SQL statements are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");' Use the inspection settings to consider any 'static' 'final' fields as constants. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";'",
+ "markdown": "Reports calls to `java.sql.Connection.prepareStatement()`, `java.sql.Connection.prepareCall()`, or any of their variants which take a dynamically-constructed string as the statement to prepare.\n\n\nConstructed SQL statements are a common source of\nsecurity breaches. By default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");\n\nUse the inspection settings to consider any `static` `final` fields as constants. Be careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JDBCPrepareStatementWithNonConstantString",
+ "cweIds": [
+ 89
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 38,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SystemProperties",
+ "shortDescription": {
+ "text": "Access of system properties"
+ },
+ "fullDescription": {
+ "text": "Reports code that accesses system properties using one of the following methods: 'System.getProperties()', 'System.setProperty()', 'System.setProperties()', 'System.clearProperties()' 'Integer.getInteger()' 'Boolean.getBoolean()' While accessing the system properties is not a security risk in itself, it is often found in malicious code. Code that accesses system properties should be closely examined in any security audit.",
+ "markdown": "Reports code that accesses system properties using one of the following methods:\n\n* `System.getProperties()`, `System.setProperty()`, `System.setProperties()`, `System.clearProperties()`\n* `Integer.getInteger()`\n* `Boolean.getBoolean()`\n\n\nWhile accessing the system properties is not a security risk in itself, it is often found in malicious code.\nCode that accesses system properties should be closely examined in any security audit."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AccessOfSystemProperties",
+ "cweIds": [
+ 250,
+ 668
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 38,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InvalidComparatorMethodReference",
+ "shortDescription": {
+ "text": "Invalid method reference used for 'Comparator'"
+ },
+ "fullDescription": {
+ "text": "Reports method references mapped to the 'Comparator' interface that don't fulfill its contract. Some method references, like 'Integer::max', can be mapped to the 'Comparator' interface. However, using them as 'Comparator' is meaningless and the result might be unpredictable. Example: 'ArrayList ints = foo();\n ints.sort(Math::min);' After the quick-fix is applied: 'ArrayList ints = foo();\n ints.sort(Comparator.reverseOrder());'",
+ "markdown": "Reports method references mapped to the `Comparator` interface that don't fulfill its contract.\n\n\nSome method references, like `Integer::max`, can be mapped to the `Comparator` interface.\nHowever, using them as `Comparator` is meaningless and the result might be unpredictable.\n\nExample:\n\n\n ArrayList ints = foo();\n ints.sort(Math::min);\n\nAfter the quick-fix is applied:\n\n\n ArrayList ints = foo();\n ints.sort(Comparator.reverseOrder());\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InvalidComparatorMethodReference",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java9ModuleExportsPackageToItself",
+ "shortDescription": {
+ "text": "Module exports/opens package to itself"
+ },
+ "fullDescription": {
+ "text": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from 'module-info.java'. Example: 'module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }' After the quick-fix is applied: 'module main {\n }' This inspection depends on the Java feature 'Modules' which is available since Java 9.",
+ "markdown": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from `module-info.java`.\n\nExample:\n\n\n module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }\n\nAfter the quick-fix is applied:\n\n\n module main {\n }\n\nThis inspection depends on the Java feature 'Modules' which is available since Java 9."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java9ModuleExportsPackageToItself",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 99,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ToArrayCallWithZeroLengthArrayArgument",
+ "shortDescription": {
+ "text": "'Collection.toArray()' call style"
+ },
+ "fullDescription": {
+ "text": "Reports 'Collection.toArray()' calls that are not in the preferred style, and suggests applying the preferred style. There are two styles to convert a collection to an array: A pre-sized array, for example, 'c.toArray(new String[c.size()])' An empty array, for example, 'c.toArray(new String[0])' In older Java versions, using a pre-sized array was recommended, as the reflection call necessary to create an array of proper size was quite slow. However, since late updates of OpenJDK 6, this call was intrinsified, making the performance of the empty array version the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the 'size' and 'toArray' calls. This may result in extra 'null's at the end of the array if the collection was concurrently shrunk during the operation. Use the inspection options to select the preferred style.",
+ "markdown": "Reports `Collection.toArray()` calls that are not in the preferred style, and suggests applying the preferred style.\n\nThere are two styles to convert a collection to an array:\n\n* A pre-sized array, for example, `c.toArray(new String[c.size()])`\n* An empty array, for example, `c.toArray(new String[0])`\n\nIn older Java versions, using a pre-sized array was recommended, as the reflection\ncall necessary to create an array of proper size was quite slow.\n\nHowever, since late updates of OpenJDK 6, this call was intrinsified, making\nthe performance of the empty array version the same, and sometimes even better, compared\nto the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or\nsynchronized collection as a data race is possible between the `size` and `toArray`\ncalls. This may result in extra `null`s at the end of the array if the collection was concurrently\nshrunk during the operation.\n\nUse the inspection options to select the preferred style."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ToArrayCallWithZeroLengthArrayArgument",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoggerInitializedWithForeignClass",
+ "shortDescription": {
+ "text": "Logger initialized with foreign class"
+ },
+ "fullDescription": {
+ "text": "Reports 'Logger' instances that are initialized with a 'class' literal from a different class than the 'Logger' is contained in. This can easily happen when copy-pasting some code from another class and may result in logging events under an unexpected category and cause filters to be applied incorrectly. A quick-fix is provided to replace the foreign class literal with one from the surrounding class. Example: 'public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n // ... other fields and methods\n }' After the quick-fix is applied: 'public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Paramount.class);\n\n // ... other fields and methods\n }' Configure the inspection: Use the table to specify the logger factory classes and logger factory methods recognized by this inspection. Use the Ignore loggers initialized with a superclass option to ignore loggers that are initialized with a superclass of the class containing the logger. Use the Ignore loggers in non-public classes to only warn on loggers in 'public' classes.",
+ "markdown": "Reports `Logger` instances that are initialized with a `class` literal from a different class than the `Logger` is contained in. This can easily happen when copy-pasting some code from another class and may result in logging events under an unexpected category and cause filters to be applied incorrectly.\n\nA quick-fix is provided to replace the foreign class literal with one from the surrounding class.\n\n**Example:**\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n // ... other fields and methods\n }\n\nAfter the quick-fix is applied:\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Paramount.class);\n\n // ... other fields and methods\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the logger factory classes and logger factory methods recognized by this inspection.\n* Use the **Ignore loggers initialized with a superclass** option to ignore loggers that are initialized with a superclass of the class containing the logger.\n* Use the **Ignore loggers in non-public classes** to only warn on loggers in `public` classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LoggerInitializedWithForeignClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 76,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MarkerInterface",
+ "shortDescription": {
+ "text": "Marker interface"
+ },
+ "fullDescription": {
+ "text": "Reports marker interfaces without any methods or fields. Such interfaces may be confusing and typically indicate a design failure. The inspection ignores interfaces that extend two or more interfaces and interfaces that specify the generic type of their superinterface.",
+ "markdown": "Reports marker interfaces without any methods or fields.\n\nSuch interfaces may be confusing and typically indicate a design failure.\n\nThe inspection ignores interfaces that extend two or more interfaces and interfaces\nthat specify the generic type of their superinterface."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MarkerInterface",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CommentedOutCode",
+ "shortDescription": {
+ "text": "Commented out code"
+ },
+ "fullDescription": {
+ "text": "Reports comments that contain Java code. Usually, code that is commented out gets outdated very quickly and becomes misleading. As most projects use some kind of version control system, it is better to delete commented out code completely and use the VCS history instead. New in 2020.3",
+ "markdown": "Reports comments that contain Java code.\n\nUsually, code that is commented out gets outdated very quickly and becomes misleading.\nAs most projects use some kind of version control system,\nit is better to delete commented out code completely and use the VCS history instead.\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "CommentedOutCode",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 56,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SortedCollectionWithNonComparableKeys",
+ "shortDescription": {
+ "text": "Sorted collection with non-comparable elements"
+ },
+ "fullDescription": {
+ "text": "Reports construction of sorted collections, for example 'TreeSet', that rely on natural ordering, whose element type doesn't implement the 'Comparable' interface. It's unlikely that such a collection will work properly. A false positive is possible if the collection element type is a non-comparable super-type, but the collection is intended to only hold comparable sub-types. Even if this is the case, it's better to narrow the collection element type or declare the super-type as 'Comparable' because the mentioned approach is error-prone. The inspection also reports cases when the collection element is a type parameter which is not declared as 'extends Comparable'. You can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility). New in 2018.3",
+ "markdown": "Reports construction of sorted collections, for example `TreeSet`, that rely on natural ordering, whose element type doesn't implement the `Comparable` interface.\n\nIt's unlikely that such a collection will work properly.\n\n\nA false positive is possible if the collection element type is a non-comparable super-type,\nbut the collection is intended to only hold comparable sub-types. Even if this is the case,\nit's better to narrow the collection element type or declare the super-type as `Comparable` because the mentioned approach is error-prone.\n\n\nThe inspection also reports cases when the collection element is a type parameter which is not declared as `extends Comparable`.\nYou can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility).\n\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SortedCollectionWithNonComparableKeys",
+ "cweIds": [
+ 697
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithoutLogger",
+ "shortDescription": {
+ "text": "Class without logger"
+ },
+ "fullDescription": {
+ "text": "Reports classes which do not have a declared logger. 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: 'public class NoLoggerDeclared {\n\n int calculateNthDigitOfPi(int n) {\n // todo\n return 1;\n }\n }' 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.",
+ "markdown": "Reports classes which do not have a declared logger.\n\nEnsuring that every class has a dedicated logger is an important step in providing a unified logging\nimplementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection.\n\nFor example:\n\n\n public class NoLoggerDeclared {\n\n int calculateNthDigitOfPi(int n) {\n // todo\n return 1;\n }\n }\n\n\nUse the table in the **Options** section to specify logger class names.\nClasses which do not declare a field with the type of one of the specified classes will be reported by this inspection."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithoutLogger",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 76,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReturnOfInnerClass",
+ "shortDescription": {
+ "text": "Return of instance of anonymous, local or inner class"
+ },
+ "fullDescription": {
+ "text": "Reports 'return' statements that return an instance of an anonymous, local, or inner class. Such instances keep an implicit reference to the outer instance, which can prevent the outer instance from being garbage-collected. Any caller of a method returning such an instance might cause a memory leak by holding on to the instance returned. Configure the inspection: Use the Ignore returns from non-public methods option to ignore returns from 'protected' or package-private methods. Returns from 'private' methods are always ignored.",
+ "markdown": "Reports `return` statements that return an instance of an anonymous, local, or inner class. Such instances keep an implicit reference to the outer instance, which can prevent the outer instance from being garbage-collected. Any caller of a method returning such an instance might cause a memory leak by holding on to the instance returned.\n\n\nConfigure the inspection:\n\n* Use the **Ignore returns from non-public methods** option to ignore returns from `protected` or package-private methods. Returns from `private` methods are always ignored."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReturnOfInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 164,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnonymousClassComplexity",
+ "shortDescription": {
+ "text": "Overly complex anonymous class"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous inner classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Anonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes. Use the Cyclomatic complexity limit field to specify the maximum allowed complexity for a class.",
+ "markdown": "Reports anonymous inner classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nAnonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes.\n\nUse the **Cyclomatic complexity limit** field to specify the maximum allowed complexity for a class."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyComplexAnonymousInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 124,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitWithoutCorrespondingNotify",
+ "shortDescription": {
+ "text": "'wait()' without corresponding 'notify()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Object.wait()', for which no call to the corresponding 'Object.notify()' or 'Object.notifyAll()' can be found. This inspection only reports calls with qualifiers referencing fields of the current class. Example: 'public class Foo {\n public Object foo = new Object();\n\n void bar() throws InterruptedException {\n this.foo.wait();\n }\n }'",
+ "markdown": "Reports calls to `Object.wait()`, for which no call to the corresponding `Object.notify()` or `Object.notifyAll()` can be found.\n\nThis inspection only reports calls with qualifiers referencing fields of the current class.\n\n**Example:**\n\n\n public class Foo {\n public Object foo = new Object();\n\n void bar() throws InterruptedException {\n this.foo.wait();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitWithoutCorrespondingNotify",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfAWTPeerClass",
+ "shortDescription": {
+ "text": "Use of AWT peer class"
+ },
+ "fullDescription": {
+ "text": "Reports uses of AWT peer classes. Such classes represent native windowing system widgets, and will be non-portable between different windowing systems. Example: 'import java.awt.peer.ButtonPeer;\n\n abstract class Sample implements ButtonPeer {\n public void foo() {\n Sample sample;\n }\n }'",
+ "markdown": "Reports uses of AWT peer classes. Such classes represent native windowing system widgets, and will be non-portable between different windowing systems.\n\n**Example:**\n\n\n import java.awt.peer.ButtonPeer;\n\n abstract class Sample implements ButtonPeer {\n public void foo() {\n Sample sample;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfAWTPeerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 95,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantExplicitVariableType",
+ "shortDescription": {
+ "text": "Local variable type can be omitted"
+ },
+ "fullDescription": {
+ "text": "Reports redundant local variable types. These types can be inferred from the context and thus replaced with 'var'. Example: 'void test(InputStream s) {\n try (InputStream in = s) {}\n }' After the fix is applied: 'void test(InputStream s) {\n try (var in = s) {}\n }' This inspection depends on the Java feature 'Local variable type inference' which is available since Java 10.",
+ "markdown": "Reports redundant local variable types.\n\nThese types can be inferred from the context and thus replaced with `var`.\n\n**Example:**\n\n\n void test(InputStream s) {\n try (InputStream in = s) {}\n }\n\nAfter the fix is applied:\n\n\n void test(InputStream s) {\n try (var in = s) {}\n }\n\n\nThis inspection depends on the Java feature 'Local variable type inference' which is available since Java 10."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "RedundantExplicitVariableType",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 10",
+ "index": 158,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableWithUnconstructableAncestor",
+ "shortDescription": {
+ "text": "Serializable class with unconstructable ancestor"
+ },
+ "fullDescription": {
+ "text": "Reports 'Serializable' classes whose closest non-serializable ancestor doesn't have a no-argument constructor. Such classes cannot be deserialized and will fail with an 'InvalidClassException'. Example: 'class Ancestor {\n private String name;\n Ancestor(String name) {\n this.name = name;\n }\n }\n\n // warning on this class because the superclass is not\n // serializable, and its constructor takes arguments\n class Descendant extends Ancestor implements Serializable {\n Descendant() {\n super(\"Bob\");\n }\n }'",
+ "markdown": "Reports `Serializable` classes whose closest non-serializable ancestor doesn't have a no-argument constructor. Such classes cannot be deserialized and will fail with an `InvalidClassException`.\n\n**Example:**\n\n\n class Ancestor {\n private String name;\n Ancestor(String name) {\n this.name = name;\n }\n }\n\n // warning on this class because the superclass is not\n // serializable, and its constructor takes arguments\n class Descendant extends Ancestor implements Serializable {\n Descendant() {\n super(\"Bob\");\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableClassWithUnconstructableAncestor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 21,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExcessiveLambdaUsage",
+ "shortDescription": {
+ "text": "Excessive lambda usage"
+ },
+ "fullDescription": {
+ "text": "Reports if a trivial lambda expression is used in cases in which there's an alternative method that behaves in the same way, but accepts a concrete value instead of a lambda. This inspection helps simplify the code. Example: 'Optional.orElseGet(() -> null)' After the quick-fix is applied: 'Optional.orElse(null)' This inspection depends on the Java feature 'Lambda expressions' which is available since Java 8. New in 2017.1",
+ "markdown": "Reports if a trivial lambda expression is used in cases in which there's an alternative method that behaves in the same way, but accepts a concrete value instead of a lambda.\n\nThis inspection helps simplify the code.\n\nExample:\n\n\n Optional.orElseGet(() -> null)\n\nAfter the quick-fix is applied:\n\n\n Optional.orElse(null)\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8.\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExcessiveLambdaUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LambdaBodyCanBeCodeBlock",
+ "shortDescription": {
+ "text": "Lambda body can be code block"
+ },
+ "fullDescription": {
+ "text": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks. Example: 'n -> n + 1' After the quick-fix is applied: 'n -> {\n return n + 1;\n}' This inspection depends on the Java feature 'Lambda expressions' which is available since Java 8.",
+ "markdown": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks.\n\nExample:\n\n\n n -> n + 1\n\nAfter the quick-fix is applied:\n\n n -> {\n return n + 1;\n }\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LambdaBodyCanBeCodeBlock",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterHidingMemberVariable",
+ "shortDescription": {
+ "text": "Parameter hides field"
+ },
+ "fullDescription": {
+ "text": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended. A quick-fix is suggested to rename the parameter. Example: 'class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }' You can configure the following options for this inspection: Ignore for property setters - ignore parameters of simple setters. Ignore superclass fields not visible from subclass - ignore 'private' fields in a superclass, which are not visible from the method. Ignore for constructors - ignore parameters of constructors. Ignore for abstract methods - ignore parameters of abstract methods. Ignore for static method parameters hiding instance fields - ignore parameters of 'static' methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing.",
+ "markdown": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended.\n\nA quick-fix is suggested to rename the parameter.\n\n**Example:**\n\n\n class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }\n \n\nYou can configure the following options for this inspection:\n\n1. **Ignore for property setters** - ignore parameters of simple setters.\n2. **Ignore superclass fields not visible from subclass** - ignore `private` fields in a superclass, which are not visible from the method.\n3. **Ignore for constructors** - ignore parameters of constructors.\n4. **Ignore for abstract methods** - ignore parameters of abstract methods.\n5. **Ignore for static method parameters hiding instance fields** - ignore parameters of `static` methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ParameterHidesMemberVariable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 99,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CustomSecurityManager",
+ "shortDescription": {
+ "text": "Custom 'SecurityManager'"
+ },
+ "fullDescription": {
+ "text": "Reports user-defined subclasses of 'java.lang.SecurityManager'. While not necessarily representing a security hole, such classes should be thoroughly and professionally inspected for possible security issues. Example: 'class CustomSecurityManager extends SecurityManager {\n }'",
+ "markdown": "Reports user-defined subclasses of `java.lang.SecurityManager`.\n\n\nWhile not necessarily representing a security hole, such classes should be thoroughly\nand professionally inspected for possible security issues.\n\n**Example:**\n\n\n class CustomSecurityManager extends SecurityManager {\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CustomSecurityManager",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 38,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectEquality",
+ "shortDescription": {
+ "text": "Object comparison using '==', instead of 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports code that uses '==' or '!=' rather than 'equals()' to test for object equality. Comparing objects using '==' or '!=' is often a bug, because it compares objects by identity instead of equality. Comparisons to 'null' are not reported. Array, 'String' and 'Number' comparisons are reported by separate inspections. Example: 'if (list1 == list2) {\n return;\n }' After the quick-fix is applied: 'if (Objects.equals(list1, list2)) {\n return;\n }' Use the inspection settings to configure exceptions for this inspection.",
+ "markdown": "Reports code that uses `==` or `!=` rather than `equals()` to test for object equality.\n\n\nComparing objects using `==` or `!=` is often a bug,\nbecause it compares objects by identity instead of equality.\nComparisons to `null` are not reported.\n\n\nArray, `String` and `Number` comparisons are reported by separate inspections.\n\n**Example:**\n\n if (list1 == list2) {\n return;\n }\n\nAfter the quick-fix is applied:\n\n if (Objects.equals(list1, list2)) {\n return;\n }\n\nUse the inspection settings to configure exceptions for this inspection."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ObjectEquality",
+ "cweIds": [
+ 480
+ ],
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TimeToString",
+ "shortDescription": {
+ "text": "Call to 'Time.toString()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'toString()' calls on 'java.sql.Time' objects. Such calls are usually incorrect in an internationalized environment.",
+ "markdown": "Reports `toString()` calls on `java.sql.Time` objects. Such calls are usually incorrect in an internationalized environment."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToTimeToString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 6,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PatternVariablesCanBeReplacedWithCast",
+ "shortDescription": {
+ "text": "Using 'instanceof' with patterns"
+ },
+ "fullDescription": {
+ "text": "Reports 'instanceof' with patterns and suggests converting them to ordinary 'instanceof' with casts. This inspection makes it possible to move 'instanceof' with patterns to a codebase using an earlier Java version by applying the quick-fix. Note that the result can be not completely equivalent to the original 'instanceof' with patterns when a complex expression before 'instanceof' is used. In this case this expression will be reevaluated. Example: 'if (object instanceof String txt && txt.length() == 1) {\n System.out.println(txt);\n } else {\n return;\n }\n System.out.println(txt);' After the quick-fix is applied: 'if (object instanceof String && ((String) object).length() ==1) {\n String txt = (String) object;\n System.out.println(txt);\n } else {\n return;\n }\n String txt = (String) object;\n System.out.println(txt);' New in 2023.1",
+ "markdown": "Reports `instanceof` with patterns and suggests converting them to ordinary `instanceof` with casts.\n\nThis inspection makes it possible to move `instanceof` with patterns to a codebase using an earlier Java version\nby applying the quick-fix.\n\n\nNote that the result can be not completely equivalent to the original `instanceof` with patterns when\na complex expression before `instanceof` is used. In this case this expression will be reevaluated.\n\nExample:\n\n\n if (object instanceof String txt && txt.length() == 1) {\n System.out.println(txt);\n } else {\n return;\n }\n System.out.println(txt);\n\nAfter the quick-fix is applied:\n\n\n if (object instanceof String && ((String) object).length() ==1) {\n String txt = (String) object;\n System.out.println(txt);\n } else {\n return;\n }\n String txt = (String) object;\n System.out.println(txt);\n\nNew in 2023.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "PatternVariablesCanBeReplacedWithCast",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ManualArrayToCollectionCopy",
+ "shortDescription": {
+ "text": "Manual array to collection copy"
+ },
+ "fullDescription": {
+ "text": "Reports code that uses a loop to copy the contents of an array into a collection. A shorter and potentially faster (depending on the collection implementation) way to do this is using 'Collection.addAll(Arrays.asList())' or 'Collections.addAll()'. Only loops without additional statements inside are reported. Example: 'void addAll(List list, String[] arr) {\n for (int i = 0; i < arr.length; i++) {\n String s = arr[i];\n list.add(s);\n }\n }' After the quick-fix is applied: 'void addAll(List list, String[] arr) {\n Collections.addAll(list, arr);\n }'",
+ "markdown": "Reports code that uses a loop to copy the contents of an array into a collection.\n\n\nA shorter and potentially faster (depending on the collection implementation) way to do this is using `Collection.addAll(Arrays.asList())` or `Collections.addAll()`.\n\n\nOnly loops without additional statements inside are reported.\n\n**Example:**\n\n\n void addAll(List list, String[] arr) {\n for (int i = 0; i < arr.length; i++) {\n String s = arr[i];\n list.add(s);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void addAll(List list, String[] arr) {\n Collections.addAll(list, arr);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ManualArrayToCollectionCopy",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchLabeledRuleCanBeCodeBlock",
+ "shortDescription": {
+ "text": "Labeled switch rule can have code block"
+ },
+ "fullDescription": {
+ "text": "Reports rules of 'switch' expressions or enhanced 'switch' statements with an expression body. These can be converted to code blocks. Example: 'String message = switch (errorCode) {\n case 404 -> \"Not found!\";\n ...\n };' After the quick-fix is applied: 'String message = switch (errorCode) {\n case 404 -> {\n yield \"Not found!\";\n }\n ...\n };' This inspection depends on the Java feature 'Enhanced 'switch' blocks' which is available since Java 14. New in 2019.1",
+ "markdown": "Reports rules of `switch` expressions or enhanced `switch` statements with an expression body. These can be converted to code blocks.\n\nExample:\n\n\n String message = switch (errorCode) {\n case 404 -> \"Not found!\";\n ...\n };\n\nAfter the quick-fix is applied:\n\n\n String message = switch (errorCode) {\n case 404 -> {\n yield \"Not found!\";\n }\n ...\n };\n\nThis inspection depends on the Java feature 'Enhanced 'switch' blocks' which is available since Java 14.\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "SwitchLabeledRuleCanBeCodeBlock",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaReflectionMemberAccess",
+ "shortDescription": {
+ "text": "Reflective access to non-existent or not visible class member"
+ },
+ "fullDescription": {
+ "text": "Reports reflective access to fields and methods that don't exist or aren't visible. Example: 'Field stringHashField() throws NoSuchFieldException {\n return String.class.getField(\"hash\");\n }' After the quick-fix is applied: 'Field stringHashField() throws NoSuchFieldException {\n return String.class.getDeclaredField(\"hash\");\n }' With a 'final' class, it's clear if there is a field or method with the specified name in the class. With non-'final' classes, it's possible that a subclass has a field or method with that name, so there could be false positives. Use the inspection's settings to get rid of such false positives everywhere or with specific classes. New in 2017.2",
+ "markdown": "Reports reflective access to fields and methods that don't exist or aren't visible.\n\nExample:\n\n\n Field stringHashField() throws NoSuchFieldException {\n return String.class.getField(\"hash\");\n }\n\nAfter the quick-fix is applied:\n\n\n Field stringHashField() throws NoSuchFieldException {\n return String.class.getDeclaredField(\"hash\");\n }\n\n\nWith a `final` class, it's clear if there is a field or method with the specified name in the class.\n\n\nWith non-`final` classes, it's possible that a subclass has a field or method with that name, so there could be false positives.\nUse the inspection's settings to get rid of such false positives everywhere or with specific classes.\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavaReflectionMemberAccess",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Reflective access",
+ "index": 129,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObviousNullCheck",
+ "shortDescription": {
+ "text": "Null-check method is called with obviously non-null argument"
+ },
+ "fullDescription": {
+ "text": "Reports if a null-checking method (for example, 'Objects.requireNonNull' or 'Assert.assertNotNull') is called on a value that is obviously non-null (for example, a newly created object). Such a check is redundant and may indicate a programming error. Example: 'final String greeting = Objects.requireNonNull(\"Hi!\");' After the quick-fix is applied: 'final String greeting = \"Hi!\";' New in 2017.2",
+ "markdown": "Reports if a null-checking method (for example, `Objects.requireNonNull` or `Assert.assertNotNull`) is called on a value that is obviously non-null (for example, a newly created object). Such a check is redundant and may indicate a programming error.\n\n**Example:**\n\n\n final String greeting = Objects.requireNonNull(\"Hi!\");\n\nAfter the quick-fix is applied:\n\n\n final String greeting = \"Hi!\";\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ObviousNullCheck",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerialVersionUIDNotStaticFinal",
+ "shortDescription": {
+ "text": "'serialVersionUID' field not declared 'private static final long'"
+ },
+ "fullDescription": {
+ "text": "Reports 'Serializable' classes whose 'serialVersionUID' field is not declared 'private static final long'. Example: 'class SampleClass implements Serializable {\n private long serialVersionUID = 1; // field of a Serializable class is not declared 'private static final long'\n\n public SampleClass() {\n System.out.println(serialVersionUID);\n }\n }'",
+ "markdown": "Reports `Serializable` classes whose `serialVersionUID` field is not declared `private static final long`.\n\n**Example:**\n\n\n class SampleClass implements Serializable {\n private long serialVersionUID = 1; // field of a Serializable class is not declared 'private static final long'\n\n public SampleClass() {\n System.out.println(serialVersionUID);\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerialVersionUIDWithWrongSignature",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 21,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InnerClassOnInterface",
+ "shortDescription": {
+ "text": "Inner class of interface"
+ },
+ "fullDescription": {
+ "text": "Reports inner classes in 'interface' classes. Some coding standards discourage the use of such classes. The inspection doesn't report enum classes and annotation interfaces. Use the Ignore inner interfaces of interfaces option to ignore inner interfaces. For example: 'interface I {\n interface Inner {\n }\n }'",
+ "markdown": "Reports inner classes in `interface` classes.\n\nSome coding standards\ndiscourage the use of such classes. The inspection doesn't report enum classes and annotation interfaces.\n\n\nUse the **Ignore inner interfaces of interfaces** option to ignore inner interfaces. For example:\n\n\n interface I {\n interface Inner {\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InnerClassOfInterface",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PublicFieldAccessedInSynchronizedContext",
+ "shortDescription": {
+ "text": "Non-private field accessed in 'synchronized' context"
+ },
+ "fullDescription": {
+ "text": "Reports non-'final', non-'private' fields that are accessed in a synchronized context. A non-'private' field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\" access may result in unexpectedly inconsistent data structures. Example: 'class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }'",
+ "markdown": "Reports non-`final`, non-`private` fields that are accessed in a synchronized context.\n\n\nA non-`private` field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\"\naccess may result in unexpectedly inconsistent data structures.\n\n**Example:**\n\n\n class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonPrivateFieldAccessedInSynchronizedContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnusedLabel",
+ "shortDescription": {
+ "text": "Unused label"
+ },
+ "fullDescription": {
+ "text": "Reports labels that are not targets of any 'break' or 'continue' statements. Example: 'label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }' After the quick-fix is applied, the label is removed: 'for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }'",
+ "markdown": "Reports labels that are not targets of any `break` or `continue` statements.\n\n**Example:**\n\n\n label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nAfter the quick-fix is applied, the label is removed:\n\n\n for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnusedLabel",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 13,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForeachStatement",
+ "shortDescription": {
+ "text": "Enhanced 'for' statement"
+ },
+ "fullDescription": {
+ "text": "Reports enhanced 'for' statements. Example: 'for (int x: Arrays.asList(1, 2, 3)) {\n System.out.println(x);\n }' After the quick-fix is applied: 'for (Iterator iterator = Arrays.asList(1, 2, 3).iterator(); iterator.hasNext(); ) {\n final int x = iterator.next();\n System.out.println(x);\n }' Enhanced 'for' statement appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions.",
+ "markdown": "Reports enhanced `for` statements.\n\nExample:\n\n\n for (int x: Arrays.asList(1, 2, 3)) {\n System.out.println(x);\n }\n\nAfter the quick-fix is applied:\n\n\n for (Iterator iterator = Arrays.asList(1, 2, 3).iterator(); iterator.hasNext(); ) {\n final int x = iterator.next();\n System.out.println(x);\n }\n\n\n*Enhanced* `for` *statement* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForeachStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level issues",
+ "index": 145,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalUsedAsFieldOrParameterType",
+ "shortDescription": {
+ "text": "'Optional' used as field or parameter type"
+ },
+ "fullDescription": {
+ "text": "Reports any cases in which 'java.util.Optional', 'java.util.OptionalDouble', 'java.util.OptionalInt', 'java.util.OptionalLong', or 'com.google.common.base.Optional' are used as types for fields or parameters. 'Optional' was designed to provide a limited mechanism for library method return types in which a clear way to represent \"no result\" was needed. Using a field with the 'java.util.Optional' type is also problematic if the class needs to be 'Serializable', as 'java.util.Optional' is not serializable. Example: 'class MyClass {\n Optional name; // Optional field\n\n // Optional parameter\n void setName(Optional name) {\n this.name = name;\n }\n }'",
+ "markdown": "Reports any cases in which `java.util.Optional`, `java.util.OptionalDouble`, `java.util.OptionalInt`, `java.util.OptionalLong`, or `com.google.common.base.Optional` are used as types for fields or parameters.\n\n`Optional` was designed to provide a limited mechanism for library method return types in which a clear way to represent \"no result\"\nwas needed.\n\nUsing a field with the `java.util.Optional` type is also problematic if the class needs to be\n`Serializable`, as `java.util.Optional` is not serializable.\n\nExample:\n\n\n class MyClass {\n Optional name; // Optional field\n\n // Optional parameter\n void setName(Optional name) {\n this.name = name;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalUsedAsFieldOrParameterType",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 86,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReplaceAllDot",
+ "shortDescription": {
+ "text": "Suspicious regex expression argument"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'String.replaceAll()' or 'String.split()' where the first argument is a single regex meta character argument. The regex meta characters are one of '.$|()[{^?*+\\'. They have a special meaning in regular expressions. For example, calling '\"ab.cd\".replaceAll(\".\", \"-\")' produces '\"-----\"', because the dot matches any character. Most likely the escaped variant '\"\\\\.\"' was intended instead. Using 'File.separator' as a regex is also reported. The 'File.separator' has a platform specific value. It equals to '/' on Linux and Mac but equals to '\\' on Windows, which is not a valid regular expression, so such code is not portable. Example: 's.replaceAll(\".\", \"-\");' After the quick-fix is applied: 's.replaceAll(\"\\\\.\", \"-\");'",
+ "markdown": "Reports calls to `String.replaceAll()` or `String.split()` where the first argument is a single regex meta character argument.\n\n\nThe regex meta characters are one of `.$|()[{^?*+\\`. They have a special meaning in regular expressions.\nFor example, calling `\"ab.cd\".replaceAll(\".\", \"-\")` produces `\"-----\"`, because the dot matches any character.\nMost likely the escaped variant `\"\\\\.\"` was intended instead.\n\n\nUsing `File.separator` as a regex is also reported. The `File.separator` has a platform specific value. It\nequals to `/` on Linux and Mac but equals to `\\` on Windows, which is not a valid regular expression, so\nsuch code is not portable.\n\n**Example:**\n\n\n s.replaceAll(\".\", \"-\");\n\nAfter the quick-fix is applied:\n\n\n s.replaceAll(\"\\\\.\", \"-\");\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousRegexArgument",
+ "cweIds": [
+ 20,
+ 185,
+ 628
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForCanBeForeach",
+ "shortDescription": {
+ "text": "'for' loop can be replaced with enhanced for loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'for' loops that iterate over collections or arrays, and can be automatically replaced with an enhanced 'for' loop (foreach iteration syntax). Example: 'for (Iterator iterator = list.iterator(); iterator.hasNext(); ) {\n String item = iterator.next();\n System.out.println(item);\n }' After the quick-fix is applied: 'for (String item : list) {\n System.out.println(item);\n }' Use the Report indexed 'java.util.List' loops option to find loops involving 'list.get(index)' calls. Generally, these loops can be replaced with enhanced 'for' loops, unless they modify an underlying list in the process, for example, by calling 'list.remove(index)'. If the latter is the case, the enhanced 'for' loop may throw 'ConcurrentModificationException'. Also, in some cases, 'list.get(index)' loops may work a little bit faster. Use the Do not report iterations over untyped collections option to ignore collections without type parameters. This prevents the creation of enhanced 'for' loop variables of the 'java.lang.Object' type and the insertion of casts where the loop variable is used. This inspection depends on the Java feature 'For-each loops' which is available since Java 5.",
+ "markdown": "Reports `for` loops that iterate over collections or arrays, and can be automatically replaced with an enhanced `for` loop (foreach iteration syntax).\n\n**Example:**\n\n\n for (Iterator iterator = list.iterator(); iterator.hasNext(); ) {\n String item = iterator.next();\n System.out.println(item);\n }\n\nAfter the quick-fix is applied:\n\n\n for (String item : list) {\n System.out.println(item);\n }\n\n\nUse the **Report indexed 'java.util.List' loops** option to find loops involving `list.get(index)` calls.\nGenerally, these loops can be replaced with enhanced `for` loops,\nunless they modify an underlying list in the process, for example, by calling `list.remove(index)`.\nIf the latter is the case, the enhanced `for` loop may throw `ConcurrentModificationException`.\nAlso, in some cases, `list.get(index)` loops may work a little bit faster.\n\n\nUse the **Do not report iterations over untyped collections** option to ignore collections without type parameters.\nThis prevents the creation of enhanced `for` loop variables of the `java.lang.Object` type and the insertion of casts\nwhere the loop variable is used.\n\nThis inspection depends on the Java feature 'For-each loops' which is available since Java 5."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForLoopReplaceableByForEach",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 120,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PackageVisibleField",
+ "shortDescription": {
+ "text": "Package-visible field"
+ },
+ "fullDescription": {
+ "text": "Reports fields that are declared without any access modifier (also known as package-private). Constants (that is, fields marked 'static' and 'final') are not reported. Example: 'public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }'",
+ "markdown": "Reports fields that are declared without any access modifier (also known as package-private).\n\nConstants (that is, fields marked `static` and `final`) are not reported.\n\n**Example:**\n\n\n public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PackageVisibleField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Encapsulation",
+ "index": 126,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstantiationOfUtilityClass",
+ "shortDescription": {
+ "text": "Instantiation of utility class"
+ },
+ "fullDescription": {
+ "text": "Reports instantiation of utility classes using the 'new' keyword. In utility classes, all fields and methods are 'static'. Instantiation of such classes is most likely unnecessary and indicates a mistake. Example: 'class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }' To prevent utility classes from being instantiated, it's recommended to use a 'private' constructor.",
+ "markdown": "Reports instantiation of utility classes using the `new` keyword.\n\n\nIn utility classes, all fields and methods are `static`.\nInstantiation of such classes is most likely unnecessary and indicates a mistake.\n\n**Example:**\n\n\n class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }\n\n\nTo prevent utility classes from being instantiated,\nit's recommended to use a `private` constructor."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstantiationOfUtilityClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TrailingWhitespacesInTextBlock",
+ "shortDescription": {
+ "text": "Trailing whitespace in text block"
+ },
+ "fullDescription": {
+ "text": "Reports text blocks with trailing whitespace characters. Trailing whitespace is considered incidental and will be stripped away by the Java compiler. This inspection depends on the Java feature 'Text block literals' which is available since Java 15. New in 2021.1",
+ "markdown": "Reports text blocks with trailing whitespace characters. Trailing whitespace is considered incidental and will be stripped away by the Java compiler.\n\nThis inspection depends on the Java feature 'Text block literals' which is available since Java 15.\n\nNew in 2021.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TrailingWhitespacesInTextBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NewClassNamingConvention",
+ "shortDescription": {
+ "text": "Class naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class produces a warning because the length of its name is 6, which is less than 8: 'public class MyTest{}'. A quick-fix that renames such classes is available only in the editor. Configure the inspection: Use the list in the Options section to specify which classes should be checked. Deselect the checkboxes for the classes for which you want to skip the check. For each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the provided input fields. Specify 0 in the length fields to skip corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format.",
+ "markdown": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class\nproduces a warning because the length of its name is 6, which is less than 8: `public class MyTest{}`.\n\nA quick-fix that renames such classes is available only in the editor.\n\nConfigure the inspection:\n\n\nUse the list in the **Options** section to specify which classes should be checked. Deselect the checkboxes for the classes for which\nyou want to skip the check.\n\nFor each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the\nprovided input fields. Specify **0** in the length fields to skip corresponding checks.\n\nRegular expressions should be specified in the standard `java.util.regex` format."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NewClassNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Class",
+ "index": 82,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseCompareMethod",
+ "shortDescription": {
+ "text": "'compare()' method can be used to compare numbers"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that can be replaced by a call to the 'Integer.compare()' method or a similar method from the 'Long', 'Short', 'Byte', 'Double' or 'Float' classes, instead of more verbose or less efficient constructs. If 'x' and 'y' are boxed integers, then 'x.compareTo(y)' is suggested, if they are primitives 'Integer.compare(x, y)' is suggested. Example: 'public int compare(int x, int y) {\n return x > y ? 1 : x < y ? -1 : 0;\n }' After the quick-fix is applied: 'public int compare(int x, int y) {\n return Integer.compare(x, y);\n }' Note that 'Double.compare' and 'Float.compare' slightly change the code semantics. In particular, they make '-0.0' and '0.0' distinguishable ('Double.compare(-0.0, 0.0)' yields -1). Also, they consistently process 'NaN' value. In most of the cases, this semantics change actually improves the code. Use the checkbox to disable this inspection for floating point numbers if semantics change is unacceptable in your case. New in 2017.2",
+ "markdown": "Reports expressions that can be replaced by a call to the `Integer.compare()` method or a similar method from the `Long`, `Short`, `Byte`, `Double` or `Float` classes, instead of more verbose or less efficient constructs.\n\nIf `x` and `y` are boxed integers, then `x.compareTo(y)` is suggested,\nif they are primitives `Integer.compare(x, y)` is suggested.\n\n**Example:**\n\n\n public int compare(int x, int y) {\n return x > y ? 1 : x < y ? -1 : 0;\n }\n\nAfter the quick-fix is applied:\n\n\n public int compare(int x, int y) {\n return Integer.compare(x, y);\n }\n\n\nNote that `Double.compare` and `Float.compare` slightly change the code semantics. In particular,\nthey make `-0.0` and `0.0` distinguishable (`Double.compare(-0.0, 0.0)` yields -1).\nAlso, they consistently process `NaN` value. In most of the cases, this semantics change actually improves the\ncode. Use the checkbox to disable this inspection for floating point numbers if semantics change is unacceptable\nin your case.\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseCompareMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids",
+ "index": 70,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MoveFieldAssignmentToInitializer",
+ "shortDescription": {
+ "text": "Field assignment can be moved to initializer"
+ },
+ "fullDescription": {
+ "text": "Suggests replacing initialization of fields using assignment with initialization in the field declaration. Only reports if the field assignment is located in an instance or static initializer, and joining it with the field declaration is likely to be safe. In other cases, like assignment inside a constructor, the quick-fix is provided without highlighting, as the fix may change the semantics. Example: 'class MyClass {\n static final int intConstant;\n \n static {\n intConstant = 10;\n }\n }' The quick fix moves the assigned value to the field initializer removing the class initializer if possible: 'class MyClass {\n static final int intConstant = 10;\n }' Since 2017.2",
+ "markdown": "Suggests replacing initialization of fields using assignment with initialization in the field declaration.\n\nOnly reports if the field assignment is located in an instance or static initializer, and\njoining it with the field declaration is likely to be safe.\nIn other cases, like assignment inside a constructor, the quick-fix is provided without highlighting,\nas the fix may change the semantics.\n\nExample:\n\n\n class MyClass {\n static final int intConstant;\n \n static {\n intConstant = 10;\n }\n }\n\nThe quick fix moves the assigned value to the field initializer removing the class initializer if possible:\n\n\n class MyClass {\n static final int intConstant = 10;\n }\n\nSince 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MoveFieldAssignmentToInitializer",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringConcatenationInFormatCall",
+ "shortDescription": {
+ "text": "String concatenation as argument to 'format()' call"
+ },
+ "fullDescription": {
+ "text": "Reports non-constant string concatenations used as a format string argument. While occasionally intended, this is usually a misuse of a formatting method and may even cause security issues if the variables used in the concatenated string contain special characters like '%'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }' Here, the 'userName' will be interpreted as a part of format string, which may result in 'IllegalFormatException' (for example, if 'userName' is '\"%\"') or in using an enormous amount of memory (for example, if 'userName' is '\"%2000000000%\"'). The call should be probably replaced with 'String.format(\"Hello, %s\", userName);'. This inspection checks calls to formatting methods on 'java.util.Formatter', 'java.lang.String', 'java.io.PrintWriter', or 'java.io.PrintStream'.",
+ "markdown": "Reports non-constant string concatenations used as a format string argument.\n\n\nWhile occasionally intended, this is usually a misuse of a formatting method\nand may even cause security issues if the variables used in the concatenated string\ncontain special characters like `%`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }\n\n\nHere, the `userName` will be interpreted as a part of format string, which may result\nin `IllegalFormatException` (for example, if `userName` is `\"%\"`) or\nin using an enormous amount of memory (for example, if `userName` is `\"%2000000000%\"`).\nThe call should be probably replaced with `String.format(\"Hello, %s\", userName);`.\n\n\nThis inspection checks calls to formatting methods on\n`java.util.Formatter`,\n`java.lang.String`,\n`java.io.PrintWriter`,\nor `java.io.PrintStream`."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringConcatenationInFormatCall",
+ "cweIds": [
+ 116,
+ 134
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitWhileHoldingTwoLocks",
+ "shortDescription": {
+ "text": "'wait()' while holding two locks"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'wait()' methods that may occur while the current thread is holding two locks. Since calling 'wait()' only releases one lock on its target, waiting with two locks held can easily lead to a deadlock. Example: 'synchronized (lockA) {\n synchronized (lockB) {\n lockB.wait(); //warning\n //thread A is stuck here holding lockA\n }\n }\n\n synchronized (lockA) { //thread B can't enter the block and release thread A\n lockB.notify();\n }'",
+ "markdown": "Reports calls to `wait()` methods that may occur while the current thread is holding two locks.\n\n\nSince calling `wait()` only releases one lock on its target,\nwaiting with two locks held can easily lead to a deadlock.\n\n**Example:**\n\n\n synchronized (lockA) {\n synchronized (lockB) {\n lockB.wait(); //warning\n //thread A is stuck here holding lockA\n }\n }\n\n synchronized (lockA) { //thread B can't enter the block and release thread A\n lockB.notify();\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitWhileHoldingTwoLocks",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableInnerClassWithNonSerializableOuterClass",
+ "shortDescription": {
+ "text": "Serializable non-'static' inner class with non-Serializable outer class"
+ },
+ "fullDescription": {
+ "text": "Reports non-static inner classes that implement 'Serializable' and are declared inside a class that doesn't implement 'Serializable'. Such classes are unlikely to serialize correctly due to implicit references to the outer class. Example: 'class A {\n class Main implements Serializable {\n }\n }' Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Whether to ignore 'Serializable' anonymous classes.",
+ "markdown": "Reports non-static inner classes that implement `Serializable` and are declared inside a class that doesn't implement `Serializable`.\n\n\nSuch classes are unlikely to serialize correctly due to implicit references to the outer class.\n\n**Example:**\n\n\n class A {\n class Main implements Serializable {\n }\n }\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization.\n* Whether to ignore `Serializable` anonymous classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableInnerClassWithNonSerializableOuterClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 21,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousListRemoveInLoop",
+ "shortDescription": {
+ "text": "Suspicious 'List.remove()' in loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'list.remove(index)' calls inside an ascending counted loop. This is suspicious as the list becomes shorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable after the removal, but probably removing via an iterator or using the 'removeIf()' method (Java 8 and later) is a more robust alternative. If you don't expect that 'remove()' will be called more than once in a loop, consider adding a 'break' after it. Example: 'public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }' The code looks like '1 2 3 4' is going to be printed, but in reality, '3' will be skipped in the output. New in 2018.2",
+ "markdown": "Reports `list.remove(index)` calls inside an ascending counted loop.\n\n\nThis is suspicious as the list becomes\nshorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable\nafter the removal,\nbut probably removing via an iterator or using the `removeIf()` method (Java 8 and later) is a more robust alternative.\nIf you don't expect that `remove()` will be called more than once in a loop, consider adding a `break` after it.\n\n**Example:**\n\n public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }\n\nThe code looks like `1 2 3 4` is going to be printed, but in reality, `3` will be skipped in the output.\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousListRemoveInLoop",
+ "cweIds": [
+ 129
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NegativeIntConstantInLongContext",
+ "shortDescription": {
+ "text": "Negative int hexadecimal constant in long context"
+ },
+ "fullDescription": {
+ "text": "Reports negative int hexadecimal constants in long context. Such constants are implicitly widened to long, which means their higher bits will become 1 rather than 0 (e.g., 0xFFFF_FFFF will become 0xFFFF_FFFF_FFFF_FFFFL). Unlikely this is intended, and even if it is, using an explicit long constant would be less confusing. Example: '// Warning: this is int constant -1 which is widened to long\n // becoming 0xFFFF_FFFF_FFFF_FFFFL.\n long mask = 0xFFFF_FFFF;' New in 2022.3",
+ "markdown": "Reports negative int hexadecimal constants in long context. Such constants are implicitly widened to long, which means their higher bits will become 1 rather than 0 (e.g., 0xFFFF_FFFF will become 0xFFFF_FFFF_FFFF_FFFFL). Unlikely this is intended, and even if it is, using an explicit long constant would be less confusing.\n\n**Example:**\n\n\n // Warning: this is int constant -1 which is widened to long\n // becoming 0xFFFF_FFFF_FFFF_FFFFL.\n long mask = 0xFFFF_FFFF;\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NegativeIntConstantInLongContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WhileLoopSpinsOnField",
+ "shortDescription": {
+ "text": "'while' loop spins on field"
+ },
+ "fullDescription": {
+ "text": "Reports 'while' loops that spin on the value of a non-'volatile' field, waiting for it to be changed by another thread. In addition to being potentially extremely CPU intensive when little work is done inside the loop, such loops are likely to have different semantics from what was intended. The Java Memory Model allows such loops to never complete even if another thread changes the field's value. Additionally, since Java 9 it's recommended to call 'Thread.onSpinWait()' inside a spin loop on a 'volatile' field, which may significantly improve performance on some hardware. Example: 'class SpinsOnField {\n boolean ready = false;\n\n void run() {\n while (!ready) {\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }' After the quick-fix is applied: 'class SpinsOnField {\n volatile boolean ready = false;\n\n void run() {\n while (!ready) {\n Thread.onSpinWait();\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }' Use the inspection options to only report empty 'while' loops.",
+ "markdown": "Reports `while` loops that spin on the value of a non-`volatile` field, waiting for it to be changed by another thread.\n\n\nIn addition to being potentially extremely CPU intensive when little work is done inside the loop, such\nloops are likely to have different semantics from what was intended.\nThe Java Memory Model allows such loops to never complete even if another thread changes the field's value.\n\n\nAdditionally, since Java 9 it's recommended to call `Thread.onSpinWait()` inside a spin loop\non a `volatile` field, which may significantly improve performance on some hardware.\n\n**Example:**\n\n\n class SpinsOnField {\n boolean ready = false;\n\n void run() {\n while (!ready) {\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class SpinsOnField {\n volatile boolean ready = false;\n\n void run() {\n while (!ready) {\n Thread.onSpinWait();\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }\n\n\nUse the inspection options to only report empty `while` loops."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WhileLoopSpinsOnField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DefaultAnnotationParam",
+ "shortDescription": {
+ "text": "Default annotation parameter value"
+ },
+ "fullDescription": {
+ "text": "Reports annotation parameters that are assigned to their 'default' value. Example: '@interface Test {\n Class> expected() default Throwable.class;\n }\n\n @Test(expected = Throwable.class)\n void testSmth() {}' After the quick-fix is applied: '@Test()\n void testSmth() {}'",
+ "markdown": "Reports annotation parameters that are assigned to their `default` value.\n\nExample:\n\n\n @interface Test {\n Class> expected() default Throwable.class;\n }\n\n @Test(expected = Throwable.class)\n void testSmth() {}\n\nAfter the quick-fix is applied:\n\n\n @Test()\n void testSmth() {}\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DefaultAnnotationParam",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 13,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizeOnLock",
+ "shortDescription": {
+ "text": "Synchronization on a 'Lock' object"
+ },
+ "fullDescription": {
+ "text": "Reports 'synchronized' blocks that lock on an instance of 'java.util.concurrent.locks.Lock'. Such synchronization is almost certainly unintended, and appropriate versions of '.lock()' and '.unlock()' should be used instead. Example: 'final ReentrantLock lock = new ReentrantLock();\n\n public void foo() {\n synchronized (lock) {}\n }'",
+ "markdown": "Reports `synchronized` blocks that lock on an instance of `java.util.concurrent.locks.Lock`. Such synchronization is almost certainly unintended, and appropriate versions of `.lock()` and `.unlock()` should be used instead.\n\n**Example:**\n\n\n final ReentrantLock lock = new ReentrantLock();\n\n public void foo() {\n synchronized (lock) {}\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchroniziationOnLockObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BadExceptionCaught",
+ "shortDescription": {
+ "text": "Prohibited 'Exception' caught"
+ },
+ "fullDescription": {
+ "text": "Reports 'catch' clauses that catch an inappropriate exception. Some exceptions, for example 'java.lang.NullPointerException' or 'java.lang.IllegalMonitorStateException', represent programming errors and therefore almost certainly should not be caught in production code. Example: 'try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }' Use the Prohibited exceptions list to specify which exceptions should be reported.",
+ "markdown": "Reports `catch` clauses that catch an inappropriate exception.\n\nSome exceptions, for example\n`java.lang.NullPointerException` or\n`java.lang.IllegalMonitorStateException`, represent programming errors\nand therefore almost certainly should not be caught in production code.\n\n**Example:**\n\n\n try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ProhibitedExceptionCaught",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstanceofCatchParameter",
+ "shortDescription": {
+ "text": "'instanceof' on 'catch' parameter"
+ },
+ "fullDescription": {
+ "text": "Reports cases in which an 'instanceof' expression is used for testing the type of a parameter in a 'catch' block. Testing the type of 'catch' parameters is usually better done by having separate 'catch' blocks instead of using 'instanceof'. Example: 'void foo(Runnable runnable) {\n try {\n runnable.run();\n } catch (Throwable throwable) {\n if (throwable instanceof NoClassDefFoundError) { // warning: 'instanceof' on 'catch' parameter 'throwable'\n System.out.println(\"Class not found!\");\n }\n }\n }'",
+ "markdown": "Reports cases in which an `instanceof` expression is used for testing the type of a parameter in a `catch` block.\n\nTesting the type of `catch` parameters is usually better done by having separate\n`catch` blocks instead of using `instanceof`.\n\n**Example:**\n\n\n void foo(Runnable runnable) {\n try {\n runnable.run();\n } catch (Throwable throwable) {\n if (throwable instanceof NoClassDefFoundError) { // warning: 'instanceof' on 'catch' parameter 'throwable'\n System.out.println(\"Class not found!\");\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstanceofCatchParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantScheduledForRemovalAnnotation",
+ "shortDescription": {
+ "text": "Redundant @ScheduledForRemoval annotation"
+ },
+ "fullDescription": {
+ "text": "Reports usages of '@ApiStatus.ScheduledForRemoval' annotation without 'inVersion' attribute in code which targets Java 9 or newer version. Such usages can be replaced by 'forRemoval' attribute in '@Deprecated' annotation to simplify code. New in 2022.1",
+ "markdown": "Reports usages of `@ApiStatus.ScheduledForRemoval` annotation without `inVersion` attribute in code which targets Java 9 or newer version.\n\n\nSuch usages can be replaced by `forRemoval` attribute in `@Deprecated` annotation to simplify code.\n\nNew in 2022.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantScheduledForRemovalAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 56,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalGetWithoutIsPresent",
+ "shortDescription": {
+ "text": "Optional.get() is called without isPresent() check"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'get()' on an 'Optional' without checking that it has a value. Calling 'Optional.get()' on an empty 'Optional' instance will throw an exception. Example: 'void x(List list) {\n final Optional optional =\n list.stream().filter(x -> x > 10).findFirst();\n final Integer result = optional.get(); // problem here\n }' This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.",
+ "markdown": "Reports calls to `get()` on an `Optional` without checking that it has a value.\n\nCalling `Optional.get()` on an empty `Optional` instance will throw an exception.\n\n**Example:**\n\n\n void x(List list) {\n final Optional optional =\n list.stream().filter(x -> x > 10).findFirst();\n final Integer result = optional.get(); // problem here\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalGetWithoutIsPresent",
+ "cweIds": [
+ 252,
+ 476
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OnDemandImport",
+ "shortDescription": {
+ "text": "'*' import"
+ },
+ "fullDescription": {
+ "text": "Reports any 'import' statements that cover entire packages ('* imports'). Some coding standards prohibit such 'import' statements. You can configure IntelliJ IDEA to detect and fix such statements with its Optimize Imports command. Go to Settings | Editor | Code Style | Java | Imports, make sure that the Use single class import option is enabled, and specify values in the Class count to use import with '*' and Names count to use static import with '*' fields. Thus this inspection is mostly useful for offline reporting on code bases that you don't intend to change.",
+ "markdown": "Reports any `import` statements that cover entire packages ('\\* imports').\n\nSome coding standards prohibit such `import` statements.\n\n\nYou can configure IntelliJ IDEA to detect and fix such statements with its **Optimize Imports**\ncommand. Go to [Settings \\| Editor \\| Code Style \\| Java \\| Imports](settings://preferences.sourceCode.Java?Use%20single%20class%20import),\nmake sure that the **Use single class import** option is enabled, and specify values in the\n**Class count to use import with '\\*'** and **Names count to use static import with '\\*'** fields.\nThus this inspection is mostly useful for offline reporting on code bases that you don't\nintend to change."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OnDemandImport",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Imports",
+ "index": 24,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FallthruInSwitchStatement",
+ "shortDescription": {
+ "text": "Fallthrough in 'switch' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'fall-through' in a 'switch' statement. Fall-through occurs when a series of executable statements after a 'case' label is not guaranteed to transfer control before the next 'case' label. For example, this can happen if the branch is missing a 'break' statement. In that case, control falls through to the statements after that 'switch' label, even though the 'switch' expression is not equal to the value of the fallen-through label. While occasionally intended, this construction is confusing and is often the result of a typo. This inspection ignores any fall-through commented with a text matching the regex pattern '(?i)falls?\\s*thro?u'. There is a fix that adds a 'break' to the branch that can fall through to the next branch. Example: 'switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n // no break here\n } else {\n break;\n }\n case (6):\n System.out.println(\"4\");\n }' After the quick-fix is applied: 'switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n } else {\n break;\n }\n break;\n case (6):\n System.out.println(\"4\");\n }'",
+ "markdown": "Reports 'fall-through' in a `switch` statement.\n\nFall-through occurs when a series of executable statements after a `case` label is not guaranteed\nto transfer control before the next `case` label. For example, this can happen if the branch is missing a `break` statement.\nIn that case, control falls through to the statements after\nthat `switch` label, even though the `switch` expression is not equal to\nthe value of the fallen-through label. While occasionally intended, this construction is confusing and is often the result of a typo.\n\n\nThis inspection ignores any fall-through commented with a text matching the regex pattern `(?i)falls?\\s*thro?u`.\n\nThere is a fix that adds a `break` to the branch that can fall through to the next branch.\n\nExample:\n\n\n switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n // no break here\n } else {\n break;\n }\n case (6):\n System.out.println(\"4\");\n }\n\nAfter the quick-fix is applied:\n\n\n switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n } else {\n break;\n }\n break;\n case (6):\n System.out.println(\"4\");\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "fallthrough",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalIsPresent",
+ "shortDescription": {
+ "text": "Non functional style 'Optional.isPresent()' usage"
+ },
+ "fullDescription": {
+ "text": "Reports 'Optional' expressions used as 'if' or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read. Example: 'if (str.isPresent()) str.get().trim();' After the quick-fix is applied: 'str.ifPresent(String::trim);' This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.",
+ "markdown": "Reports `Optional` expressions used as `if` or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read.\n\nExample:\n\n\n if (str.isPresent()) str.get().trim();\n\nAfter the quick-fix is applied:\n\n\n str.ifPresent(String::trim);\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalIsPresent",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantOperationOnEmptyContainer",
+ "shortDescription": {
+ "text": "Redundant operation on empty container"
+ },
+ "fullDescription": {
+ "text": "Reports redundant operations on empty collections, maps or arrays. Iterating, removing elements, sorting, and some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug. Example: 'if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }' New in 2019.1",
+ "markdown": "Reports redundant operations on empty collections, maps or arrays.\n\n\nIterating, removing elements, sorting,\nand some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug.\n\n**Example:**\n\n\n if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantOperationOnEmptyContainer",
+ "cweIds": [
+ 561
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AtomicFieldUpdaterNotStaticFinal",
+ "shortDescription": {
+ "text": "'AtomicFieldUpdater' field not declared 'static final'"
+ },
+ "fullDescription": {
+ "text": "Reports fields of types: 'java.util.concurrent.atomic.AtomicLongFieldUpdater' 'java.util.concurrent.atomic.AtomicIntegerFieldUpdater' 'java.util.concurrent.atomic.AtomicReferenceFieldUpdater' that are not 'static final'. Because only one atomic field updater is needed for updating a 'volatile' field in all instances of a class, it can almost always be 'static'. Making the updater 'final' allows the JVM to optimize access for improved performance. Example: 'class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }' After the quick-fix is applied: 'class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }'",
+ "markdown": "Reports fields of types:\n\n* `java.util.concurrent.atomic.AtomicLongFieldUpdater`\n* `java.util.concurrent.atomic.AtomicIntegerFieldUpdater`\n* `java.util.concurrent.atomic.AtomicReferenceFieldUpdater`\n\nthat are not `static final`. Because only one atomic field updater is needed for updating a `volatile` field in all instances of a class, it can almost always be `static`.\n\nMaking the updater `final` allows the JVM to optimize access for improved performance.\n\n**Example:**\n\n\n class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AtomicFieldUpdaterNotStaticFinal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java8MapForEach",
+ "shortDescription": {
+ "text": "Map.forEach() can be used"
+ },
+ "fullDescription": {
+ "text": "Suggests replacing 'for(Entry,?> entry : map.entrySet()) {...}' or 'map.entrySet().forEach(entry -> ...)' with 'map.forEach((key, value) -> ...)'. Example 'void print(Map map) {\n map.entrySet().forEach(entry -> {\n String str = entry.getKey();\n System.out.println(str + \":\" + entry.getValue());\n });\n }' After the quick-fix is applied: 'void print(Map map) {\n map.forEach((str, value) -> System.out.println(str + \":\" + value));\n }' When the Do not report loops option is enabled, only 'entrySet().forEach()' cases will be reported. However, the quick-fix action will be available for 'for'-loops as well. This inspection depends on the Java feature 'Lambda methods in collections' which is available since Java 8. New in 2017.1",
+ "markdown": "Suggests replacing `for(Entry,?> entry : map.entrySet()) {...}` or `map.entrySet().forEach(entry -> ...)` with `map.forEach((key, value) -> ...)`.\n\nExample\n\n\n void print(Map map) {\n map.entrySet().forEach(entry -> {\n String str = entry.getKey();\n System.out.println(str + \":\" + entry.getValue());\n });\n }\n\nAfter the quick-fix is applied:\n\n\n void print(Map map) {\n map.forEach((str, value) -> System.out.println(str + \":\" + value));\n }\n\n\nWhen the **Do not report loops** option is enabled, only `entrySet().forEach()` cases will be reported.\nHowever, the quick-fix action will be available for `for`-loops as well.\n\nThis inspection depends on the Java feature 'Lambda methods in collections' which is available since Java 8.\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java8MapForEach",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 121,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RecordStoreResource",
+ "shortDescription": {
+ "text": "'RecordStore' opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports Java ME 'javax.microedition.rms.RecordStore' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }'",
+ "markdown": "Reports Java ME `javax.microedition.rms.RecordStore` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block.\n\nSuch resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RecordStoreOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 169,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectsEqualsCanBeSimplified",
+ "shortDescription": {
+ "text": "'Objects.equals()' can be replaced with 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Objects.equals(a, b)' in which the first argument is statically known to be non-null. Such a call can be safely replaced with 'a.equals(b)' or 'a == b' if both arguments are primitives. Example: 'String defaultName = \"default\";\n boolean isDefault = Objects.equals(defaultName, name);' After the quick-fix is applied: 'String defaultName = \"default\";\n boolean isDefault = defaultName.equals(name);' New in 2018.3",
+ "markdown": "Reports calls to `Objects.equals(a, b)` in which the first argument is statically known to be non-null.\n\nSuch a call can be safely replaced with `a.equals(b)` or `a == b` if both arguments are primitives.\n\nExample:\n\n\n String defaultName = \"default\";\n boolean isDefault = Objects.equals(defaultName, name);\n\nAfter the quick-fix is applied:\n\n\n String defaultName = \"default\";\n boolean isDefault = defaultName.equals(name);\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ObjectsEqualsCanBeSimplified",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassLoaderInstantiation",
+ "shortDescription": {
+ "text": "'ClassLoader' instantiation"
+ },
+ "fullDescription": {
+ "text": "Reports instantiations of the 'java.lang.ClassLoader' class. While often benign, any instantiations of 'ClassLoader' should be closely examined in any security audit. Example: 'Class> loadExtraClass(String name) throws Exception {\n try(URLClassLoader loader =\n new URLClassLoader(new URL[]{new URL(\"extraClasses/\")})) {\n return loader.loadClass(name);\n }\n }'",
+ "markdown": "Reports instantiations of the `java.lang.ClassLoader` class.\n\nWhile often benign, any instantiations of `ClassLoader` should be closely examined in any security audit.\n\n**Example:**\n\n Class> loadExtraClass(String name) throws Exception {\n try(URLClassLoader loader =\n new URLClassLoader(new URL[]{new URL(\"extraClasses/\")})) {\n return loader.loadClass(name);\n }\n }\n \n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassLoaderInstantiation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 38,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NativeMethods",
+ "shortDescription": {
+ "text": "Native method"
+ },
+ "fullDescription": {
+ "text": "Reports methods declared 'native'. Native methods are inherently unportable.",
+ "markdown": "Reports methods declared `native`. Native methods are inherently unportable."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NativeMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 95,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsWithItself",
+ "shortDescription": {
+ "text": "'equals()' called on itself"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'equals()', 'compareTo()' or similar, that compare an object for equality with itself. The method contracts of these methods specify that such calls will always return 'true' for 'equals()' or '0' for 'compareTo()'. The inspection also checks calls to 'Objects.equals()', 'Objects.deepEquals()', 'Arrays.equals()', 'Comparator.compare()', 'assertEquals()' methods of test frameworks (JUnit, TestNG, AssertJ), 'Integer.compare()', 'Integer.compareUnsigned()' and similar methods. Example: 'class Foo {\n boolean foo(Object o) {\n return o.equals(o); // warning\n }\n\n boolean bar(String[] ss) {\n return Arrays.equals(ss, ss); // warning\n }\n}' Use the option to report test assertions report only on non-extendable library classes (like 'String') and primitive types. This option can be useful, when testing 'equals()' methods.",
+ "markdown": "Reports calls to `equals()`, `compareTo()` or similar, that compare an object for equality with itself. The method contracts of these methods specify that such calls will always return `true` for `equals()` or `0` for `compareTo()`. The inspection also checks calls to `Objects.equals()`, `Objects.deepEquals()`, `Arrays.equals()`, `Comparator.compare()`, `assertEquals()` methods of test frameworks (JUnit, TestNG, AssertJ), `Integer.compare()`, `Integer.compareUnsigned()` and similar methods.\n\n**Example:**\n\n\n class Foo {\n boolean foo(Object o) {\n return o.equals(o); // warning\n }\n\n boolean bar(String[] ss) {\n return Arrays.equals(ss, ss); // warning\n }\n }\n\n\nUse the option to report test assertions report only on non-extendable library classes (like `String`) and primitive types.\nThis option can be useful, when testing `equals()` methods."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EqualsWithItself",
+ "cweIds": [
+ 571
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassInheritanceDepth",
+ "shortDescription": {
+ "text": "Class too deep in inheritance tree"
+ },
+ "fullDescription": {
+ "text": "Reports classes that are too deep in the inheritance hierarchy. Classes that are too deeply inherited may be confusing and indicate that a refactoring is necessary. All superclasses from a library are treated as a single superclass, libraries are considered unmodifiable. Use the Inheritance depth limit field to specify the maximum inheritance depth for a class.",
+ "markdown": "Reports classes that are too deep in the inheritance hierarchy.\n\nClasses that are too deeply inherited may be confusing and indicate that a refactoring is necessary.\n\nAll superclasses from a library are treated as a single superclass, libraries are considered unmodifiable.\n\nUse the **Inheritance depth limit** field to specify the maximum inheritance depth for a class."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassTooDeepInInheritanceTree",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 124,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MarkedForRemoval",
+ "shortDescription": {
+ "text": "Usage of API marked for removal"
+ },
+ "fullDescription": {
+ "text": "Reports usages of deprecated APIs (classes, fields, and methods) that are marked for removal with '@Deprecated(forRemoval=true)'. The code that uses an API marked for removal may cause a runtime error with a future version of the API. That is why the recommended severity for this inspection is Error. You can change the severity to Warning if you want to use the same code highlighting as in ordinary deprecation. New in 2017.3",
+ "markdown": "Reports usages of deprecated APIs (classes, fields, and methods) that are marked for removal with `@Deprecated(`**forRemoval**`=true)`.\n\n\nThe code that uses an API marked for removal may cause a runtime error with a future version of the API. That is why\nthe recommended severity for this inspection is *Error*.\n\n\nYou can change the severity to *Warning* if you want to use the same code highlighting as in ordinary deprecation.\n\nNew in 2017.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "removal",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 56,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestedConditionalExpression",
+ "shortDescription": {
+ "text": "Nested conditional expression"
+ },
+ "fullDescription": {
+ "text": "Reports nested conditional expressions as they may result in extremely confusing code. Example: 'int y = a == 10 ? b == 20 ? 10 : a : b;'",
+ "markdown": "Reports nested conditional expressions as they may result in extremely confusing code.\n\nExample:\n\n\n int y = a == 10 ? b == 20 ? 10 : a : b;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NestedConditionalExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WhileCanBeForeach",
+ "shortDescription": {
+ "text": "'while' loop can be replaced with enhanced 'for' loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'while' loops that iterate over collections and can be replaced with enhanced 'for' loops (foreach iteration syntax). Example: 'Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }' Can be replaced with: 'for (Object obj : c) {\n System.out.println(obj);\n }' This inspection depends on the Java feature 'For-each loops' which is available since Java 5.",
+ "markdown": "Reports `while` loops that iterate over collections and can be replaced with enhanced `for` loops (foreach iteration syntax).\n\n**Example:**\n\n\n Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }\n\nCan be replaced with:\n\n\n for (Object obj : c) {\n System.out.println(obj);\n }\n\nThis inspection depends on the Java feature 'For-each loops' which is available since Java 5."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WhileLoopReplaceableByForEach",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 120,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BulkFileAttributesRead",
+ "shortDescription": {
+ "text": "Bulk 'Files.readAttributes()' call can be used"
+ },
+ "fullDescription": {
+ "text": "Reports multiple sequential 'java.io.File' attribute checks, such as: 'isDirectory()' 'isFile()' 'lastModified()' 'length()' Such calls can be replaced with a bulk 'Files.readAttributes()' call. This is usually more performant than multiple separate attribute checks. Example: 'boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }' After the quick-fix is applied: 'boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }' This inspection does not show a warning if 'IOException' is not handled in the current context, but the quick-fix is still available. Note that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if the file does not exist at all. This inspection only reports if the language level of the project or module is 7 or higher. New in 2022.1",
+ "markdown": "Reports multiple sequential `java.io.File` attribute checks, such as:\n\n* `isDirectory()`\n* `isFile()`\n* `lastModified()`\n* `length()`\n\nSuch calls can be replaced with a bulk `Files.readAttributes()` call. This is usually more performant than multiple separate attribute checks.\n\nExample:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }\n\nThis inspection does not show a warning if `IOException` is not handled in the current context, but the quick-fix is still available.\n\nNote that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if\nthe file does not exist at all.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nNew in 2022.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BulkFileAttributesRead",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ImplicitNumericConversion",
+ "shortDescription": {
+ "text": "Implicit numeric conversion"
+ },
+ "fullDescription": {
+ "text": "Reports implicit conversion between numeric types. Implicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs. Example: 'double m(int i) {\n return i * 10;\n }' After the quick-fix is applied: 'double m(int i) {\n return (double) (i * 10);\n }' Configure the inspection: Use the Ignore widening conversions option to ignore implicit conversion that cannot result in data loss (for example, 'int'->'long'). Use the Ignore conversions from and to 'char' option to ignore conversion from and to 'char'. The inspection will still report conversion from and to floating-point numbers. Use the Ignore conversion from constants and literals to make the inspection ignore conversion from literals and compile-time constants.",
+ "markdown": "Reports implicit conversion between numeric types.\n\nImplicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs.\n\n**Example:**\n\n\n double m(int i) {\n return i * 10;\n }\n\nAfter the quick-fix is applied:\n\n\n double m(int i) {\n return (double) (i * 10);\n }\n\nConfigure the inspection:\n\n* Use the **Ignore widening conversions** option to ignore implicit conversion that cannot result in data loss (for example, `int`-\\>`long`).\n* Use the **Ignore conversions from and to 'char'** option to ignore conversion from and to `char`. The inspection will still report conversion from and to floating-point numbers.\n* Use the **Ignore conversion from constants and literals** to make the inspection ignore conversion from literals and compile-time constants."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ImplicitNumericConversion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NotNullFieldNotInitialized",
+ "shortDescription": {
+ "text": "@NotNull field is not initialized"
+ },
+ "fullDescription": {
+ "text": "Reports fields annotated as not-null that are not initialized in the constructor. Example: 'public class MyClass {\n private @NotNull String value;\n\n public void setValue(@NotNull String value) {\n this.value = value;\n }\n\n public @NotNull String getValue() {\n return value;\n }\n}' Such fields may violate the not-null constraint. In the example above, the 'setValue' parameter is annotated as not-null, but 'getValue' may return null if the setter was not called.",
+ "markdown": "Reports fields annotated as not-null that are not initialized in the constructor.\n\nExample:\n\n public class MyClass {\n private @NotNull String value;\n\n public void setValue(@NotNull String value) {\n this.value = value;\n }\n\n public @NotNull String getValue() {\n return value;\n }\n }\n\n\nSuch fields may violate the not-null constraint. In the example above, the `setValue` parameter is annotated as not-null, but\n`getValue` may return null if the setter was not called."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NotNullFieldNotInitialized",
+ "cweIds": [
+ 476
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs/Nullability problems",
+ "index": 172,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverlyComplexBooleanExpression",
+ "shortDescription": {
+ "text": "Overly complex boolean expression"
+ },
+ "fullDescription": {
+ "text": "Reports boolean expressions with too many terms. Such expressions may be confusing and bug-prone. Example: 'cond(x1) && cond(x2) ^ cond(x3) && cond(x4);' Configure the inspection: Use the Maximum number of terms field to specify the maximum number of terms allowed in a boolean expression. Use the Ignore pure conjunctions and disjunctions option to ignore boolean expressions which use only a single boolean operator repeatedly.",
+ "markdown": "Reports boolean expressions with too many terms. Such expressions may be confusing and bug-prone.\n\nExample:\n\n\n cond(x1) && cond(x2) ^ cond(x3) && cond(x4);\n\nConfigure the inspection:\n\n* Use the **Maximum number of terms** field to specify the maximum number of terms allowed in a boolean expression.\n* Use the **Ignore pure conjunctions and disjunctions** option to ignore boolean expressions which use only a single boolean operator repeatedly."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyComplexBooleanExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NotifyCalledOnCondition",
+ "shortDescription": {
+ "text": "'notify()' or 'notifyAll()' called on 'java.util.concurrent.locks.Condition' object"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'notify()' or 'notifyAll()' made on 'java.util.concurrent.locks.Condition' object. This is probably a programming error, and some variant of the 'signal()' or 'signalAll()' method was intended instead, otherwise 'IllegalMonitorStateException' may occur. Example: 'class C {\n final Lock l = new ReentrantLock();\n final Condition c = l.newCondition();\n\n void release() {\n l.lock();\n try {\n c.notifyAll(); // probably 'signalAll()' was intended here\n } finally {\n l.unlock();\n }\n }\n }'",
+ "markdown": "Reports calls to `notify()` or `notifyAll()` made on `java.util.concurrent.locks.Condition` object.\n\n\nThis is probably a programming error, and some variant of the `signal()` or\n`signalAll()` method was intended instead, otherwise `IllegalMonitorStateException` may occur.\n\n**Example:**\n\n\n class C {\n final Lock l = new ReentrantLock();\n final Condition c = l.newCondition();\n\n void release() {\n l.lock();\n try {\n c.notifyAll(); // probably 'signalAll()' was intended here\n } finally {\n l.unlock();\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NotifyCalledOnCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NewMethodNamingConvention",
+ "shortDescription": {
+ "text": "Method naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose names are too short, too long, or do not follow the specified regular expression pattern. Instance methods that override library methods and constructors are ignored by this inspection. Example: if the inspection is enabled for static methods, and the minimum specified method name length is 4 (the default), the following static method produces a warning, because the length of its name is 3, which is less than 4: 'public static int max(int a, int b)'. A quick-fix that renames such methods is available only in the editor. Configure the inspection: Use the list in the Options section to specify which methods should be checked. Deselect the checkboxes for the method types for which you want to skip the check. Specify 0 in the length fields to skip the corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format.",
+ "markdown": "Reports methods whose names are too short, too long, or do not follow the specified regular expression pattern.\n\nInstance methods that override library\nmethods and constructors are ignored by this inspection.\n\n**Example:** if the inspection is enabled for static methods, and the minimum specified method name length is 4 (the default),\nthe following static method produces a warning, because the length of its name is 3, which is less\nthan 4: `public static int max(int a, int b)`.\n\nA quick-fix that renames such methods is available only in the editor.\n\nConfigure the inspection:\n\nUse the list in the **Options** section to specify which methods should be checked. Deselect the checkboxes for the method types for which\nyou want to skip the check. Specify **0** in the length fields to skip the corresponding checks.\n\nRegular expressions should be specified in the standard `java.util.regex` format."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NewMethodNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 109,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverlyStrongTypeCast",
+ "shortDescription": {
+ "text": "Overly strong type cast"
+ },
+ "fullDescription": {
+ "text": "Reports type casts that are overly strong. For instance, casting an object to 'ArrayList' when casting it to 'List' would do just as well. Note: much like the Redundant type cast inspection, applying the fix for this inspection may change the semantics of your program if you are intentionally using an overly strong cast to cause a 'ClassCastException' to be generated. Example: 'interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }' Use the checkbox below to ignore casts when there's a matching 'instanceof' check in the code.",
+ "markdown": "Reports type casts that are overly strong. For instance, casting an object to `ArrayList` when casting it to `List` would do just as well.\n\n\n**Note:** much like the *Redundant type cast*\ninspection, applying the fix for this inspection may change the semantics of your program if you are\nintentionally using an overly strong cast to cause a `ClassCastException` to be generated.\n\nExample:\n\n\n interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }\n\n\nUse the checkbox below to ignore casts when there's a matching `instanceof` check in the code."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyStrongTypeCast",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 86,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaLangImport",
+ "shortDescription": {
+ "text": "Unnecessary import from the 'java.lang' package"
+ },
+ "fullDescription": {
+ "text": "Reports 'import' statements that refer to the 'java.lang' package. 'java.lang' classes are always implicitly imported, so such import statements are redundant and confusing. Since IntelliJ IDEA can automatically detect and fix such statements with its Optimize Imports command, this inspection is mostly useful for offline reporting on code bases that you don't intend to change.",
+ "markdown": "Reports `import` statements that refer to the `java.lang` package.\n\n\n`java.lang` classes are always implicitly imported, so such import statements are\nredundant and confusing.\n\n\nSince IntelliJ IDEA can automatically detect and fix such statements with its **Optimize Imports** command, this inspection is mostly useful for offline reporting on code bases that you don't intend to change."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavaLangImport",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Imports",
+ "index": 24,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UtilityClass",
+ "shortDescription": {
+ "text": "Utility class"
+ },
+ "fullDescription": {
+ "text": "Reports utility classes. Utility classes have all fields and methods declared as 'static' and their presence may indicate a lack of object-oriented design. Use the Ignore if annotated by option to specify special annotations. The inspection ignores classes annotated with one of these annotations.",
+ "markdown": "Reports utility classes.\n\nUtility classes have all fields and methods declared as `static` and their\npresence may indicate a lack of object-oriented design.\n\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection ignores classes annotated with one of\nthese annotations."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UtilityClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassNameDiffersFromFileName",
+ "shortDescription": {
+ "text": "Class name differs from file name"
+ },
+ "fullDescription": {
+ "text": "Reports top-level class names that don't match the name of a file containing them. While the Java specification allows for naming non-'public' classes this way, files with unmatched names may be confusing and decrease usefulness of various software tools.",
+ "markdown": "Reports top-level class names that don't match the name of a file containing them.\n\nWhile the Java specification allows for naming non-`public` classes this way,\nfiles with unmatched names may be confusing and decrease usefulness of various software tools."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassNameDiffersFromFileName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IndexOfReplaceableByContains",
+ "shortDescription": {
+ "text": "'String.indexOf()' expression can be replaced with 'contains()'"
+ },
+ "fullDescription": {
+ "text": "Reports comparisons with 'String.indexOf()' calls that can be replaced with a call to the 'String.contains()' method. Example: 'boolean b = \"abcd\".indexOf('e') >= 0;' After the quick-fix is applied: 'boolean b = \"abcd\".contains('e');' This inspection only reports if the language level of the project or module is 5 or higher.",
+ "markdown": "Reports comparisons with `String.indexOf()` calls that can be replaced with a call to the `String.contains()` method.\n\n**Example:**\n\n\n boolean b = \"abcd\".indexOf('e') >= 0;\n\nAfter the quick-fix is applied:\n\n\n boolean b = \"abcd\".contains('e');\n\nThis inspection only reports if the language level of the project or module is 5 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IndexOfReplaceableByContains",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 120,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringConcatenationArgumentToLogCall",
+ "shortDescription": {
+ "text": "Non-constant string concatenation as argument to logging call"
+ },
+ "fullDescription": {
+ "text": "Reports non-constant string concatenations that are used as arguments to SLF4J and Log4j 2 logging methods. Non-constant concatenations are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled. Example: 'public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld(\" + i + \", \" + s + \", \" + b + \")\");\n // todo\n }\n }' After the quick-fix is applied: 'public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld({}, {}, {})\", i, s, b);\n // todo\n }\n }' Configure the inspection: Use the Warn on list to ignore certain higher logging levels. Higher logging levels may be enabled even in production, and the arguments will always be evaluated.",
+ "markdown": "Reports non-constant string concatenations that are used as arguments to **SLF4J** and **Log4j 2** logging methods. Non-constant concatenations are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example:**\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld(\" + i + \", \" + s + \", \" + b + \")\");\n // todo\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld({}, {}, {})\", i, s, b);\n // todo\n }\n }\n\n\nConfigure the inspection:\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be enabled even in production, and the arguments will always be evaluated."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "StringConcatenationArgumentToLogCall",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 76,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalContainsCollection",
+ "shortDescription": {
+ "text": "'Optional' contains array or collection"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.util.Optional' or 'com.google.common.base.Optional' types with an array or collection type parameter. In such cases, it is more clear to just use an empty array or collection to indicate the absence of result. Example: 'Optional> foo() {\n return Optional.empty();\n }' This code could look like: 'List foo() {\n return List.of();\n }' This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.",
+ "markdown": "Reports `java.util.Optional` or `com.google.common.base.Optional` types with an array or collection type parameter.\n\nIn such cases, it is more clear to just use an empty array or collection to indicate the absence of result.\n\n**Example:**\n\n\n Optional> foo() {\n return Optional.empty();\n }\n\nThis code could look like:\n\n\n List foo() {\n return List.of();\n }\n \nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalContainsCollection",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoadLibraryWithNonConstantString",
+ "shortDescription": {
+ "text": "Call to 'System.loadLibrary()' with non-constant string"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.lang.System.loadLibrary()', 'java.lang.System.load()', 'java.lang.Runtime.loadLibrary()' and 'java.lang.Runtime.load()' which take a dynamically-constructed string as the name of the library. Constructed library name strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }' Use the inspection settings to consider any 'static final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'private static final String LIBRARY = getUserInput();'",
+ "markdown": "Reports calls to `java.lang.System.loadLibrary()`, `java.lang.System.load()`, `java.lang.Runtime.loadLibrary()` and `java.lang.Runtime.load()` which take a dynamically-constructed string as the name of the library.\n\n\nConstructed library name strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }\n\n\nUse the inspection settings to consider any `static final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n private static final String LIBRARY = getUserInput();\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LoadLibraryWithNonConstantString",
+ "cweIds": [
+ 114,
+ 494,
+ 676,
+ 829
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 38,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifiableAssertion",
+ "shortDescription": {
+ "text": "Simplifiable assertion"
+ },
+ "fullDescription": {
+ "text": "Reports any 'assert' calls that can be replaced with simpler and equivalent calls. Example → Replacement 'assertEquals(true, x());' 'assertTrue(x());' 'assertTrue(y() != null);' 'assertNotNull(y());' 'assertTrue(z == z());' 'assertSame(z, z());' 'assertTrue(a.equals(a()));' 'assertEquals(a, a());' 'assertTrue(false);' 'fail();'",
+ "markdown": "Reports any `assert` calls that can be replaced with simpler and equivalent calls.\n\n| Example | → | Replacement |\n|----------------------------------|---|-------------------------|\n| `assertEquals(`**true**`, x());` | | `assertTrue(x());` |\n| `assertTrue(y() != null);` | | `assertNotNull(y());` |\n| `assertTrue(z == z());` | | `assertSame(z, z());` |\n| `assertTrue(a.equals(a()));` | | `assertEquals(a, a());` |\n| `assertTrue(`**false**`);` | | `fail();` |"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifiableAssertion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Test frameworks",
+ "index": 128,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InterfaceMethodClashesWithObject",
+ "shortDescription": {
+ "text": "Interface method clashes with method in 'Object'"
+ },
+ "fullDescription": {
+ "text": "Reports interface methods that clash with the protected methods 'clone()' and 'finalize()' from the 'java.lang.Object' class. In an interface, it is possible to declare these methods with a return type that is incompatible with the 'java.lang.Object' methods. A class that implements such an interface will not be compilable. When the interface is functional, it remains possible to create a lambda from it, but this is not recommended. Example: '// Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }'",
+ "markdown": "Reports interface methods that clash with the **protected** methods `clone()` and `finalize()` from the `java.lang.Object` class.\n\nIn an interface, it is possible to declare these methods with a return type that is incompatible with the `java.lang.Object` methods.\nA class that implements such an interface will not be compilable.\nWhen the interface is functional, it remains possible to create a lambda from it, but this is not recommended.\n\nExample:\n\n\n // Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InterfaceMethodClashesWithObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 86,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticMethodOnlyUsedInOneClass",
+ "shortDescription": {
+ "text": "Static member only used from one other class"
+ },
+ "fullDescription": {
+ "text": "Reports 'static' methods and fields that are only used from a class other than the containing class. Such members could be moved into the using class. Factory methods and members accessed from an anonymous class inside the member's class are ignored by this inspection. Convenience overloads, which call a method with the same name in the same class but have fewer parameters, are also ignored. Use the first checkbox to suppress this inspection when the static member is only used from a test class. Use the second checkbox below to ignore member usages from inside anonymous, local, or non-static inner classes. Use the third checkbox below to not warn on members that cannot be moved without problems, for example, because a method with an identical signature is already present in the target class, or because a field or a method used inside the method will not be accessible when this method is moved. Use the fourth checkbox to ignore members located in utility classes.",
+ "markdown": "Reports `static` methods and fields that are only used from a class other than the containing class. Such members could be moved into the using class. Factory methods and members accessed from an anonymous class inside the member's class are ignored by this inspection. Convenience overloads, which call a method with the same name in the same class but have fewer parameters, are also ignored.\n\n\nUse the first checkbox to suppress this inspection when the static member is only used from a test class.\n\n\nUse the second checkbox below to ignore member usages from inside anonymous, local, or non-static inner classes.\n\n\nUse the third checkbox below to not warn on members that cannot be moved without problems,\nfor example, because a method with an identical signature is already present in the target class,\nor because a field or a method used inside the method will not be accessible when this method is moved.\n\n\nUse the fourth checkbox to ignore members located in utility classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticMethodOnlyUsedInOneClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 86,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantEscapeInRegexReplacement",
+ "shortDescription": {
+ "text": "Redundant escape in regex replacement string"
+ },
+ "fullDescription": {
+ "text": "Reports redundant escapes in the replacement string of regex methods. It is allowed to escape any character in a regex replacement string, but only for the '$' and '\\' characters is escaping necessary. Example: 'string.replaceAll(\"a\", \"\\\\b\");' After the quick-fix is applied: 'string.replaceAll(\"a\", \"b\");' New in 2022.3",
+ "markdown": "Reports redundant escapes in the replacement string of regex methods. It is allowed to escape any character in a regex replacement string, but only for the `$` and `\\` characters is escaping necessary.\n\n**Example:**\n\n\n string.replaceAll(\"a\", \"\\\\b\");\n\nAfter the quick-fix is applied:\n\n\n string.replaceAll(\"a\", \"b\");\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantEscapeInRegexReplacement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizedOnLiteralObject",
+ "shortDescription": {
+ "text": "Synchronization on an object initialized with a literal"
+ },
+ "fullDescription": {
+ "text": "Reports 'synchronized' blocks that lock on an object initialized with a literal. String literals are interned and 'Character', 'Boolean' and 'Number' literals can be allocated from a cache. Because of this, it is possible that some other part of the system, which uses an object initialized with the same literal, is actually holding a reference to the exact same object. This can create unexpected dead-lock situations, if the lock object was thought to be private. Example: 'class Main {\n final String mutex = \"Mutex\";\n void method() {\n synchronized (mutex) {\n }\n }\n }' Use the Warn on all possible literals option to report any synchronization on 'String', 'Character', 'Boolean' and 'Number' objects.",
+ "markdown": "Reports `synchronized` blocks that lock on an object initialized with a literal.\n\n\nString literals are interned and `Character`, `Boolean` and `Number` literals can be allocated from a cache.\nBecause of this, it is possible that some other part of the system, which uses an object initialized with the same literal, is actually\nholding a reference to the exact same object. This can create unexpected dead-lock situations, if the lock object was thought to be private.\n\n**Example:**\n\n\n class Main {\n final String mutex = \"Mutex\";\n void method() {\n synchronized (mutex) {\n }\n }\n }\n\n\nUse the **Warn on all possible literals** option to report any synchronization on\n`String`, `Character`, `Boolean` and `Number` objects."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchronizedOnLiteralObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java9ReflectionClassVisibility",
+ "shortDescription": {
+ "text": "Reflective access across modules issues"
+ },
+ "fullDescription": {
+ "text": "Reports 'Class.forName()' and 'ClassLoader.loadClass()' calls which try to access classes that aren't visible in the current scope due to Java 9 module accessibility rules. This inspection depends on the Java feature 'Modules' which is available since Java 9.",
+ "markdown": "Reports `Class.forName()` and `ClassLoader.loadClass()` calls which try to access classes that aren't visible in the current scope due to Java 9 module accessibility rules.\n\nThis inspection depends on the Java feature 'Modules' which is available since Java 9."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java9ReflectionClassVisibility",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Reflective access",
+ "index": 129,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CharsetObjectCanBeUsed",
+ "shortDescription": {
+ "text": "Standard 'Charset' object can be used"
+ },
+ "fullDescription": {
+ "text": "Reports methods and constructors in which constant charset 'String' literal (for example, '\"UTF-8\"') can be replaced with the predefined 'StandardCharsets.UTF_8' code. The code after the fix may work faster, because the charset lookup becomes unnecessary. Also, catching 'UnsupportedEncodingException' may become unnecessary as well. In this case, the catch block will be removed automatically. Example: 'try {\n byte[] bytes = \"str\".getBytes(\"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n }' After quick-fix is applied: 'byte[] bytes = \"str\".getBytes(StandardCharsets.UTF_8);' The inspection is available in Java 7 and later. New in 2018.2",
+ "markdown": "Reports methods and constructors in which constant charset `String` literal (for example, `\"UTF-8\"`) can be replaced with the predefined `StandardCharsets.UTF_8` code.\n\nThe code after the fix may work faster, because the charset lookup becomes unnecessary.\nAlso, catching `UnsupportedEncodingException` may become unnecessary as well. In this case,\nthe catch block will be removed automatically.\n\nExample:\n\n\n try {\n byte[] bytes = \"str\".getBytes(\"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n }\n\nAfter quick-fix is applied:\n\n\n byte[] bytes = \"str\".getBytes(StandardCharsets.UTF_8);\n\nThe inspection is available in Java 7 and later.\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CharsetObjectCanBeUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfSunClasses",
+ "shortDescription": {
+ "text": "Use of 'sun.*' classes"
+ },
+ "fullDescription": {
+ "text": "Reports uses of classes from the 'sun.*' hierarchy. Such classes are non-portable between different JVMs.",
+ "markdown": "Reports uses of classes from the `sun.*` hierarchy. Such classes are non-portable between different JVMs."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfSunClasses",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 95,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantCast",
+ "shortDescription": {
+ "text": "Redundant type cast"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary cast expressions. Example: 'static Object toObject(String s) {\n return (Object) s;\n }' Use the checkbox below to ignore clarifying casts e.g., casts in collection calls where 'Object' is expected: 'static void removeFromList(List l, Object o) {\n l.remove((String)o);\n }'",
+ "markdown": "Reports unnecessary cast expressions.\n\nExample:\n\n\n static Object toObject(String s) {\n return (Object) s;\n }\n\n\nUse the checkbox below to ignore clarifying casts e.g., casts in collection calls where `Object` is expected:\n\n\n static void removeFromList(List l, Object o) {\n l.remove((String)o);\n } \n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantCast",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnonymousInnerClass",
+ "shortDescription": {
+ "text": "Anonymous class can be replaced with inner class"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous classes. Occasionally replacing anonymous classes with inner classes can lead to more readable and maintainable code. Some code standards discourage anonymous classes. Example: 'class Example {\n public static void main(String[] args) {\n new Thread() {\n public void run() {\n work()\n }\n\n private void work() {}\n }.start();\n }\n }' After the quick-fix is applied: 'class Example {\n public static void main(String[] args) {\n new MyThread().start();\n }\n\n private static class MyThread extends Thread {\n public void run() {\n work();\n }\n\n private void work() {}\n }\n }'",
+ "markdown": "Reports anonymous classes.\n\nOccasionally replacing anonymous classes with inner classes can lead to more readable and maintainable code.\nSome code standards discourage anonymous classes.\n\n**Example:**\n\n\n class Example {\n public static void main(String[] args) {\n new Thread() {\n public void run() {\n work()\n }\n\n private void work() {}\n }.start();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n public static void main(String[] args) {\n new MyThread().start();\n }\n\n private static class MyThread extends Thread {\n public void run() {\n work();\n }\n\n private void work() {}\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "AnonymousInnerClass",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifyCollector",
+ "shortDescription": {
+ "text": "Simplifiable collector"
+ },
+ "fullDescription": {
+ "text": "Reports collectors that can be simplified. In particular, some cascaded 'groupingBy()' collectors can be expressed by using a simpler 'toMap()' collector, which is also likely to be more performant. Example: 'Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));' After the quick-fix is applied: 'Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));' This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8. New in 2017.1",
+ "markdown": "Reports collectors that can be simplified.\n\nIn particular, some cascaded `groupingBy()` collectors can be expressed by using a\nsimpler `toMap()` collector, which is also likely to be more performant.\n\nExample:\n\n\n Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));\n\nAfter the quick-fix is applied:\n\n\n Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifyCollector",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MultipleTopLevelClassesInFile",
+ "shortDescription": {
+ "text": "Multiple top level classes in single file"
+ },
+ "fullDescription": {
+ "text": "Reports multiple top-level classes in a single Java file. Putting multiple top-level classes in one file may be confusing and degrade the usefulness of various software tools.",
+ "markdown": "Reports multiple top-level classes in a single Java file.\n\nPutting multiple\ntop-level classes in one file may be confusing and degrade the usefulness of various\nsoftware tools."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MultipleTopLevelClassesInFile",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IteratorNextDoesNotThrowNoSuchElementException",
+ "shortDescription": {
+ "text": "'Iterator.next()' which can't throw 'NoSuchElementException'"
+ },
+ "fullDescription": {
+ "text": "Reports implementations of 'Iterator.next()' that cannot throw 'java.util.NoSuchElementException'. Such implementations violate the contract of 'java.util.Iterator', and may result in subtle bugs if the iterator is used in a non-standard way. Example: 'class Numbers implements Iterator {\n @Override\n public Integer next() { //warning\n if (hasNext()) {\n return generateNext();\n } else {\n return null; //throw NoSuchElementException instead\n }\n }\n\n ...\n }'",
+ "markdown": "Reports implementations of `Iterator.next()` that cannot throw `java.util.NoSuchElementException`.\n\n\nSuch implementations violate the contract of `java.util.Iterator`,\nand may result in subtle bugs if the iterator is used in a non-standard way.\n\n**Example:**\n\n\n class Numbers implements Iterator {\n @Override\n public Integer next() { //warning\n if (hasNext()) {\n return generateNext();\n } else {\n return null; //throw NoSuchElementException instead\n }\n }\n\n ...\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IteratorNextCanNotThrowNoSuchElementException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IncorrectMessageFormat",
+ "shortDescription": {
+ "text": "Incorrect 'MessageFormat' pattern"
+ },
+ "fullDescription": {
+ "text": "Reports incorrect message format patterns or incorrect indexes of placeholders The following errors are reported: Unparsed or negative index Unclosed brace Unpaired quote. In this case, a part of a pattern may not be used Probably incorrect number of quotes Incorrect lower bound of nested choice patterns Incorrect indexes of placeholders. In this case, a placeholder may not be substituted or an argument may not be used Examples: 'MessageFormat.format(\"{wrong}\", 1); // incorrect index\n MessageFormat.format(\"{0\", 1); // Unmatched brace\n MessageFormat.format(\"'{0}\", 1); // Unpaired quote\n MessageFormat.format(\"It''''s {0}\", 1); // \"It''s\" will be printed, instead of \"It's\"\n MessageFormat.format(\"{0}\", 1, 2); // The argument with index '1' is not used in the pattern' New in 2023.2",
+ "markdown": "Reports incorrect message format patterns or incorrect indexes of placeholders\n\nThe following errors are reported:\n\n* Unparsed or negative index\n* Unclosed brace\n* Unpaired quote. In this case, a part of a pattern may not be used\n* Probably incorrect number of quotes\n* Incorrect lower bound of nested choice patterns\n* Incorrect indexes of placeholders. In this case, a placeholder may not be substituted or an argument may not be used\n\nExamples:\n\n\n MessageFormat.format(\"{wrong}\", 1); // incorrect index\n MessageFormat.format(\"{0\", 1); // Unmatched brace\n MessageFormat.format(\"'{0}\", 1); // Unpaired quote\n MessageFormat.format(\"It''''s {0}\", 1); // \"It''s\" will be printed, instead of \"It's\"\n MessageFormat.format(\"{0}\", 1, 2); // The argument with index '1' is not used in the pattern\n\nNew in 2023.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IncorrectMessageFormat",
+ "cweIds": [
+ 628,
+ 707
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousTernaryOperatorInVarargsCall",
+ "shortDescription": {
+ "text": "Suspicious ternary operator in varargs method call"
+ },
+ "fullDescription": {
+ "text": "Reports vararg method calls that use a ternary operator with mixed array and non-array branches. When compiled, both branches are wrapped in arrays. As a result, the array branch is turned into a two-dimensional array, which may indicate a problem. The quick-fix wraps the non-array branch in an array to prevent the compiler from doing the conversion. Example: 'static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : b);\n }\n static void foo(Object... obj) {\n }' After the quick-fix: 'static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : new Object[]{b});\n }\n static void foo(Object... obj) {\n }' This inspection depends on the Java feature 'Variable arity methods' which is available since Java 5. New in 2020.3",
+ "markdown": "Reports vararg method calls that use a ternary operator with mixed array and non-array branches.\n\n\nWhen compiled, both branches are wrapped in arrays. As a result, the array branch is turned into\na two-dimensional array, which may indicate a problem.\n\n\nThe quick-fix wraps the non-array branch in an array to prevent the compiler from doing the conversion.\n\n**Example:**\n\n\n static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : b);\n }\n static void foo(Object... obj) {\n }\n\nAfter the quick-fix:\n\n\n static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : new Object[]{b});\n }\n static void foo(Object... obj) {\n }\n\nThis inspection depends on the Java feature 'Variable arity methods' which is available since Java 5.\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousTernaryOperatorInVarargsCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableInnerClassHasSerialVersionUIDField",
+ "shortDescription": {
+ "text": "Serializable non-static inner class without 'serialVersionUID'"
+ },
+ "fullDescription": {
+ "text": "Reports non-static inner classes that implement 'java.io.Serializable', but do not define a 'serialVersionUID' field. Without a 'serialVersionUID' field, any change to the class will make previously serialized versions unreadable. It is strongly recommended that 'Serializable' non-static inner classes have a 'serialVersionUID' field, otherwise the default serialization algorithm may result in serialized versions being incompatible between compilers due to differences in synthetic accessor methods. A quick-fix is suggested to add the missing 'serialVersionUID' field. Example: 'class Outer {\n class Inner implements Serializable {}\n }' After the quick-fix is applied: 'class Outer {\n class Inner implements Serializable {\n private static final long serialVersionUID = -7004458730436243902L;\n }\n }' Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Whether to ignore 'Serializable' anonymous classes.",
+ "markdown": "Reports non-static inner classes that implement `java.io.Serializable`, but do not define a `serialVersionUID` field.\n\n\nWithout a `serialVersionUID` field, any change to the class will make previously\nserialized versions unreadable. It is strongly recommended that `Serializable`\nnon-static inner classes have a `serialVersionUID` field, otherwise the default\nserialization algorithm may result in serialized versions being incompatible between\ncompilers due to differences in synthetic accessor methods.\n\n\nA quick-fix is suggested to add the missing `serialVersionUID` field.\n\n**Example:**\n\n\n class Outer {\n class Inner implements Serializable {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Outer {\n class Inner implements Serializable {\n private static final long serialVersionUID = -7004458730436243902L;\n }\n }\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization.\n* Whether to ignore `Serializable` anonymous classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableNonStaticInnerClassWithoutSerialVersionUID",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 21,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterNameDiffersFromOverriddenParameter",
+ "shortDescription": {
+ "text": "Parameter name differs from parameter in overridden or overloaded method"
+ },
+ "fullDescription": {
+ "text": "Reports parameters whose names differ from the corresponding parameters of the methods they override or overload. While legal in Java, such inconsistent names may be confusing and decrease the documentation benefits of good naming practices. Example: 'class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String name) { super(name); }\n }' After the quick-fix is applied: 'class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String fullName) { super(fullName); }\n }' Use the options to indicate whether to ignore overridden parameter names that are only a single character long or come from a library method. Both can be useful if you do not wish to be bound by dubious naming conventions used in libraries.",
+ "markdown": "Reports parameters whose names differ from the corresponding parameters of the methods they override or overload. While legal in Java, such inconsistent names may be confusing and decrease the documentation benefits of good naming practices.\n\n**Example:**\n\n\n class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String name) { super(name); }\n }\n\nAfter the quick-fix is applied:\n\n\n class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String fullName) { super(fullName); }\n }\n\n\nUse the options to indicate whether to ignore overridden parameter names that are only\na single character long or come from a library method. Both can be useful if\nyou do not wish to be bound by dubious naming conventions used in libraries."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ParameterNameDiffersFromOverriddenParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 81,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OctalLiteral",
+ "shortDescription": {
+ "text": "Octal integer"
+ },
+ "fullDescription": {
+ "text": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals. Example: 'int i = 015;\n int j = 0_777;' This inspection has two different quick-fixes. After the Convert octal literal to decimal literal quick-fix is applied, the code changes to: 'int i = 13;\n int j = 511;' After the Remove leading zero to make decimal quick-fix is applied, the code changes to: 'int i = 15;\n int j = 777;'",
+ "markdown": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals.\n\nExample:\n\n\n int i = 015;\n int j = 0_777;\n\nThis inspection has two different quick-fixes.\nAfter the **Convert octal literal to decimal literal** quick-fix is applied, the code changes to:\n\n\n int i = 13;\n int j = 511;\n\nAfter the **Remove leading zero to make decimal** quick-fix is applied, the code changes to:\n\n\n int i = 15;\n int j = 777;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OctalInteger",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReadWriteStringCanBeUsed",
+ "shortDescription": {
+ "text": "'Files.readString()' or 'Files.writeString()' can be used"
+ },
+ "fullDescription": {
+ "text": "Reports method calls that read or write a 'String' as bytes using 'java.nio.file.Files'. Such calls can be replaced with a call to a 'Files.readString()' or 'Files.writeString()' method introduced in Java 11. Example: 'String s = \"example\";\n Files.write(Paths.get(\"out.txt\"), s.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE);\n s = new String(Files.readAllBytes(Paths.get(\"in.txt\")), StandardCharsets.ISO_8859_1);' After the quick fix is applied: 'String s = \"example\";\n Files.writeString(Paths.get(\"out.txt\"), s, StandardOpenOption.WRITE);\n s = Files.readString(Paths.get(\"in.txt\"), StandardCharsets.ISO_8859_1);' New in 2018.3",
+ "markdown": "Reports method calls that read or write a `String` as bytes using `java.nio.file.Files`. Such calls can be replaced with a call to a `Files.readString()` or `Files.writeString()` method introduced in Java 11.\n\n**Example:**\n\n\n String s = \"example\";\n Files.write(Paths.get(\"out.txt\"), s.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE);\n s = new String(Files.readAllBytes(Paths.get(\"in.txt\")), StandardCharsets.ISO_8859_1);\n\nAfter the quick fix is applied:\n\n\n String s = \"example\";\n Files.writeString(Paths.get(\"out.txt\"), s, StandardOpenOption.WRITE);\n s = Files.readString(Paths.get(\"in.txt\"), StandardCharsets.ISO_8859_1);\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReadWriteStringCanBeUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 11",
+ "index": 176,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CyclomaticComplexity",
+ "shortDescription": {
+ "text": "Overly complex method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that have too many branch points. A branch point is one of the following: loop statement 'if' statement ternary expression 'catch' section expression with one or more '&&' or '||' operators inside 'switch' block with non-default branches Methods with too high cyclomatic complexity may be confusing and hard to test. Use the Method complexity limit field to specify the maximum allowed cyclomatic complexity for a method.",
+ "markdown": "Reports methods that have too many branch points.\n\nA branch point is one of the following:\n\n* loop statement\n* `if` statement\n* ternary expression\n* `catch` section\n* expression with one or more `&&` or `||` operators inside\n* `switch` block with non-default branches\n\nMethods with too high cyclomatic complexity may be confusing and hard to test.\n\nUse the **Method complexity limit** field to specify the maximum allowed cyclomatic complexity for a method."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyComplexMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 133,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AwaitNotInLoop",
+ "shortDescription": {
+ "text": "'await()' not called in loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.util.concurrent.locks.Condition.await()' not being called inside a loop. 'await()' and related methods are normally used to suspend a thread until some condition becomes true. As the thread could have been woken up for a different reason, the condition should be checked after the 'await()' call returns. A loop is a simple way to achieve this. Example: 'void acquire(Condition released) throws InterruptedException {\n released.await();\n }' Good code should look like this: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }'",
+ "markdown": "Reports `java.util.concurrent.locks.Condition.await()` not being called inside a loop.\n\n\n`await()` and related methods are normally used to suspend a thread until some condition becomes true.\nAs the thread could have been woken up for a different reason,\nthe condition should be checked after the `await()` call returns.\nA loop is a simple way to achieve this.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n released.await();\n }\n\nGood code should look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AwaitNotInLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticVariableUninitializedUse",
+ "shortDescription": {
+ "text": "Static field used before initialization"
+ },
+ "fullDescription": {
+ "text": "Reports 'static' variables that are read before initialization. The inspection ignores equality checks with 'null'. Example: 'class Foo {\n public static int bar;\n\n public static void main(String[] args) {\n System.out.println(bar);\n }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report 'static' variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore primitive fields option to ignore uninitialized primitive fields.",
+ "markdown": "Reports `static` variables that are read before initialization.\n\nThe inspection ignores equality checks with `null`.\n\n**Example:**\n\n\n class Foo {\n public static int bar;\n\n public static void main(String[] args) {\n System.out.println(bar);\n }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report `static` variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticVariableUsedBeforeInitialization",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 33,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CyclicClassDependency",
+ "shortDescription": {
+ "text": "Cyclic class dependency"
+ },
+ "fullDescription": {
+ "text": "Reports classes that are mutually or cyclically dependent on other classes. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.",
+ "markdown": "Reports classes that are mutually or cyclically dependent on other classes.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CyclicClassDependency",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 144,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringBufferReplaceableByStringBuilder",
+ "shortDescription": {
+ "text": "'StringBuffer' may be 'StringBuilder'"
+ },
+ "fullDescription": {
+ "text": "Reports variables declared as 'StringBuffer' and suggests replacing them with 'StringBuilder'. 'StringBuilder' is a non-thread-safe replacement for 'StringBuffer'. This inspection only reports if the language level of the project or module is 5 or higher.",
+ "markdown": "Reports variables declared as `StringBuffer` and suggests replacing them with `StringBuilder`. `StringBuilder` is a non-thread-safe replacement for `StringBuffer`.\n\nThis inspection only reports if the language level of the project or module is 5 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringBufferMayBeStringBuilder",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 120,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizedMethod",
+ "shortDescription": {
+ "text": "'synchronized' method"
+ },
+ "fullDescription": {
+ "text": "Reports the 'synchronized' modifier on methods. There are several reasons a 'synchronized' modifier on a method may be a bad idea: As little work as possible should be performed under a lock. Therefore it is often better to use a 'synchronized' block and keep there only the code that works with shared state. Synchronization becomes a part of a method's interface. This makes a transition to a different locking mechanism difficult. Keeping track of what is locking a particular object gets harder. The DoS (denial-of-service) attack becomes feasible either on purpose or unknowingly when inheriting the method's class. As an alternative, consider synchronizing on a 'private final' lock object, access to which can be completely controlled. A quick-fix is provided to wrap the method body with 'synchronized(this)'. Example: 'class Main {\n public synchronized void fooBar() {\n }\n }' After the quick-fix is applied: 'class Main {\n public void fooBar() {\n synchronized (this) {\n }\n }\n }' You can configure the following options for this inspection: Include native methods - include native methods into the inspection's scope. Ignore methods overriding a synchronized method - do not report methods that override a 'synchronized' method.",
+ "markdown": "Reports the `synchronized` modifier on methods.\n\n\nThere are several reasons a `synchronized` modifier on a method may be a bad idea:\n\n1. As little work as possible should be performed under a lock. Therefore it is often better to use a `synchronized` block and keep there only the code that works with shared state.\n2. Synchronization becomes a part of a method's interface. This makes a transition to a different locking mechanism difficult.\n3. Keeping track of what is locking a particular object gets harder.\n4. The DoS (denial-of-service) attack becomes feasible either on purpose or unknowingly when inheriting the method's class.\n\n\nAs an alternative, consider synchronizing on a `private final` lock object, access to which can be completely controlled.\n\nA quick-fix is provided to wrap the method body with `synchronized(this)`.\n\n**Example:**\n\n\n class Main {\n public synchronized void fooBar() {\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n public void fooBar() {\n synchronized (this) {\n }\n }\n }\n\nYou can configure the following options for this inspection:\n\n1. **Include native methods** - include native methods into the inspection's scope.\n2. **Ignore methods overriding a synchronized method** - do not report methods that override a `synchronized` method."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchronizedMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbstractMethodWithMissingImplementations",
+ "shortDescription": {
+ "text": "Abstract method with missing implementations"
+ },
+ "fullDescription": {
+ "text": "Reports 'abstract' methods that are not implemented in every concrete subclass. This results in a compile-time error on the subclasses; the inspection reports the problem at the point of the abstract method, allowing faster detection of the problem.",
+ "markdown": "Reports `abstract` methods that are not implemented in every concrete subclass.\n\n\nThis results in a compile-time error on the subclasses;\nthe inspection reports the problem at the point of the abstract method, allowing faster detection of the problem."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbstractMethodWithMissingImplementations",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 149,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Convert2MethodRef",
+ "shortDescription": {
+ "text": "Lambda can be replaced with method reference"
+ },
+ "fullDescription": {
+ "text": "Reports lambdas that can be replaced with method references. While often it could be a matter of taste, method references are more clear and readable compared to lambdas. Example: 'Runnable r = () -> System.out.println();' After the quick-fix is applied: 'Runnable r = System.out::println;' The inspection may suggest method references even if a lambda doesn't call any method, like replacing 'obj -> obj != null' with 'Objects::nonNull'. Use the Settings | Editor | Code Style | Java | Code Generation settings to configure special method references. This inspection depends on the Java feature 'Lambda expressions' which is available since Java 8.",
+ "markdown": "Reports lambdas that can be replaced with method references. While often it could be a matter of taste, method references are more clear and readable compared to lambdas.\n\nExample:\n\n\n Runnable r = () -> System.out.println();\n\nAfter the quick-fix is applied:\n\n\n Runnable r = System.out::println;\n\n\nThe inspection may suggest method references even if a lambda doesn't call any method, like replacing `obj -> obj != null`\nwith `Objects::nonNull`.\nUse the [Settings \\| Editor \\| Code Style \\| Java \\| Code Generation](settings://preferences.sourceCode.Java?Lambda%20Body)\nsettings to configure special method references.\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Convert2MethodRef",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 121,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassOnlyUsedInOnePackage",
+ "shortDescription": {
+ "text": "Class only used from one other package"
+ },
+ "fullDescription": {
+ "text": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.",
+ "markdown": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassOnlyUsedInOnePackage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Packaging issues",
+ "index": 44,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryToStringCall",
+ "shortDescription": {
+ "text": "Unnecessary call to 'toString()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null.",
+ "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods, and the explicit call to `toString()` is not needed.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryToStringCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuppressionAnnotation",
+ "shortDescription": {
+ "text": "Inspection suppression annotation"
+ },
+ "fullDescription": {
+ "text": "Reports comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\nstatic Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n}'",
+ "markdown": "Reports comments or annotations suppressing inspections.\n\nThis inspection can be useful when leaving suppressions intentionally for further review.\n\n**Example:**\n\n\n @SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuppressionAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 3,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizeOnNonFinalField",
+ "shortDescription": {
+ "text": "Synchronization on a non-final field"
+ },
+ "fullDescription": {
+ "text": "Reports 'synchronized' statement lock expressions that consist of a non-'final' field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object. Example: 'private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }'",
+ "markdown": "Reports `synchronized` statement lock expressions that consist of a non-`final` field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object.\n\n**Example:**\n\n\n private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchronizeOnNonFinalField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReturnSeparatedFromComputation",
+ "shortDescription": {
+ "text": "'return' separated from the result computation"
+ },
+ "fullDescription": {
+ "text": "Reports 'return' statements that return a local variable where the value of the variable is computed somewhere else within the same method. The quick-fix inlines the returned variable by moving the return statement to the location in which the value of the variable is computed. When the returned value can't be inlined into the 'return' statement, the quick-fix attempts to move the return statement as close to the computation of the returned value as possible. Example: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;' After the quick-fix is applied: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;'",
+ "markdown": "Reports `return` statements that return a local variable where the value of the variable is computed somewhere else within the same method.\n\nThe quick-fix inlines the returned variable by moving the return statement to the location in which the value\nof the variable is computed.\nWhen the returned value can't be inlined into the `return` statement,\nthe quick-fix attempts to move the return statement as close to the computation of the returned value as possible.\n\nExample:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;\n\nAfter the quick-fix is applied:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ReturnSeparatedFromComputation",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArrayObjectsEquals",
+ "shortDescription": {
+ "text": "Use of shallow or 'Objects' methods with arrays"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that seem to use an inappropriate method for determining array equality or calculating their hashcode. The following method calls are reported: 'Object.equals()' for any arrays 'Arrays.equals()' for multidimensional arrays 'Arrays.hashCode()' for multidimensional arrays",
+ "markdown": "Reports expressions that seem to use an inappropriate method for determining array equality or calculating their hashcode.\n\nThe following method calls are reported:\n\n* `Object.equals()` for any arrays\n* `Arrays.equals()` for multidimensional arrays\n* `Arrays.hashCode()` for multidimensional arrays"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ArrayObjectsEquals",
+ "cweIds": [
+ 480
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsWhichDoesntCheckParameterClass",
+ "shortDescription": {
+ "text": "'equals()' method which does not check class of parameter"
+ },
+ "fullDescription": {
+ "text": "Reports 'equals()' methods that do not check the type of their parameter. Failure to check the type of the parameter in the 'equals()' method may result in latent errors if the object is used in an untyped collection. Example: 'class MyClass {\n int x;\n\n @Override\n public boolean equals(Object obj) {\n // equals method should return false if obj is not MyClass\n return ((MyClass)obj).x == x;\n }\n }'",
+ "markdown": "Reports `equals()` methods that do not check the type of their parameter.\n\nFailure to check the type of the parameter\nin the `equals()` method may result in latent errors if the object is used in an untyped collection.\n\n**Example:**\n\n\n class MyClass {\n int x;\n\n @Override\n public boolean equals(Object obj) {\n // equals method should return false if obj is not MyClass\n return ((MyClass)obj).x == x;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EqualsWhichDoesntCheckParameterClass",
+ "cweIds": [
+ 697
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseHashCodeMethodInspection",
+ "shortDescription": {
+ "text": "Standard 'hashCode()' method can be used"
+ },
+ "fullDescription": {
+ "text": "Reports bitwise operations that can be replaced with a call to the 'Long.hashCode()' or 'Double.hashCode()' methods. It detects the construct '(int)(x ^ (x >>> 32))' where 'x' is a variable of type 'long' or the result of a previous 'Double.doubleToLongBits()' call. The replacement shortens the code, improving its readability. Example: 'int result = (int)(var ^ (var >>> 32));' After applying the quick-fix: 'int result = Long.hashCode(var);' This inspection only reports if the language level of the project or module is 8 or higher. New in 2024.1",
+ "markdown": "Reports bitwise operations that can be replaced with a call to the `Long.hashCode()` or `Double.hashCode()` methods. It detects the construct `(int)(x ^ (x >>> 32))` where `x` is a variable of type `long` or the result of a previous `Double.doubleToLongBits()` call. The replacement shortens the code, improving its readability.\n\n**Example:**\n\n\n int result = (int)(var ^ (var >>> 32));\n\nAfter applying the quick-fix:\n\n\n int result = Long.hashCode(var);\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nNew in 2024.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseHashCodeMethodInspection",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 121,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousIndentAfterControlStatement",
+ "shortDescription": {
+ "text": "Suspicious indentation after control statement without braces"
+ },
+ "fullDescription": {
+ "text": "Reports suspicious indentation of statements after a control statement without braces. Such indentation can make it look like the statement is inside the control statement, when in fact it will be executed unconditionally after the control statement. Example: 'class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }'",
+ "markdown": "Reports suspicious indentation of statements after a control statement without braces.\n\n\nSuch indentation can make it look like the statement is inside the control statement,\nwhen in fact it will be executed unconditionally after the control statement.\n\n**Example:**\n\n\n class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousIndentAfterControlStatement",
+ "cweIds": [
+ 483
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NumericOverflow",
+ "shortDescription": {
+ "text": "Numeric overflow"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction . Examples: 'float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;'",
+ "markdown": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction .\n\n**Examples:**\n\n\n float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NumericOverflow",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssignmentToSuperclassField",
+ "shortDescription": {
+ "text": "Constructor assigns value to field defined in superclass"
+ },
+ "fullDescription": {
+ "text": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor. It is considered preferable to initialize the fields of a superclass in its own constructor and delegate to that constructor in a subclass. This will also allow declaring a field 'final' if it isn't changed after the construction. Example: 'class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }' To avoid the problem, declare a superclass constructor: 'class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }'",
+ "markdown": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor.\n\nIt is considered preferable to initialize the fields of a superclass in its own constructor and\ndelegate to that constructor in a subclass. This will also allow declaring a field `final`\nif it isn't changed after the construction.\n\n**Example:**\n\n\n class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }\n\nTo avoid the problem, declare a superclass constructor:\n\n\n class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssignmentToSuperclassField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 87,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassNewInstance",
+ "shortDescription": {
+ "text": "Unsafe call to 'Class.newInstance()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.lang.Class.newInstance()'. This method propagates exceptions thrown by the no-arguments constructor, including checked exceptions. Usages of this method effectively bypass the compile-time exception checking that would otherwise be performed by the compiler. A quick-fix is suggested to replace the call with a call to the 'java.lang.reflect.Constructor.newInstance()' method, which avoids this problem by wrapping any exception thrown by the constructor in a (checked) 'java.lang.reflect.InvocationTargetException'. Example: 'clazz.newInstance()' After the quick-fix is applied: 'clazz.getConstructor().newInstance();'",
+ "markdown": "Reports calls to `java.lang.Class.newInstance()`.\n\n\nThis method propagates exceptions thrown by\nthe no-arguments constructor, including checked exceptions. Usages of this method\neffectively bypass the compile-time exception checking that would\notherwise be performed by the compiler.\n\n\nA quick-fix is suggested to replace the call with a call to the\n`java.lang.reflect.Constructor.newInstance()` method, which\navoids this problem by wrapping any exception thrown by the constructor in a\n(checked) `java.lang.reflect.InvocationTargetException`.\n\n**Example:**\n\n\n clazz.newInstance()\n\nAfter the quick-fix is applied:\n\n\n clazz.getConstructor().newInstance();\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassNewInstance",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LimitedScopeInnerClass",
+ "shortDescription": {
+ "text": "Local class"
+ },
+ "fullDescription": {
+ "text": "Reports local classes. A local class is a named nested class declared inside a code block. Local classes are uncommon and may therefore be confusing. In addition, some code standards discourage the use of local classes. Example: 'class Example {\n void test() {\n class Local { // here\n }\n new Local();\n }\n }' After the quick-fix is applied: 'class Example {\n void test() {\n new Local();\n }\n\n private static class Local { // here\n }\n }'",
+ "markdown": "Reports local classes.\n\nA local class is a named nested class declared inside a code block.\nLocal classes are uncommon and may therefore be confusing.\nIn addition, some code standards discourage the use of local classes.\n\n**Example:**\n\n\n class Example {\n void test() {\n class Local { // here\n }\n new Local();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n void test() {\n new Local();\n }\n\n private static class Local { // here\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LimitedScopeInnerClass",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MultiplyOrDivideByPowerOfTwo",
+ "shortDescription": {
+ "text": "Multiplication or division by power of two"
+ },
+ "fullDescription": {
+ "text": "Reports multiplication of an integer value by a constant integer that can be represented as a power of two. Such expressions can be replaced with right or left shift operations for a possible performance improvement. Note that this inspection is not relevant for modern JVMs (e. g., HotSpot or OpenJ9) because their JIT compilers will perform this optimization. It might only be useful in some embedded systems where no JIT compilation is performed. Example: 'int y = x * 4;' A quick-fix is suggested to replace the multiplication or division operation with the shift operation: 'int y = x << 2;' Use the option to make the inspection also report division by a power of two. Note that replacing a power of two division with a shift does not work for negative numbers.",
+ "markdown": "Reports multiplication of an integer value by a constant integer that can be represented as a power of two. Such expressions can be replaced with right or left shift operations for a possible performance improvement.\n\n\nNote that this inspection is not relevant for modern JVMs (e. g.,\nHotSpot or OpenJ9) because their JIT compilers will perform this optimization.\nIt might only be useful in some embedded systems where no JIT compilation is performed.\n\n**Example:**\n\n\n int y = x * 4;\n\nA quick-fix is suggested to replace the multiplication or division operation with the shift operation:\n\n\n int y = x << 2;\n\n\nUse the option to make the inspection also report division by a power of two.\nNote that replacing a power of two division with a shift does not work for negative numbers."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MultiplyOrDivideByPowerOfTwo",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 169,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodCallInLoopCondition",
+ "shortDescription": {
+ "text": "Method call in loop condition"
+ },
+ "fullDescription": {
+ "text": "Reports method calls in the condition part of a loop statement. In highly resource constrained environments, such calls may have adverse performance implications. Applying the results of this inspection without consideration might have negative effects on code clarity and design. This inspection is intended for Java ME and other highly resource constrained environments. Example: 'String s = \"example\";\n for (int i = 0; i < s.length(); i++) {\n System.out.println(s.charAt(i));\n }' After the quick-fix is applied: 'String s = \"example\";\n int length = s.length();\n for (int i = 0; i < length; i++) {\n System.out.println(s.charAt(i));\n }' Use the option to ignore calls to common Java iteration methods like 'Iterator.hasNext()' and known methods with side-effects like 'Atomic*.compareAndSet'.",
+ "markdown": "Reports method calls in the condition part of a loop statement. In highly resource constrained environments, such calls may have adverse performance implications.\n\n\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\nThis inspection is intended for Java ME and other highly resource constrained environments.\n\n**Example:**\n\n\n String s = \"example\";\n for (int i = 0; i < s.length(); i++) {\n System.out.println(s.charAt(i));\n }\n\nAfter the quick-fix is applied:\n\n\n String s = \"example\";\n int length = s.length();\n for (int i = 0; i < length; i++) {\n System.out.println(s.charAt(i));\n }\n\n\nUse the option to ignore calls to common Java iteration methods like `Iterator.hasNext()`\nand known methods with side-effects like `Atomic*.compareAndSet`."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodCallInLoopCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 169,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodCount",
+ "shortDescription": {
+ "text": "Class with too many methods"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose number of methods exceeds the specified maximum. Classes with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes. Configure the inspection: Use the Method count limit field to specify the maximum allowed number of methods in a class. Use the Ignore simple getter and setter methods option to ignore simple getters and setters in method count. Use the Ignore methods overriding/implementing a super method to ignore methods that override or implement a method from a superclass.",
+ "markdown": "Reports classes whose number of methods exceeds the specified maximum.\n\nClasses with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes.\n\nConfigure the inspection:\n\n* Use the **Method count limit** field to specify the maximum allowed number of methods in a class.\n* Use the **Ignore simple getter and setter methods** option to ignore simple getters and setters in method count.\n* Use the **Ignore methods overriding/implementing a super method** to ignore methods that override or implement a method from a superclass."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithTooManyMethods",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 124,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForLoopReplaceableByWhile",
+ "shortDescription": {
+ "text": "'for' loop may be replaced by 'while' loop"
+ },
+ "fullDescription": {
+ "text": "Reports 'for' loops that contain neither initialization nor update components, and suggests converting them to 'while' loops. This makes the code easier to read. Example: 'for(; exitCondition(); ) {\n process();\n }' After the quick-fix is applied: 'while(exitCondition()) {\n process();\n }' The quick-fix is also available for other 'for' loops, so you can replace any 'for' loop with a 'while' loop. Use the Ignore 'infinite' for loops without conditions option if you want to ignore 'for' loops with trivial or non-existent conditions.",
+ "markdown": "Reports `for` loops that contain neither initialization nor update components, and suggests converting them to `while` loops. This makes the code easier to read.\n\nExample:\n\n\n for(; exitCondition(); ) {\n process();\n }\n\nAfter the quick-fix is applied:\n\n\n while(exitCondition()) {\n process();\n }\n\nThe quick-fix is also available for other `for` loops, so you can replace any `for` loop with a\n`while` loop.\n\nUse the **Ignore 'infinite' for loops without conditions** option if you want to ignore `for`\nloops with trivial or non-existent conditions."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForLoopReplaceableByWhile",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticFieldReferenceOnSubclass",
+ "shortDescription": {
+ "text": "Static field referenced via subclass"
+ },
+ "fullDescription": {
+ "text": "Reports accesses to static fields where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Child.foo);\n }' After the quick-fix is applied, the result looks like this: 'class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Parent.foo);\n }'",
+ "markdown": "Reports accesses to static fields where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Child.foo);\n }\n\nAfter the quick-fix is applied, the result looks like this:\n\n\n class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Parent.foo);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticFieldReferencedViaSubclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IgnoreResultOfCall",
+ "shortDescription": {
+ "text": "Result of method call ignored"
+ },
+ "fullDescription": {
+ "text": "Reports method calls whose result is ignored. For many methods, ignoring the result is perfectly legitimate, but for some it is almost certainly an error. Examples of methods where ignoring the result is likely an error include 'java.io.inputStream.read()', which returns the number of bytes actually read, and any method on 'java.lang.String' or 'java.math.BigInteger'. These methods do not produce side-effects and thus pointless if their result is ignored. The calls to the following methods are inspected: Simple getters (which do nothing except return a field) Methods specified in the settings of this inspection Methods annotated with 'org.jetbrains.annotations.Contract(pure=true)' Methods annotated with .*.'CheckReturnValue' Methods in a class or package annotated with 'javax.annotation.CheckReturnValue' Optionally, all non-library methods Calls to methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation are not reported. Use the inspection settings to specify the classes to check. Methods are matched by name or name pattern using Java regular expression syntax. For classes, use fully-qualified names. Each entry applies to both the class and all its inheritors.",
+ "markdown": "Reports method calls whose result is ignored.\n\nFor many methods, ignoring the result is perfectly\nlegitimate, but for some it is almost certainly an error. Examples of methods where ignoring\nthe result is likely an error include `java.io.inputStream.read()`,\nwhich returns the number of bytes actually read, and any method on\n`java.lang.String` or `java.math.BigInteger`. These methods do not produce side-effects and thus pointless\nif their result is ignored.\n\nThe calls to the following methods are inspected:\n\n* Simple getters (which do nothing except return a field)\n* Methods specified in the settings of this inspection\n* Methods annotated with `org.jetbrains.annotations.Contract(pure=true)`\n* Methods annotated with .\\*.`CheckReturnValue`\n* Methods in a class or package annotated with `javax.annotation.CheckReturnValue`\n* Optionally, all non-library methods\n\nCalls to methods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation are not reported.\n\n\nUse the inspection settings to specify the classes to check.\nMethods are matched by name or name pattern using Java regular expression syntax.\nFor classes, use fully-qualified names. Each entry applies to both the class and all its inheritors."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ResultOfMethodCallIgnored",
+ "cweIds": [
+ 252,
+ 563
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BlockingMethodInNonBlockingContext",
+ "shortDescription": {
+ "text": "Possibly blocking call in non-blocking context"
+ },
+ "fullDescription": {
+ "text": "Reports thread-blocking method calls in code fragments where threads should not be blocked. Example (Project Reactor): 'Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n);' Consider running blocking code with a proper scheduler, for example 'Schedulers.boundedElastic()', or try to find an alternative non-blocking API. Example (Kotlin Coroutines): 'suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n}' Consider running blocking code with a special dispatcher, for example 'Dispatchers.IO', or try to find an alternative non-blocking API. Configure the inspection: In the Blocking Annotations list, specify annotations that mark thread-blocking methods. In the Non-Blocking Annotations list, specify annotations that mark non-blocking methods. Specified annotations can be used as External Annotations",
+ "markdown": "Reports thread-blocking method calls in code fragments where threads should not be blocked.\n\n**Example (Project Reactor):**\n\n\n Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n );\n\nConsider running blocking code [with a proper\nscheduler](https://projectreactor.io/docs/core/release/reference/#faq.wrap-blocking), for example `Schedulers.boundedElastic()`, or try to find an alternative non-blocking API.\n\n**Example (Kotlin Coroutines):**\n\n\n suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n }\n\nConsider running blocking code [with a special dispatcher](https://kotlinlang.org/docs/coroutine-context-and-dispatchers.html),\nfor example `Dispatchers.IO`, or try to find an alternative non-blocking API.\n\nConfigure the inspection:\n\n* In the **Blocking Annotations** list, specify annotations that mark thread-blocking methods.\n* In the **Non-Blocking Annotations** list, specify annotations that mark non-blocking methods.\n\nSpecified annotations can be used as [External Annotations](https://www.jetbrains.com/help/idea/external-annotations.html)"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BlockingMethodInNonBlockingContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 3,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssertBetweenInconvertibleTypes",
+ "shortDescription": {
+ "text": "'assertEquals()' between objects of inconvertible types"
+ },
+ "fullDescription": {
+ "text": "Reports calls to assertion methods where the \"expected\" and \"actual\" arguments are of incompatible types. Such calls often indicate that there is a bug in the test. This inspection checks the relevant JUnit, TestNG, and AssertJ methods. Examples: 'assertEquals(\"1\", 1);\n assertNotSame(new int[0], 0);\n\n // weak warning, may just test the equals() contract\n assertThat(foo).as(\"user type\").isNotEqualTo(bar);'",
+ "markdown": "Reports calls to assertion methods where the \"expected\" and \"actual\" arguments are of incompatible types.\n\nSuch calls often indicate that there is a bug in the test.\nThis inspection checks the relevant JUnit, TestNG, and AssertJ methods.\n\n**Examples:**\n\n\n assertEquals(\"1\", 1);\n assertNotSame(new int[0], 0);\n\n // weak warning, may just test the equals() contract\n assertThat(foo).as(\"user type\").isNotEqualTo(bar);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssertBetweenInconvertibleTypes",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 122,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchExpressionCanBePushedDown",
+ "shortDescription": {
+ "text": "Common subexpression can be extracted from 'switch'"
+ },
+ "fullDescription": {
+ "text": "Reports switch expressions and statements where every branch has a common subexpression, and the 'switch' can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method. Example: 'switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }' After the quick-fix is applied: 'System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });' This inspection is applicable only for enhanced switches with arrow syntax. This inspection depends on the Java feature ''switch' expressions' which is available since Java 14. New in 2022.3",
+ "markdown": "Reports switch expressions and statements where every branch has a common subexpression, and the `switch` can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method.\n\nExample:\n\n\n switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }\n\nAfter the quick-fix is applied:\n\n\n System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });\n\n\nThis inspection is applicable only for enhanced switches with arrow syntax.\n\nThis inspection depends on the Java feature ''switch' expressions' which is available since Java 14.\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "SwitchExpressionCanBePushedDown",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConfusingElse",
+ "shortDescription": {
+ "text": "Redundant 'else'"
+ },
+ "fullDescription": {
+ "text": "Reports redundant 'else' keywords in 'if'—'else' statements and statement chains. The 'else' keyword is redundant when all previous branches end with a 'return', 'throw', 'break', or 'continue' statement. In this case, the statements from the 'else' branch can be placed after the 'if' statement, and the 'else' keyword can be removed. Example: 'if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }' After the quick-fix is applied: 'if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);' Disable the Report when there are no more statements after the 'if' statement option to ignore cases where the 'if'—'else' statement is the last statement in a code block.",
+ "markdown": "Reports redundant `else` keywords in `if`---`else` statements and statement chains.\n\n\nThe `else` keyword is redundant when all previous branches end with a\n`return`, `throw`, `break`, or `continue` statement. In this case,\nthe statements from the `else` branch can be placed after the `if` statement, and the\n`else` keyword can be removed.\n\n**Example:**\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }\n\nAfter the quick-fix is applied:\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);\n\nDisable the **Report when there are no more statements after the 'if' statement** option to ignore cases where the `if`---`else` statement is the last statement in a code block."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ConfusingElseBranch",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InnerClassReferencedViaSubclass",
+ "shortDescription": {
+ "text": "Inner class referenced via subclass"
+ },
+ "fullDescription": {
+ "text": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }' After the quick-fix is applied: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }'",
+ "markdown": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InnerClassReferencedViaSubclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ScheduledThreadPoolExecutorWithZeroCoreThreads",
+ "shortDescription": {
+ "text": "'ScheduledThreadPoolExecutor' with zero core threads"
+ },
+ "fullDescription": {
+ "text": "Reports any 'java.util.concurrent.ScheduledThreadPoolExecutor' instances in which 'corePoolSize' is set to zero via the 'setCorePoolSize' method or the object constructor. A 'ScheduledThreadPoolExecutor' with zero core threads will run nothing. Example: 'void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }'",
+ "markdown": "Reports any `java.util.concurrent.ScheduledThreadPoolExecutor` instances in which `corePoolSize` is set to zero via the `setCorePoolSize` method or the object constructor.\n\n\nA `ScheduledThreadPoolExecutor` with zero core threads will run nothing.\n\n**Example:**\n\n\n void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ScheduledThreadPoolExecutorWithZeroCoreThreads",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ChannelResource",
+ "shortDescription": {
+ "text": "'Channel' opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports 'Channel' resources that are not safely closed, including any instances created by calling 'getChannel()' on a file or socket resource. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }' Use the following options to configure the inspection: Whether a 'Channel' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a 'Channel' in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.",
+ "markdown": "Reports `Channel` resources that are not safely closed, including any instances created by calling `getChannel()` on a file or socket resource.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `Channel` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a `Channel` in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ChannelOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 134,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaEmptyModuleInfoFile",
+ "shortDescription": {
+ "text": "Empty 'module-info.java' file"
+ },
+ "fullDescription": {
+ "text": "Reports an empty 'module-info.java' file, indicating unresolved module dependencies. Automatically adds necessary 'requires' statements by inspecting imports. To suppress this warning, you may write any comment inside the module statement body, like this: 'module module.name {\n // no dependencies\n}' Quick Fix: Fill in module dependencies fills in missing 'requires' based on source code imports. New in 2024.1",
+ "markdown": "Reports an empty `module-info.java` file, indicating unresolved module dependencies. Automatically adds necessary `requires` statements by inspecting imports. To suppress this warning, you may write any comment inside the module statement body, like this:\n\n\n module module.name {\n // no dependencies\n }\n\n**Quick Fix:** *Fill in module dependencies* fills in missing `requires` based on source code imports. New in 2024.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavaEmptyModuleInfoFile",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 99,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassMayBeInterface",
+ "shortDescription": {
+ "text": "Abstract 'class' may be 'interface'"
+ },
+ "fullDescription": {
+ "text": "Reports 'abstract' classes that can be converted to interfaces. Using interfaces instead of classes is preferable as Java doesn't support multiple class inheritance, while a class can implement multiple interfaces. A class may be converted to an interface if it has no superclasses (other than Object), has only 'public static final' fields, 'public abstract' methods, and 'public' inner classes. Example: 'abstract class Example {\n public static final int MY_CONST = 42;\n public abstract void foo();\n}\n\nclass Inheritor extends Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n}' After the quick-fix is applied: 'interface Example {\n int MY_CONST = 42;\n void foo();\n}\n\nclass Inheritor implements Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n}' Configure the inspection: Use the Report classes containing non-abstract methods when using Java 8 option to report only the classes with 'static' methods and non-abstract methods that can be converted to 'default' methods (only applicable to language level of 8 or higher).",
+ "markdown": "Reports `abstract` classes that can be converted to interfaces.\n\nUsing interfaces instead of classes is preferable as Java doesn't support multiple class inheritance,\nwhile a class can implement multiple interfaces.\n\nA class may be converted to an interface if it has no superclasses (other\nthan Object), has only `public static final` fields,\n`public abstract` methods, and `public` inner classes.\n\n\nExample:\n\n\n abstract class Example {\n public static final int MY_CONST = 42;\n public abstract void foo();\n }\n\n class Inheritor extends Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n interface Example {\n int MY_CONST = 42;\n void foo();\n }\n\n class Inheritor implements Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Report classes containing non-abstract methods when using Java 8** option to report only the classes with `static` methods and non-abstract methods that can be converted to\n`default` methods (only applicable to language level of 8 or higher)."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ClassMayBeInterface",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryCallToStringValueOf",
+ "shortDescription": {
+ "text": "Unnecessary conversion to 'String'"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. 'String.valueOf()' or 'Integer.toString()'. Such calls are unnecessary when used in string concatenations. Example: 'System.out.println(\"Number: \" + Integer.toString(count));' After the quick-fix is applied: 'System.out.println(\"Number: \" + count);' Additionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are: Classes 'java.io.PrintWriter', 'java.io.PrintStream' 'print()', 'println()' Classes 'java.lang.StringBuilder', 'java.lang.StringBuffer' 'append()' Class 'org.slf4j.Logger' 'trace()', 'debug()', 'info()', 'warn()', 'error()' Use the Report calls that can be replaced with a concatenation with the empty string option to also report cases where concatenations with the empty string can be used instead of a call to 'String.valueOf()'.",
+ "markdown": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. `String.valueOf()` or `Integer.toString()`. Such calls are unnecessary when used in string concatenations.\n\nExample:\n\n\n System.out.println(\"Number: \" + Integer.toString(count));\n\nAfter the quick-fix is applied:\n\n\n System.out.println(\"Number: \" + count);\n\nAdditionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are:\n\n* Classes `java.io.PrintWriter`, `java.io.PrintStream`\n * `print()`, `println()`\n* Classes `java.lang.StringBuilder`, `java.lang.StringBuffer`\n * `append()`\n* Class `org.slf4j.Logger`\n * `trace()`, `debug()`, `info()`, `warn()`, `error()`\n\n\nUse the **Report calls that can be replaced with a concatenation with the empty string**\noption to also report cases where concatenations with the empty string can be used instead of a call to `String.valueOf()`."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryCallToStringValueOf",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringReplaceableByStringBuffer",
+ "shortDescription": {
+ "text": "Non-constant 'String' can be replaced with 'StringBuilder'"
+ },
+ "fullDescription": {
+ "text": "Reports variables declared as 'java.lang.String' that are repeatedly appended to. Such variables could be declared more efficiently as 'java.lang.StringBuffer' or 'java.lang.StringBuilder'. Example: 'String s = \"\";\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s = s + name;\n }' Such a loop can be replaced with: 'StringBuilder s = new StringBuilder();\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s.append(name);\n }' Or even with: 'String s = String.join(\" \", names);' Use the option to make this inspection only report when the variable is appended to in a loop.",
+ "markdown": "Reports variables declared as `java.lang.String` that are repeatedly appended to. Such variables could be declared more efficiently as `java.lang.StringBuffer` or `java.lang.StringBuilder`.\n\n**Example:**\n\n\n String s = \"\";\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s = s + name;\n }\n\nSuch a loop can be replaced with:\n\n\n StringBuilder s = new StringBuilder();\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s.append(name);\n }\n\nOr even with:\n\n\n String s = String.join(\" \", names);\n\n\nUse the option to make this inspection only report when the variable is appended to in a loop."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonConstantStringShouldBeStringBuffer",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FinallyBlockCannotCompleteNormally",
+ "shortDescription": {
+ "text": "'finally' block which can not complete normally"
+ },
+ "fullDescription": {
+ "text": "Reports 'return', 'throw', 'break', 'continue', and 'yield' statements that are used inside 'finally' blocks. These cause the 'finally' block to not complete normally but to complete abruptly. Any exceptions thrown from the 'try' and 'catch' blocks of the same 'try'-'catch' statement will be suppressed. Example: 'void x() {\n try {\n throw new RuntimeException();\n } finally {\n // if bar() returns true, the RuntimeException will be suppressed\n if (bar()) return;\n }\n }'",
+ "markdown": "Reports `return`, `throw`, `break`, `continue`, and `yield` statements that are used inside `finally` blocks. These cause the `finally` block to not complete normally but to complete abruptly. Any exceptions thrown from the `try` and `catch` blocks of the same `try`-`catch` statement will be suppressed.\n\n**Example:**\n\n\n void x() {\n try {\n throw new RuntimeException();\n } finally {\n // if bar() returns true, the RuntimeException will be suppressed\n if (bar()) return;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "finally",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstantOnWrongSideOfComparison",
+ "shortDescription": {
+ "text": "Constant on wrong side of comparison"
+ },
+ "fullDescription": {
+ "text": "Reports comparison operations where the constant value is on the wrong side. Some coding conventions specify that constants should be on a specific side of a comparison, either left or right. Example: 'boolean compare(int x) {\n return 1 > x; // Constant '1' on the left side of the comparison\n }' After the quick-fix is applied: 'boolean compare(int x) {\n return x < 1;\n }' Use the inspection settings to choose the side of constants in comparisons and whether to warn if 'null' literals are on the wrong side. New in 2019.2",
+ "markdown": "Reports comparison operations where the constant value is on the wrong side.\n\nSome coding conventions specify that constants should be on a specific side of a comparison, either left or right.\n\n**Example:**\n\n\n boolean compare(int x) {\n return 1 > x; // Constant '1' on the left side of the comparison\n }\n\nAfter the quick-fix is applied:\n\n\n boolean compare(int x) {\n return x < 1;\n }\n\n\nUse the inspection settings to choose the side of constants in comparisons\nand whether to warn if `null` literals are on the wrong side.\n\nNew in 2019.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstantOnWrongSideOfComparison",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarilyQualifiedStaticallyImportedElement",
+ "shortDescription": {
+ "text": "Unnecessarily qualified statically imported element"
+ },
+ "fullDescription": {
+ "text": "Reports usage of statically imported members qualified with their containing class name. Such qualification is unnecessary and can be removed because statically imported members can be accessed directly by member name. Example: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }' After the quick-fix is applied: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }'",
+ "markdown": "Reports usage of statically imported members qualified with their containing class name.\n\nSuch qualification is unnecessary and can be removed\nbecause statically imported members can be accessed directly by member name.\n\n**Example:**\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessarilyQualifiedStaticallyImportedElement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectToString",
+ "shortDescription": {
+ "text": "Call to default 'toString()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'toString()' that use the default implementation from 'java.lang.Object'. The default implementation is rarely intended but may be used by accident. Calls to 'toString()' on objects with 'java.lang.Object', interface or abstract class type are ignored by this inspection. Example: 'class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }'",
+ "markdown": "Reports calls to `toString()` that use the default implementation from `java.lang.Object`.\n\nThe default implementation is rarely intended but may be used by accident.\n\n\nCalls to `toString()` on objects with `java.lang.Object`,\ninterface or abstract class type are ignored by this inspection.\n\n**Example:**\n\n\n class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ObjectToString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfJDBCDriverClass",
+ "shortDescription": {
+ "text": "Use of concrete JDBC driver class"
+ },
+ "fullDescription": {
+ "text": "Reports uses of specific JDBC driver classes. Use of such classes will bind your project to a specific database and driver, defeating the purpose of JDBC and resulting in loss of portability. Example: 'import java.sql.Driver;\n\n abstract class Sample implements Driver {\n public void foo() {\n Sample sample;\n }\n }'",
+ "markdown": "Reports uses of specific JDBC driver classes. Use of such classes will bind your project to a specific database and driver, defeating the purpose of JDBC and resulting in loss of portability.\n\n**Example:**\n\n\n import java.sql.Driver;\n\n abstract class Sample implements Driver {\n public void foo() {\n Sample sample;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfJDBCDriverClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 95,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JDBCResource",
+ "shortDescription": {
+ "text": "JDBC resource opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include 'java.sql.Connection', 'java.sql.Statement', 'java.sql.PreparedStatement', 'java.sql.CallableStatement', and 'java.sql.ResultSet'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }' Use the following options to configure the inspection: Whether a JDBC resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.",
+ "markdown": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include `java.sql.Connection`, `java.sql.Statement`, `java.sql.PreparedStatement`, `java.sql.CallableStatement`, and `java.sql.ResultSet`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a JDBC resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JDBCResourceOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 134,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoggingSimilarMessage",
+ "shortDescription": {
+ "text": "Non-distinguishable logging calls"
+ },
+ "fullDescription": {
+ "text": "Reports SLF4J, Log4j2 logging calls in one class, such as 'logger.info(\"message: {}\", key)' with similar log messages. These calls can be non-distinguishable from each other, and this introduces difficulties to understand where a certain log message is coming from. Example (for Java): 'private static void request1(String text) {\n log.info(\"Message: {}\", text); //similar call\n doSomething1();\n }\n\n private static void request2(int i) {\n log.info(\"Message: {}\", i); //similar call\n doSomething2();\n }' Use the Minimum length of a similar sequence option to set the minimum length of similar sequences after which calls will be reported Use the Do not report calls with the 'error' log level option to ignore messages with `error` log level and when there is an exception. It may be useful to hide the warnings, because call sites can still be located using stack traces New in 2024.1",
+ "markdown": "Reports SLF4J, Log4j2 logging calls in one class, such as `logger.info(\"message: {}\", key)` with similar log messages. These calls can be non-distinguishable from each other, and this introduces difficulties to understand where a certain log message is coming from.\n\n**Example (for Java):**\n\n\n private static void request1(String text) {\n log.info(\"Message: {}\", text); //similar call\n doSomething1();\n }\n\n private static void request2(int i) {\n log.info(\"Message: {}\", i); //similar call\n doSomething2();\n }\n\n* Use the **Minimum length of a similar sequence** option to set the minimum length of similar sequences after which calls will be reported\n* Use the **Do not report calls with the 'error' log level** option to ignore messages with \\`error\\` log level and when there is an exception. It may be useful to hide the warnings, because call sites can still be located using stack traces\n\nNew in 2024.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LoggingSimilarMessage",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Logging",
+ "index": 52,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IfCanBeAssertion",
+ "shortDescription": {
+ "text": "Statement can be replaced with 'assert' or 'Objects.requireNonNull'"
+ },
+ "fullDescription": {
+ "text": "Reports 'if' statements that throw only 'java.lang.Throwable' from a 'then' branch and do not have an 'else' branch. Such statements can be converted to more compact 'assert' statements. The inspection also reports Guava's 'Preconditions.checkNotNull()'. They can be replaced with a 'Objects.requireNonNull()' call for which a library may not be needed. Example: 'if (x == 2) throw new RuntimeException(\"fail\");\n if (y == null) throw new AssertionError();\n Preconditions.checkNotNull(z, \"z\");' After the quick-fix is applied: 'assert x != 2 : \"fail\";\n Objects.requireNonNull(y);\n Objects.requireNonNull(z, \"z\");' By default, this inspection provides a quick-fix in the editor without code highlighting.",
+ "markdown": "Reports `if` statements that throw only `java.lang.Throwable` from a `then` branch and do not have an `else` branch. Such statements can be converted to more compact `assert` statements.\n\n\nThe inspection also reports Guava's `Preconditions.checkNotNull()`.\nThey can be replaced with a `Objects.requireNonNull()` call for which a library may not be needed.\n\nExample:\n\n\n if (x == 2) throw new RuntimeException(\"fail\");\n if (y == null) throw new AssertionError();\n Preconditions.checkNotNull(z, \"z\");\n\nAfter the quick-fix is applied:\n\n\n assert x != 2 : \"fail\";\n Objects.requireNonNull(y);\n Objects.requireNonNull(z, \"z\");\n\nBy default, this inspection provides a quick-fix in the editor without code highlighting."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "IfCanBeAssertion",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavadocDeclaration",
+ "shortDescription": {
+ "text": "Javadoc declaration problems"
+ },
+ "fullDescription": {
+ "text": "Reports Javadoc comments and tags with the following problems: invalid tag names incomplete tag descriptions duplicated tags missing Javadoc descriptions Example: '/**\n * Invalid tag name\n * @poram param description\n */\n public void sample(int param){\n }' Example: '/**\n * Pointing to itself {@link #sample(int)}\n */\n public void sample(int param){\n }' Quick-fix adds the unknown Javadoc tag to the list of user defined additional tags. Use textfield below to define additional Javadoc tags. Use first checkbox to ignore duplicated 'throws' tag. Use second checkbox to ignore problem with missing or incomplete first sentence in the description. Use third checkbox to ignore references pointing to itself.",
+ "markdown": "Reports Javadoc comments and tags with the following problems:\n\n* invalid tag names\n* incomplete tag descriptions\n* duplicated tags\n* missing Javadoc descriptions\n\nExample:\n\n\n /**\n * Invalid tag name\n * @poram param description\n */\n public void sample(int param){\n }\n\nExample:\n\n\n /**\n * Pointing to itself {@link #sample(int)}\n */\n public void sample(int param){\n }\n\nQuick-fix adds the unknown Javadoc tag to the list of user defined additional tags.\n\nUse textfield below to define additional Javadoc tags.\n\nUse first checkbox to ignore duplicated 'throws' tag.\n\nUse second checkbox to ignore problem with missing or incomplete first sentence in the description.\n\nUse third checkbox to ignore references pointing to itself."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavadocDeclaration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 78,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssignmentToMethodParameter",
+ "shortDescription": {
+ "text": "Assignment to method parameter"
+ },
+ "fullDescription": {
+ "text": "Reports assignment to, or modification of method parameters. Although occasionally intended, this construct may be confusing and is therefore prohibited in some Java projects. The quick-fix adds a declaration of a new variable. Example: 'void printTrimmed(String s) {\n s = s.trim();\n System.out.println(s);\n }' After the quick-fix is applied: 'void printTrimmed(String s) {\n String trimmed = s.trim();\n System.out.println(trimmed);\n }' Use the Ignore if assignment is a transformation of the original parameter option to ignore assignments that modify the parameter value based on its previous value.",
+ "markdown": "Reports assignment to, or modification of method parameters.\n\nAlthough occasionally intended, this construct may be confusing\nand is therefore prohibited in some Java projects.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n void printTrimmed(String s) {\n s = s.trim();\n System.out.println(s);\n }\n\nAfter the quick-fix is applied:\n\n\n void printTrimmed(String s) {\n String trimmed = s.trim();\n System.out.println(trimmed);\n }\n\n\nUse the **Ignore if assignment is a transformation of the original parameter** option to ignore assignments that modify\nthe parameter value based on its previous value."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssignmentToMethodParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 87,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LocalVariableHidingMemberVariable",
+ "shortDescription": {
+ "text": "Local variable hides field"
+ },
+ "fullDescription": {
+ "text": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }' You can configure the following options for this inspection: Ignore non-accessible fields - ignore local variables named identically to superclass fields that are not visible (for example, because they are private). Ignore local variables in a static context hiding non-static fields - for example when the local variable is inside a static method or inside a method which is inside a static inner class.",
+ "markdown": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended.\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }\n\n\nYou can configure the following options for this inspection:\n\n1. **Ignore non-accessible fields** - ignore local variables named identically to superclass fields that are not visible (for example, because they are private).\n2. **Ignore local variables in a static context hiding non-static fields** - for example when the local variable is inside a static method or inside a method which is inside a static inner class."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LocalVariableHidesMemberVariable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 99,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryTemporaryOnConversionToString",
+ "shortDescription": {
+ "text": "Unnecessary temporary object in conversion to 'String'"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary creation of temporary objects when converting from a primitive type to 'String'. Example: 'String foo = new Integer(3).toString();' After the quick-fix is applied: 'String foo = Integer.toString(3);'",
+ "markdown": "Reports unnecessary creation of temporary objects when converting from a primitive type to `String`.\n\n**Example:**\n\n\n String foo = new Integer(3).toString();\n\nAfter the quick-fix is applied:\n\n\n String foo = Integer.toString(3);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryTemporaryOnConversionToString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InterfaceMayBeAnnotatedFunctional",
+ "shortDescription": {
+ "text": "Interface may be annotated as '@FunctionalInterface'"
+ },
+ "fullDescription": {
+ "text": "Reports interfaces that can be annotated with '@FunctionalInterface' (available since JDK 1.8). Annotating an interface with '@FunctionalInterface' indicates that the interface is functional and no more 'abstract' methods can be added to it. Example: 'interface FileProcessor {\n void execute(File file);\n }' After the quick-fix is applied: '@FunctionalInterface\n interface FileProcessor {\n void execute(File file);\n }' This inspection only reports if the language level of the project or module is 8 or higher. This inspection depends on the Java feature 'Lambda expressions' which is available since Java 8.",
+ "markdown": "Reports interfaces that can be annotated with `@FunctionalInterface` (available since JDK 1.8).\n\nAnnotating an interface with `@FunctionalInterface` indicates that the interface\nis functional and no more `abstract` methods can be added to it.\n\n**Example:**\n\n\n interface FileProcessor {\n void execute(File file);\n }\n\nAfter the quick-fix is applied:\n\n\n @FunctionalInterface\n interface FileProcessor {\n void execute(File file);\n }\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InterfaceMayBeAnnotatedFunctional",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BreakStatementWithLabel",
+ "shortDescription": {
+ "text": "'break' statement with label"
+ },
+ "fullDescription": {
+ "text": "Reports 'break' statements with labels. Labeled 'break' statements complicate refactoring and can be confusing. Example: 'void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) break outer;\n handleChar(ch);\n }\n }\n }'",
+ "markdown": "Reports `break` statements with labels.\n\nLabeled `break` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) break outer;\n handleChar(ch);\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BreakStatementWithLabel",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringEquality",
+ "shortDescription": {
+ "text": "String comparison using '==', instead of 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports code that uses of == or != to compare strings. These operators determine referential equality instead of comparing content. In most cases, strings should be compared using 'equals()', which does a character-by-character comparison when the strings are different objects. Example: 'void foo(String s, String t) {\n final boolean b = t == s;\n }' If 't' is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following: 'void foo(String s, String t) {\n final boolean b = t.equals(s);\n }'",
+ "markdown": "Reports code that uses of **==** or **!=** to compare strings.\n\n\nThese operators determine referential equality instead of comparing content.\nIn most cases, strings should be compared using `equals()`,\nwhich does a character-by-character comparison when the strings are different objects.\n\n**Example:**\n\n\n void foo(String s, String t) {\n final boolean b = t == s;\n }\n\nIf `t` is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following:\n\n\n void foo(String s, String t) {\n final boolean b = t.equals(s);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringEquality",
+ "cweIds": [
+ 597
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousLiteralUnderscore",
+ "shortDescription": {
+ "text": "Suspicious underscore in number literal"
+ },
+ "fullDescription": {
+ "text": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo. This inspection will not warn on literals containing two consecutive underscores. It is also allowed to omit underscores in the fractional part of 'double' and 'float' literals. Example: 'int oneMillion = 1_000_0000;'",
+ "markdown": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo.\n\nThis inspection will not warn on literals containing two consecutive underscores.\nIt is also allowed to omit underscores in the fractional part of `double` and `float` literals.\n\n**Example:** `int oneMillion = 1_000_0000;`"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousLiteralUnderscore",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticCallOnSubclass",
+ "shortDescription": {
+ "text": "Static method referenced via subclass"
+ },
+ "fullDescription": {
+ "text": "Reports static method calls where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself. Java allows such qualification for classes, but such calls may indicate a subtle confusion of inheritance and overriding. Example: 'class Parent {\n public static void print(String str) {}\n }\n class Child extends Parent {}\n\n Child.print(\"Hello, world!\");' After the quick-fix is applied: 'Parent.print(\"Hello, world!\");'",
+ "markdown": "Reports static method calls where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself.\n\n\nJava allows such qualification for classes, but such calls\nmay indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Parent {\n public static void print(String str) {}\n }\n class Child extends Parent {}\n\n Child.print(\"Hello, world!\");\n\nAfter the quick-fix is applied:\n\n\n Parent.print(\"Hello, world!\");\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticMethodReferencedViaSubclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReadResolveAndWriteReplaceProtected",
+ "shortDescription": {
+ "text": "'readResolve()' or 'writeReplace()' not declared 'protected'"
+ },
+ "fullDescription": {
+ "text": "Reports classes that implement 'java.io.Serializable' where the 'readResolve()' or 'writeReplace()' methods are not declared 'protected'. Declaring 'readResolve()' and 'writeReplace()' methods 'private' can force subclasses to silently ignore them, while declaring them 'public' allows them to be invoked by untrusted code. If the containing class is declared 'final', these methods can be declared 'private'. Example: 'class ClassWithSerialization implements Serializable {\n public Object writeReplace() { // warning: 'writeReplace()' not declared protected\n ...\n }\n }'",
+ "markdown": "Reports classes that implement `java.io.Serializable` where the `readResolve()` or `writeReplace()` methods are not declared `protected`.\n\n\nDeclaring `readResolve()` and `writeReplace()` methods `private`\ncan force subclasses to silently ignore them, while declaring them\n`public` allows them to be invoked by untrusted code.\n\n\nIf the containing class is declared `final`, these methods can be declared `private`.\n\n**Example:**\n\n\n class ClassWithSerialization implements Serializable {\n public Object writeReplace() { // warning: 'writeReplace()' not declared protected\n ...\n }\n }\n \n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReadResolveAndWriteReplaceProtected",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 21,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryLabelOnContinueStatement",
+ "shortDescription": {
+ "text": "Unnecessary label on 'continue' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'continue' statements with unnecessary labels. Example: 'LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }'",
+ "markdown": "Reports `continue` statements with unnecessary labels.\n\nExample:\n\n\n LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryLabelOnContinueStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterNamingConvention",
+ "shortDescription": {
+ "text": "Method parameter naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports method parameters whose names are too short, too long, or do not follow the specified regular expression pattern. Example: 'void fooBar(int X)' should be reported if the inspection is enabled with the default settings in which a parameter name should start with a lowercase letter. Configure the inspection: Use the fields in the Options section to specify the minimum length, maximum length, and a regular expression expected for method parameter names. Specify 0 in order not to check the length of names. Regular expressions should be specified in the standard 'java.util.regex' format.",
+ "markdown": "Reports method parameters whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** `void fooBar(int X)`\nshould be reported if the inspection is enabled with the default settings in which a parameter name should start with a lowercase letter.\n\nConfigure the inspection:\n\n\nUse the fields in the **Options** section to specify the minimum length, maximum length, and a regular expression expected for\nmethod parameter names. Specify **0** in order not to check the length of names.\n\nRegular expressions should be specified in the standard `java.util.regex` format."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodParameterNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 81,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodCanBeVariableArityMethod",
+ "shortDescription": {
+ "text": "Method can have varargs parameter"
+ },
+ "fullDescription": {
+ "text": "Reports methods that can be converted to variable arity methods. Example: 'void process(String name, Object[] objects);' After the quick-fix is applied: 'void process(String name, Object... objects);' This inspection depends on the Java feature 'Variable arity methods' which is available since Java 5.",
+ "markdown": "Reports methods that can be converted to variable arity methods.\n\n**Example:**\n\n\n void process(String name, Object[] objects);\n\nAfter the quick-fix is applied:\n\n\n void process(String name, Object... objects);\n\nThis inspection depends on the Java feature 'Variable arity methods' which is available since Java 5."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MethodCanBeVariableArityMethod",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 120,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbstractClassNeverImplemented",
+ "shortDescription": {
+ "text": "Abstract class which has no concrete subclass"
+ },
+ "fullDescription": {
+ "text": "Reports 'abstract' classes that have no concrete subclasses.",
+ "markdown": "Reports `abstract` classes that have no concrete subclasses."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbstractClassNeverImplemented",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 149,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StreamToLoop",
+ "shortDescription": {
+ "text": "Stream API call chain can be replaced with loop"
+ },
+ "fullDescription": {
+ "text": "Reports Stream API chains, 'Iterable.forEach()', and 'Map.forEach()' calls that can be automatically converted into classical loops. Example: 'String joinNonEmpty(List list) {\n return list.stream() // Stream can be converted to loop\n .filter(s -> !s.isEmpty())\n .map(String::trim)\n .collect(Collectors.joining(\", \"));\n }' After the quick-fix is applied: 'String joinNonEmpty(List list) {\n StringJoiner joiner = new StringJoiner(\", \");\n for (String s : list) {\n if (!s.isEmpty()) {\n String trim = s.trim();\n joiner.add(trim);\n }\n }\n return joiner.toString();\n }' Note that sometimes this inspection might cause slight semantic changes. Special care should be taken when it comes to short-circuiting, as it's not specified how many elements will be actually read when the stream short-circuits. Configure the inspection: Use the Iterate unknown Stream sources via Stream.iterator() option to suggest conversions for streams with unrecognized source. In this case, iterator will be created from the stream. For example, when checkbox is selected, the conversion will be suggested here: 'List handles = ProcessHandle.allProcesses().collect(Collectors.toList());' In this case, the result will be as follows: 'List handles = new ArrayList<>();\n for (Iterator it = ProcessHandle.allProcesses().iterator(); it.hasNext(); ) {\n ProcessHandle allProcess = it.next();\n handles.add(allProcess);\n }' This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8. New in 2017.1",
+ "markdown": "Reports Stream API chains, `Iterable.forEach()`, and `Map.forEach()` calls that can be automatically converted into classical loops.\n\n**Example:**\n\n\n String joinNonEmpty(List list) {\n return list.stream() // Stream can be converted to loop\n .filter(s -> !s.isEmpty())\n .map(String::trim)\n .collect(Collectors.joining(\", \"));\n }\n\nAfter the quick-fix is applied:\n\n\n String joinNonEmpty(List list) {\n StringJoiner joiner = new StringJoiner(\", \");\n for (String s : list) {\n if (!s.isEmpty()) {\n String trim = s.trim();\n joiner.add(trim);\n }\n }\n return joiner.toString();\n }\n\n\nNote that sometimes this inspection might cause slight semantic changes.\nSpecial care should be taken when it comes to short-circuiting, as it's not specified how many elements will be actually read when\nthe stream short-circuits.\n\nConfigure the inspection:\n\nUse the **Iterate unknown Stream sources via Stream.iterator()** option to suggest conversions for streams with unrecognized source.\nIn this case, iterator will be created from the stream.\nFor example, when checkbox is selected, the conversion will be suggested here:\n\n\n List handles = ProcessHandle.allProcesses().collect(Collectors.toList());\n\nIn this case, the result will be as follows:\n\n\n List handles = new ArrayList<>();\n for (Iterator it = ProcessHandle.allProcesses().iterator(); it.hasNext(); ) {\n ProcessHandle allProcess = it.next();\n handles.add(allProcess);\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "StreamToLoop",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NotifyWithoutCorrespondingWait",
+ "shortDescription": {
+ "text": "'notify()' without corresponding 'wait()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Object.notify()' or 'Object.notifyAll()' for which no call to a corresponding 'Object.wait()' can be found. Only calls that target fields of the current class are reported by this inspection. Example: 'synchronized (synList) {\n synList.notify(); //synList.wait() is never called\n }'",
+ "markdown": "Reports calls to `Object.notify()` or `Object.notifyAll()` for which no call to a corresponding `Object.wait()` can be found.\n\nOnly calls that target fields of the current class are reported by this inspection.\n\n**Example:**\n\n\n synchronized (synList) {\n synList.notify(); //synList.wait() is never called\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NotifyWithoutCorrespondingWait",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassInitializerMayBeStatic",
+ "shortDescription": {
+ "text": "Class initializer may be 'static'"
+ },
+ "fullDescription": {
+ "text": "Reports instance initializers which may be made 'static'. An instance initializer may be static if it does not reference any of its class' non-static members. Static initializers are executed once the class is resolved, while instance initializers are executed on each instantiation of the class. This inspection doesn't report instance empty initializers and initializers in anonymous classes. Example: 'class A {\n public static String CONSTANT;\n {\n CONSTANT = \"Hello\";\n }\n }' After the quick-fix is applied: 'class A {\n public static String CONSTANT;\n static {\n CONSTANT = \"Hello\"; //now initialized only once per class\n }\n }'",
+ "markdown": "Reports instance initializers which may be made `static`.\n\n\nAn instance initializer may be static if it does not reference any of its class' non-static members.\nStatic initializers are executed once the class is resolved,\nwhile instance initializers are executed on each instantiation of the class.\n\nThis inspection doesn't report instance empty initializers and initializers in anonymous classes.\n\n**Example:**\n\n\n class A {\n public static String CONSTANT;\n {\n CONSTANT = \"Hello\";\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class A {\n public static String CONSTANT;\n static {\n CONSTANT = \"Hello\"; //now initialized only once per class\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassInitializerMayBeStatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MagicCharacter",
+ "shortDescription": {
+ "text": "Magic character"
+ },
+ "fullDescription": {
+ "text": "Reports character literals that are used without constant declaration. These characters might result in bad code readability. Also, there might be errors if a character is changed only in one location but not everywhere in code. Example: 'char c = 'c';'",
+ "markdown": "Reports character literals that are used without constant declaration. These characters might result in bad code readability. Also, there might be errors if a character is changed only in one location but not everywhere in code.\n\n**Example:**\n\n char c = 'c';\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MagicCharacter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 6,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SlowAbstractSetRemoveAll",
+ "shortDescription": {
+ "text": "Call to 'set.removeAll(list)' may work slowly"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.util.Set.removeAll()' with a 'java.util.List' argument. Such a call can be slow when the size of the argument is greater than or equal to the size of the set, and the set is a subclass of 'java.util.AbstractSet'. In this case, 'List.contains()' is called for each element in the set, which will perform a linear search. Example: 'public void check(String... ss) {\n // possible O(n^2) complexity\n mySet.removeAll(List.of(ss));\n }' After the quick fix is applied: 'public void check(String... ss) {\n // O(n) complexity\n List.of(ss).forEach(mySet::remove);\n }' New in 2020.3",
+ "markdown": "Reports calls to `java.util.Set.removeAll()` with a `java.util.List` argument.\n\n\nSuch a call can be slow when the size of the argument is greater than or equal to the size of the set,\nand the set is a subclass of `java.util.AbstractSet`.\nIn this case, `List.contains()` is called for each element in the set, which will perform a linear search.\n\n**Example:**\n\n\n public void check(String... ss) {\n // possible O(n^2) complexity\n mySet.removeAll(List.of(ss));\n }\n\nAfter the quick fix is applied:\n\n\n public void check(String... ss) {\n // O(n) complexity\n List.of(ss).forEach(mySet::remove);\n }\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SlowAbstractSetRemoveAll",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArrayEquality",
+ "shortDescription": {
+ "text": "Array comparison using '==', instead of 'Arrays.equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports operators '==' and '!=' used to test for array equality. In most cases, testing for the equality of array contents is intended, which can be done with the 'java.util.Arrays.equals()' method. A quick-fix is suggested to replace '==' with 'java.util.Arrays.equals()'. Example: 'void foo(Object[] x, Object[] y) {\n boolean comparison = x == y;\n }' After the quick-fix is applied: 'void foo(Object[] x, Object[] y) {\n boolean comparison = Arrays.equals(x, y);\n }'",
+ "markdown": "Reports operators `==` and `!=` used to test for array equality. In most cases, testing for the equality of array contents is intended, which can be done with the `java.util.Arrays.equals()` method.\n\n\nA quick-fix is suggested to replace `==` with `java.util.Arrays.equals()`.\n\n**Example:**\n\n\n void foo(Object[] x, Object[] y) {\n boolean comparison = x == y;\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(Object[] x, Object[] y) {\n boolean comparison = Arrays.equals(x, y);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ArrayEquality",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticCollection",
+ "shortDescription": {
+ "text": "Static collection"
+ },
+ "fullDescription": {
+ "text": "Reports static fields of a 'Collection' type. While it's not necessarily a problem, static collections often cause memory leaks and are therefore prohibited by some coding standards. Example: 'public class Example {\n static List list = new ArrayList<>();\n\n }' Configure the inspection: Use the Ignore weak static collections or maps option to ignore the fields of the 'java.util.WeakHashMap' type.",
+ "markdown": "Reports static fields of a `Collection` type. While it's not necessarily a problem, static collections often cause memory leaks and are therefore prohibited by some coding standards.\n\n**Example:**\n\n\n public class Example {\n static List list = new ArrayList<>();\n\n }\n\n\nConfigure the inspection:\n\n* Use the **Ignore weak static collections or maps** option to ignore the fields of the `java.util.WeakHashMap` type."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticCollection",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 164,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonExceptionNameEndsWithException",
+ "shortDescription": {
+ "text": "Non-exception class name ends with 'Exception'"
+ },
+ "fullDescription": {
+ "text": "Reports non-'exception' classes whose names end with 'Exception'. Such classes may cause confusion by breaking a common naming convention and often indicate that the 'extends Exception' clause is missing. Example: 'public class NotStartedException {}' A quick-fix that renames such classes is available only in the editor.",
+ "markdown": "Reports non-`exception` classes whose names end with `Exception`.\n\nSuch classes may cause confusion by breaking a common naming convention and\noften indicate that the `extends Exception` clause is missing.\n\n**Example:**\n\n public class NotStartedException {}\n\nA quick-fix that renames such classes is available only in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonExceptionNameEndsWithException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Class",
+ "index": 82,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassComplexity",
+ "shortDescription": {
+ "text": "Overly complex class"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Too high complexity indicates that the class should be refactored into several smaller classes. Use the Cyclomatic complexity limit field below to specify the maximum allowed complexity for a class.",
+ "markdown": "Reports classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nToo high complexity indicates that the class should be refactored into several smaller classes.\n\nUse the **Cyclomatic complexity limit** field below to specify the maximum allowed complexity for a class."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyComplexClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 124,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SystemGC",
+ "shortDescription": {
+ "text": "Call to 'System.gc()' or 'Runtime.gc()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'System.gc()' or 'Runtime.gc()' calls. While occasionally useful in testing, explicitly triggering garbage collection via 'System.gc()' is almost never recommended in production code and can result in serious performance issues.",
+ "markdown": "Reports `System.gc()` or `Runtime.gc()` calls. While occasionally useful in testing, explicitly triggering garbage collection via `System.gc()` is almost never recommended in production code and can result in serious performance issues."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToSystemGC",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 164,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverflowingLoopIndex",
+ "shortDescription": {
+ "text": "Loop executes zero or billions of times"
+ },
+ "fullDescription": {
+ "text": "Reports loops that cannot be completed without an index overflow or loops that don't loop at all. It usually happens because of a mistake in the update operation. Example: 'void foo(int s) {\n for (int i = s; i > 12; i++) { // i-- should be here\n System.out.println(i);\n }\n }' New in 2019.1",
+ "markdown": "Reports loops that cannot be completed without an index overflow or loops that don't loop at all. It usually happens because of a mistake in the update operation.\n\nExample:\n\n\n void foo(int s) {\n for (int i = s; i > 12; i++) { // i-- should be here\n System.out.println(i);\n }\n }\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverflowingLoopIndex",
+ "cweIds": [
+ 691,
+ 835
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java9UndeclaredServiceUsage",
+ "shortDescription": {
+ "text": "Usage of service not declared in 'module-info'"
+ },
+ "fullDescription": {
+ "text": "Reports situations in which a service is loaded with 'java.util.ServiceLoader' but it isn't declared with the 'uses' clause in the 'module-info.java' file and suggests inserting it. This inspection depends on the Java feature 'Modules' which is available since Java 9. New in 2018.1",
+ "markdown": "Reports situations in which a service is loaded with `java.util.ServiceLoader` but it isn't declared with the `uses` clause in the `module-info.java` file and suggests inserting it.\n\nThis inspection depends on the Java feature 'Modules' which is available since Java 9.\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java9UndeclaredServiceUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 99,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InnerClassMayBeStatic",
+ "shortDescription": {
+ "text": "Inner class may be 'static'"
+ },
+ "fullDescription": {
+ "text": "Reports inner classes that can be made 'static'. A 'static' 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. Example: 'public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' After the quick-fix is applied: 'public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }'",
+ "markdown": "Reports inner classes that can be made `static`.\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nThis prevents a common cause of memory leaks and uses less memory per instance of the class.\n\n**Example:**\n\n\n public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InnerClassMayBeStatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 164,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SetReplaceableByEnumSet",
+ "shortDescription": {
+ "text": "'Set' can be replaced with 'EnumSet'"
+ },
+ "fullDescription": {
+ "text": "Reports instantiations of 'java.util.Set' objects whose content types are enumerated classes. Such 'Set' objects can be replaced with 'java.util.EnumSet' objects. 'EnumSet' implementations can be much more efficient compared to other sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to 'EnumSet.noneOf()'. This quick-fix is not available when the type of the variable is a sub-class of 'Set'. Example: 'enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();' After the quick-fix is applied: 'enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);'",
+ "markdown": "Reports instantiations of `java.util.Set` objects whose content types are enumerated classes. Such `Set` objects can be replaced with `java.util.EnumSet` objects.\n\n\n`EnumSet` implementations can be much more efficient compared to\nother sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to\n`EnumSet.noneOf()`. This quick-fix is not available when the type of the variable is a sub-class of `Set`.\n\n**Example:**\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();\n\nAfter the quick-fix is applied:\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SetReplaceableByEnumSet",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CallToSimpleSetterInClass",
+ "shortDescription": {
+ "text": "Call to simple setter from within class"
+ },
+ "fullDescription": {
+ "text": "Reports calls to a simple property setter from within the property's class. A simple property setter is defined as one which simply assigns the value of its parameter to a field, and does no other calculations. Such simple setter calls can be safely inlined. Some coding standards also suggest against the use of simple setters for code clarity reasons. Example: 'class Foo {\n private int index;\n public Foo(int idx) {\n setIndex(idx);\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }' After the quick-fix is applied: 'class Foo {\n private int index;\n public Foo(int idx) {\n index = idx;\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }' Use the following options to configure the inspection: Whether to only report setter calls on 'this', not on objects of the same type passed in as a parameter. Whether to ignore non-'private' setters.",
+ "markdown": "Reports calls to a simple property setter from within the property's class.\n\n\nA simple property setter is defined as one which simply assigns the value of its parameter to a field,\nand does no other calculations. Such simple setter calls can be safely inlined.\nSome coding standards also suggest against the use of simple setters for code clarity reasons.\n\n**Example:**\n\n\n class Foo {\n private int index;\n public Foo(int idx) {\n setIndex(idx);\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n private int index;\n public Foo(int idx) {\n index = idx;\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }\n\nUse the following options to configure the inspection:\n\n* Whether to only report setter calls on `this`, not on objects of the same type passed in as a parameter.\n* Whether to ignore non-`private` setters."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToSimpleSetterFromWithinClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryFinalOnLocalVariableOrParameter",
+ "shortDescription": {
+ "text": "Unnecessary 'final' on local variable or parameter"
+ },
+ "fullDescription": {
+ "text": "Reports local variables or parameters unnecessarily declared 'final'. Some coding standards frown upon variables declared 'final' for reasons of terseness. Example: 'class Foo {\n Foo(Object o) {}\n\n void bar(final Object o) {\n new Foo(o);\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo(Object o) {}\n\n void bar(Object o) {\n new Foo(o);\n }\n }' Use the inspection options to toggle the reporting for: local variables parameters (including parameters of 'catch' blocks and enhanced 'for' statements) Also, you can configure the inspection to only report 'final' parameters of 'abstract' or interface methods, which may be considered extra unnecessary as such markings don't affect the implementation of these methods.",
+ "markdown": "Reports local variables or parameters unnecessarily declared `final`.\n\nSome coding standards frown upon variables declared `final` for reasons of terseness.\n\n**Example:**\n\n\n class Foo {\n Foo(Object o) {}\n\n void bar(final Object o) {\n new Foo(o);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo(Object o) {}\n\n void bar(Object o) {\n new Foo(o);\n }\n }\n\n\nUse the inspection options to toggle the reporting for:\n\n* local variables\n* parameters (including parameters of `catch` blocks and enhanced `for` statements)\n\n\nAlso, you can configure the inspection to only report `final` parameters of `abstract` or interface\nmethods, which may be considered extra unnecessary as such markings don't\naffect the implementation of these methods."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryFinalOnLocalVariableOrParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonBooleanMethodNameMayNotStartWithQuestion",
+ "shortDescription": {
+ "text": "Non-boolean method name must not start with question word"
+ },
+ "fullDescription": {
+ "text": "Reports non-boolean methods whose names start with a question word. Such method names may be confusing. Non-boolean methods that override library methods are ignored by this inspection. Example: 'public void hasName(String name) {\n assert names.contains(name);\n }' A quick-fix that renames such methods is available only in the editor. Configure the inspection: Use the Boolean method name prefixes list to specify the question words that should be used only for boolean methods. Use the Ignore methods with 'java.lang.Boolean' return type option to ignore methods with 'java.lang.Boolean' return type. Use the Ignore methods overriding/implementing a super method option to ignore methods which have supers.",
+ "markdown": "Reports non-boolean methods whose names start with a question word. Such method names may be confusing.\n\nNon-boolean methods that override library methods are ignored by this inspection.\n\n**Example:**\n\n\n public void hasName(String name) {\n assert names.contains(name);\n }\n\nA quick-fix that renames such methods is available only in the editor.\n\nConfigure the inspection:\n\n* Use the **Boolean method name prefixes** list to specify the question words that should be used only for boolean methods.\n* Use the **Ignore methods with 'java.lang.Boolean' return type** option to ignore methods with `java.lang.Boolean` return type.\n* Use the **Ignore methods overriding/implementing a super method** option to ignore methods which have supers."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonBooleanMethodNameMayNotStartWithQuestion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 109,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WeakerAccess",
+ "shortDescription": {
+ "text": "Declaration access can be weaker"
+ },
+ "fullDescription": {
+ "text": "Reports fields, methods or classes that may have their access modifier narrowed down. Example: 'class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }' After the quick-fix is applied: 'class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }' Use the inspection's options to define the rules for the modifier change suggestions.",
+ "markdown": "Reports fields, methods or classes that may have their access modifier narrowed down.\n\nExample:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }\n\nAfter the quick-fix is applied:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }\n\nUse the inspection's options to define the rules for the modifier change suggestions."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WeakerAccess",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 13,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReplaceWithJavadoc",
+ "shortDescription": {
+ "text": "Comment replaceable with Javadoc"
+ },
+ "fullDescription": {
+ "text": "Reports a regular comment that belongs to a field, method, or class that can be replaced with a Javadoc comment. Example: 'public class Main {\n /*\n * Hello,\n */\n // World!\n void f() {\n }\n }' After the quick-fix is applied: 'public class Main {\n /**\n * Hello,\n * World!\n */\n void f() {\n }\n }'",
+ "markdown": "Reports a regular comment that belongs to a field, method, or class that can be replaced with a Javadoc comment.\n\n**Example:**\n\n\n public class Main {\n /*\n * Hello,\n */\n // World!\n void f() {\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Main {\n /**\n * Hello,\n * World!\n */\n void f() {\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ReplaceWithJavadoc",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 78,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WrapperTypeMayBePrimitive",
+ "shortDescription": {
+ "text": "Wrapper type may be primitive"
+ },
+ "fullDescription": {
+ "text": "Reports local variables of wrapper type that are mostly used as primitive types. In some cases, boxing can be source of significant performance penalty, especially in loops. Heuristics are applied to estimate the number of boxing operations. For example, conversions inside loops are considered as much more numerous. Example: 'public void example() {\n Integer value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}' After the quick-fix is applied: 'public void example() {\n int value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}' New in 2018.2",
+ "markdown": "Reports local variables of wrapper type that are mostly used as primitive types.\n\nIn some cases, boxing can be source of significant performance penalty, especially in loops.\n\nHeuristics are applied to estimate the number of boxing operations. For example, conversions inside loops are considered\nas much more numerous.\n\n**Example:**\n\n public void example() {\n Integer value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}\n\nAfter the quick-fix is applied:\n\n public void example() {\n int value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}\n\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WrapperTypeMayBePrimitive",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EmptyStatementBody",
+ "shortDescription": {
+ "text": "Statement with empty body"
+ },
+ "fullDescription": {
+ "text": "Reports 'if', 'while', 'do', 'for', and 'switch' statements with empty bodies. While occasionally intended, such code is confusing and is often the result of a typo. This inspection is disabled in JSP files.",
+ "markdown": "Reports `if`, `while`, `do`, `for`, and `switch` statements with empty bodies.\n\nWhile occasionally intended, such code is confusing and is often the result of a typo.\n\nThis inspection is disabled in JSP files."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StatementWithEmptyBody",
+ "cweIds": [
+ 561
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EmptyFinallyBlock",
+ "shortDescription": {
+ "text": "Empty 'finally' block"
+ },
+ "fullDescription": {
+ "text": "Reports empty 'finally' blocks. Empty 'finally' blocks usually indicate coding errors. They may also remain after code refactoring and can safely be removed. This inspection doesn't report empty 'finally' blocks found in JSP files. Example: 'try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n\n }' After the quick-fix is applied: 'try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }'",
+ "markdown": "Reports empty `finally` blocks.\n\nEmpty `finally` blocks usually indicate coding errors. They may also remain after code refactoring and can safely be removed.\n\nThis inspection doesn't report empty `finally` blocks found in JSP files.\n\n**Example:**\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EmptyFinallyBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InconsistentLanguageLevel",
+ "shortDescription": {
+ "text": "Inconsistent language level settings"
+ },
+ "fullDescription": {
+ "text": "Reports modules which depend on other modules with a higher language level. Such dependencies should be removed or the language level of the module be increased. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.",
+ "markdown": "Reports modules which depend on other modules with a higher language level.\n\nSuch dependencies should be removed or the language level of the module be increased.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InconsistentLanguageLevel",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Modularization issues",
+ "index": 77,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EnumerationCanBeIteration",
+ "shortDescription": {
+ "text": "Enumeration can be iteration"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Enumeration' methods that are used on collections and may be replaced with equivalent 'Iterator' constructs. Example: 'Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }' After the quick-fix is applied: 'Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }'",
+ "markdown": "Reports calls to `Enumeration` methods that are used on collections and may be replaced with equivalent `Iterator` constructs.\n\n**Example:**\n\n\n Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }\n\nAfter the quick-fix is applied:\n\n\n Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EnumerationCanBeIteration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids",
+ "index": 70,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FinalStaticMethod",
+ "shortDescription": {
+ "text": "'static' method declared 'final'"
+ },
+ "fullDescription": {
+ "text": "Reports static methods that are marked as 'final'. Such code might indicate an error or an incorrect assumption about the effect of the 'final' keyword. Static methods are not subject to runtime polymorphism, so the only purpose of the 'final' keyword used with static methods is to ensure the method will not be hidden in a subclass.",
+ "markdown": "Reports static methods that are marked as `final`.\n\nSuch code might indicate an error or an incorrect assumption about the effect of the `final` keyword.\nStatic methods are not subject to runtime polymorphism, so the only purpose of the `final` keyword used with static methods\nis to ensure the method will not be hidden in a subclass."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FinalStaticMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantTypeArguments",
+ "shortDescription": {
+ "text": "Redundant type arguments"
+ },
+ "fullDescription": {
+ "text": "Reports calls to parametrized methods with explicit argument types that can be omitted since they will be unambiguously inferred by the compiler. Using redundant type arguments is unnecessary and makes the code less readable. Example: 'List list = Arrays.asList(\"Hello\", \"World\");' A quick-fix is provided to remove redundant type arguments: 'List list = Arrays.asList(\"Hello\", \"World\");'",
+ "markdown": "Reports calls to parametrized methods with explicit argument types that can be omitted since they will be unambiguously inferred by the compiler.\n\n\nUsing redundant type arguments is unnecessary and makes the code less readable.\n\nExample:\n\n\n List list = Arrays.asList(\"Hello\", \"World\");\n\nA quick-fix is provided to remove redundant type arguments:\n\n\n List list = Arrays.asList(\"Hello\", \"World\");\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantTypeArguments",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FieldHasSetterButNoGetter",
+ "shortDescription": {
+ "text": "Field has setter but no getter"
+ },
+ "fullDescription": {
+ "text": "Reports fields that have setter methods but no getter methods. In certain bean containers, when used within the Java beans specification, such fields might be difficult to work with.",
+ "markdown": "Reports fields that have setter methods but no getter methods.\n\n\nIn certain bean containers, when used within the Java beans specification, such fields might be difficult\nto work with."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FieldHasSetterButNoGetter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JavaBeans issues",
+ "index": 139,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RuntimeExecWithNonConstantString",
+ "shortDescription": {
+ "text": "Call to 'Runtime.exec()' with non-constant string"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.lang.Runtime.exec()' which take a dynamically-constructed string as the command to execute. Constructed execution strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning' Use the inspection settings to consider any 'static' 'final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";'",
+ "markdown": "Reports calls to `java.lang.Runtime.exec()` which take a dynamically-constructed string as the command to execute.\n\n\nConstructed execution strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning\n\n\nUse the inspection settings to consider any `static` `final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToRuntimeExecWithNonConstantString",
+ "cweIds": [
+ 20,
+ 77,
+ 78,
+ 88,
+ 94
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 38,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ErrorRethrown",
+ "shortDescription": {
+ "text": "'Error' not rethrown"
+ },
+ "fullDescription": {
+ "text": "Reports 'try' statements that catch 'java.lang.Error' or any of its subclasses and do not rethrow the error. Statements that catch 'java.lang.ThreadDeath' are not reported. Example: 'try {\n executeTests(request);\n }\n catch (OutOfMemoryError ex) { // warning: Error 'ex' not rethrown\n return false;\n }'",
+ "markdown": "Reports `try` statements that catch `java.lang.Error` or any of its subclasses and do not rethrow the error.\n\nStatements that catch `java.lang.ThreadDeath` are not\nreported.\n\n**Example:**\n\n\n try {\n executeTests(request);\n }\n catch (OutOfMemoryError ex) { // warning: Error 'ex' not rethrown\n return false;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ErrorNotRethrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CyclicPackageDependency",
+ "shortDescription": {
+ "text": "Cyclic package dependency"
+ },
+ "fullDescription": {
+ "text": "Reports packages that are mutually or cyclically dependent on other packages. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.",
+ "markdown": "Reports packages that are mutually or cyclically dependent on other packages.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CyclicPackageDependency",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 144,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SystemSetSecurityManager",
+ "shortDescription": {
+ "text": "Call to 'System.setSecurityManager()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'System.setSecurityManager()'. While often benign, any call to 'System.setSecurityManager()' should be closely examined in any security audit.",
+ "markdown": "Reports calls to `System.setSecurityManager()`.\n\nWhile often benign, any call to `System.setSecurityManager()` should be closely examined in any security audit."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToSystemSetSecurityManager",
+ "cweIds": [
+ 250
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 38,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnsatisfiedRange",
+ "shortDescription": {
+ "text": "Return value is outside of declared range"
+ },
+ "fullDescription": {
+ "text": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations: 'org.jetbrains.annotations.Range' from JetBrains annotations package (specify 'from' and 'to') 'org.checkerframework.common.value.qual.IntRange' from Checker Framework annotations package (specify 'from' and 'to') 'org.checkerframework.checker.index.qual.GTENegativeOne' from Checker Framework annotations package (range is '>= -1') 'org.checkerframework.checker.index.qual.NonNegative' from Checker Framework annotations package (range is '>= 0') 'org.checkerframework.checker.index.qual.Positive' from Checker Framework annotations package (range is '> 0') 'javax.annotation.Nonnegative' from JSR 305 annotations package (range is '>= 0') 'javax.validation.constraints.Min' (specify minimum value) 'javax.validation.constraints.Max' (specify maximum value) Example: '@Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }' New in 2021.2",
+ "markdown": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations:\n\n* `org.jetbrains.annotations.Range` from JetBrains annotations package (specify 'from' and 'to')\n* `org.checkerframework.common.value.qual.IntRange` from Checker Framework annotations package (specify 'from' and 'to')\n* `org.checkerframework.checker.index.qual.GTENegativeOne` from Checker Framework annotations package (range is '\\>= -1')\n* `org.checkerframework.checker.index.qual.NonNegative` from Checker Framework annotations package (range is '\\>= 0')\n* `org.checkerframework.checker.index.qual.Positive` from Checker Framework annotations package (range is '\\> 0')\n* `javax.annotation.Nonnegative` from JSR 305 annotations package (range is '\\>= 0')\n* `javax.validation.constraints.Min` (specify minimum value)\n* `javax.validation.constraints.Max` (specify maximum value)\n\nExample:\n\n\n @Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }\n\nNew in 2021.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnsatisfiedRange",
+ "cweIds": [
+ 129,
+ 682
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs/Nullability problems",
+ "index": 172,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithTooManyDependencies",
+ "shortDescription": {
+ "text": "Class with too many dependencies"
+ },
+ "fullDescription": {
+ "text": "Reports classes that are directly dependent on too many other classes in the project. Modifications to any dependency of such classes may require changing the class, thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of dependencies field to specify the maximum allowed number of dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.",
+ "markdown": "Reports classes that are directly dependent on too many other classes in the project.\n\nModifications to any dependency of such classes may require changing the class, thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of dependencies** field to specify the maximum allowed number of dependencies for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithTooManyDependencies",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 144,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithoutNoArgConstructor",
+ "shortDescription": {
+ "text": "Class without no-arg constructor"
+ },
+ "fullDescription": {
+ "text": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection. Example: 'public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }' Use the checkbox below to ignore classes without explicit constructors. The compiler provides a default no-arg constructor to such classes.",
+ "markdown": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection.\n\n**Example:**\n\n\n public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }\n\n\nUse the checkbox below to ignore classes without explicit constructors.\nThe compiler provides a default no-arg constructor to such classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithoutNoArgConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JavaBeans issues",
+ "index": 139,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CastConflictsWithInstanceof",
+ "shortDescription": {
+ "text": "Cast conflicts with 'instanceof'"
+ },
+ "fullDescription": {
+ "text": "Reports type cast expressions that are preceded by an 'instanceof' check for a different type. Although this might be intended, such a construct is most likely an error, and will result in a 'java.lang.ClassCastException' at runtime. Example: 'class Main {\n int whenCharSequenceCastToNumber(Object o){\n if (o instanceof CharSequence) {\n return ((Number) o).intValue();\n }\n return 0;\n }\n\n int earlyReturnWhenNotCharSequence(Object o){\n if (!(o instanceof CharSequence)) return 0;\n return ((Number)o).intValue();\n }\n }'",
+ "markdown": "Reports type cast expressions that are preceded by an `instanceof` check for a different type.\n\n\nAlthough this might be intended, such a construct is most likely an error, and will\nresult in a `java.lang.ClassCastException` at runtime.\n\n**Example:**\n\n\n class Main {\n int whenCharSequenceCastToNumber(Object o){\n if (o instanceof CharSequence) {\n return ((Number) o).intValue();\n }\n return 0;\n }\n\n int earlyReturnWhenNotCharSequence(Object o){\n if (!(o instanceof CharSequence)) return 0;\n return ((Number)o).intValue();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CastConflictsWithInstanceof",
+ "cweIds": [
+ 704
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NewExceptionWithoutArguments",
+ "shortDescription": {
+ "text": "Exception constructor called without arguments"
+ },
+ "fullDescription": {
+ "text": "Reports creation of a exception instance without any arguments specified. When an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes debugging needlessly hard. Example: 'throw new IOException(); // warning: exception without arguments'",
+ "markdown": "Reports creation of a exception instance without any arguments specified.\n\nWhen an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes\ndebugging needlessly hard.\n\n**Example:**\n\n\n throw new IOException(); // warning: exception without arguments\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NewExceptionWithoutArguments",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Contract",
+ "shortDescription": {
+ "text": "Contract issues"
+ },
+ "fullDescription": {
+ "text": "Reports issues in method '@Contract' annotations. The types of issues that can be reported are: Errors in contract syntax Contracts that do not conform to the method signature (wrong parameter count) Method implementations that contradict the contract (e.g. return 'true' when the contract says 'false') Example: '// method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }'",
+ "markdown": "Reports issues in method `@Contract` annotations. The types of issues that can be reported are:\n\n* Errors in contract syntax\n* Contracts that do not conform to the method signature (wrong parameter count)\n* Method implementations that contradict the contract (e.g. return `true` when the contract says `false`)\n\nExample:\n\n\n // method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Contract",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EnhancedSwitchBackwardMigration",
+ "shortDescription": {
+ "text": "Enhanced 'switch'"
+ },
+ "fullDescription": {
+ "text": "Reports enhanced 'switch' statements and expressions. Suggests replacing them with regular 'switch' statements. Example: 'boolean even = switch (condition) {\n case 1, 3, 5, 7, 9 -> false;\n default -> true;\n };' After the quick-fix is applied: 'boolean even;\n switch (condition) {\n case 1:\n case 3:\n case 5:\n case 7:\n case 9:\n even = false;\n break;\n default:\n even = true;\n break;\n}' Enhanced 'switch' appeared in Java 14. This inspection can help to downgrade for backward compatibility with earlier Java versions. New in 2019.1",
+ "markdown": "Reports enhanced `switch` statements and expressions. Suggests replacing them with regular `switch` statements.\n\n**Example:**\n\n\n boolean even = switch (condition) {\n case 1, 3, 5, 7, 9 -> false;\n default -> true;\n };\n\nAfter the quick-fix is applied:\n\n\n boolean even;\n switch (condition) {\n case 1:\n case 3:\n case 5:\n case 7:\n case 9:\n even = false;\n break;\n default:\n even = true;\n break;\n }\n\n\n*Enhanced* `switch` appeared in Java 14.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "EnhancedSwitchBackwardMigration",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 14",
+ "index": 136,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PackageWithTooManyClasses",
+ "shortDescription": {
+ "text": "Package with too many classes"
+ },
+ "fullDescription": {
+ "text": "Reports packages that contain too many classes. Overly large packages may indicate a lack of design clarity. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Maximum number of classes field to specify the maximum allowed number of classes in a package.",
+ "markdown": "Reports packages that contain too many classes.\n\nOverly large packages may indicate a lack of design clarity.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Maximum number of classes** field to specify the maximum allowed number of classes in a package."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PackageWithTooManyClasses",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Packaging issues",
+ "index": 44,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TryFinallyCanBeTryWithResources",
+ "shortDescription": {
+ "text": "'try finally' can be replaced with 'try' with resources"
+ },
+ "fullDescription": {
+ "text": "Reports 'try'-'finally' statements that can use Java 7 Automatic Resource Management, which is less error-prone. A quick-fix is available to convert a 'try'-'finally' statement into a 'try'-with-resources statement. Example: 'PrintStream printStream = new PrintStream(fileName);\n try {\n printStream.print(true);\n } finally {\n printStream.close();\n }' A quick-fix is provided to pass the cause to a constructor: 'try (PrintStream printStream = new PrintStream(fileName)) {\n printStream.print(true);\n }' This inspection depends on the Java feature 'Try-with-resources' which is available since Java 7.",
+ "markdown": "Reports `try`-`finally` statements that can use Java 7 Automatic Resource Management, which is less error-prone.\n\nA quick-fix is available to convert a `try`-`finally`\nstatement into a `try`-with-resources statement.\n\n**Example:**\n\n\n PrintStream printStream = new PrintStream(fileName);\n try {\n printStream.print(true);\n } finally {\n printStream.close();\n }\n\nA quick-fix is provided to pass the cause to a constructor:\n\n\n try (PrintStream printStream = new PrintStream(fileName)) {\n printStream.print(true);\n }\n\nThis inspection depends on the Java feature 'Try-with-resources' which is available since Java 7."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TryFinallyCanBeTryWithResources",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 7",
+ "index": 159,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SamePackageImport",
+ "shortDescription": {
+ "text": "Unnecessary import from the same package"
+ },
+ "fullDescription": {
+ "text": "Reports 'import' statements that refer to the same package as the containing file. Same-package files are always implicitly imported, so such 'import' statements are redundant and confusing. Since IntelliJ IDEA can automatically detect and fix such statements with its Optimize Imports command, this inspection is mostly useful for offline reporting on code bases that you don't intend to change.",
+ "markdown": "Reports `import` statements that refer to the same package as the containing file.\n\n\nSame-package files are always implicitly imported, so such `import`\nstatements are redundant and confusing.\n\n\nSince IntelliJ IDEA can automatically detect and fix such statements with its **Optimize Imports**\ncommand, this inspection is mostly useful for offline reporting on code bases that you\ndon't intend to change."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SamePackageImport",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Imports",
+ "index": 24,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadLocalSetWithNull",
+ "shortDescription": {
+ "text": "'ThreadLocal.set()' with null as an argument"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.lang.ThreadLocal.set()' with null as an argument. This call does not free the resources, and it may cause a memory leak. It may happen because: Firstly, 'ThreadLocal.set(null)' finds a map associated with the current Thread. If there is no such a map, it will be created It sets key and value: 'map.set(this, value)', where 'this' refers to instance of 'ThreadLocal' 'java.lang.ThreadLocal.remove()' should be used to free the resources. Example: 'ThreadLocal threadLocal = new ThreadLocal<>();\n threadLocal.set(null);' After the quick-fix is applied: 'threadLocal.remove();' New in 2023.2",
+ "markdown": "Reports `java.lang.ThreadLocal.set()` with null as an argument.\n\nThis call does not free the resources, and it may cause a memory leak.\nIt may happen because:\n\n* Firstly, `ThreadLocal.set(null)` finds a map associated with the current Thread. If there is no such a map, it will be created\n* It sets key and value: `map.set(this, value)`, where `this` refers to instance of `ThreadLocal`\n\n`java.lang.ThreadLocal.remove()` should be used to free the resources.\n\nExample:\n\n\n ThreadLocal threadLocal = new ThreadLocal<>();\n threadLocal.set(null);\n\nAfter the quick-fix is applied:\n\n\n threadLocal.remove();\n\nNew in 2023.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ThreadLocalSetWithNull",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingJavadoc",
+ "shortDescription": {
+ "text": "Missing Javadoc"
+ },
+ "fullDescription": {
+ "text": "Reports missing Javadoc comments and tags. Example: '/**\n * Missing \"@param\" is reported (if configured).\n */\n public void sample(int param){\n }' The quick-fixes add missing tag or missing Javadoc comment: '/**\n * Missing \"@param\" is reported (if configured).\n * @param param\n */\n public void sample(int param){\n }' Inspection can be configured to ignore deprecated elements or simple accessor methods like 'getField()' or 'setField()'. You can also use options below to configure required tags and minimal required visibility for the specific code elements like method, field, class, package, module.",
+ "markdown": "Reports missing Javadoc comments and tags.\n\nExample:\n\n\n /**\n * Missing \"@param\" is reported (if configured).\n */\n public void sample(int param){\n }\n\nThe quick-fixes add missing tag or missing Javadoc comment:\n\n\n /**\n * Missing \"@param\" is reported (if configured).\n * @param param\n */\n public void sample(int param){\n }\n\n\nInspection can be configured to ignore deprecated elements or simple accessor methods like `getField()` or `setField()`.\nYou can also use options below to configure required tags and minimal required visibility for the specific code elements like method, field, class, package, module."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MissingJavadoc",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 78,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AwaitWithoutCorrespondingSignal",
+ "shortDescription": {
+ "text": "'await()' without corresponding 'signal()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Condition.await()', for which no call to a corresponding 'Condition.signal()' or 'Condition.signalAll()' can be found. Calling 'Condition.await()' in a thread without corresponding 'Condition.signal()' may cause the thread to become disabled until it is interrupted or \"spurious wakeup\" occurs. Only calls that target fields of the current class are reported by this inspection. Example: 'class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n // isEmpty.signal();\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n isEmpty.await(); // 'await()' doesn't contain corresponding 'signal()'/'signalAll()' call\n // ...\n }\n }'",
+ "markdown": "Reports calls to `Condition.await()`, for which no call to a corresponding `Condition.signal()` or `Condition.signalAll()` can be found.\n\n\nCalling `Condition.await()` in a thread without corresponding `Condition.signal()` may cause the thread\nto become disabled until it is interrupted or \"spurious wakeup\" occurs.\n\nOnly calls that target fields of the current class are reported by this inspection.\n\n**Example:**\n\n\n class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n // isEmpty.signal();\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n isEmpty.await(); // 'await()' doesn't contain corresponding 'signal()'/'signalAll()' call\n // ...\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AwaitWithoutCorrespondingSignal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryLocalVariable",
+ "shortDescription": {
+ "text": "Redundant local variable"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including: Local variables that are immediately returned. Local variables that are immediately assigned to another variable and then not used. Local variables that always have the same value as another local variable or parameter. Example: 'boolean yes() {\n boolean b = true;\n return b;\n }' After the quick-fix is applied: 'boolean yes() {\n return true;\n }' Configure the inspection: Use the Ignore immediately returned or thrown variables option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging. Use the Ignore variables which have an annotation option to ignore annotated variables.",
+ "markdown": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:\n\n* Local variables that are immediately returned.\n* Local variables that are immediately assigned to another variable and then not used.\n* Local variables that always have the same value as another local variable or parameter.\n\n**Example:**\n\n\n boolean yes() {\n boolean b = true;\n return b;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean yes() {\n return true;\n }\n \nConfigure the inspection:\n\n* Use the **Ignore immediately returned or thrown variables** option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging.\n* Use the **Ignore variables which have an annotation** option to ignore annotated variables."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryLocalVariable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Data flow",
+ "index": 65,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Java9RedundantRequiresStatement",
+ "shortDescription": {
+ "text": "Redundant 'requires' directive in module-info"
+ },
+ "fullDescription": {
+ "text": "Reports redundant 'requires' directives in Java Platform Module System 'module-info.java' files. A 'requires' directive is redundant when a module 'A' requires a module 'B', but the code in module 'A' doesn't import any packages or classes from 'B'. Furthermore, all modules have an implicitly declared dependence on the 'java.base' module, therefore a 'requires java.base;' directive is always redundant. The quick-fix deletes the redundant 'requires' directive. If the deleted dependency re-exported modules that are actually used, the fix adds a 'requires' directives for these modules. This inspection only reports if the language level of the project or module is 9 or higher. New in 2017.1",
+ "markdown": "Reports redundant `requires` directives in Java Platform Module System `module-info.java` files. A `requires` directive is redundant when a module `A` requires a module `B`, but the code in module `A` doesn't import any packages or classes from `B`. Furthermore, all modules have an implicitly declared dependence on the `java.base` module, therefore a `requires java.base;` directive is always redundant.\n\n\nThe quick-fix deletes the redundant `requires` directive.\nIf the deleted dependency re-exported modules that are actually used, the fix adds a `requires` directives for these modules.\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java9RedundantRequiresStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 13,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BusyWait",
+ "shortDescription": {
+ "text": "Busy wait"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.lang.Thread.sleep()' that occur inside loops. Such calls are indicative of \"busy-waiting\". Busy-waiting is often inefficient, and may result in unexpected deadlocks as busy-waiting threads do not release locked resources. Example: 'class X {\n volatile int x;\n public void waitX() throws Exception {\n while (x > 0) {\n Thread.sleep(10);//warning: Call to 'Thread.sleep()' in a loop, probably busy-waiting\n }\n }\n }'",
+ "markdown": "Reports calls to `java.lang.Thread.sleep()` that occur inside loops.\n\nSuch calls\nare indicative of \"busy-waiting\". Busy-waiting is often inefficient, and may result in unexpected deadlocks\nas busy-waiting threads do not release locked resources.\n\n**Example:**\n\n\n class X {\n volatile int x;\n public void waitX() throws Exception {\n while (x > 0) {\n Thread.sleep(10);//warning: Call to 'Thread.sleep()' in a loop, probably busy-waiting\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BusyWait",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForLoopWithMissingComponent",
+ "shortDescription": {
+ "text": "'for' loop with missing components"
+ },
+ "fullDescription": {
+ "text": "Reports 'for' loops that lack initialization, condition, or update clauses. Some coding styles prohibit such loops. Example: 'for (int i = 0;;i++) {\n // body\n }' Use the Ignore collection iterations option to ignore loops which use an iterator. This is a standard way to iterate over a collection in which the 'for' loop does not have an update clause.",
+ "markdown": "Reports `for` loops that lack initialization, condition, or update clauses. Some coding styles prohibit such loops.\n\nExample:\n\n\n for (int i = 0;;i++) {\n // body\n }\n\n\nUse the **Ignore collection iterations** option to ignore loops which use an iterator.\nThis is a standard way to iterate over a collection in which the `for` loop does not have an update clause."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForLoopWithMissingComponent",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverwrittenKey",
+ "shortDescription": {
+ "text": "Overwritten Map, Set, or array element"
+ },
+ "fullDescription": {
+ "text": "Reports code that overwrites a 'Map' key, a 'Set' element, or an array element in a sequence of 'add'/'put' calls or using a Java 9 factory method like 'Set.of' (which will result in runtime exception). This usually occurs due to a copy-paste error. Example: 'map.put(\"A\", 1);\n map.put(\"B\", 2);\n map.put(\"C\", 3);\n map.put(\"D\", 4);\n map.put(\"A\", 5); // duplicating key \"A\", overwrites the previously written entry' New in 2017.3",
+ "markdown": "Reports code that overwrites a `Map` key, a `Set` element, or an array element in a sequence of `add`/`put` calls or using a Java 9 factory method like `Set.of` (which will result in runtime exception).\n\nThis usually occurs due to a copy-paste error.\n\n**Example:**\n\n\n map.put(\"A\", 1);\n map.put(\"B\", 2);\n map.put(\"C\", 3);\n map.put(\"D\", 4);\n map.put(\"A\", 5); // duplicating key \"A\", overwrites the previously written entry\n\nNew in 2017.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverwrittenKey",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnonymousClassMethodCount",
+ "shortDescription": {
+ "text": "Anonymous class with too many methods"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous inner classes whose method count exceeds the specified maximum. Anonymous classes with numerous methods may be difficult to understand and should be promoted to become named inner classes. Use the Method count limit field to specify the maximum allowed number of methods in an anonymous inner class.",
+ "markdown": "Reports anonymous inner classes whose method count exceeds the specified maximum.\n\nAnonymous classes with numerous methods may be\ndifficult to understand and should be promoted to become named inner classes.\n\nUse the **Method count limit** field to specify the maximum allowed number of methods in an anonymous inner class."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AnonymousInnerClassWithTooManyMethods",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 124,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OptionalOfNullableMisuse",
+ "shortDescription": {
+ "text": "Use of Optional.ofNullable with null or not-null argument"
+ },
+ "fullDescription": {
+ "text": "Reports uses of 'Optional.ofNullable()' where always null or always not-null argument is passed. There's no point in using 'Optional.ofNullable()' in this case: either 'Optional.empty()' or 'Optional.of()' should be used to explicitly state the intent of creating an always-empty or always non-empty optional respectively. It's also possible that there's a mistake in 'Optional.ofNullable()' argument, so it should be examined. Example: 'Optional empty = Optional.ofNullable(null); // should be Optional.empty();\nOptional present = Optional.ofNullable(\"value\"); // should be Optional.of(\"value\");' This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.",
+ "markdown": "Reports uses of `Optional.ofNullable()` where always null or always not-null argument is passed. There's no point in using `Optional.ofNullable()` in this case: either `Optional.empty()` or `Optional.of()` should be used to explicitly state the intent of creating an always-empty or always non-empty optional respectively. It's also possible that there's a mistake in `Optional.ofNullable()` argument, so it should be examined.\n\n\nExample:\n\n\n Optional empty = Optional.ofNullable(null); // should be Optional.empty();\n Optional present = Optional.ofNullable(\"value\"); // should be Optional.of(\"value\"); \n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalOfNullableMisuse",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CastToIncompatibleInterface",
+ "shortDescription": {
+ "text": "Cast to incompatible type"
+ },
+ "fullDescription": {
+ "text": "Reports type cast expressions where the casted expression has a class/interface type that neither extends/implements the cast class/interface type, nor has subclasses that do. Such a construct is likely erroneous, and will throw a 'java.lang.ClassCastException' at runtime. Example: 'interface A {}\n interface Z {}\n static class C {}\n\n void x(C c) {\n if (c instanceof Z) {\n A a = ((A)c); // cast to incompatible interface 'A'\n }\n }'",
+ "markdown": "Reports type cast expressions where the casted expression has a class/interface type that neither extends/implements the cast class/interface type, nor has subclasses that do.\n\n\nSuch a construct is likely erroneous, and will\nthrow a `java.lang.ClassCastException` at runtime.\n\n**Example:**\n\n\n interface A {}\n interface Z {}\n static class C {}\n\n void x(C c) {\n if (c instanceof Z) {\n A a = ((A)c); // cast to incompatible interface 'A'\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CastToIncompatibleInterface",
+ "cweIds": [
+ 704
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifiableConditionalExpression",
+ "shortDescription": {
+ "text": "Simplifiable conditional expression"
+ },
+ "fullDescription": {
+ "text": "Reports conditional expressions and suggests simplifying them. Examples: 'condition ? true : foo → condition || foo' 'condition ? false : foo → !condition && foo' 'condition ? foo : !foo → condition == foo' 'condition ? true : false → condition' 'a == b ? b : a → a' 'result != null ? result : null → result'",
+ "markdown": "Reports conditional expressions and suggests simplifying them.\n\nExamples:\n\n condition ? true : foo → condition || foo\n\n condition ? false : foo → !condition && foo\n\n condition ? foo : !foo → condition == foo\n\n condition ? true : false → condition\n\n a == b ? b : a → a\n\n result != null ? result : null → result\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifiableConditionalExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 30,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnqualifiedMethodAccess",
+ "shortDescription": {
+ "text": "Instance method call not qualified with 'this'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to non-'static' methods on the same instance that are not qualified with 'this'. Example: 'class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }' After the quick-fix is applied: 'class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }'",
+ "markdown": "Reports calls to non-`static` methods on the same instance that are not qualified with `this`.\n\n**Example:**\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnqualifiedMethodAccess",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstanceofIncompatibleInterface",
+ "shortDescription": {
+ "text": "'instanceof' with incompatible type"
+ },
+ "fullDescription": {
+ "text": "Reports 'instanceof' expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the 'instanceof' expression, nor has subclasses that do. Although it could be intended for e.g. library code, such a construct is likely erroneous, because no instance of any class declared in the project could pass this 'instanceof' test. Example: 'class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }'",
+ "markdown": "Reports `instanceof` expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the `instanceof` expression, nor has subclasses that do.\n\n\nAlthough it could be intended for e.g. library code, such a construct is likely erroneous,\nbecause no instance of any class declared in the project could pass this `instanceof` test.\n\n**Example:**\n\n\n class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstanceofIncompatibleInterface",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FunctionalExpressionCanBeFolded",
+ "shortDescription": {
+ "text": "Functional expression can be folded"
+ },
+ "fullDescription": {
+ "text": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation. Example: 'SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());' After the quick-fix is applied: 'SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);' This inspection reports only if the language level of the project or module is 8 or higher.",
+ "markdown": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation.\n\nExample:\n\n\n SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());\n\nAfter the quick-fix is applied:\n\n\n SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);\n\nThis inspection reports only if the language level of the project or module is 8 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FunctionalExpressionCanBeFolded",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 13,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CustomClassloader",
+ "shortDescription": {
+ "text": "Custom 'ClassLoader' is declared"
+ },
+ "fullDescription": {
+ "text": "Reports user-defined subclasses of 'java.lang.ClassLoader'. While not necessarily representing a security hole, such classes should be thoroughly inspected for possible security issues.",
+ "markdown": "Reports user-defined subclasses of `java.lang.ClassLoader`.\n\n\nWhile not necessarily representing a security hole, such classes should be thoroughly\ninspected for possible security issues."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CustomClassloader",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 38,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarySuperConstructor",
+ "shortDescription": {
+ "text": "Unnecessary call to 'super()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to no-arg superclass constructors during object construction. Such calls are unnecessary and may be removed. Example: 'class Foo {\n Foo() {\n super();\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n }\n }'",
+ "markdown": "Reports calls to no-arg superclass constructors during object construction.\n\nSuch calls are unnecessary and may be removed.\n\n**Example:**\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryCallToSuper",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThisEscapedInConstructor",
+ "shortDescription": {
+ "text": "'this' reference escaped in object construction"
+ },
+ "fullDescription": {
+ "text": "Reports possible escapes of 'this' during the object initialization. The escapes occur when 'this' is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized. Example: 'class Foo {\n {\n System.out.println(this);\n }\n }'",
+ "markdown": "Reports possible escapes of `this` during the object initialization. The escapes occur when `this` is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized.\n\n**Example:**\n\n\n class Foo {\n {\n System.out.println(this);\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThisEscapedInObjectConstruction",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 33,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IfCanBeSwitch",
+ "shortDescription": {
+ "text": "'if' can be replaced with 'switch'"
+ },
+ "fullDescription": {
+ "text": "Reports 'if' statements that can be replaced with 'switch' statements. The replacement result is usually shorter and clearer. Example: 'void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }' After the quick-fix is applied: 'void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }' This inspection only reports if the language level of the project or module is 7 or higher. Use the Minimum number of 'if' condition branches field to specify the minimum number of 'if' condition branches for an 'if' statement to have to be reported. Note that the terminal 'else' branch (without 'if') is not counted. Use the Suggest switch on numbers option to enable the suggestion of 'switch' statements on primitive and boxed numbers and characters. Use the Suggest switch on enums option to enable the suggestion of 'switch' statements on 'enum' constants. Use the Only suggest on null-safe expressions option to suggest 'switch' statements that can't introduce a 'NullPointerException' only.",
+ "markdown": "Reports `if` statements that can be replaced with `switch` statements.\n\nThe replacement result is usually shorter and clearer.\n\n**Example:**\n\n\n void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }\n \nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nUse the **Minimum number of 'if' condition branches** field to specify the minimum number of `if` condition branches\nfor an `if` statement to have to be reported. Note that the terminal `else` branch (without `if`) is not counted.\n\n\nUse the **Suggest switch on numbers** option to enable the suggestion of `switch` statements on\nprimitive and boxed numbers and characters.\n\n\nUse the **Suggest switch on enums** option to enable the suggestion of `switch` statements on\n`enum` constants.\n\n\nUse the **Only suggest on null-safe expressions** option to suggest `switch` statements that can't introduce a `NullPointerException` only."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IfCanBeSwitch",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids",
+ "index": 70,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonPublicClone",
+ "shortDescription": {
+ "text": "'clone()' method not 'public'"
+ },
+ "fullDescription": {
+ "text": "Reports 'clone()' methods that are 'protected' and not 'public'. When overriding the 'clone()' method from 'java.lang.Object', it is expected to make the method 'public', so that it is accessible from non-subclasses outside the package.",
+ "markdown": "Reports `clone()` methods that are `protected` and not `public`.\n\nWhen overriding the `clone()` method from `java.lang.Object`, it is expected to make the method `public`,\nso that it is accessible from non-subclasses outside the package."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonPublicClone",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Cloning issues",
+ "index": 116,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InfiniteRecursion",
+ "shortDescription": {
+ "text": "Infinite recursion"
+ },
+ "fullDescription": {
+ "text": "Reports methods that call themselves infinitely unless an exception is thrown. Methods reported by this inspection cannot return normally. While such behavior may be intended, in many cases this is just an oversight. Example: 'int baz() {\n return baz();\n }'",
+ "markdown": "Reports methods that call themselves infinitely unless an exception is thrown.\n\n\nMethods reported by this inspection cannot return normally.\nWhile such behavior may be intended, in many cases this is just an oversight.\n\n**Example:**\n\n int baz() {\n return baz();\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InfiniteRecursion",
+ "cweIds": [
+ 674,
+ 835
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DeprecatedIsStillUsed",
+ "shortDescription": {
+ "text": "Deprecated member is still used"
+ },
+ "fullDescription": {
+ "text": "Reports deprecated classes, methods, and fields that are used in your code nonetheless. Example: 'class MyCode {\n @Deprecated\n void oldMethod() {}// warning: \"Deprecated member is still used\"\n\n void newMethod() {\n oldMethod(); // forgotten usage\n }\n }' Usages within deprecated elements are ignored. NOTE: Due to performance reasons, a non-private member is checked only when its name rarely occurs in the project.",
+ "markdown": "Reports deprecated classes, methods, and fields that are used in your code nonetheless.\n\nExample:\n\n\n class MyCode {\n @Deprecated\n void oldMethod() {}// warning: \"Deprecated member is still used\"\n\n void newMethod() {\n oldMethod(); // forgotten usage\n }\n }\n\nUsages within deprecated elements are ignored.\n\n**NOTE:** Due to performance reasons, a non-private member is checked only when its name rarely occurs in the project."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DeprecatedIsStillUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 56,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantComparatorComparing",
+ "shortDescription": {
+ "text": "Comparator method can be simplified"
+ },
+ "fullDescription": {
+ "text": "Reports 'Comparator' combinator constructs that can be simplified. Example: 'c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());' After the quick-fixes are applied: 'c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());' New in 2018.1",
+ "markdown": "Reports `Comparator` combinator constructs that can be simplified.\n\nExample:\n\n\n c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());\n\nAfter the quick-fixes are applied:\n\n\n c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantComparatorComparing",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "VariableNotUsedInsideIf",
+ "shortDescription": {
+ "text": "Reference checked for 'null' is not used inside 'if'"
+ },
+ "fullDescription": {
+ "text": "Reports references to variables that are checked for nullability in the condition of an 'if' statement or conditional expression but not used inside that 'if' statement. Usually this either means that the check is unnecessary or that the variable is not referenced inside the 'if' statement by mistake. Example: 'void test(Integer i) {\n if (i != null) { // here 'i' is not used inside 'if' statement\n System.out.println();\n }\n }'",
+ "markdown": "Reports references to variables that are checked for nullability in the condition of an `if` statement or conditional expression but not used inside that `if` statement.\n\n\nUsually this either means that\nthe check is unnecessary or that the variable is not referenced inside the\n`if` statement by mistake.\n\n**Example:**\n\n\n void test(Integer i) {\n if (i != null) { // here 'i' is not used inside 'if' statement\n System.out.println();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "VariableNotUsedInsideIf",
+ "cweIds": [
+ 563
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CollectionAddAllCanBeReplacedWithConstructor",
+ "shortDescription": {
+ "text": "Redundant 'Collection.addAll()' call"
+ },
+ "fullDescription": {
+ "text": "Reports 'Collection.addAll()' and 'Map.putAll()' calls immediately after an instantiation of a collection using a no-arg constructor. Such constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement might be more performant. Example: 'Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' After the quick-fix is applied: 'Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' The JDK collection classes are supported by default. Additionally, you can specify other classes using the Classes to check panel.",
+ "markdown": "Reports `Collection.addAll()` and `Map.putAll()` calls immediately after an instantiation of a collection using a no-arg constructor.\n\nSuch constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement\nmight be more performant.\n\n**Example:**\n\n\n Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\nAfter the quick-fix is applied:\n\n\n Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\n\nThe JDK collection classes are supported by default.\nAdditionally, you can specify other classes using the **Classes to check** panel."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CollectionAddAllCanBeReplacedWithConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MultipleReturnPointsPerMethod",
+ "shortDescription": {
+ "text": "Method with multiple return points"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose number of 'return' points exceeds the specified maximum. Methods with too many 'return' points may be confusing and hard to refactor. A 'return' point is either a 'return' statement or a falling through the bottom of a 'void' method or constructor. Example: The method below is reported if only two 'return' statements are allowed: 'void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user)) {\n user.setId(getId());\n return;\n } else if (cond2(user)) {\n if (cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }\n }' Consider rewriting the method so it becomes easier to understand: 'void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user) || cond2(user) && cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }' Configure the inspection: Use the Return point limit field to specify the maximum allowed number of 'return' points for a method. Use the Ignore guard clauses option to ignore guard clauses. A guard clause is an 'if' statement that contains only a 'return' statement Use the Ignore for 'equals()' methods option to ignore 'return' points inside 'equals()' methods.",
+ "markdown": "Reports methods whose number of `return` points exceeds the specified maximum. Methods with too many `return` points may be confusing and hard to refactor.\n\nA `return` point is either a `return` statement or a falling through the bottom of a\n`void` method or constructor.\n\n**Example:**\n\nThe method below is reported if only two `return` statements are allowed:\n\n\n void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user)) {\n user.setId(getId());\n return;\n } else if (cond2(user)) {\n if (cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }\n }\n\nConsider rewriting the method so it becomes easier to understand:\n\n\n void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user) || cond2(user) && cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }\n\nConfigure the inspection:\n\n* Use the **Return point limit** field to specify the maximum allowed number of `return` points for a method.\n* Use the **Ignore guard clauses** option to ignore guard clauses. A guard clause is an `if` statement that contains only a `return` statement\n* Use the **Ignore for 'equals()' methods** option to ignore `return` points inside `equals()` methods."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodWithMultipleReturnPoints",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 133,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousMethodCalls",
+ "shortDescription": {
+ "text": "Suspicious collection method call"
+ },
+ "fullDescription": {
+ "text": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type. Example: 'List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted' In the inspection settings, you can disable warnings for potentially correct code like the following: 'public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }'",
+ "markdown": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type.\n\n**Example:**\n\n\n List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted\n\n\nIn the inspection settings, you can disable warnings for potentially correct code like the following:\n\n\n public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousMethodCalls",
+ "cweIds": [
+ 628
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ForwardCompatibility",
+ "shortDescription": {
+ "text": "Forward compatibility"
+ },
+ "fullDescription": {
+ "text": "Reports Java code constructs that may fail to compile in future Java versions. The following problems are reported: Uses of 'assert', 'enum' or '_' as an identifier Uses of the 'var', 'yield', or 'record' restricted identifier as a type name Unqualified calls to methods named 'yield' Modifiers on the 'requires java.base' statement inside of 'module-info.java' Redundant semicolons between import statements Example: '// This previously legal class does not compile with Java 14,\n // as 'yield' became a restricted identifier.\n public class yield {}' Fixing these issues timely may simplify migration to future Java versions.",
+ "markdown": "Reports Java code constructs that may fail to compile in future Java versions.\n\nThe following problems are reported:\n\n* Uses of `assert`, `enum` or `_` as an identifier\n* Uses of the `var`, `yield`, or `record` restricted identifier as a type name\n* Unqualified calls to methods named `yield`\n* Modifiers on the `requires java.base` statement inside of `module-info.java`\n* Redundant semicolons between import statements\n\n**Example:**\n\n\n // This previously legal class does not compile with Java 14,\n // as 'yield' became a restricted identifier.\n public class yield {} \n\nFixing these issues timely may simplify migration to future Java versions."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForwardCompatibility",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level issues",
+ "index": 145,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DiamondCanBeReplacedWithExplicitTypeArguments",
+ "shortDescription": {
+ "text": "Diamond can be replaced with explicit type arguments"
+ },
+ "fullDescription": {
+ "text": "Reports instantiation of generic classes in which the <> symbol (diamond) is used instead of type parameters. The quick-fix replaces <> (diamond) with explicit type parameters. Example: 'List list = new ArrayList<>()' After the quick-fix is applied: 'List list = new ArrayList()' Diamond operation appeared in Java 7. This inspection can help to downgrade for backward compatibility with earlier Java versions.",
+ "markdown": "Reports instantiation of generic classes in which the **\\<\\>** symbol (diamond) is used instead of type parameters.\n\nThe quick-fix replaces **\\<\\>** (diamond) with explicit type parameters.\n\nExample:\n\n List list = new ArrayList<>()\n\nAfter the quick-fix is applied:\n\n List list = new ArrayList()\n\n\n*Diamond operation* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "DiamondCanBeReplacedWithExplicitTypeArguments",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfProcessBuilder",
+ "shortDescription": {
+ "text": "Use of 'java.lang.ProcessBuilder' class"
+ },
+ "fullDescription": {
+ "text": "Reports uses of 'java.lang.ProcessBuilder', which might be unportable between operating systems because paths to executables, environment variables, command-line arguments and their escaping might vary depending on the OS.",
+ "markdown": "Reports uses of `java.lang.ProcessBuilder`, which might be unportable between operating systems because paths to executables, environment variables, command-line arguments and their escaping might vary depending on the OS."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfProcessBuilder",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 95,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaRequiresAutoModule",
+ "shortDescription": {
+ "text": "Dependencies on automatic modules"
+ },
+ "fullDescription": {
+ "text": "Reports usages of automatic modules in a 'requires' directive. An automatic module is unreliable since it can depend on the types on the class path, and its name and exported packages can change if it's converted into an explicit module. Corresponds to '-Xlint:requires-automatic' and '-Xlint:requires-transitive-automatic' Javac options. The first option increases awareness of when automatic modules are used. The second warns the authors of a module that they're putting the users of that module at risk by establishing implied readability to an automatic module. Example: '//module-info.java\n module org.printer {\n requires transitive drivers.corp.org; // reported in case 'drivers.corp.org' is an automatic module\n }' Use the Highlight only transitive dependencies option to warn only about transitive dependencies. This inspection depends on the Java feature 'Modules' which is available since Java 9.",
+ "markdown": "Reports usages of automatic modules in a `requires` directive.\n\nAn automatic\nmodule is unreliable since it can depend on the types on the class path,\nand its name and exported packages can change if it's\nconverted into an explicit module.\n\nCorresponds to `-Xlint:requires-automatic` and `-Xlint:requires-transitive-automatic` Javac options.\nThe first option increases awareness of when automatic modules are used.\nThe second warns the authors of a module that they're putting the users of that module at risk by establishing implied readability to an automatic module.\n\n**Example:**\n\n\n //module-info.java\n module org.printer {\n requires transitive drivers.corp.org; // reported in case 'drivers.corp.org' is an automatic module\n }\n\n\nUse the **Highlight only transitive dependencies** option to warn only about transitive dependencies.\n\nThis inspection depends on the Java feature 'Modules' which is available since Java 9."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "requires-transitive-automatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 9",
+ "index": 88,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExcessiveRangeCheck",
+ "shortDescription": {
+ "text": "Excessive range check"
+ },
+ "fullDescription": {
+ "text": "Reports condition chains in which a value range is checked and these condition chains can be simplified to a single check. The quick-fix replaces a condition chain with a simplified expression: Example: 'x > 2 && x < 4' After the quick-fix is applied: 'x == 3' Example: 'arr.length == 0 || arr.length > 1' After the quick-fix is applied: 'arr.length != 1' New in 2019.1",
+ "markdown": "Reports condition chains in which a value range is checked and these condition chains can be simplified to a single check.\n\nThe quick-fix replaces a condition chain with a simplified expression:\n\nExample:\n\n\n x > 2 && x < 4\n\nAfter the quick-fix is applied:\n\n\n x == 3\n\nExample:\n\n\n arr.length == 0 || arr.length > 1\n\nAfter the quick-fix is applied:\n\n\n arr.length != 1\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExcessiveRangeCheck",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringConcatenation",
+ "shortDescription": {
+ "text": "String concatenation"
+ },
+ "fullDescription": {
+ "text": "Reports 'String' concatenations. Concatenation might be incorrect in an internationalized environment and could be replaced by usages of 'java.text.MessageFormat' or similar classes. Example: 'String getMessage(String string, int number) {\n return string + number;\n }'",
+ "markdown": "Reports `String` concatenations. Concatenation might be incorrect in an internationalized environment and could be replaced by usages of `java.text.MessageFormat` or similar classes.\n\n**Example:**\n\n\n String getMessage(String string, int number) {\n return string + number;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringConcatenation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 6,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassCanBeRecord",
+ "shortDescription": {
+ "text": "Class can be record class"
+ },
+ "fullDescription": {
+ "text": "Reports classes that can be converted record classes. Record classes focus on modeling immutable data rather than extensible behavior. Automatic implicit implementation of data-driven methods, such as 'equals()' and accessors, helps to reduce boilerplate code. Note that not every class can be a record class. Here are some of the restrictions: The class must be a top-level class and must have no subclasses. All non-static fields in the class must be final. Initializers, generic constructors, and native methods must not be present. For a full description of record classes, refer to the Java Language Specification. Example: 'class Point {\n private final double x;\n private final double y;\n\n Point(double x, double y) {\n this.x = x;\n this.y = y;\n }\n\n double getX() {\n return x;\n }\n\n double getY() {\n return y;\n }\n }' After the quick-fix is applied: 'record Point(int x, int y) {\n }' Enable the Suggest renaming accessor methods option to rename 'getX()'/'isX()' accessors to 'x()' automatically. Use the If members become more accessible option to specify what to do when conversion will make members more accessible: Choose Do not suggest conversion option to not convert when members would become more accessible. Choose Show conflicts view option to show the affected members and ask to continue. In batch mode conversion will not be suggested. Choose Convert silently option to increase accessibility silently when needed. Use the Suppress conversion if class is annotated by list to exclude classes from conversion when annotated by annotations matching the specified patterns. This inspection depends on the Java feature 'Records' which is available since Java 16. New in 2020.3",
+ "markdown": "Reports classes that can be converted record classes.\n\nRecord classes focus on modeling immutable data rather than extensible behavior.\nAutomatic implicit implementation of data-driven methods, such as `equals()` and accessors, helps to reduce boilerplate code.\n\n\nNote that not every class can be a record class. Here are some of the restrictions:\n\n* The class must be a top-level class and must have no subclasses.\n* All non-static fields in the class must be final.\n* Initializers, generic constructors, and native methods must not be present.\n\nFor a full description of record classes, refer to the\n[Java Language Specification](https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.10).\n\nExample:\n\n\n class Point {\n private final double x;\n private final double y;\n\n Point(double x, double y) {\n this.x = x;\n this.y = y;\n }\n\n double getX() {\n return x;\n }\n\n double getY() {\n return y;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n record Point(int x, int y) {\n }\n\nEnable the **Suggest renaming accessor methods** option to rename `getX()`/`isX()` accessors to `x()` automatically.\n\n\nUse the **If members become more accessible** option to specify what to do when conversion will make members more accessible:\n\n* Choose **Do not suggest conversion** option to not convert when members would become more accessible.\n* Choose **Show conflicts view** option to show the affected members and ask to continue. In batch mode conversion will not be suggested.\n* Choose **Convert silently** option to increase accessibility silently when needed.\n\nUse the **Suppress conversion if class is annotated by** list to exclude classes from conversion when annotated by annotations matching the specified patterns.\n\nThis inspection depends on the Java feature 'Records' which is available since Java 16.\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ClassCanBeRecord",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 16",
+ "index": 185,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstantAssertArgument",
+ "shortDescription": {
+ "text": "Constant assert argument"
+ },
+ "fullDescription": {
+ "text": "Reports constant arguments in 'assertTrue()', 'assertFalse()', 'assertNull()', and 'assertNotNull()' calls. Calls to these methods with constant arguments will either always succeed or always fail. Such statements can easily be left over after refactoring and are probably not intended. Example: 'assertNotNull(\"foo\");'",
+ "markdown": "Reports constant arguments in `assertTrue()`, `assertFalse()`, `assertNull()`, and `assertNotNull()` calls.\n\n\nCalls to these methods with\nconstant arguments will either always succeed or always fail.\nSuch statements can easily be left over after refactoring and are probably not intended.\n\n**Example:**\n\n\n assertNotNull(\"foo\");\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstantAssertArgument",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Test frameworks",
+ "index": 128,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RuntimeExec",
+ "shortDescription": {
+ "text": "Call to 'Runtime.exec()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Runtime.exec()' or any of its variants. Calls to 'Runtime.exec()' are inherently unportable.",
+ "markdown": "Reports calls to `Runtime.exec()` or any of its variants. Calls to `Runtime.exec()` are inherently unportable."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToRuntimeExec",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 95,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticInitializerReferencesSubClass",
+ "shortDescription": {
+ "text": "Static initializer references subclass"
+ },
+ "fullDescription": {
+ "text": "Reports classes that refer to their subclasses in static initializers or static fields. Such references can cause JVM-level deadlocks in multithreaded environment, when one thread tries to load the superclass and another thread tries to load the subclass at the same time. Example: 'class Parent {\n static final Child field = new Child();\n }\n class Child extends Parent { }'",
+ "markdown": "Reports classes that refer to their subclasses in static initializers or static fields.\n\nSuch references can cause JVM-level deadlocks in multithreaded environment, when one thread tries to load the superclass\nand another thread tries to load the subclass at the same time.\n\n**Example:**\n\n\n class Parent {\n static final Child field = new Child();\n }\n class Child extends Parent { }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticInitializerReferencesSubClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingDeprecatedAnnotationOnScheduledForRemovalApi",
+ "shortDescription": {
+ "text": "Missing '@Deprecated' annotation on scheduled for removal API"
+ },
+ "fullDescription": {
+ "text": "Reports declarations marked with '@ApiStatus.ScheduledForRemoval' without '@Deprecated'. Example: '@ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }' After the quick-fix is applied the result looks like: '@Deprecated\n @ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }'",
+ "markdown": "Reports declarations marked with `@ApiStatus.ScheduledForRemoval` without `@Deprecated`.\n\nExample:\n\n\n @ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }\n\nAfter the quick-fix is applied the result looks like:\n\n\n @Deprecated\n @ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "MissingDeprecatedAnnotationOnScheduledForRemovalApi",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 3,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstantDeclaredInAbstractClass",
+ "shortDescription": {
+ "text": "Constant declared in 'abstract' class"
+ },
+ "fullDescription": {
+ "text": "Reports constants ('public static final' fields) declared in abstract classes. Some coding standards require declaring constants in interfaces instead.",
+ "markdown": "Reports constants (`public static final` fields) declared in abstract classes.\n\nSome coding standards require declaring constants in interfaces instead."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstantDeclaredInAbstractClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SubtractionInCompareTo",
+ "shortDescription": {
+ "text": "Subtraction in 'compareTo()'"
+ },
+ "fullDescription": {
+ "text": "Reports subtraction in 'compareTo()' methods and methods implementing 'java.util.Comparator.compare()'. While it is a common idiom to use the results of integer subtraction as the result of a 'compareTo()' method, this construct may cause subtle and difficult bugs in cases of integer overflow. Comparing the integer values directly and returning '-1', '0', or '1' is a better practice in most cases. Subtraction on floating point values that is immediately cast to integral type is also reported because precision loss is possible due to rounding. The inspection doesn't report when it's statically determined that value ranges are limited, and overflow never occurs. Additionally, subtraction on 'int' numbers greater than or equal to '0' will never overflow. Therefore, this inspection tries not to warn in those cases. Methods that always return zero or greater can be marked with the 'javax.annotation.Nonnegative' annotation or specified in this inspection's options. Example: 'class DoubleHolder implements Comparable {\n double d;\n public int compareTo(DoubleHolder that) {\n return (int)(this.d - that.d);\n }\n }' A no-warning example because 'String.length()' is known to be non-negative: 'class A implements Comparable {\n final String s = \"\";\n public int compareTo(A a) {\n return s.length() - a.s.length();\n }\n }' Use the options to list methods that are safe to use inside a subtraction. Methods are safe when they return an 'int' value that is always greater than or equal to '0'.",
+ "markdown": "Reports subtraction in `compareTo()` methods and methods implementing `java.util.Comparator.compare()`.\n\n\nWhile it is a common idiom to\nuse the results of integer subtraction as the result of a `compareTo()`\nmethod, this construct may cause subtle and difficult bugs in cases of integer overflow.\nComparing the integer values directly and returning `-1`, `0`, or `1` is a better practice in most cases.\n\n\nSubtraction on floating point values that is immediately cast to integral type is also reported because precision loss is possible due to\nrounding.\n\n\nThe inspection doesn't report when it's statically determined that value ranges are limited, and overflow never occurs.\nAdditionally, subtraction on `int` numbers greater than or equal to `0` will never overflow.\nTherefore, this inspection tries not to warn in those cases.\n\n\nMethods that always return zero or greater can be marked with the\n`javax.annotation.Nonnegative` annotation or specified in this inspection's options.\n\n**Example:**\n\n\n class DoubleHolder implements Comparable {\n double d;\n public int compareTo(DoubleHolder that) {\n return (int)(this.d - that.d);\n }\n }\n\nA no-warning example because `String.length()` is known to be non-negative:\n\n\n class A implements Comparable {\n final String s = \"\";\n public int compareTo(A a) {\n return s.length() - a.s.length();\n }\n }\n\n\nUse the options to list methods that are safe to use inside a subtraction.\nMethods are safe when they return an `int` value that is always greater than or equal to `0`."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SubtractionInCompareTo",
+ "cweIds": [
+ 682
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConnectionResource",
+ "shortDescription": {
+ "text": "Connection opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports Java ME 'javax.microedition.io.Connection' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. Example: 'void example() throws IOException {\n Connection c = Connector.open(\"foo\");\n }'",
+ "markdown": "Reports Java ME `javax.microedition.io.Connection` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n**Example:**\n\n\n void example() throws IOException {\n Connection c = Connector.open(\"foo\");\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConnectionOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 169,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BooleanVariableAlwaysNegated",
+ "shortDescription": {
+ "text": "Boolean variable is always inverted"
+ },
+ "fullDescription": {
+ "text": "Reports boolean variables or fields which are always negated when their value is used. Example: 'void m() {\n boolean b = true; //boolean variable 'b' is always inverted\n System.out.println(!b);\n }'",
+ "markdown": "Reports boolean variables or fields which are always negated when their value is used.\n\nExample:\n\n\n void m() {\n boolean b = true; //boolean variable 'b' is always inverted\n System.out.println(!b);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BooleanVariableAlwaysNegated",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Data flow",
+ "index": 65,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtendsAnnotation",
+ "shortDescription": {
+ "text": "Class extends annotation interface"
+ },
+ "fullDescription": {
+ "text": "Reports classes declared as an implementation or extension of an annotation interface. While it is legal to extend an annotation interface, it is often done by accident, and the result can't be used as an annotation. This inspection depends on the Java feature 'Annotations' which is available since Java 5.",
+ "markdown": "Reports classes declared as an implementation or extension of an annotation interface.\n\nWhile it is legal to extend an annotation interface, it is often done by accident,\nand the result can't be used as an annotation.\n\nThis inspection depends on the Java feature 'Annotations' which is available since Java 5."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassExplicitlyAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 149,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "unused",
+ "shortDescription": {
+ "text": "Unused declaration"
+ },
+ "fullDescription": {
+ "text": "Reports classes, methods, or fields that are not used or unreachable from the entry points. An entry point can be a main method, tests, classes from outside the specified scope, classes accessible from 'module-info.java', and so on. It is possible to configure custom entry points by using name patterns or annotations. Example: 'public class Department {\n private Organization myOrganization;\n }' In this example, 'Department' explicitly references 'Organization' but if 'Department' class itself is unused, then inspection will report both classes. The inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local variables that are declared but not used. Note: Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is checked only when its name rarely occurs in the project. To see all results, run the inspection by selecting Code | Inspect Code or Code | Analyze Code | Run Inspection by Name from the main menu. Use the visibility settings below to configure members to be reported. For example, configuring report 'private' methods only means that 'public' methods of 'private' inner class will be reported but 'protected' methods of top level class will be ignored. Use the entry points tab to configure entry points to be considered during the inspection run. You can add entry points manually when inspection results are ready. If your code uses unsupported frameworks, there are several options: If the framework relies on annotations, use the Annotations... button to configure the framework's annotations. If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework. This way the annotated code accessible by the framework internals will be treated as used.",
+ "markdown": "Reports classes, methods, or fields that are not used or unreachable from the entry points.\n\nAn entry point can be a main method, tests, classes from outside the specified scope, classes accessible from\n`module-info.java`, and so on. It is possible to configure custom entry points by using name patterns or annotations.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nIn this example, `Department` explicitly references `Organization` but if `Department` class itself is unused, then inspection will report both classes.\n\n\nThe inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local\nvariables that are declared but not used.\n\n\n**Note:** Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is\nchecked only when its name rarely occurs in the project.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the visibility settings below to configure members to be reported. For example, configuring report `private` methods only means\nthat `public` methods of `private` inner class will be reported but `protected` methods of top level class\nwill be ignored.\n\n\nUse the **entry points** tab to configure entry points to be considered during the inspection run.\n\nYou can add entry points manually when inspection results are ready.\n\nIf your code uses unsupported frameworks, there are several options:\n\n* If the framework relies on annotations, use the **Annotations...** button to configure the framework's annotations.\n* If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.\n\nThis way the annotated code accessible by the framework internals will be treated as used."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "unused",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 13,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MismatchedStringCase",
+ "shortDescription": {
+ "text": "Mismatched case in 'String' operation"
+ },
+ "fullDescription": {
+ "text": "Reports 'String' method calls that always return the same value ('-1' or 'false') because a lowercase character is searched in an uppercase-only string or vice versa. Reported methods include 'equals', 'startsWith', 'endsWith', 'contains', 'indexOf', and 'lastIndexOf'. Example: if (columnName.toLowerCase().equals(\"ID\")) {...}\n New in 2019.3",
+ "markdown": "Reports `String` method calls that always return the same value (`-1` or `false`) because a lowercase character is searched in an uppercase-only string or vice versa.\n\nReported methods include `equals`, `startsWith`, `endsWith`, `contains`,\n`indexOf`, and `lastIndexOf`.\n\n**Example:**\n\n```\n if (columnName.toLowerCase().equals(\"ID\")) {...}\n```\n\nNew in 2019.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MismatchedStringCase",
+ "cweIds": [
+ 597
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousGetterSetter",
+ "shortDescription": {
+ "text": "Suspicious getter/setter"
+ },
+ "fullDescription": {
+ "text": "Reports getter or setter methods that access a field that is not expected by its name. For example, when 'getY()' returns the 'x' field. Usually, it might be a copy-paste error. Example: 'class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }' Use the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter.",
+ "markdown": "Reports getter or setter methods that access a field that is not expected by its name. For example, when `getY()` returns the `x` field. Usually, it might be a copy-paste error.\n\n**Example:**\n\n class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }\n\n\nUse the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousGetterSetter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JavaBeans issues",
+ "index": 139,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssignmentToNull",
+ "shortDescription": {
+ "text": "'null' assignment"
+ },
+ "fullDescription": {
+ "text": "Reports variables that are assigned to 'null' outside a declaration. The main purpose of 'null' in Java is to denote uninitialized reference variables. In rare cases, assigning a variable explicitly to 'null' is useful to aid garbage collection. However, using 'null' to denote a missing, not specified, or invalid value or a not found element is considered bad practice and may make your code more prone to 'NullPointerExceptions'. Instead, consider defining a sentinel object with the intended semantics or use library types like 'Optional' to denote the absence of a value. Example: 'Integer convert(String s) {\n Integer value;\n try {\n value = Integer.parseInt(s);\n } catch (NumberFormatException e) {\n // Warning: null is used to denote an 'invalid value'\n value = null;\n }\n return value;\n }' Use the Ignore assignments to fields option to ignore assignments to fields.",
+ "markdown": "Reports variables that are assigned to `null` outside a declaration.\n\nThe main purpose of `null` in Java is to denote uninitialized\nreference variables. In rare cases, assigning a variable explicitly to `null`\nis useful to aid garbage collection. However, using `null` to denote a missing, not specified, or invalid value or a not\nfound element is considered bad practice and may make your code more prone to `NullPointerExceptions`.\nInstead, consider defining a sentinel object with the intended semantics\nor use library types like `Optional` to denote the absence of a value.\n\n**Example:**\n\n\n Integer convert(String s) {\n Integer value;\n try {\n value = Integer.parseInt(s);\n } catch (NumberFormatException e) {\n // Warning: null is used to denote an 'invalid value'\n value = null;\n }\n return value;\n }\n\n\nUse the **Ignore assignments to fields** option to ignore assignments to fields."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssignmentToNull",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 87,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonSynchronizedMethodOverridesSynchronizedMethod",
+ "shortDescription": {
+ "text": "Unsynchronized method overrides 'synchronized' method"
+ },
+ "fullDescription": {
+ "text": "Reports non-'synchronized' methods overriding 'synchronized' methods. The overridden method will not be automatically synchronized if the superclass method is declared as 'synchronized'. This may result in unexpected race conditions when using the subclass. Example: 'class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n }'",
+ "markdown": "Reports non-`synchronized` methods overriding `synchronized` methods.\n\n\nThe overridden method will not be automatically synchronized if the superclass method\nis declared as `synchronized`. This may result in unexpected race conditions when using the subclass.\n\n**Example:**\n\n\n class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n } \n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonSynchronizedMethodOverridesSynchronizedMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitCalledOnCondition",
+ "shortDescription": {
+ "text": "'wait()' called on 'java.util.concurrent.locks.Condition' object"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'wait()' made on a 'java.util.concurrent.locks.Condition' object. This is probably a programming error, and some variant of the 'await()' method was intended instead. Example: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }' Good code would look like this: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }'",
+ "markdown": "Reports calls to `wait()` made on a `java.util.concurrent.locks.Condition` object. This is probably a programming error, and some variant of the `await()` method was intended instead.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }\n\nGood code would look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitCalledOnCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TooBroadCatch",
+ "shortDescription": {
+ "text": "Overly broad 'catch' block"
+ },
+ "fullDescription": {
+ "text": "Reports 'catch' blocks with parameters that are more generic than the exception thrown by the corresponding 'try' block. Example: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }' After the quick-fix is applied: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }' Configure the inspection: Use the Only warn on RuntimeException, Exception, Error or Throwable option to have this inspection warn only on the most generic exceptions. Use the Ignore exceptions which hide others but are themselves thrown option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad.",
+ "markdown": "Reports `catch` blocks with parameters that are more generic than the exception thrown by the corresponding `try` block.\n\n**Example:**\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }\n\nConfigure the inspection:\n\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyBroadCatchBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ProtectedMemberInFinalClass",
+ "shortDescription": {
+ "text": "'protected' member in 'final' class"
+ },
+ "fullDescription": {
+ "text": "Reports 'protected' members in 'final'classes. Since 'final' classes cannot be inherited, marking the method as 'protected' may be confusing. It is better to declare such members as 'private' or package-visible instead. Example: 'record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly.",
+ "markdown": "Reports `protected` members in `final`classes.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ProtectedMemberInFinalClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 13,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DanglingJavadoc",
+ "shortDescription": {
+ "text": "Dangling Javadoc comment"
+ },
+ "fullDescription": {
+ "text": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates. Example: 'class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' A quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied: 'class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' Use the Ignore file header comment in JavaDoc format option to ignore comments at the beginning of Java files. These are usually copyright messages.",
+ "markdown": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates.\n\n**Example:**\n\n\n class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nA quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied:\n\n\n class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nUse the **Ignore file header comment in JavaDoc format** option to ignore comments at the beginning of Java files.\nThese are usually copyright messages."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DanglingJavadoc",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 78,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "HibernateResource",
+ "shortDescription": {
+ "text": "Hibernate resource opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports calls to the 'openSession()' method if the returned 'org.hibernate.Session' resource is not safely closed. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void doHibernateQuery(SessionFactory factory) {\n Session session = factory.openSession(); //warning\n session.createQuery(\"...\");\n }' Use the following options to configure the inspection: Whether a 'org.hibernate.Session' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.",
+ "markdown": "Reports calls to the `openSession()` method if the returned `org.hibernate.Session` resource is not safely closed.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void doHibernateQuery(SessionFactory factory) {\n Session session = factory.openSession(); //warning\n session.createQuery(\"...\");\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `org.hibernate.Session` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "HibernateResourceOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 134,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryInitCause",
+ "shortDescription": {
+ "text": "Unnecessary call to 'Throwable.initCause()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Throwable.initCause()' where an exception constructor also takes a 'Throwable cause' argument. In this case, the 'initCause()' call can be removed and its argument can be added to the call to the exception's constructor. Example: 'try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }' A quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied: 'try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }'",
+ "markdown": "Reports calls to `Throwable.initCause()` where an exception constructor also takes a `Throwable cause` argument.\n\nIn this case, the `initCause()` call can be removed and its argument can be added to the call to the exception's constructor.\n\n**Example:**\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }\n\nA quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied:\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }\n \n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryInitCause",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ComparisonOfShortAndChar",
+ "shortDescription": {
+ "text": "Comparison of 'short' and 'char' values"
+ },
+ "fullDescription": {
+ "text": "Reports equality comparisons between 'short' and 'char' values. Such comparisons may cause subtle bugs because while both values are 2-byte long, 'short' values are signed, and 'char' values are unsigned. Example: 'if (Character.MAX_VALUE == shortValue()) {} //never can be true'",
+ "markdown": "Reports equality comparisons between `short` and `char` values.\n\nSuch comparisons may cause subtle bugs because while both values are 2-byte long, `short` values are\nsigned, and `char` values are unsigned.\n\n**Example:**\n\n\n if (Character.MAX_VALUE == shortValue()) {} //never can be true\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparisonOfShortAndChar",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArrayCanBeReplacedWithEnumValues",
+ "shortDescription": {
+ "text": "Array can be replaced with enum values"
+ },
+ "fullDescription": {
+ "text": "Reports arrays of enum constants that can be replaced with a call to 'EnumType.values()'. Usually, when updating such an enum, you have to update the array as well. However, if you use 'EnumType.values()' instead, no modifications are required. Example: 'enum States {\n NOT_RUN, IN_PROGRESS, FINISHED;\n }\n \n handleStates(new States[] {NOT_RUN, IN_PROGRESS, FINISHED});' After the quick-fix is applied: 'handleStates(States.values());' New in 2019.1",
+ "markdown": "Reports arrays of enum constants that can be replaced with a call to `EnumType.values()`.\n\nUsually, when updating such an enum, you have to update the array as well. However, if you use `EnumType.values()`\ninstead, no modifications are required.\n\nExample:\n\n\n enum States {\n NOT_RUN, IN_PROGRESS, FINISHED;\n }\n \n handleStates(new States[] {NOT_RUN, IN_PROGRESS, FINISHED});\n\nAfter the quick-fix is applied:\n\n\n handleStates(States.values());\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ArrayCanBeReplacedWithEnumValues",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitNotifyNotInSynchronizedContext",
+ "shortDescription": {
+ "text": "'wait()' or 'notify()' is not in synchronized context"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'wait()', 'notify()', and 'notifyAll()' that are not made inside a corresponding synchronized statement or synchronized method. Calling these methods on an object without holding a lock on that object causes 'IllegalMonitorStateException'. Such a construct is not necessarily an error, as the necessary lock may be acquired before the containing method is called, but it's worth looking at. Example: 'class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }'",
+ "markdown": "Reports calls to `wait()`, `notify()`, and `notifyAll()` that are not made inside a corresponding synchronized statement or synchronized method.\n\n\nCalling these methods on an object\nwithout holding a lock on that object causes `IllegalMonitorStateException`.\nSuch a construct is not necessarily an error, as the necessary lock may be acquired before\nthe containing method is called, but it's worth looking at.\n\n**Example:**\n\n\n class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitNotifyWhileNotSynced",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DollarSignInName",
+ "shortDescription": {
+ "text": "Use of '$' in identifier"
+ },
+ "fullDescription": {
+ "text": "Reports variables, methods, and classes with dollar signs ('$') in their names. While such names are legal Java, their use outside of generated java code is strongly discouraged. Example: 'class SalaryIn${}' Rename quick-fix is suggested only in the editor.",
+ "markdown": "Reports variables, methods, and classes with dollar signs (`$`) in their names. While such names are legal Java, their use outside of generated java code is strongly discouraged.\n\n**Example:**\n\n\n class SalaryIn${}\n\nRename quick-fix is suggested only in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DollarSignInName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 81,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DynamicRegexReplaceableByCompiledPattern",
+ "shortDescription": {
+ "text": "Dynamic regular expression could be replaced by compiled 'Pattern'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to the regular expression methods (such as 'matches()' or 'split()') of 'java.lang.String' using constant arguments. Such calls may be profitably replaced with a 'private static final Pattern' field so that the regular expression does not have to be compiled each time it is used. Example: 'text.replaceAll(\"abc\", replacement);' After the quick-fix is applied: 'private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));'",
+ "markdown": "Reports calls to the regular expression methods (such as `matches()` or `split()`) of `java.lang.String` using constant arguments.\n\n\nSuch calls may be profitably replaced with a `private static final Pattern` field\nso that the regular expression does not have to be compiled each time it is used.\n\n**Example:**\n\n\n text.replaceAll(\"abc\", replacement);\n\nAfter the quick-fix is applied:\n\n\n private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DynamicRegexReplaceableByCompiledPattern",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EmptyInitializer",
+ "shortDescription": {
+ "text": "Empty class initializer"
+ },
+ "fullDescription": {
+ "text": "Reports empty class initializer blocks.",
+ "markdown": "Reports empty class initializer blocks."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EmptyClassInitializer",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 13,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryBreak",
+ "shortDescription": {
+ "text": "Unnecessary 'break' statement"
+ },
+ "fullDescription": {
+ "text": "Reports any unnecessary 'break' statements. An 'break' statement is unnecessary if no other statements are executed after it has been removed. Example: 'switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }'",
+ "markdown": "Reports any unnecessary `break` statements.\n\nAn `break` statement is unnecessary if no other statements are executed after it has been removed.\n\n**Example:**\n\n\n switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryBreak",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RawUseOfParameterizedType",
+ "shortDescription": {
+ "text": "Raw use of parameterized class"
+ },
+ "fullDescription": {
+ "text": "Reports generic classes with omitted type parameters. Such raw use of generic types is valid in Java, but it defeats the purpose of type parameters and may mask bugs. This inspection mirrors the 'rawtypes' warning of 'javac'. Examples: '//warning: Raw use of parameterized class 'List'\nList list = new ArrayList();\n//list of strings was created but integer is accepted as well\nlist.add(1);' '//no warning as it's impossible to provide type arguments during array creation\nIntFunction[]> fun = List[]::new;' Configure the inspection: Use the Ignore construction of new objects option to ignore raw types used in object construction. Use the Ignore type casts option to ignore raw types used in type casts. Use the Ignore where a type parameter would not compile option to ignore the cases when a type parameter fails to compile (for example, when creating an array or overriding a library method). Use the Ignore parameter types of overriding methods option to ignore type parameters used in parameters of overridden methods. Use the Ignore when automatic quick-fix is not available option to ignore the cases when a quick-fix is not available. This inspection only reports if the language level of the project or module is 5 or higher. This inspection depends on the Java feature 'Generics' which is available since Java 5.",
+ "markdown": "Reports generic classes with omitted type parameters. Such *raw* use of generic types is valid in Java, but it defeats the purpose of type parameters and may mask bugs. This inspection mirrors the `rawtypes` warning of `javac`.\n\n**Examples:**\n\n\n //warning: Raw use of parameterized class 'List'\n List list = new ArrayList();\n //list of strings was created but integer is accepted as well\n list.add(1);\n\n\n //no warning as it's impossible to provide type arguments during array creation\n IntFunction[]> fun = List[]::new;\n\nConfigure the inspection:\n\n* Use the **Ignore construction of new objects** option to ignore raw types used in object construction.\n* Use the **Ignore type casts** option to ignore raw types used in type casts.\n* Use the **Ignore where a type parameter would not compile** option to ignore the cases when a type parameter fails to compile (for example, when creating an array or overriding a library method).\n* Use the **Ignore parameter types of overriding methods** option to ignore type parameters used in parameters of overridden methods.\n* Use the **Ignore when automatic quick-fix is not available** option to ignore the cases when a quick-fix is not available.\n\nThis inspection only reports if the language level of the project or module is 5 or higher.\n\nThis inspection depends on the Java feature 'Generics' which is available since Java 5."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "rawtypes",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 120,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PublicConstructorInNonPublicClass",
+ "shortDescription": {
+ "text": "'public' constructor in non-public class"
+ },
+ "fullDescription": {
+ "text": "Reports 'public' constructors in non-'public' classes. Usually, there is no reason for creating a 'public' constructor in a class with a lower access level. Please note, however, that this inspection changes the behavior of some reflection calls. In particular, 'Class.getConstructor()' won't be able to find the updated constructor ('Class.getDeclaredConstructor()' should be used instead). Do not use the inspection if your code or code of some used frameworks relies on constructor accessibility via 'getConstructor()'. Example: 'class House {\n public House() {}\n }' After the quick-fix is applied: 'class House {\n House() {}\n }'",
+ "markdown": "Reports `public` constructors in non-`public` classes.\n\nUsually, there is no reason for creating a `public` constructor in a class with a lower access level.\nPlease note, however, that this inspection changes the behavior of some reflection calls. In particular,\n`Class.getConstructor()` won't be able to find the updated constructor\n(`Class.getDeclaredConstructor()` should be used instead). Do not use the inspection if your code\nor code of some used frameworks relies on constructor accessibility via `getConstructor()`.\n\n**Example:**\n\n\n class House {\n public House() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class House {\n House() {}\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PublicConstructorInNonPublicClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 99,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ProtectedInnerClass",
+ "shortDescription": {
+ "text": "Protected nested class"
+ },
+ "fullDescription": {
+ "text": "Reports 'protected' nested classes. Example: 'public class Outer {\n protected static class Nested {} // warning\n protected class Inner {} // warning\n protected enum Mode {} // warning depends on the setting\n protected interface I {} // warning depends on the setting\n }' Configure the inspection: Use the Ignore 'protected' inner enums option to ignore 'protected' inner enums. Use the Ignore 'protected' inner interfaces option to ignore 'protected' inner interfaces.",
+ "markdown": "Reports `protected` nested classes.\n\n**Example:**\n\n\n public class Outer {\n protected static class Nested {} // warning\n protected class Inner {} // warning\n protected enum Mode {} // warning depends on the setting\n protected interface I {} // warning depends on the setting\n }\n\nConfigure the inspection:\n\n* Use the **Ignore 'protected' inner enums** option to ignore `protected` inner enums.\n* Use the **Ignore 'protected' inner interfaces** option to ignore `protected` inner interfaces."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ProtectedInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Encapsulation",
+ "index": 126,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnqualifiedStaticUsage",
+ "shortDescription": {
+ "text": "Unqualified static access"
+ },
+ "fullDescription": {
+ "text": "Reports usage of static members that is not qualified with the class name. This is legal if the static member is in the same class, but may be confusing. Example: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }' After the quick-fix is applied: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }' Use the inspection settings to toggle the reporting for the following items: static fields access 'void bar() { System.out.println(x); }' calls to static methods 'void bar() { foo(); }' 'static void baz() { foo(); }' You can also configure the inspection to only report static member usage from a non-static context. In the above example, 'static void baz() { foo(); }' will not be reported.",
+ "markdown": "Reports usage of static members that is not qualified with the class name.\n\n\nThis is legal if the static member is in\nthe same class, but may be confusing.\n\n**Example:**\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }\n\nUse the inspection settings to toggle the reporting for the following items:\n\n*\n static fields access \n\n `void bar() { System.out.println(x); }`\n\n*\n calls to static methods \n\n `void bar() { foo(); }` \n\n `static void baz() { foo(); }`\n\n\nYou can also configure the inspection to only report static member usage from a non-static context.\nIn the above example, `static void baz() { foo(); }` will not be reported."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnqualifiedStaticUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticGuardedByInstance",
+ "shortDescription": {
+ "text": "Static member guarded by instance field or this"
+ },
+ "fullDescription": {
+ "text": "Reports '@GuardedBy' annotations on 'static' fields or methods in which the guard is either a non-static field or 'this'. Guarding a static element with a non-static element may result in excessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'",
+ "markdown": "Reports `@GuardedBy` annotations on `static` fields or methods in which the guard is either a non-static field or `this`.\n\nGuarding a static element with a non-static element may result in\nexcessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticGuardedByInstance",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Concurrency annotation issues",
+ "index": 101,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExternalizableWithoutPublicNoArgConstructor",
+ "shortDescription": {
+ "text": "'Externalizable' class without 'public' no-arg constructor"
+ },
+ "fullDescription": {
+ "text": "Reports 'Externalizable' classes without a public no-argument constructor. When an 'Externalizable' object is reconstructed, an instance is created using the public no-arg constructor before the 'readExternal' method called. If a public no-arg constructor is not available, a 'java.io.InvalidClassException' will be thrown at runtime.",
+ "markdown": "Reports `Externalizable` classes without a public no-argument constructor.\n\nWhen an `Externalizable` object is reconstructed, an instance is created using the public\nno-arg constructor before the `readExternal` method called. If a public\nno-arg constructor is not available, a `java.io.InvalidClassException` will be\nthrown at runtime."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExternalizableWithoutPublicNoArgConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 21,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ManualArrayCopy",
+ "shortDescription": {
+ "text": "Manual array copy"
+ },
+ "fullDescription": {
+ "text": "Reports manual copying of array contents that can be replaced with a call to 'System.arraycopy()'. Example: 'for (int i = 0; i < array.length; i++) {\n newArray[i] = array[i];\n }' After the quick-fix is applied: 'System.arraycopy(array, 0, newArray, 0, array.length);'",
+ "markdown": "Reports manual copying of array contents that can be replaced with a call to `System.arraycopy()`.\n\n**Example:**\n\n\n for (int i = 0; i < array.length; i++) {\n newArray[i] = array[i];\n }\n\nAfter the quick-fix is applied:\n\n\n System.arraycopy(array, 0, newArray, 0, array.length);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ManualArrayCopy",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticPseudoFunctionalStyleMethod",
+ "shortDescription": {
+ "text": "Guava pseudo-functional call can be converted to Stream API call"
+ },
+ "fullDescription": {
+ "text": "Reports usages of Guava pseudo-functional code when 'Java Stream API' is available. Though 'Guava Iterable API' provides functionality similar to 'Java Streams API', it's slightly different and may miss some features. Especially, primitive-specialized stream variants like 'IntStream' are more performant than generic variants. Example: 'List transformedIterable = Iterables.transform(someList, someTransformFunction);//warning: Pseudo functional style code' After the quick-fix is applied: 'List transformedIterable = someList.stream().map(someTransformFunction).collect(Collectors.toList());' Note: Code semantics can be changed; for example, Guava's 'Iterable.transform' produces a lazy-evaluated iterable, but the replacement is eager-evaluated. This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.",
+ "markdown": "Reports usages of Guava pseudo-functional code when `Java Stream API` is available.\n\nThough `Guava Iterable API` provides functionality similar to `Java Streams API`, it's slightly different and\nmay miss some features.\nEspecially, primitive-specialized stream variants like `IntStream` are more performant than generic variants.\n\n**Example:**\n\n\n List transformedIterable = Iterables.transform(someList, someTransformFunction);//warning: Pseudo functional style code\n\nAfter the quick-fix is applied:\n\n List transformedIterable = someList.stream().map(someTransformFunction).collect(Collectors.toList());\n\n\n**Note:** Code semantics can be changed; for example, Guava's `Iterable.transform` produces a lazy-evaluated iterable,\nbut the replacement is eager-evaluated.\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticPseudoFunctionalStyleMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 121,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ControlFlowStatementWithoutBraces",
+ "shortDescription": {
+ "text": "Control flow statement without braces"
+ },
+ "fullDescription": {
+ "text": "Reports any 'if', 'while', 'do', or 'for' statements without braces. Some code styles, e.g. the Google Java Style guide, require braces for all control statements. When adding further statements to control statements without braces, it is important not to forget adding braces. When commenting out a line of code, it is also necessary to be more careful when not using braces, to not inadvertently make the next statement part of the control flow statement. Always using braces makes inserting or commenting out a line of code safer. It's likely the goto fail vulnerability would not have happened, if an always use braces code style was used. Control statements with braces make the control flow easier to see, without relying on, possibly incorrect, indentation. Example: 'class Strange {\n void x(boolean one, boolean two) {\n if(one)\n if(two)\n foo();\n else\n bar();\n }\n\n void foo() {}\n void bar() {}\n }' The quick-fix wraps the statement body with braces: 'class Strange {\n void x(boolean one, boolean two) {\n if(one) {\n if(two) {\n foo();\n } else {\n bar();\n }\n }\n }\n\n void foo() {}\n void bar() {}\n }'",
+ "markdown": "Reports any `if`, `while`, `do`, or `for` statements without braces. Some code styles, e.g. the [Google Java Style guide](https://google.github.io/styleguide/javaguide.html), require braces for all control statements.\n\n\nWhen adding further statements to control statements without braces, it is important not to forget adding braces.\nWhen commenting out a line of code, it is also necessary to be more careful when not using braces,\nto not inadvertently make the next statement part of the control flow statement.\nAlways using braces makes inserting or commenting out a line of code safer.\n\n\nIt's likely the [goto fail vulnerability](https://www.imperialviolet.org/2014/02/22/applebug.html) would not have happened,\nif an always use braces code style was used.\nControl statements with braces make the control flow easier to see, without relying on, possibly incorrect, indentation.\n\nExample:\n\n\n class Strange {\n void x(boolean one, boolean two) {\n if(one)\n if(two)\n foo();\n else\n bar();\n }\n\n void foo() {}\n void bar() {}\n }\n\nThe quick-fix wraps the statement body with braces:\n\n\n class Strange {\n void x(boolean one, boolean two) {\n if(one) {\n if(two) {\n foo();\n } else {\n bar();\n }\n }\n }\n\n void foo() {}\n void bar() {}\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ControlFlowStatementWithoutBraces",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MisspelledEquals",
+ "shortDescription": {
+ "text": "'equal()' instead of 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports declarations of 'equal()' with a single parameter. Normally, this is a typo and 'equals()' is actually intended. A quick-fix is suggested to rename the method to 'equals'. Example: 'class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }' After the quick-fix is applied: 'class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }'",
+ "markdown": "Reports declarations of `equal()` with a single parameter. Normally, this is a typo and `equals()` is actually intended.\n\nA quick-fix is suggested to rename the method to `equals`.\n\n**Example:**\n\n\n class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MisspelledEquals",
+ "cweIds": [
+ 697
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LengthOneStringInIndexOf",
+ "shortDescription": {
+ "text": "Single character string argument in 'String.indexOf()' call"
+ },
+ "fullDescription": {
+ "text": "Reports single character strings being used as an argument in 'String.indexOf()' and 'String.lastIndexOf()' calls. A quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement. Example: 'return s.indexOf(\"x\");' After the quick-fix is applied: 'return s.indexOf('x');'",
+ "markdown": "Reports single character strings being used as an argument in `String.indexOf()` and `String.lastIndexOf()` calls.\n\nA quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement.\n\n**Example:**\n\n\n return s.indexOf(\"x\");\n\nAfter the quick-fix is applied:\n\n\n return s.indexOf('x');\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SingleCharacterStringConcatenation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonFinalFieldInEnum",
+ "shortDescription": {
+ "text": "Non-final field in 'enum'"
+ },
+ "fullDescription": {
+ "text": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable. Example: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' After the quick-fix is applied: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' Use the `Ignore fields that cannot be made 'final'` option to only warn on fields that can be made final using the quick-fix.",
+ "markdown": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable.\n\n**Example:**\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nUse the \\`Ignore fields that cannot be made 'final'\\` option to only warn on fields that can be made final using the quick-fix."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonFinalFieldInEnum",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 20,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TrivialFunctionalExpressionUsage",
+ "shortDescription": {
+ "text": "Trivial usage of functional expression"
+ },
+ "fullDescription": {
+ "text": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation. Example: 'boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }' When the quick-fix is applied, the method call changes to: 'boolean contains(List names, String name) {\n return names.contains(name);\n }'",
+ "markdown": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TrivialFunctionalExpressionUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 13,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EnumClass",
+ "shortDescription": {
+ "text": "Enumerated class"
+ },
+ "fullDescription": {
+ "text": "Reports enum classes. Such statements are not supported in Java 1.4 and earlier JVM.",
+ "markdown": "Reports **enum** classes. Such statements are not supported in Java 1.4 and earlier JVM."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EnumClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level issues",
+ "index": 145,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnonymousHasLambdaAlternative",
+ "shortDescription": {
+ "text": "Anonymous type has shorter lambda alternative"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous classes which could be transformed to a constructor or a factory method call with a lambda expression argument. The following classes are reported by this inspection: Anonymous classes extending 'ThreadLocal' which have an 'initialValue()' method (can be replaced with 'ThreadLocal.withInitial') Anonymous classes extending 'Thread' which have a 'run()' method (can be replaced with 'new Thread(Runnable)' Example: 'new Thread() {\n @Override\n public void run() {\n System.out.println(\"Hello from thread!\");\n }\n }.start();' After the quick-fix is applied: 'new Thread(() -> {\n System.out.println(\"Hello from thread!\");\n }).start();' This inspection depends on the Java feature 'ThreadLocal.withInitial()' which is available since Java 8.",
+ "markdown": "Reports anonymous classes which could be transformed to a constructor or a factory method call with a lambda expression argument.\n\nThe following classes are reported by this inspection:\n\n* Anonymous classes extending `ThreadLocal` which have an `initialValue()` method (can be replaced with `ThreadLocal.withInitial`)\n* Anonymous classes extending `Thread` which have a `run()` method (can be replaced with `new Thread(Runnable)`\n\nExample:\n\n\n new Thread() {\n @Override\n public void run() {\n System.out.println(\"Hello from thread!\");\n }\n }.start();\n\nAfter the quick-fix is applied:\n\n\n new Thread(() -> {\n System.out.println(\"Hello from thread!\");\n }).start();\n\nThis inspection depends on the Java feature 'ThreadLocal.withInitial()' which is available since Java 8."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AnonymousHasLambdaAlternative",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 121,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtendsThread",
+ "shortDescription": {
+ "text": "Class directly extends 'Thread'"
+ },
+ "fullDescription": {
+ "text": "Reports classes that directly extend 'java.lang.Thread'. It is usually recommended to prefer composition over inheritance to create more reusable code that is easier to modify later. Example: 'class MainThread extends Thread {\n }'",
+ "markdown": "Reports classes that directly extend `java.lang.Thread`. It is usually recommended to prefer composition over inheritance to create more reusable code that is easier to modify later.\n\n**Example:**\n\n\n class MainThread extends Thread {\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassExplicitlyExtendsThread",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 29,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifyOptionalCallChains",
+ "shortDescription": {
+ "text": "Optional call chain can be simplified"
+ },
+ "fullDescription": {
+ "text": "Reports Optional call chains that can be simplified. Here are several examples of possible simplifications: 'optional.map(x -> true).orElse(false)' → 'optional.isPresent()' 'optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)' → 'optional.map(String::trim)' 'optional.map(x -> (String)x).orElse(null)' → '(String) optional.orElse(null)' 'Optional.ofNullable(optional.orElse(null))' → 'optional' 'val = optional.orElse(null); val != null ? val : defaultExpr' → 'optional.orElse(defaultExpr)' 'val = optional.orElse(null); if(val != null) expr(val)' → 'optional.ifPresent(val -> expr(val))' This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8. New in 2017.2",
+ "markdown": "Reports **Optional** call chains that can be simplified. Here are several examples of possible simplifications:\n\n* `optional.map(x -> true).orElse(false)` → `optional.isPresent()`\n* `optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)` → `optional.map(String::trim)`\n* `optional.map(x -> (String)x).orElse(null)` → `(String) optional.orElse(null)`\n* `Optional.ofNullable(optional.orElse(null))` → `optional`\n* `val = optional.orElse(null); val != null ? val : defaultExpr ` → `optional.orElse(defaultExpr)`\n* `val = optional.orElse(null); if(val != null) expr(val) ` → `optional.ifPresent(val -> expr(val))`\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifyOptionalCallChains",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RandomDoubleForRandomInteger",
+ "shortDescription": {
+ "text": "Using 'Random.nextDouble()' to get random integer"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.util.Random.nextDouble()' that are used to create a positive integer number by multiplying the call by a factor and casting to an integer. For generating a random positive integer in a range, 'java.util.Random.nextInt(int)' is simpler and more efficient. Example: 'int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }'\n After the quick-fix is applied: 'int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }'",
+ "markdown": "Reports calls to `java.util.Random.nextDouble()` that are used to create a positive integer number by multiplying the call by a factor and casting to an integer.\n\n\nFor generating a random positive integer in a range,\n`java.util.Random.nextInt(int)` is simpler and more efficient.\n\n**Example:**\n\n\n int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }\n \nAfter the quick-fix is applied:\n\n\n int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UsingRandomNextDoubleForRandomInteger",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousArrayCast",
+ "shortDescription": {
+ "text": "Suspicious array cast"
+ },
+ "fullDescription": {
+ "text": "Reports suspicious array casts. An array cast is considered suspicious when it casts to a more specific array type. Such a cast is legal at compile time but may fail with a 'ClassCastException' at runtime. Example: 'Number[] numbers = new Number[]{1L, 2L, 4L};\n Long[] longs = (Long[])numbers;'",
+ "markdown": "Reports suspicious array casts. An array cast is considered suspicious when it casts to a more specific array type. Such a cast is legal at compile time but may fail with a `ClassCastException` at runtime.\n\n**Example:**\n\n\n Number[] numbers = new Number[]{1L, 2L, 4L};\n Long[] longs = (Long[])numbers;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousArrayCast",
+ "cweIds": [
+ 704
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ZeroLengthArrayInitialization",
+ "shortDescription": {
+ "text": "Zero-length array allocation"
+ },
+ "fullDescription": {
+ "text": "Reports allocations of arrays with known lengths of zero. Since array lengths in Java are non-modifiable, it is almost always possible to share zero-length arrays, rather than repeatedly allocate new ones. Such sharing may provide useful optimizations in the program runtime or footprint. Note that the inspection does not report zero-length arrays allocated as static final fields, since those arrays are assumed to be used for implementing array sharing.",
+ "markdown": "Reports allocations of arrays with known lengths of zero.\n\n\nSince array lengths in Java are non-modifiable, it is almost always possible to share zero-length arrays, rather than repeatedly\nallocate new ones. Such sharing may provide useful optimizations in the program runtime or footprint.\n\n\nNote that the inspection does not report zero-length arrays allocated as static final fields,\nsince those arrays are assumed to be used for implementing array sharing."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ZeroLengthArrayAllocation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 164,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DivideByZero",
+ "shortDescription": {
+ "text": "Division by zero"
+ },
+ "fullDescription": {
+ "text": "Reports division by zero or remainder by zero. Such expressions will produce an 'Infinity', '-Infinity' or 'NaN' result for doubles or floats, and will throw an 'ArithmeticException' for integers. When the expression has a 'NaN' result, the fix suggests replacing the division expression with the 'NaN' constant.",
+ "markdown": "Reports division by zero or remainder by zero. Such expressions will produce an `Infinity`, `-Infinity` or `NaN` result for doubles or floats, and will throw an `ArithmeticException` for integers.\n\nWhen the expression has a `NaN` result, the fix suggests replacing the division expression with the `NaN` constant."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "divzero",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingSerialAnnotation",
+ "shortDescription": {
+ "text": "'@Serial' annotation could be used"
+ },
+ "fullDescription": {
+ "text": "Reports methods and fields in the 'Serializable' and 'Externalizable' classes that are suitable to be annotated with the 'java.io.Serial' annotation. The quick-fix adds the annotation. Example: 'class Main implements Serializable {\n private static final long serialVersionUID = 7874493593505141603L;\n\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n}' After the quick-fix is applied: 'class Main implements Serializable {\n @Serial\n private static final long serialVersionUID = 7874493593505141603L;\n\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n}' Example: 'class Main implements Externalizable {\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }' After the quick-fix is applied: 'class Main implements Externalizable {\n @Serial\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }' For more information about all possible cases, refer the documentation for 'java.io.Serial'. This inspection depends on the Java feature '@Serial annotation' which is available since Java 14. New in 2020.3",
+ "markdown": "Reports methods and fields in the `Serializable` and `Externalizable` classes that are suitable to be annotated with the `java.io.Serial` annotation. The quick-fix adds the annotation.\n\n**Example:**\n\n\n class Main implements Serializable {\n private static final long serialVersionUID = 7874493593505141603L;\n\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main implements Serializable {\n @Serial\n private static final long serialVersionUID = 7874493593505141603L;\n\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\n**Example:**\n\n\n class Main implements Externalizable {\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main implements Externalizable {\n @Serial\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }\n\nFor more information about all possible cases, refer the documentation for `java.io.Serial`.\n\nThis inspection depends on the Java feature '@Serial annotation' which is available since Java 14.\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MissingSerialAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 21,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringConcatenationMissingWhitespace",
+ "shortDescription": {
+ "text": "Whitespace may be missing in string concatenation"
+ },
+ "fullDescription": {
+ "text": "Reports string concatenations with missing whitespaces, that is where the left-hand side ends with a Unicode letter or digit and the right-hand side starts with a Unicode letter or digit. Example: 'String sql = \"SELECT column\" +\n \"FROM table\";' Use the Ignore concatenations with variable strings option to only report when both the left and right side of the concatenation are literals.",
+ "markdown": "Reports string concatenations with missing whitespaces, that is where the left-hand side ends with a Unicode letter or digit and the right-hand side starts with a Unicode letter or digit.\n\n**Example:**\n\n\n String sql = \"SELECT column\" +\n \"FROM table\";\n\n\nUse the **Ignore concatenations with variable strings** option to only report\nwhen both the left and right side of the concatenation are literals."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringConcatenationMissingWhitespace",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StandardVariableNames",
+ "shortDescription": {
+ "text": "Standard variable names"
+ },
+ "fullDescription": {
+ "text": "Reports variables with 'standard' names that do not correspond to their types. Such names may be confusing. There are the following standard names for specific types: i, j, k, m, n - 'int' f - 'float' d - 'double' b - 'byte' c, ch - 'char' l - 'long' s, str - 'String' Rename quick-fix is suggested only in the editor. Use the option to ignore parameter names which are identical to the parameter name from a direct super method.",
+ "markdown": "Reports variables with 'standard' names that do not correspond to their types. Such names may be confusing. There are the following standard names for specific types:\n\n* i, j, k, m, n - `int`\n* f - `float`\n* d - `double`\n* b - `byte`\n* c, ch - `char`\n* l - `long`\n* s, str - `String`\n\nRename quick-fix is suggested only in the editor.\n\n\nUse the option to ignore parameter names which are identical to the parameter name from a direct super method."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StandardVariableNames",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 81,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DeconstructionCanBeUsed",
+ "shortDescription": {
+ "text": "Record pattern can be used"
+ },
+ "fullDescription": {
+ "text": "Reports patterns that can be replaced with record patterns. Example: 'record Point(int x, int y) {}\n\n static void printSum(Object obj) {\n if (obj instanceof Point p) {\n int x = p.x();\n int y = p.y();\n System.out.println(x + y);\n }\n }' After the quick-fix is applied: 'record Point(int x, int y) {}\n\n static void printSum(Object obj) {\n if (obj instanceof Point(int x, int y)) {\n System.out.println(x + y);\n }\n }' This inspection depends on the Java feature 'Pattern guards and record patterns' which is available since Java 21. New in 2023.1",
+ "markdown": "Reports patterns that can be replaced with record patterns.\n\nExample:\n\n\n record Point(int x, int y) {}\n\n static void printSum(Object obj) {\n if (obj instanceof Point p) {\n int x = p.x();\n int y = p.y();\n System.out.println(x + y);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n record Point(int x, int y) {}\n\n static void printSum(Object obj) {\n if (obj instanceof Point(int x, int y)) {\n System.out.println(x + y);\n }\n }\n\nThis inspection depends on the Java feature 'Pattern guards and record patterns' which is available since Java 21.\n\nNew in 2023.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "DeconstructionCanBeUsed",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 21",
+ "index": 192,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExceptionFromCatchWhichDoesntWrap",
+ "shortDescription": {
+ "text": "'throw' inside 'catch' block which ignores the caught exception"
+ },
+ "fullDescription": {
+ "text": "Reports exceptions that are thrown from inside 'catch' blocks but do not \"wrap\" the caught exception. When an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information, such as stack frames and line numbers. Example: '...\n catch (IOException e) {\n closeAllConnections();\n throw new ConnectException(\"Connection problem.\"); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'\n }' Configure the inspection: Use the Ignore if result of exception method call is used option to indicate whether the inspection should ignore exceptions whose argument is the result of a method call on the original exception, such as 'getMessage()'. Use the Ignore if thrown exception cannot wrap an exception option to ignore 'throw' statements that throw exceptions without a constructor that accepts a 'Throwable' cause.",
+ "markdown": "Reports exceptions that are thrown from inside `catch` blocks but do not \"wrap\" the caught exception.\n\nWhen an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information,\nsuch as stack frames and line numbers.\n\n**Example:**\n\n\n ...\n catch (IOException e) {\n closeAllConnections();\n throw new ConnectException(\"Connection problem.\"); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if result of exception method call is used** option to indicate whether the inspection should ignore exceptions whose argument is the result of a method call on the original exception, such as `getMessage()`.\n* Use the **Ignore if thrown exception cannot wrap an exception** option to ignore `throw` statements that throw exceptions without a constructor that accepts a `Throwable` cause."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThrowInsideCatchBlockWhichIgnoresCaughtException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodOnlyUsedFromInnerClass",
+ "shortDescription": {
+ "text": "Private method only used from inner class"
+ },
+ "fullDescription": {
+ "text": "Reports 'private' methods which are only called from an inner class of the class containing the method. Such methods can be safely moved into that inner class. Example: 'public class Outer {\n public static void main(String[] args) {\n new Inner().run(args[0]);\n }\n\n static class Inner {\n void run(String arg) {\n // Method isEmpty() is used from Inner class only\n // consider moving it to the Inner class\n if (!isEmpty(arg)) {\n System.out.println(\"Argument is supplied\");\n }\n }\n }\n\n private static boolean isEmpty(String s) {\n return s != null && s.trim().isEmpty();\n }\n}' Use the first checkbox below to ignore 'private' methods which are called from an anonymous or local class. Use the third checkbox to only report 'static' methods.",
+ "markdown": "Reports `private` methods which are only called from an inner class of the class containing the method. Such methods can be safely moved into that inner class.\n\nExample:\n\n\n public class Outer {\n public static void main(String[] args) {\n new Inner().run(args[0]);\n }\n\n static class Inner {\n void run(String arg) {\n // Method isEmpty() is used from Inner class only\n // consider moving it to the Inner class\n if (!isEmpty(arg)) {\n System.out.println(\"Argument is supplied\");\n }\n }\n }\n\n private static boolean isEmpty(String s) {\n return s != null && s.trim().isEmpty();\n }\n }\n\n\nUse the first checkbox below to ignore `private`\nmethods which are called from an anonymous or local class.\n\n\nUse the third checkbox to only report `static` methods."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodOnlyUsedFromInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 86,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ComparisonToNaN",
+ "shortDescription": {
+ "text": "Comparison to 'Double.NaN' or 'Float.NaN'"
+ },
+ "fullDescription": {
+ "text": "Reports any comparisons to 'Double.NaN' or 'Float.NaN'. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the 'Double.isNaN()' or 'Float.isNaN()' methods instead. Example: 'if (x == Double.NaN) {...}' After the quick-fix is applied: 'if (Double.isNaN(x)) {...}'",
+ "markdown": "Reports any comparisons to `Double.NaN` or `Float.NaN`. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the `Double.isNaN()` or `Float.isNaN()` methods instead.\n\n**Example:**\n\n\n if (x == Double.NaN) {...}\n\nAfter the quick-fix is applied:\n\n\n if (Double.isNaN(x)) {...}\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparisonToNaN",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 31,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MultiCatchCanBeSplit",
+ "shortDescription": {
+ "text": "Multi-catch can be split into separate catch blocks"
+ },
+ "fullDescription": {
+ "text": "Reports multi-'catch' sections and suggests splitting them into separate 'catch' blocks. Example: 'try {\n int i = getIndex();\n } catch (NullPointerException|IndexOutOfBoundsException e) {\n e.printStackTrace();\n }' After the quick-fix is applied: 'try {\n int i = getIndex();\n } catch (NullPointerException e) {\n e.printStackTrace();\n } catch (IndexOutOfBoundsException e) {\n e.printStackTrace();\n }' This inspection depends on the Java feature 'Multi-catches' which is available since Java 7.",
+ "markdown": "Reports multi-`catch` sections and suggests splitting them into separate `catch` blocks.\n\nExample:\n\n\n try {\n int i = getIndex();\n } catch (NullPointerException|IndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n int i = getIndex();\n } catch (NullPointerException e) {\n e.printStackTrace();\n } catch (IndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n\nThis inspection depends on the Java feature 'Multi-catches' which is available since Java 7."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MultiCatchCanBeSplit",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ResultSetIndexZero",
+ "shortDescription": {
+ "text": "Use of index 0 in JDBC ResultSet"
+ },
+ "fullDescription": {
+ "text": "Reports attempts to access column 0 of 'java.sql.ResultSet' or 'java.sql.PreparedStatement'. For historical reasons, columns of 'java.sql.ResultSet' and 'java.sql.PreparedStatement' are numbered starting with 1, rather than with 0, and accessing column 0 is a common error in JDBC programming. Example: 'String getName(ResultSet rs) {\n return rs.getString(0);\n }'",
+ "markdown": "Reports attempts to access column 0 of `java.sql.ResultSet` or `java.sql.PreparedStatement`. For historical reasons, columns of `java.sql.ResultSet` and `java.sql.PreparedStatement` are numbered starting with **1** , rather than with **0** , and accessing column 0 is a common error in JDBC programming.\n\n**Example:**\n\n\n String getName(ResultSet rs) {\n return rs.getString(0);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfIndexZeroInJDBCResultSet",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 15,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConditionCoveredByFurtherCondition",
+ "shortDescription": {
+ "text": "Condition is covered by further condition"
+ },
+ "fullDescription": {
+ "text": "Reports conditions that become redundant as they are completely covered by a subsequent condition. For example, in the 'value != -1 && value > 0' condition, the first part is redundant: if it's false, then the second part is also false. Or in a condition like 'obj != null && obj instanceof String', the null-check is redundant as 'instanceof' operator implies non-nullity. New in 2018.3",
+ "markdown": "Reports conditions that become redundant as they are completely covered by a subsequent condition.\n\nFor example, in the `value != -1 && value > 0` condition, the first part is redundant:\nif it's false, then the second part is also false.\nOr in a condition like `obj != null && obj instanceof String`,\nthe null-check is redundant as `instanceof` operator implies non-nullity.\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConditionCoveredByFurtherCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 47,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PatternVariableHidesField",
+ "shortDescription": {
+ "text": "Pattern variable hides field"
+ },
+ "fullDescription": {
+ "text": "Reports pattern variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the pattern variable when using the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'class Pointless {\n Point p = new Point();\n\n public void test(Object a) {\n if (a instanceof Point p) {\n System.out.print(\"a is a point (\" + p.x + \", \" + p.y + ')');\n } else {\n System.out.print(\"p is a point (\" + p.x + \", \" + p.y + ')');\n }\n }\n }' New in 2022.2",
+ "markdown": "Reports pattern variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the pattern variable when using the identically named field is intended.\n\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n class Pointless {\n Point p = new Point();\n\n public void test(Object a) {\n if (a instanceof Point p) {\n System.out.print(\"a is a point (\" + p.x + \", \" + p.y + ')');\n } else {\n System.out.print(\"p is a point (\" + p.x + \", \" + p.y + ')');\n }\n }\n }\n\nNew in 2022.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PatternVariableHidesField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 99,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JoinDeclarationAndAssignmentJava",
+ "shortDescription": {
+ "text": "Assignment can be joined with declaration"
+ },
+ "fullDescription": {
+ "text": "Reports variable assignments that can be joined with a variable declaration. Example: 'int x;\n x = 1;' The quick-fix converts the assignment into an initializer: 'int x = 1;' New in 2018.3",
+ "markdown": "Reports variable assignments that can be joined with a variable declaration.\n\nExample:\n\n\n int x;\n x = 1;\n\nThe quick-fix converts the assignment into an initializer:\n\n\n int x = 1;\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "JoinDeclarationAndAssignmentJava",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 11,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InnerClassVariableHidesOuterClassVariable",
+ "shortDescription": {
+ "text": "Inner class field hides outer class field"
+ },
+ "fullDescription": {
+ "text": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended. A quick-fix is suggested to rename the inner class field. Example: 'class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }' Use the option to choose whether this inspection should report all name clashes, or only clashes with fields that are visible from the inner class.",
+ "markdown": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended.\n\nA quick-fix is suggested to rename the inner class field.\n\n**Example:**\n\n\n class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }\n\n\nUse the option to choose whether this inspection should report all name clashes,\nor only clashes with fields that are visible from the inner class."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InnerClassFieldHidesOuterClassField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 99,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MISSORTED_IMPORTS",
+ "shortDescription": {
+ "text": "Missorted imports"
+ },
+ "fullDescription": {
+ "text": "Reports 'import' statements which are not arranged according to the current code style (see Settings|Editor|Code Style). Example: 'import java.util.List;\n import java.util.ArrayList;\n\n public class Example {\n List list = new ArrayList();\n }' After the \"Optimize Imports\" quick fix is applied: 'import java.util.ArrayList;\n import java.util.List;\n\n public class Example {\n List list = new ArrayList();\n }'",
+ "markdown": "Reports `import` statements which are not arranged according to the current code style (see Settings\\|Editor\\|Code Style).\n\n**Example:**\n\n\n import java.util.List;\n import java.util.ArrayList;\n\n public class Example {\n List list = new ArrayList();\n }\n\nAfter the \"Optimize Imports\" quick fix is applied:\n\n\n import java.util.ArrayList;\n import java.util.List;\n\n public class Example {\n List list = new ArrayList();\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MISSORTED_IMPORTS",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Imports",
+ "index": 24,
+ "toolComponent": {
+ "name": "QDJVM"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonThreadSafeLazyInitialization",
+ "shortDescription": {
+ "text": "Unsafe lazy initialization of 'static' field"
+ },
+ "fullDescription": {
+ "text": "Reports 'static' variables that are lazily initialized in a non-thread-safe manner. Lazy initialization of 'static' variables should be done with an appropriate synchronization construct to prevent different threads from performing conflicting initialization. When applicable, a quick-fix, which introduces the lazy initialization holder class idiom, is suggested. This idiom makes use of the fact that the JVM guarantees that a class will not be initialized until it is used. Example: 'class X {\n private static List list;\n\n public List getList() {\n if (list == null) {\n list = List.of(\"one\", \"two\", \"tree\");\n }\n return list;\n }\n }' After the quick-fix is applied: 'class X {\n private static final class ListHolder {\n static final List list = List.of(\"one\", \"two\", \"tree\");\n }\n\n public List