...' can be replaced with '{@code ...}'"
+ },
+ "fullDescription": {
+ "text": "Reports usages of '' tags in Javadoc comments. Since Java 5, these tags can be replaced with '{@code ...}' constructs. This allows using angle brackets '<' and '>' inside the comment instead of HTML character entities. Example: '/**\n * @return empty ArrayList<Integer>\n */\n List getList(){ ... }' After the quick-fix is applied: '/**\n * @return empty {@code ArrayList}\n */\n List getList(){ ... }'",
+ "markdown": "Reports usages of `` tags in Javadoc comments. Since Java 5, these tags can be replaced with `{@code ...}` constructs. This allows using angle brackets `<` and `>` inside the comment instead of HTML character entities.\n\n**Example:**\n\n\n /**\n * @return empty ArrayList<Integer>\n */\n List getList(){ ... }\n\nAfter the quick-fix is applied:\n\n\n /**\n * @return empty {@code ArrayList}\n */\n List getList(){ ... }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "HtmlTagCanBeJavadocTag",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 45,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassEscapesItsScope",
+ "shortDescription": {
+ "text": "Class is exposed outside of its visibility scope"
+ },
+ "fullDescription": {
+ "text": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference. Example: 'public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }' Additionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages. However, if a member that is part of the exported API references a non-exported class in its signature, such a member cannot be used outside of the module. Configure the inspection: Use the Report non-exported classes exposed in module API (Java 9+) option to report module API members that expose non-exported classes. Note that the language level of the project or module needs to be 9 or higher for this option. Use the Report non-accessible classes exposed in public API option to report on public members that expose classes with a smaller visibility scope. Use the Report private classes exposed in package-local API option to report on package-local members that expose 'private' classes.",
+ "markdown": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference.\n\n**Example:**\n\n\n public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }\n\n\nAdditionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages.\nHowever, if a member that is part of the exported API references a non-exported class in its signature,\nsuch a member cannot be used outside of the module.\n\nConfigure the inspection:\n\n* Use the **Report non-exported classes exposed in module API (Java 9+)** option to report module API members that expose non-exported classes. \n Note that the language level of the project or module needs to be 9 or higher for this option.\n* Use the **Report non-accessible classes exposed in public API** option to report on public members that expose classes with a smaller visibility scope.\n* Use the **Report private classes exposed in package-local API** option to report on package-local members that expose `private` classes."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassEscapesDefinedScope",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringBufferField",
+ "shortDescription": {
+ "text": "'StringBuilder' field"
+ },
+ "fullDescription": {
+ "text": "Reports fields of type 'java.lang.StringBuffer' or 'java.lang.StringBuilder'. Such fields can grow without limit and are often the cause of memory leaks. Example: 'public class Example {\n private StringBuilder builder = new StringBuilder();\n\n }'",
+ "markdown": "Reports fields of type `java.lang.StringBuffer` or `java.lang.StringBuilder`. Such fields can grow without limit and are often the cause of memory leaks.\n\n**Example:**\n\n\n public class Example {\n private StringBuilder builder = new StringBuilder();\n\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringBufferField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 71,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassNameSameAsAncestorName",
+ "shortDescription": {
+ "text": "Class name same as ancestor name"
+ },
+ "fullDescription": {
+ "text": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing. Example: 'package util;\n abstract class Iterable implements java.lang.Iterable {}' A quick-fix that renames such classes is available only in the editor.",
+ "markdown": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing.\n\n**Example:**\n\n\n package util;\n abstract class Iterable implements java.lang.Iterable {}\n\nA quick-fix that renames such classes is available only in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassNameSameAsAncestorName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Class",
+ "index": 69,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantMethodOverride",
+ "shortDescription": {
+ "text": "Method is identical to its super method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed. Use the first checkbox below to run the inspection for the methods that override library methods. Checking library methods may slow down the inspection. Use the second checkbox below to ignore methods that only delegate calls to their super methods.",
+ "markdown": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed.\n\n\nUse the first checkbox below to run the inspection for the methods that override library methods.\nChecking library methods may slow down the inspection.\n\n\nUse the second checkbox below to ignore methods that only delegate calls to their super methods."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantMethodOverride",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsUsesNonFinalVariable",
+ "shortDescription": {
+ "text": "Non-final field referenced in 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports implementations of 'equals()' that access non-'final' variables. Such access may result in 'equals()' returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes. Example: 'public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }'",
+ "markdown": "Reports implementations of `equals()` that access non-`final` variables. Such access may result in `equals()` returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes.\n\n**Example:**\n\n\n public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }\n \n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonFinalFieldReferenceInEquals",
+ "cweIds": [
+ 697
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ContinueStatementWithLabel",
+ "shortDescription": {
+ "text": "'continue' statement with label"
+ },
+ "fullDescription": {
+ "text": "Reports 'continue' statements with labels. Labeled 'continue' 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) continue outer;\n handleChar(ch);\n }\n }\n }'",
+ "markdown": "Reports `continue` statements with labels.\n\nLabeled `continue` 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) continue outer;\n handleChar(ch);\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ContinueStatementWithLabel",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestedAssignment",
+ "shortDescription": {
+ "text": "Nested assignment"
+ },
+ "fullDescription": {
+ "text": "Reports assignment expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing. Example: 'String userName;\n // Warning: result of assignment to 'userName' is used\n String message = \"Hello \" + (userName = \"Alice\") + \"!\"\n System.out.println(message);\n System.out.println(\"Goodbye \" + userName);'",
+ "markdown": "Reports assignment expressions that are nested inside other expressions.\n\nSuch expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing.\n\n**Example:**\n\n\n String userName;\n // Warning: result of assignment to 'userName' is used\n String message = \"Hello \" + (userName = \"Alice\") + \"!\"\n System.out.println(message);\n System.out.println(\"Goodbye \" + userName);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NestedAssignment",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 35,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifiableBooleanExpression",
+ "shortDescription": {
+ "text": "Simplifiable boolean expression"
+ },
+ "fullDescription": {
+ "text": "Reports boolean expressions that can be simplified. Example: 'void f(boolean foo, boolean bar) {\n boolean b = !(foo ^ bar);\n }' After the quick-fix is applied: 'void f(boolean foo, boolean bar) {\n boolean b = foo == bar;\n }' Example: 'void f(boolean foo, boolean bar) {\n boolean b = (foo && bar) || !foo;\n }' After the quick-fix is applied: 'void f(boolean foo, boolean bar) {\n boolean b = !foo || bar;\n }'",
+ "markdown": "Reports boolean expressions that can be simplified.\n\nExample:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = !(foo ^ bar);\n }\n\nAfter the quick-fix is applied:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = foo == bar;\n }\n\nExample:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = (foo && bar) || !foo;\n }\n \nAfter the quick-fix is applied:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = !foo || bar;\n }\n \n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifiableBooleanExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AutoUnboxing",
+ "shortDescription": {
+ "text": "Auto-unboxing"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that are affected by unboxing conversion (automatic unwrapping of objects into primitive values). Try not to use objects instead of primitives. It might significantly affect the performance. Example: 'int x = new Integer(42);' The quick-fix makes the conversion explicit: 'int x = new Integer(42).intValue();' AutoUnboxing appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions.",
+ "markdown": "Reports expressions that are affected by unboxing conversion (automatic unwrapping of objects into primitive values). Try not to use objects instead of primitives. It might significantly affect the performance.\n\n**Example:**\n\n int x = new Integer(42);\n\nThe quick-fix makes the conversion explicit:\n\n int x = new Integer(42).intValue();\n\n\n*AutoUnboxing* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AutoUnboxing",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringConcatenationInMessageFormatCall",
+ "shortDescription": {
+ "text": "String concatenation as argument to 'MessageFormat.format()' call"
+ },
+ "fullDescription": {
+ "text": "Reports non-constant string concatenations used as an argument to a call to 'MessageFormat.format()'. While occasionally intended, this is usually a misuse of the formatting method and may even cause unexpected exceptions 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: 'String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }' Here, the 'userName' will be interpreted as a part of the format string, which may result in 'IllegalArgumentException' (for example, if 'userName' is '\"{\"'). This call should be probably replaced with 'MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)'.",
+ "markdown": "Reports non-constant string concatenations used as an argument to a call to `MessageFormat.format()`.\n\n\nWhile occasionally intended, this is usually a misuse of the formatting method\nand may even cause unexpected exceptions if the variables used in the concatenated string contain\nspecial 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 String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }\n\n\nHere, the `userName` will be interpreted as a part of the format string, which may result\nin `IllegalArgumentException` (for example, if `userName` is `\"{\"`).\nThis call should be probably replaced with `MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)`."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringConcatenationInMessageFormatCall",
+ "cweIds": [
+ 116,
+ 134
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonFinalFieldInImmutable",
+ "shortDescription": {
+ "text": "Non-final field in '@Immutable' class"
+ },
+ "fullDescription": {
+ "text": "Reports any non-final field in a class with the '@Immutable' annotation. This violates the contract of the '@Immutable' annotation. Example: 'import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\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 any non-final field in a class with the `@Immutable` annotation. This violates the contract of the `@Immutable` annotation.\n\nExample:\n\n\n import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\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": "NonFinalFieldInImmutable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Concurrency annotation issues",
+ "index": 58,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CallToStringConcatCanBeReplacedByOperator",
+ "shortDescription": {
+ "text": "Call to 'String.concat()' can be replaced with '+'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.lang.String.concat()'. Such calls can be replaced with the '+' operator for clarity and possible increased performance if the method was invoked on a constant with a constant argument. Example: 'String foo(String name) {\n return name.concat(\"foo\");\n }' After the quick-fix is applied: 'String foo(String name) {\n return name + \"foo\";\n }'",
+ "markdown": "Reports calls to `java.lang.String.concat()`.\n\n\nSuch calls can be replaced with the `+` operator for clarity and possible increased\nperformance if the method was invoked on a constant with a constant argument.\n\n**Example:**\n\n\n String foo(String name) {\n return name.concat(\"foo\");\n }\n\nAfter the quick-fix is applied:\n\n\n String foo(String name) {\n return name + \"foo\";\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToStringConcatCanBeReplacedByOperator",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExpectedExceptionNeverThrown",
+ "shortDescription": {
+ "text": "Expected exception never thrown in test method body"
+ },
+ "fullDescription": {
+ "text": "Reports checked exceptions expected by a JUnit 4 test-method that are never thrown inside the method body. Such test methods will never succeed. Example: '@Test(expected = CloneNotSupportedException.class)\n public void testIt() {\n }'",
+ "markdown": "Reports checked exceptions expected by a JUnit 4 test-method that are never thrown inside the method body. Such test methods will never succeed.\n\n**Example:**\n\n\n @Test(expected = CloneNotSupportedException.class)\n public void testIt() {\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExpectedExceptionNeverThrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JUnit",
+ "index": 74,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SignalWithoutCorrespondingAwait",
+ "shortDescription": {
+ "text": "'signal()' without corresponding 'await()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Condition.signal()' or 'Condition.signalAll()' for which no call to a corresponding 'Condition.await()' can be found. 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(); // warning: Call to 'signal()' without corresponding 'await()'\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n // isEmpty.await();\n // ...\n }\n }'",
+ "markdown": "Reports calls to `Condition.signal()` or `Condition.signalAll()` for which no call to a corresponding `Condition.await()` can be found.\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(); // warning: Call to 'signal()' without corresponding 'await()'\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n // isEmpty.await();\n // ...\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SignalWithoutCorrespondingAwait",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FoldExpressionIntoStream",
+ "shortDescription": {
+ "text": "Expression can be folded into Stream chain"
+ },
+ "fullDescription": {
+ "text": "Reports expressions with a repeating pattern which could be replaced with Stream API or 'String.join()'. Example: 'boolean allStartWith(String a, String b, String c, String d, String prefix) {\n return a.startsWith(prefix) && b.startsWith(prefix) && c.startsWith(prefix) && d.startsWith(prefix);\n }' After the quick-fix is applied: 'boolean foo(String a, String b, String c, String d, String prefix) {\n return Stream.of(a, b, c, d).allMatch(s -> s.startsWith(prefix));\n }' Example: 'String joinAll(String a, String b, String c, String d) {\n return a + \",\" + b + \",\" + c + \",\" + d;\n }' After the quick-fix is applied: 'String joinAll(String a, String b, String c, String d) {\n return String.join(\",\", a, b, c, d);\n }' This inspection only reports if the language level of the project or module is 8 or higher. New in 2018.2",
+ "markdown": "Reports expressions with a repeating pattern which could be replaced with *Stream API* or `String.join()`.\n\nExample:\n\n\n boolean allStartWith(String a, String b, String c, String d, String prefix) {\n return a.startsWith(prefix) && b.startsWith(prefix) && c.startsWith(prefix) && d.startsWith(prefix);\n }\n\nAfter the quick-fix is applied:\n\n\n boolean foo(String a, String b, String c, String d, String prefix) {\n return Stream.of(a, b, c, d).allMatch(s -> s.startsWith(prefix));\n }\n\nExample:\n\n\n String joinAll(String a, String b, String c, String d) {\n return a + \",\" + b + \",\" + c + \",\" + d;\n }\n\nAfter the quick-fix is applied:\n\n\n String joinAll(String a, String b, String c, String d) {\n return String.join(\",\", a, b, c, d);\n }\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "FoldExpressionIntoStream",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "HardcodedFileSeparators",
+ "shortDescription": {
+ "text": "Hardcoded file separator"
+ },
+ "fullDescription": {
+ "text": "Reports the forward ('/') or backward ('\\') slash in a string or character literal. These characters are commonly used as file separators, and portability may suffer if they are hardcoded. The inspection will not report backward slashes inside escape sequences and forward slashes immediately following the '<' character or immediately preceding the '>' character, as those often indicate XML or HTML tags rather than file names. Strings representing a 'java.util.TimeZone' ID, strings that are valid regular expressions, or strings that equal IANA-registered MIME media types will not be reported either. Example: 'new File(\"C:\\\\Users\\\\Name\");' Use the option to include 'example/*' in the set of recognized media types. Normally, usage of the 'example/*' MIME media type outside of an example (e.g. in a 'Content-Type' header) is an error.",
+ "markdown": "Reports the forward (`/`) or backward (`\\`) slash in a string or character literal. These characters are commonly used as file separators, and portability may suffer if they are hardcoded.\n\n\nThe inspection will not report backward slashes inside escape sequences and forward slashes immediately following the '\\<' character\nor immediately preceding the '\\>' character, as those often indicate XML or HTML tags rather than file names.\nStrings representing a `java.util.TimeZone` ID, strings that are valid regular expressions,\nor strings that equal IANA-registered MIME media types will not be reported either.\n\n**Example:**\n\n\n new File(\"C:\\\\Users\\\\Name\");\n\n\nUse the option to include `example/*` in the set of recognized media types.\nNormally, usage of the `example/*` MIME media type outside of an example (e.g. in a `Content-Type`\nheader) is an error."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "HardcodedFileSeparator",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Portability",
+ "index": 7,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableDeserializableClassInSecureContext",
+ "shortDescription": {
+ "text": "Serializable class in secure context"
+ },
+ "fullDescription": {
+ "text": "Reports classes that may be serialized or deserialized. A class may be serialized if it supports the 'Serializable' interface, and its 'readObject()' and 'writeObject()' methods are not defined to always throw an exception. Serializable classes may be dangerous in code intended for secure use. Example: 'class DeserializableClass implements Serializable { // the class doesn't contain 'writeObject()' method throwing an exception\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n}' After the quick-fix is applied: 'class DeserializableClass implements Serializable {\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n\n private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {\n throw new java.io.NotSerializableException(\"DeserializableClass\");\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. Note that it still may be more secure to add 'readObject()' and 'writeObject()' methods which always throw an exception, instead of ignoring those classes. Whether to ignore serializable anonymous classes.",
+ "markdown": "Reports classes that may be serialized or deserialized.\n\n\nA class may be serialized if it supports the `Serializable` interface,\nand its `readObject()` and `writeObject()` methods are not defined to always\nthrow an exception. Serializable classes may be dangerous in code intended for secure use.\n\n**Example:**\n\n\n class DeserializableClass implements Serializable { // the class doesn't contain 'writeObject()' method throwing an exception\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class DeserializableClass implements Serializable {\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n\n private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {\n throw new java.io.NotSerializableException(\"DeserializableClass\");\n }\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. Note that it still may be more secure to add `readObject()` and `writeObject()` methods which always throw an exception, instead of ignoring those classes.\n* Whether to ignore serializable anonymous classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableDeserializableClassInSecureContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 31,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConfusingFloatingPointLiteral",
+ "shortDescription": {
+ "text": "Confusing floating-point literal"
+ },
+ "fullDescription": {
+ "text": "Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point. Such literals may be confusing, and violate several coding standards. Example: 'double d = .03;' After the quick-fix is applied: 'double d = 0.03;' Use the Ignore floating point literals in scientific notation option to ignore floating point numbers in scientific notation.",
+ "markdown": "Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point.\n\nSuch literals may be confusing, and violate several coding standards.\n\n**Example:**\n\n double d = .03;\n\nAfter the quick-fix is applied:\n\n double d = 0.03;\n\n\nUse the **Ignore floating point literals in scientific notation** option to ignore floating point numbers in scientific notation."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConfusingFloatingPointLiteral",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaModuleNaming",
+ "shortDescription": {
+ "text": "Java module name contradicts the convention"
+ },
+ "fullDescription": {
+ "text": "Reports cases when a module name contradicts Java Platform Module System recommendations. One of the recommendations is to avoid using digits at the end of module names. Example: 'module foo1.bar2 {}'",
+ "markdown": "Reports cases when a module name contradicts Java Platform Module System recommendations.\n\nOne of the [recommendations](http://mail.openjdk.org/pipermail/jpms-spec-experts/2017-March/000659.html)\nis to avoid using digits at the end of module names.\n\n**Example:**\n\n\n module foo1.bar2 {}\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavaModuleNaming",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 51,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavadocReference",
+ "shortDescription": {
+ "text": "Declaration has problems in Javadoc references"
+ },
+ "fullDescription": {
+ "text": "Reports unresolved references inside Javadoc comments. In the following example, the 'someParam' parameter is missing, so it will be highlighted: 'class A {\n /**\n * @param someParam description\n **/\n void foo() {\n }\n}' Disable the Report inaccessible symbols option to ignore the tags that reference missing method parameters, classes, fields and methods.",
+ "markdown": "Reports unresolved references inside Javadoc comments.\n\nIn the following example, the `someParam` parameter is missing, so it will be highlighted:\n\n\n class A {\n /**\n * @param someParam description\n **/\n void foo() {\n }\n }\n\n\nDisable the **Report inaccessible symbols** option to ignore the tags that reference missing method parameters,\nclasses, fields and methods."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavadocReference",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 45,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnaryPlus",
+ "shortDescription": {
+ "text": "Unary plus"
+ },
+ "fullDescription": {
+ "text": "Reports usages of the '+' unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in '+++') or with the equal operator (like in '=+'). Example: 'void unaryPlus(int i) {\n int x = + +i;\n }' The following quick fixes are suggested: Remove '+' operators before the 'i' variable: 'void unaryPlus(int i) {\n int x = i;\n }' Replace '+' operators with the prefix increment operator: 'void unaryPlus(int i) {\n int x = ++i;\n }' Use the checkbox below to report unary pluses that are used together with a binary or another unary expression. It means the inspection will not report situations when a unary plus expression is used in array initializer expressions or as a method argument.",
+ "markdown": "Reports usages of the `+` unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in `+++`) or with the equal operator (like in `=+`).\n\n**Example:**\n\n\n void unaryPlus(int i) {\n int x = + +i;\n }\n\nThe following quick fixes are suggested:\n\n* Remove `+` operators before the `i` variable:\n\n\n void unaryPlus(int i) {\n int x = i;\n }\n\n* Replace `+` operators with the prefix increment operator:\n\n\n void unaryPlus(int i) {\n int x = ++i;\n }\n\n\nUse the checkbox below to report unary pluses that are used together with a binary or another unary expression.\nIt means the inspection will not report situations when a unary plus expression is used in array\ninitializer expressions or as a method argument."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnaryPlus",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstructorCount",
+ "shortDescription": {
+ "text": "Class with too many constructors"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose number of constructors exceeds the specified maximum. Classes with too many constructors are prone to initialization errors, and often modeling such a class as multiple subclasses is preferable. Configure the inspection: Use the Constructor count limit field to specify the maximum allowed number of constructors in a class. Use the Ignore deprecated constructors option to avoid adding deprecated constructors to the total count.",
+ "markdown": "Reports classes whose number of constructors exceeds the specified maximum.\n\nClasses with too many constructors are prone to initialization errors, and often modeling such a class as multiple subclasses is preferable.\n\nConfigure the inspection:\n\n* Use the **Constructor count limit** field to specify the maximum allowed number of constructors in a class.\n* Use the **Ignore deprecated constructors** option to avoid adding deprecated constructors to the total count."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithTooManyConstructors",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 84,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IncrementDecrementUsedAsExpression",
+ "shortDescription": {
+ "text": "Result of '++' or '--' used"
+ },
+ "fullDescription": {
+ "text": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing. The quick-fix extracts the increment or decrement operation to a separate expression statement. Example: 'int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }' After the quick-fix is applied: 'int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;'",
+ "markdown": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing.\n\nThe quick-fix extracts the increment or decrement operation to a separate expression statement.\n\n**Example:**\n\n\n int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }\n\nAfter the quick-fix is applied:\n\n\n int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ValueOfIncrementOrDecrementUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 35,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodOverloadsParentMethod",
+ "shortDescription": {
+ "text": "Possibly unintended overload of method from superclass"
+ },
+ "fullDescription": {
+ "text": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type. In this case, the method in a subclass will be overloading the method from the superclass instead of overriding it. If it is unintended, it may result in latent bugs. Example: 'public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }' Use the option to choose whether the inspection should also report cases where parameter types are not compatible.",
+ "markdown": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type.\n\n\nIn this case, the method in a subclass will be overloading the method from the superclass\ninstead of overriding it. If it is unintended, it may result in latent bugs.\n\n**Example:**\n\n\n public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }\n\n\nUse the option to choose whether the inspection should also report cases where parameter types are not compatible."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodOverloadsMethodOfSuperclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DisjointPackage",
+ "shortDescription": {
+ "text": "Package with disjoint dependency graph"
+ },
+ "fullDescription": {
+ "text": "Reports packages whose classes can be separated into mutually independent subsets. Such disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.",
+ "markdown": "Reports packages whose classes can be separated into mutually independent subsets.\n\nSuch disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion.\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": "DisjointPackage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Packaging issues",
+ "index": 37,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UpperCaseFieldNameNotConstant",
+ "shortDescription": {
+ "text": "Non-constant field with upper-case name"
+ },
+ "fullDescription": {
+ "text": "Reports non-'static' non-'final' fields whose names are all in upper case. Such fields may cause confusion by breaking a common naming convention and are often used by mistake. Example: 'public static int THE_ANSWER = 42; //a warning here: final modifier is missing' A quick-fix that renames such fields is available only in the editor.",
+ "markdown": "Reports non-`static` non-`final` fields whose names are all in upper case.\n\nSuch fields may cause confusion by breaking a common naming convention and\nare often used by mistake.\n\n**Example:**\n\n\n public static int THE_ANSWER = 42; //a warning here: final modifier is missing\n\nA quick-fix that renames such fields is available only in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonConstantFieldWithUpperCaseName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 51,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodMayBeSynchronized",
+ "shortDescription": {
+ "text": "Method with single 'synchronized' block can be replaced with 'synchronized' method"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose body contains a single 'synchronized' statement. A lock expression for this 'synchronized' statement must be equal to 'this' for instance methods or '[ClassName].class' for static methods. To improve readability of such methods, you can remove the 'synchronized' wrapper and mark the method as 'synchronized'. Example: 'public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }' After the quick-fix is applied: 'public synchronized int generateInt(int x) {\n return 1;\n }'",
+ "markdown": "Reports methods whose body contains a single `synchronized` statement. A lock expression for this `synchronized` statement must be equal to `this` for instance methods or `[ClassName].class` for static methods.\n\n\nTo improve readability of such methods,\nyou can remove the `synchronized` wrapper and mark the method as `synchronized`.\n\n**Example:**\n\n\n public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public synchronized int generateInt(int x) {\n return 1;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodMayBeSynchronized",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoggingPlaceholderCountMatchesArgumentCount",
+ "shortDescription": {
+ "text": "Number of placeholders does not match number of arguments in logging call"
+ },
+ "fullDescription": {
+ "text": "Reports SLF4J, Log4j2 and akka.event.LoggingAdapter logging calls, such as 'logger.info(\"{}: {}\", key)' where the number of '{}' placeholders in the logger message doesn't match the number of other arguments to the logging call. Use the inspection option to specify which implementation SLF4J uses. If Check automatically is chosen, then 'org.apache.logging.slf4j.Log4jLogger' is searched in the classpath. If this file is founded or Yes is chosen, then cases, when the last parameter with an exception type has a placeholder, will not be reported for SLFJ4 API. For example: '//this case will not be reported with \"Yes\" option\nlog.error(\"For id {}: {}\", \"1\", new RuntimeException());' In this case 'new RuntimeException()' will be printed using 'toString()', (its stacktrace will not be printed): 'For id 1: java.lang.RuntimeException' Otherwise, it will be highlighted because the last placeholder is not used: 'For id 1: {}\njava.lang.RuntimeException: null' No option can be used to always highlight such cases when a placeholder is used for an exception even if 'org.apache.logging.slf4j.Log4jLogger' is used as a backend. This option works only for SLF4J.",
+ "markdown": "Reports SLF4J, Log4j2 and akka.event.LoggingAdapter logging calls, such as `logger.info(\"{}: {}\", key)` where the number of `{}` placeholders in the logger message doesn't match the number of other arguments to the logging call.\n\n\nUse the inspection option to specify which implementation SLF4J uses.\nIf **Check automatically** is chosen, then `org.apache.logging.slf4j.Log4jLogger` is searched in the classpath.\nIf this file is founded or **Yes** is chosen, then cases, when the last parameter with an exception type has a placeholder,\nwill not be reported for SLFJ4 API. \n\nFor example:\n\n\n //this case will not be reported with \"Yes\" option\n log.error(\"For id {}: {}\", \"1\", new RuntimeException());\n\nIn this case 'new RuntimeException()' will be printed using 'toString()', (its stacktrace will not be printed):\n\n\n For id 1: java.lang.RuntimeException\n\nOtherwise, it will be highlighted because the last placeholder is not used:\n\n\n For id 1: {}\n java.lang.RuntimeException: null\n\n**No** option can be used to always highlight such cases when a placeholder is used for an exception even if `org.apache.logging.slf4j.Log4jLogger` is used as a backend. \nThis option works only for SLF4J."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LoggingPlaceholderCountMatchesArgumentCount",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Logging",
+ "index": 46,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Convert2streamapi",
+ "shortDescription": {
+ "text": "Loop can be collapsed with Stream API"
+ },
+ "fullDescription": {
+ "text": "Reports loops which can be replaced with stream API calls using lambda expressions. Such a replacement changes the style from imperative to more functional and makes the code more compact. Example: 'boolean check(List data) {\n for (String e : data) {\n String trimmed = e.trim();\n if (!trimmed.startsWith(\"xyz\")) {\n return false;\n }\n }\n return true;\n }' After the quick-fix is applied: 'boolean check(List data) {\n return data.stream().map(String::trim).allMatch(trimmed -> trimmed.startsWith(\"xyz\"));\n }' This inspection only reports if the language level of the project or module is 8 or higher.",
+ "markdown": "Reports loops which can be replaced with stream API calls using lambda expressions.\n\nSuch a replacement changes the style from imperative to more functional and makes the code more compact.\n\nExample:\n\n\n boolean check(List data) {\n for (String e : data) {\n String trimmed = e.trim();\n if (!trimmed.startsWith(\"xyz\")) {\n return false;\n }\n }\n return true;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean check(List data) {\n return data.stream().map(String::trim).allMatch(trimmed -> trimmed.startsWith(\"xyz\"));\n }\n\nThis inspection only reports if the language level of the project or module is 8 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "Convert2streamapi",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerialPersistentFieldsWithWrongSignature",
+ "shortDescription": {
+ "text": "'serialPersistentFields' field not declared 'private static final ObjectStreamField[]'"
+ },
+ "fullDescription": {
+ "text": "Reports 'Serializable' classes whose 'serialPersistentFields' field is not declared as 'private static final ObjectStreamField[]'. If a 'serialPersistentFields' field is not declared with those modifiers, the serialization behavior will be as if the field was not declared at all. Example: 'class List implements Serializable {\n private List next;\n\n ObjectStreamField[] serialPersistentFields = {new ObjectStreamField(\"next\", List.class)};\n\n }'",
+ "markdown": "Reports `Serializable` classes whose `serialPersistentFields` field is not declared as `private static final ObjectStreamField[]`.\n\n\nIf a `serialPersistentFields` field is not declared with those modifiers,\nthe serialization behavior will be as if the field was not declared at all.\n\n**Example:**\n\n\n class List implements Serializable {\n private List next;\n\n ObjectStreamField[] serialPersistentFields = {new ObjectStreamField(\"next\", List.class)};\n\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerialPersistentFieldsWithWrongSignature",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ComparatorResultComparison",
+ "shortDescription": {
+ "text": "Suspicious usage of compare method"
+ },
+ "fullDescription": {
+ "text": "Reports comparisons of the result of 'Comparator.compare()' or 'Comparable.compareTo()' calls with non-zero constants. By contract, these methods can return any integer (not just -1, 0 or 1), so comparing against particular numbers is bad practice. Some widely used comparison methods (e.g. 'String.compareTo()') actually return values outside the [-1..1] range, and such a comparison may cause incorrect program behavior. Example: 'void validate(String s1, String s2) {\n // Comparing to 1 is incorrect\n if (s1.compareTo(s2) == 1) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }' After the quick-fix is applied: 'void validate(String s1, String s2) {\n if (s1.compareTo(s2) > 0) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }' New in 2017.2",
+ "markdown": "Reports comparisons of the result of `Comparator.compare()` or `Comparable.compareTo()` calls with non-zero constants. By contract, these methods can return any integer (not just -1, 0 or 1), so comparing against particular numbers is bad practice. Some widely used comparison methods (e.g. `String.compareTo()`) actually return values outside the \\[-1..1\\] range, and such a comparison may cause incorrect program behavior.\n\nExample:\n\n\n void validate(String s1, String s2) {\n // Comparing to 1 is incorrect\n if (s1.compareTo(s2) == 1) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void validate(String s1, String s2) {\n if (s1.compareTo(s2) > 0) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparatorResultComparison",
+ "cweIds": [
+ 253
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ListIndexOfReplaceableByContains",
+ "shortDescription": {
+ "text": "'List.indexOf()' expression can be replaced with 'contains()'"
+ },
+ "fullDescription": {
+ "text": "Reports any 'List.indexOf()' expressions that can be replaced with the 'List.contains()' method. Example: 'boolean hasEmptyString(List list) {\n // Warning: can be simplified\n return list.indexOf(\"\") >= 0;\n }' The provided quick-fix replaces the 'indexOf' call with the 'contains' call: 'boolean hasEmptyString(List list) {\n // Quick-fix is applied\n return list.contains(\"\");\n }'",
+ "markdown": "Reports any `List.indexOf()` expressions that can be replaced with the `List.contains()` method.\n\nExample:\n\n\n boolean hasEmptyString(List list) {\n // Warning: can be simplified\n return list.indexOf(\"\") >= 0;\n }\n\nThe provided quick-fix replaces the `indexOf` call with the `contains` call:\n\n\n boolean hasEmptyString(List list) {\n // Quick-fix is applied\n return list.contains(\"\");\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ListIndexOfReplaceableByContains",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonStrictComparisonCanBeEquality",
+ "shortDescription": {
+ "text": "Non-strict inequality '>=' or '<=' can be replaced with '=='"
+ },
+ "fullDescription": {
+ "text": "Reports inequality conditions that, according to data flow analysis, can be satisfied only for a single operand value. Such conditions could be replaced with equality conditions to make the code clearer. Example: 'if (x >= 10) {\n ...\n if (x <= 10) { // can be replaced with 'x == 10'\n }\n }' New in 2022.2",
+ "markdown": "Reports inequality conditions that, according to data flow analysis, can be satisfied only for a single operand value. Such conditions could be replaced with equality conditions to make the code clearer.\n\nExample:\n\n\n if (x >= 10) {\n ...\n if (x <= 10) { // can be replaced with 'x == 10'\n }\n }\n\nNew in 2022.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "NonStrictComparisonCanBeEquality",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryParentheses",
+ "shortDescription": {
+ "text": "Unnecessary parentheses"
+ },
+ "fullDescription": {
+ "text": "Reports any instance of unnecessary parentheses. Parentheses are considered unnecessary if the evaluation order of an expression remains unchanged after you remove the parentheses. Example: 'int n = 3 + (9 * 8);' After quick-fix is applied: 'int n = 3 + 9 * 8;' Configure the inspection: Use the Ignore clarifying parentheses option to ignore parentheses that help clarify a binary expression. Parentheses are clarifying if the parenthesized expression is an 'instanceof' expression that is a part of a larger expression or has a different operator than the parent expression. Use the Ignore parentheses around the condition of conditional expressions option to ignore any parentheses around the condition of conditional expressions. Some coding standards specify that all such conditions must be surrounded by parentheses. Use the Ignore parentheses around single no formal type lambda parameter option to ignore parentheses around a single lambda parameter within a lambda expression.",
+ "markdown": "Reports any instance of unnecessary parentheses.\n\nParentheses are considered unnecessary if the evaluation order of an expression remains\nunchanged after you remove the parentheses.\n\nExample:\n\n\n int n = 3 + (9 * 8);\n\nAfter quick-fix is applied:\n\n\n int n = 3 + 9 * 8;\n\nConfigure the inspection:\n\n* Use the **Ignore clarifying parentheses** option to ignore parentheses that help clarify a binary expression. Parentheses are clarifying if the parenthesized expression is an `instanceof` expression that is a part of a larger expression or has a different operator than the parent expression.\n* Use the **Ignore parentheses around the condition of conditional expressions** option to ignore any parentheses around the condition of conditional expressions. Some coding standards specify that all such conditions must be surrounded by parentheses.\n* Use the **Ignore parentheses around single no formal type lambda parameter** option to ignore parentheses around a single lambda parameter within a lambda expression."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "UnnecessaryParentheses",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ImplicitArrayToString",
+ "shortDescription": {
+ "text": "Call to 'toString()' on array"
+ },
+ "fullDescription": {
+ "text": "Reports arrays used in 'String' concatenations or passed as parameters to 'java.io.PrintStream' methods, such as 'System.out.println()'. Usually, the content of the array is meant to be used and not the array object itself. Example: 'void print(Object[] objects) {\n System.out.println(objects);\n }' After the quick-fix is applied: 'void print(Object[] objects) {\n System.out.println(Arrays.toString(objects));\n }'",
+ "markdown": "Reports arrays used in `String` concatenations or passed as parameters to `java.io.PrintStream` methods, such as `System.out.println()`.\n\n\nUsually, the content of the array is meant to be used and not the array object itself.\n\n**Example:**\n\n\n void print(Object[] objects) {\n System.out.println(objects);\n }\n\nAfter the quick-fix is applied:\n\n\n void print(Object[] objects) {\n System.out.println(Arrays.toString(objects));\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ImplicitArrayToString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReuseOfLocalVariable",
+ "shortDescription": {
+ "text": "Reuse of local variable"
+ },
+ "fullDescription": {
+ "text": "Reports local variables that are \"reused\" overwriting their values with new values unrelated to their original use. Such a local variable reuse may be confusing, as the intended semantics of the local variable may vary with each use. It may also be prone to bugs if due to the code changes, the values that have been considered overwritten actually appear to be alive. It is a good practice to keep variable lifetimes as short as possible, and not to reuse local variables for the sake of brevity. Example: 'void x() {\n String s = \"one\";\n System.out.println(\"s = \" + s);\n s = \"two\"; //reuse of local variable 's'\n System.out.println(\"s = \" + s);\n }'",
+ "markdown": "Reports local variables that are \"reused\" overwriting their values with new values unrelated to their original use.\n\nSuch a local variable reuse may be confusing,\nas the intended semantics of the local variable may vary with each use. It may also be\nprone to bugs if due to the code changes, the values that have been considered overwritten actually\nappear to be alive. It is a good practice to keep variable lifetimes as short as possible, and not\nto reuse local variables for the sake of brevity.\n\nExample:\n\n\n void x() {\n String s = \"one\";\n System.out.println(\"s = \" + s);\n s = \"two\"; //reuse of local variable 's'\n System.out.println(\"s = \" + s);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ReuseOfLocalVariable",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Data flow",
+ "index": 24,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BooleanMethodNameMustStartWithQuestion",
+ "shortDescription": {
+ "text": "Boolean method name must start with question word"
+ },
+ "fullDescription": {
+ "text": "Reports boolean methods whose names do not start with a question word. Boolean methods that override library methods are ignored by this inspection. Example: 'boolean empty(List list) {\n return list.isEmpty();\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 acceptable question words to start boolean method names with. Use the Ignore methods with 'java.lang.Boolean' return type option to ignore methods with the 'java.lang.Boolean' return type. Use the Ignore boolean methods in an @interface option to ignore boolean methods in annotation types ('@interface'). Use the Ignore methods overriding/implementing a super method to ignore methods the have supers.",
+ "markdown": "Reports boolean methods whose names do not start with a question word.\n\nBoolean methods that override library methods are ignored by this inspection.\n\n**Example:**\n\n boolean empty(List list) {\n return list.isEmpty();\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 acceptable question words to start boolean method names with.\n* Use the **Ignore methods with 'java.lang.Boolean' return type** option to ignore methods with the `java.lang.Boolean` return type.\n* Use the **Ignore boolean methods in an @interface** option to ignore boolean methods in annotation types (`@interface`).\n* Use the **Ignore methods overriding/implementing a super method** to ignore methods the have supers."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BooleanMethodNameMustStartWithQuestion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 85,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousToArrayCall",
+ "shortDescription": {
+ "text": "Suspicious 'Collection.toArray()' call"
+ },
+ "fullDescription": {
+ "text": "Reports suspicious calls to 'Collection.toArray()'. The following types of calls are considered suspicious: when the type of the array argument is not the same as the array type to which the result is casted. when the type of the array argument does not match the type parameter in the collection declaration. Example: 'void m1(List list) {\n Number[] ns = (Number[]) list.toArray(new String[0]);\n}\n\nvoid m2(List list) {\n Number[] ns = list.toArray(new String[0]);\n}'",
+ "markdown": "Reports suspicious calls to `Collection.toArray()`.\n\nThe following types of calls are considered suspicious:\n\n* when the type of the array argument is not the same as the array type to which the result is casted.\n* when the type of the array argument does not match the type parameter in the collection declaration.\n\n**Example:**\n\n\n void m1(List list) {\n Number[] ns = (Number[]) list.toArray(new String[0]);\n }\n\n void m2(List list) {\n Number[] ns = list.toArray(new String[0]);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousToArrayCall",
+ "cweIds": [
+ 704
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringToUpperWithoutLocale",
+ "shortDescription": {
+ "text": "Call to 'String.toUpperCase()' or 'toLowerCase()' without locale"
+ },
+ "fullDescription": {
+ "text": "Reports 'toUpperCase()' or 'toLowerCase()' calls on 'String' objects that do not specify a 'java.util.Locale'. In these cases the default system locale is used, which can cause problems in an internationalized environment. For example the code '\"i\".toUpperCase().equals(\"I\")' returns 'false' in the Turkish and Azerbaijani locales, where the dotted and dotless 'i' are separate letters. Calling 'toUpperCase()' on an English string containing an 'i', when running in a Turkish locale, will return incorrect results. Alternatively, when dealing with strings that should be treated as locale-independent, like HTML tags, this can lead to errors.",
+ "markdown": "Reports `toUpperCase()` or `toLowerCase()` calls on `String` objects that do not specify a `java.util.Locale`. In these cases the default system locale is used, which can cause problems in an internationalized environment.\n\n\nFor example the code `\"i\".toUpperCase().equals(\"I\")` returns `false` in the Turkish and Azerbaijani locales, where\nthe dotted and dotless 'i' are separate letters. Calling `toUpperCase()` on an English string containing an 'i', when running\nin a Turkish locale, will return incorrect results. Alternatively, when dealing with strings that should be treated as locale-independent,\nlike HTML tags, this can lead to errors."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringToUpperCaseOrToLowerCaseWithoutLocale",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 9,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizationOnLocalVariableOrMethodParameter",
+ "shortDescription": {
+ "text": "Synchronization on local variable or method parameter"
+ },
+ "fullDescription": {
+ "text": "Reports synchronization on a local variable or parameter. It is very difficult to guarantee correct operation when such synchronization is used. It may be possible to improve such code, for example, by controlling access using a synchronized wrapper class or by synchronizing on a field. Example: 'void bar() {\n final Object lock = new Object();\n synchronized (lock) { }\n }'",
+ "markdown": "Reports synchronization on a local variable or parameter.\n\n\nIt is very difficult to guarantee correct operation when such synchronization is used.\nIt may be possible to improve such code, for example, by controlling access using a synchronized wrapper class or by synchronizing on a\nfield.\n\n**Example:**\n\n\n void bar() {\n final Object lock = new Object();\n synchronized (lock) { }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchronizationOnLocalVariableOrMethodParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestedMethodCall",
+ "shortDescription": {
+ "text": "Nested method call"
+ },
+ "fullDescription": {
+ "text": "Reports method calls used as parameters to another method call. The quick-fix introduces a variable to make the code simpler and easier to debug. Example: 'public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int x = f(y());\n }' After the quick-fix is applied: 'public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int y = y();\n int x = f(y);\n }' Use the inspection options to toggle the reporting of: method calls in field initializers calls to static methods calls to simple getters",
+ "markdown": "Reports method calls used as parameters to another method call.\n\nThe quick-fix introduces a variable to make the code simpler and easier to debug.\n\n**Example:**\n\n\n public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int x = f(y());\n }\n\nAfter the quick-fix is applied:\n\n\n public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int y = y();\n int x = f(y);\n }\n\n\nUse the inspection options to toggle the reporting of:\n\n* method calls in field initializers\n* calls to static methods\n* calls to simple getters"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NestedMethodCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NegatedConditionalExpression",
+ "shortDescription": {
+ "text": "Negated conditional expression"
+ },
+ "fullDescription": {
+ "text": "Reports conditional expressions which are negated with a prefix expression, as such constructions may be confusing. There is a fix that propagates the outer negation to both branches. Example: '!(i == 1 ? a : b)' After the quick-fix is applied: 'i == 1 ? !a : !b'",
+ "markdown": "Reports conditional expressions which are negated with a prefix expression, as such constructions may be confusing.\n\nThere is a fix that propagates the outer negation to both branches.\n\nExample:\n\n\n !(i == 1 ? a : b)\n\nAfter the quick-fix is applied:\n\n\n i == 1 ? !a : !b\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NegatedConditionalExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FinalMethod",
+ "shortDescription": {
+ "text": "Method can't be overridden"
+ },
+ "fullDescription": {
+ "text": "Reports methods that are declared 'final'. Such methods can't be overridden and may indicate a lack of object-oriented design. Some coding standards discourage 'final' methods.",
+ "markdown": "Reports methods that are declared `final`. Such methods can't be overridden and may indicate a lack of object-oriented design. Some coding standards discourage `final` methods."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FinalMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithTooManyTransitiveDependents",
+ "shortDescription": {
+ "text": "Class with too many transitive dependents"
+ },
+ "fullDescription": {
+ "text": "Reports a class on which too many other classes are directly or indirectly dependent. Any modification to such a class may require changing many other classes, which may be expensive. Only top-level classes are reported. Use the Maximum number of transitive dependents field to specify the maximum allowed number of direct or indirect dependents 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 a class on which too many other classes are directly or indirectly dependent.\n\nAny modification to such a class may require changing many other classes, which may be expensive.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of transitive dependents** field to specify the maximum allowed number of direct or indirect dependents\nfor 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": "ClassWithTooManyTransitiveDependents",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 86,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CompareToUsesNonFinalVariable",
+ "shortDescription": {
+ "text": "Non-final field referenced in 'compareTo()'"
+ },
+ "fullDescription": {
+ "text": "Reports access to a non-'final' field inside a 'compareTo()' implementation. Such access may result in 'compareTo()' returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes, for example 'java.util.TreeSet'. A quick-fix to make the field 'final' is available only when there is no write access to the field, otherwise no fixes are suggested. Example: 'class Foo implements Comparable{\n private int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }' After the quick-fix is applied: 'class Foo implements Comparable{\n private final int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }'",
+ "markdown": "Reports access to a non-`final` field inside a `compareTo()` implementation.\n\n\nSuch access may result in `compareTo()`\nreturning different results at different points in the object's lifecycle, which may in turn cause problems when\nusing the standard collections classes, for example `java.util.TreeSet`.\n\n\nA quick-fix to make the field `final` is available\nonly when there is no write access to the field, otherwise no fixes are suggested.\n\n**Example:**\n\n\n class Foo implements Comparable{\n private int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Comparable{\n private final int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CompareToUsesNonFinalVariable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousSystemArraycopy",
+ "shortDescription": {
+ "text": "Suspicious 'System.arraycopy()' call"
+ },
+ "fullDescription": {
+ "text": "Reports suspicious calls to 'System.arraycopy()'. Such calls are suspicious when: the source or destination is not of an array type the source and destination are of different types the copied chunk length is greater than 'src.length - srcPos' the copied chunk length is greater than 'dest.length - destPos' the ranges always intersect when the source and destination are the same array Example: 'void foo() {\n int[] src = new int[] { 1, 2, 3, 4 };\n System.arraycopy(src, 0, src, 1, 2); // warning: Copying to the same array with intersecting ranges\n }'",
+ "markdown": "Reports suspicious calls to `System.arraycopy()`.\n\nSuch calls are suspicious when:\n\n* the source or destination is not of an array type\n* the source and destination are of different types\n* the copied chunk length is greater than `src.length - srcPos`\n* the copied chunk length is greater than `dest.length - destPos`\n* the ranges always intersect when the source and destination are the same array\n\n**Example:**\n\n\n void foo() {\n int[] src = new int[] { 1, 2, 3, 4 };\n System.arraycopy(src, 0, src, 1, 2); // warning: Copying to the same array with intersecting ranges\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousSystemArraycopy",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavacQuirks",
+ "shortDescription": {
+ "text": "Javac quirks"
+ },
+ "fullDescription": {
+ "text": "Reports known Javac issues, performance problems, and incompatibilities. For example, type inference may be slow when it has to process many nested calls. The following code triggers a warning, as the vararg method call has 50+ poly arguments: 'Arrays.asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));' The quick-fix adds explicit type arguments, which makes compilation and IDE processing much faster: '//noinspection RedundantTypeArguments\n Arrays.>asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));'",
+ "markdown": "Reports known Javac issues, performance problems, and incompatibilities. For example, type inference may be slow when it has to process many nested calls.\n\nThe following code triggers a warning, as the vararg method call has 50+ poly arguments:\n\n\n Arrays.asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));\n\nThe quick-fix adds explicit type arguments, which makes compilation and IDE processing much faster:\n\n\n //noinspection RedundantTypeArguments\n Arrays.>asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavacQuirks",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Compiler issues",
+ "index": 87,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchStatement",
+ "shortDescription": {
+ "text": "'switch' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'switch' statements. 'switch' statements often (but not always) indicate a poor object-oriented design. Example: 'switch (i) {\n // code\n }'",
+ "markdown": "Reports `switch` statements.\n\n`switch` statements often (but not always) indicate a poor object-oriented design.\n\nExample:\n\n\n switch (i) {\n // code\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SwitchStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbsoluteAlignmentInUserInterface",
+ "shortDescription": {
+ "text": "Absolute alignment in AWT/Swing code"
+ },
+ "fullDescription": {
+ "text": "Reports usages of absolute alignment constants from AWT and Swing. Internationalized applications use relative alignment because it respects the locale component orientation settings. Example: 'JPanel panel = new JPanel(new BorderLayout(2, 2));\n JLabel label = new JLabel(\"Hello World\");\n panel.add(label, BorderLayout.NORTH);' After the quick-fix is applied: 'JPanel panel = new JPanel(new BorderLayout(2, 2));\n JLabel label = new JLabel(\"Hello World\");\n panel.add(label, BorderLayout.PAGE_START);'",
+ "markdown": "Reports usages of absolute alignment constants from AWT and Swing. Internationalized applications use relative alignment because it respects the locale component orientation settings.\n\n**Example:**\n\n\n JPanel panel = new JPanel(new BorderLayout(2, 2));\n JLabel label = new JLabel(\"Hello World\");\n panel.add(label, BorderLayout.NORTH);\n\nAfter the quick-fix is applied:\n\n\n JPanel panel = new JPanel(new BorderLayout(2, 2));\n JLabel label = new JLabel(\"Hello World\");\n panel.add(label, BorderLayout.PAGE_START);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbsoluteAlignmentInUserInterface",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 9,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringBufferReplaceableByString",
+ "shortDescription": {
+ "text": "'StringBuilder' can be replaced with 'String'"
+ },
+ "fullDescription": {
+ "text": "Reports usages of 'StringBuffer', 'StringBuilder', or 'StringJoiner' which can be replaced with a single 'String' concatenation. Using 'String' concatenation makes the code shorter and simpler. This inspection only reports when the suggested replacement does not result in significant performance drawback on modern JVMs. In many cases, 'String' concatenation may perform better. Example: 'StringBuilder result = new StringBuilder();\n result.append(\"i = \");\n result.append(i);\n result.append(\";\");\n return result.toString();' After the quick-fix is applied: 'String result = \"i = \" + i + \";\";\n return result;'",
+ "markdown": "Reports usages of `StringBuffer`, `StringBuilder`, or `StringJoiner` which can be replaced with a single `String` concatenation.\n\nUsing `String` concatenation\nmakes the code shorter and simpler.\n\n\nThis inspection only reports when the suggested replacement does not result in significant\nperformance drawback on modern JVMs. In many cases, `String` concatenation may perform better.\n\n**Example:**\n\n\n StringBuilder result = new StringBuilder();\n result.append(\"i = \");\n result.append(i);\n result.append(\";\");\n return result.toString();\n\nAfter the quick-fix is applied:\n\n\n String result = \"i = \" + i + \";\";\n return result;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringBufferReplaceableByString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SourceToSinkFlow",
+ "shortDescription": {
+ "text": "Non-safe string is passed to safe method"
+ },
+ "fullDescription": {
+ "text": "Reports cases when a non-safe object is passed to a method with a parameter marked with '@Untainted' annotations, returned from annotated methods or assigned to annotated fields, parameters, or local variables. Kotlin 'set' and 'get' methods for fields are not supported as entry points. A safe object (in the same class) is: a string literal, interface instance, or enum object a result of a call of a method that is marked as '@Untainted' a private field, which is assigned only with a string literal and has a safe initializer a final field, which has a safe initializer local variable or parameter that are marked as '@Untainted' and are not assigned from non-safe objects This field, local variable, or parameter must not be passed as arguments to methods or used as a qualifier or must be a primitive, its wrapper or immutable. Also static final fields are considered as safe. The analysis is performed only inside one file. To process dependencies from other classes, use options. The analysis extends to private or static methods and has a limit of depth propagation. Example: 'void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n if (b) s1 = s;\n sink(s);\n }\n\n String sink(@Untainted String s) {}'\n Here we do not have non-safe string assignments to 's' so a warning is not produced. On the other hand: 'void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n s1 = foo();\n if (b) s = s1;\n sink(s); // warning here\n }\n\n String foo();\n\n String sink(@Untainted String s) {}'\n Here we have a warning since 's1' has an unknown state after 'foo' call result assignment. New in 2021.2",
+ "markdown": "Reports cases when a non-safe object is passed to a method with a parameter marked with `@Untainted` annotations, returned from annotated methods or assigned to annotated fields, parameters, or local variables. Kotlin `set` and `get` methods for fields are not supported as entry points.\n\n\nA safe object (in the same class) is:\n\n* a string literal, interface instance, or enum object\n* a result of a call of a method that is marked as `@Untainted`\n* a private field, which is assigned only with a string literal and has a safe initializer\n* a final field, which has a safe initializer\n* local variable or parameter that are marked as `@Untainted` and are not assigned from non-safe objects\nThis field, local variable, or parameter must not be passed as arguments to methods or used as a qualifier or must be a primitive, its wrapper or immutable.\n\nAlso static final fields are considered as safe.\n\n\nThe analysis is performed only inside one file. To process dependencies from other classes, use options.\nThe analysis extends to private or static methods and has a limit of depth propagation.\n\n\nExample:\n\n\n void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n if (b) s1 = s;\n sink(s);\n }\n\n String sink(@Untainted String s) {}\n\n\nHere we do not have non-safe string assignments to `s` so a warning is not produced. On the other hand:\n\n\n void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n s1 = foo();\n if (b) s = s1;\n sink(s); // warning here\n }\n\n String foo();\n\n String sink(@Untainted String s) {}\n\n\nHere we have a warning since `s1` has an unknown state after `foo` call result assignment.\n\nNew in 2021.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "tainting",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RecordCanBeClass",
+ "shortDescription": {
+ "text": "Record can be converted to class"
+ },
+ "fullDescription": {
+ "text": "Reports record classes and suggests converting them to ordinary classes. This inspection makes it possible to move a Java record to a codebase using an earlier Java version by applying the quick-fix to this record. Note that the resulting class is not completely equivalent to the original record: The resulting class no longer extends 'java.lang.Record', so 'instanceof Record' returns 'false'. Reflection methods like 'Class.isRecord()' and 'Class.getRecordComponents()' produce different results. The generated 'hashCode()' implementation may produce a different result because the formula to calculate record 'hashCode' is deliberately not specified. Record serialization mechanism differs from that of an ordinary class. Refer to Java Object Serialization Specification for details. Example: 'record Point(int x, int y) {}' After the quick-fix is applied: 'final class Point {\n private final int x;\n private final int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n public int x() { return x; }\n\n public int y() { return y; }\n\n @Override\n public boolean equals(Object obj) {\n if (obj == this) return true;\n if (obj == null || obj.getClass() != this.getClass()) return false;\n var that = (Point)obj;\n return this.x == that.x &&\n this.y == that.y;\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(x, y);\n }\n\n @Override\n public String toString() {\n return \"Point[\" +\n \"x=\" + x + \", \" +\n \"y=\" + y + ']';\n }\n }' This inspection only reports if the language level of the project or module is 16 or higher. New in 2020.3",
+ "markdown": "Reports record classes and suggests converting them to ordinary classes.\n\nThis inspection makes it possible to move a Java record to a codebase using an earlier Java version\nby applying the quick-fix to this record.\n\n\nNote that the resulting class is not completely equivalent to the original record:\n\n* The resulting class no longer extends `java.lang.Record`, so `instanceof Record` returns `false`.\n* Reflection methods like `Class.isRecord()` and `Class.getRecordComponents()` produce different results.\n* The generated `hashCode()` implementation may produce a different result because the formula to calculate record `hashCode` is deliberately not specified.\n* Record serialization mechanism differs from that of an ordinary class. Refer to *Java Object Serialization Specification* for details.\n\nExample:\n\n\n record Point(int x, int y) {}\n\nAfter the quick-fix is applied:\n\n\n final class Point {\n private final int x;\n private final int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n public int x() { return x; }\n\n public int y() { return y; }\n\n @Override\n public boolean equals(Object obj) {\n if (obj == this) return true;\n if (obj == null || obj.getClass() != this.getClass()) return false;\n var that = (Point)obj;\n return this.x == that.x &&\n this.y == that.y;\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(x, y);\n }\n\n @Override\n public String toString() {\n return \"Point[\" +\n \"x=\" + x + \", \" +\n \"y=\" + y + ']';\n }\n }\n\nThis inspection only reports if the language level of the project or module is 16 or higher.\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "RecordCanBeClass",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantLambdaParameterType",
+ "shortDescription": {
+ "text": "Redundant lambda parameter types"
+ },
+ "fullDescription": {
+ "text": "Reports lambda formal parameter types that are redundant because they can be inferred from the context. Example: 'Map map = ...\n map.forEach((String s, Integer i) -> log.info(s + \"=\" + i));' The quick-fix removes the parameter types from the lambda. 'Map map = ...\n map.forEach((s, i) -> log.info(s + \"=\" + i));'",
+ "markdown": "Reports lambda formal parameter types that are redundant because they can be inferred from the context.\n\n**Example:**\n\n\n Map map = ...\n map.forEach((String s, Integer i) -> log.info(s + \"=\" + i));\n\nThe quick-fix removes the parameter types from the lambda.\n\n\n Map map = ...\n map.forEach((s, i) -> log.info(s + \"=\" + i));\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "RedundantLambdaParameterType",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MalformedFormatString",
+ "shortDescription": {
+ "text": "Malformed format string"
+ },
+ "fullDescription": {
+ "text": "Reports format strings that don't comply with the standard Java syntax. By default, the inspection considers a compile-time constant a format string if it's used as an argument to the corresponding methods on 'java.util.Formatter', 'java.lang.String', 'java.io.PrintWriter' or 'java.io.PrintStream'. Example: 'String.format(\"x = %d, y = %d\", 42);' Use the inspection settings to mark additional classes and methods as related to string formatting. As an alternative, you can use the 'org.intellij.lang.annotations.PrintFormat' annotation to mark the format string method parameter. In this case, the format arguments parameter must immediately follow the format string and be the last method parameter. Example: 'void myFormatMethod(int mode, @PrintFormat String formatString, Object... args) {...}' Methods annotated in this way will also be recognized by this inspection.",
+ "markdown": "Reports format strings that don't comply with the standard Java syntax.\n\nBy default, the inspection considers a compile-time constant a format string if it's used as an argument to the corresponding methods on\n`java.util.Formatter`, `java.lang.String`, `java.io.PrintWriter` or `java.io.PrintStream`.\n\n**Example:**\n\n\n String.format(\"x = %d, y = %d\", 42);\n\nUse the inspection settings to mark additional classes and methods as related to string formatting.\n\nAs an alternative, you can use the `org.intellij.lang.annotations.PrintFormat` annotation\nto mark the format string method parameter. In this case,\nthe format arguments parameter must immediately follow the format string and be the last method parameter. Example:\n\n\n void myFormatMethod(int mode, @PrintFormat String formatString, Object... args) {...}\n\n\nMethods annotated in this way will also be recognized by this inspection."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MalformedFormatString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuspiciousReturnByteInputStream",
+ "shortDescription": {
+ "text": "Suspicious byte value returned from 'InputStream.read()'"
+ },
+ "fullDescription": {
+ "text": "Reports expressions of 'byte' type returned from a method implementing the 'InputStream.read()' method. This is suspicious because 'InputStream.read()' should return a value in the range from '0' to '255', while an expression of byte type contains a value from '-128' to '127'. The quick-fix converts the expression into an unsigned 'byte' by applying the bitmask '0xFF'. Example: 'class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++]; // problem\n }\n}' After applying the quick-fix: 'class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++] & 0xFF;\n }\n}' New in 2023.2",
+ "markdown": "Reports expressions of `byte` type returned from a method implementing the `InputStream.read()` method.\n\n\nThis is suspicious because `InputStream.read()` should return a value in the range from `0` to `255`,\nwhile an expression of byte type contains a value from `-128` to `127`.\nThe quick-fix converts the expression into an unsigned `byte` by applying the bitmask `0xFF`.\n\n**Example:**\n\n\n class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++]; // problem\n }\n }\n\nAfter applying the quick-fix:\n\n\n class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++] & 0xFF;\n }\n }\n\nNew in 2023.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuspiciousReturnByteInputStream",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConditionalExpression",
+ "shortDescription": {
+ "text": "Conditional expression"
+ },
+ "fullDescription": {
+ "text": "Reports usages of the ternary condition operator and suggests converting them to 'if'/'else' statements. Some code standards prohibit the use of the condition operator. Example: 'Object result = (condition) ? foo() : bar();' After the quick-fix is applied: 'Object result;\n if (condition) {\n comp = foo();\n }\n else {\n comp = bar();\n }' Configure the inspection: Use the Ignore for simple assignments and returns option to ignore simple assignments and returns and allow the following constructs: 'String s = (foo == null) ? \"\" : foo.toString();' Use the Ignore places where an if statement is not possible option to ignore conditional expressions in contexts in which automatic replacement with an if statement is not possible (for example, when the conditional expression is used as an argument to a 'super()' constructor call).",
+ "markdown": "Reports usages of the ternary condition operator and suggests converting them to `if`/`else` statements.\n\nSome code standards prohibit the use of the condition operator.\n\nExample:\n\n\n Object result = (condition) ? foo() : bar();\n\nAfter the quick-fix is applied:\n\n\n Object result;\n if (condition) {\n comp = foo();\n }\n else {\n comp = bar();\n }\n\nConfigure the inspection:\n\nUse the **Ignore for simple assignments and returns** option to ignore simple assignments and returns and allow the following constructs:\n\n\n String s = (foo == null) ? \"\" : foo.toString();\n\n\nUse the **Ignore places where an if statement is not possible** option to ignore conditional expressions in contexts in which automatic\nreplacement with an if statement is not possible (for example, when the conditional expression is used as an argument to a\n`super()` constructor call)."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ConditionalExpression",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadYield",
+ "shortDescription": {
+ "text": "Call to 'Thread.yield()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Thread.yield()'. The behavior of 'yield()' is non-deterministic and platform-dependent, and it is rarely appropriate to use this method. Its use should be combined with detailed profiling and benchmarking to ensure that it actually has the desired effect. Example: 'public static void main(String[] args) {\n Runnable r = () -> {\n for (int i = 0; i < 10; i++) {\n System.out.println(i);\n Thread.yield();\n }\n };\n new Thread(r).start();\n new Thread(r).start();\n }'",
+ "markdown": "Reports calls to `Thread.yield()`.\n\n\nThe behavior of `yield()` is non-deterministic and platform-dependent, and it is rarely appropriate to use this method.\nIts use should be combined with detailed profiling and benchmarking to ensure that it actually has the desired effect.\n\n**Example:**\n\n\n public static void main(String[] args) {\n Runnable r = () -> {\n for (int i = 0; i < 10; i++) {\n System.out.println(i);\n Thread.yield();\n }\n };\n new Thread(r).start();\n new Thread(r).start();\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToThreadYield",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfClone",
+ "shortDescription": {
+ "text": "Use of 'clone()' or 'Cloneable'"
+ },
+ "fullDescription": {
+ "text": "Reports implementations of, and calls to, the 'clone()' method and uses of the 'java.lang.Cloneable' interface. Some coding standards prohibit the use of 'clone()', and recommend using a copy constructor or a 'static' factory method instead. The inspection ignores calls to 'clone()' on arrays because it's a correct and compact way to copy an array. Example: 'class Copy implements Cloneable /*warning*/ {\n\n public Copy clone() /*warning*/ {\n try {\n return (Copy) super.clone(); // warning\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }'",
+ "markdown": "Reports implementations of, and calls to, the `clone()` method and uses of the `java.lang.Cloneable` interface.\n\nSome coding standards prohibit the use of `clone()`, and recommend using a copy constructor or\na `static` factory method instead.\n\nThe inspection ignores calls to `clone()` on arrays because it's a correct and compact way to copy an array.\n\n**Example:**\n\n\n class Copy implements Cloneable /*warning*/ {\n\n public Copy clone() /*warning*/ {\n try {\n return (Copy) super.clone(); // warning\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfClone",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Cloning issues",
+ "index": 79,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingFinalNewline",
+ "shortDescription": {
+ "text": "Missing final new line"
+ },
+ "fullDescription": {
+ "text": "Reports if manifest files do not end with a final newline as required by the JAR file specification.",
+ "markdown": "Reports if manifest files do not end with a final newline as required by the JAR file specification."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "MissingFinalNewline",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Manifest",
+ "index": 90,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LambdaCanBeMethodCall",
+ "shortDescription": {
+ "text": "Lambda can be replaced with method call"
+ },
+ "fullDescription": {
+ "text": "Reports lambda expressions which can be replaced with a call to a JDK method. For example, an expression 'x -> x' of type 'Function' can be replaced with a 'Function.identity()' call. New in 2017.1",
+ "markdown": "Reports lambda expressions which can be replaced with a call to a JDK method.\n\nFor example, an expression `x -> x` of type `Function`\ncan be replaced with a `Function.identity()` call.\n\nNew in 2017.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LambdaCanBeMethodCall",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestedTryStatement",
+ "shortDescription": {
+ "text": "Nested 'try' statement"
+ },
+ "fullDescription": {
+ "text": "Reports nested 'try' statements. Nested 'try' statements may result in unclear code and should probably have their 'catch' and 'finally' sections merged.",
+ "markdown": "Reports nested `try` statements.\n\nNested `try` statements\nmay result in unclear code and should probably have their `catch` and `finally` sections\nmerged."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NestedTryStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EndlessStream",
+ "shortDescription": {
+ "text": "Non-short-circuit operation consumes infinite stream"
+ },
+ "fullDescription": {
+ "text": "Reports non-short-circuit operations consuming an infinite stream. Such operations can be completed only by throwing an exception. Example: 'Stream.iterate(0, i -> i + 1).collect(Collectors.toList())'",
+ "markdown": "Reports non-short-circuit operations consuming an infinite stream. Such operations can be completed only by throwing an exception.\n\nExample:\n\n\n Stream.iterate(0, i -> i + 1).collect(Collectors.toList())\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EndlessStream",
+ "cweIds": [
+ 835
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonFinalUtilityClass",
+ "shortDescription": {
+ "text": "Utility class is not 'final'"
+ },
+ "fullDescription": {
+ "text": "Reports utility classes that aren't 'final' or 'abstract'. Utility classes have all fields and methods declared as 'static'. Making them 'final' prevents them from being accidentally subclassed. Example: 'public class UtilityClass {\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n public static void foo() {}\n }'",
+ "markdown": "Reports utility classes that aren't `final` or `abstract`.\n\nUtility classes have all fields and methods declared as `static`.\nMaking them `final` prevents them from being accidentally subclassed.\n\n**Example:**\n\n\n public class UtilityClass {\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n public static void foo() {}\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonFinalUtilityClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonStaticFinalLogger",
+ "shortDescription": {
+ "text": "Non-constant logger"
+ },
+ "fullDescription": {
+ "text": "Reports logger fields that are not declared 'static' and/or 'final'. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application. A quick-fix is provided to change the logger modifiers to 'static final'. Example: 'public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }' After the quick-fix is applied: 'public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }' Configure the inspection: Use the Logger class name table to specify logger class names. The inspection will report the fields that are not 'static' and 'final' and are of the type equal to one of the specified class names.",
+ "markdown": "Reports logger fields that are not declared `static` and/or `final`. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application.\n\nA quick-fix is provided to change the logger modifiers to `static final`.\n\n**Example:**\n\n\n public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }\n\nAfter the quick-fix is applied:\n\n\n public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }\n\n\nConfigure the inspection:\n\n* Use the **Logger class name** table to specify logger class names. The inspection will report the fields that are not `static` and `final` and are of the type equal to one of the specified class names."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonConstantLogger",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 66,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Singleton",
+ "shortDescription": {
+ "text": "Singleton"
+ },
+ "fullDescription": {
+ "text": "Reports singleton classes. Singleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing, and their presence may indicate a lack of object-oriented design. Example: 'class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }'",
+ "markdown": "Reports singleton classes.\n\nSingleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing,\nand their presence may indicate a lack of object-oriented design.\n\n**Example:**\n\n\n class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Singleton",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FuseStreamOperations",
+ "shortDescription": {
+ "text": "Subsequent steps can be fused into Stream API chain"
+ },
+ "fullDescription": {
+ "text": "Detects transformations outside a Stream API chain that could be incorporated into it. Example: 'List list = stream.collect(Collectors.toList());\n list.sort(null);\n return list.toArray(new String[list.size()]);' After the conversion: 'return stream.sorted().toArray(String[]::new);' Note that sometimes the converted stream chain may replace explicit 'ArrayList' with 'Collectors.toList()' or explicit 'HashSet' with 'Collectors.toSet()'. The current library implementation uses these collections internally. However, this approach is not very reliable and might change in the future altering the semantics of your code. If you are concerned about it, use the Do not suggest 'toList()' or 'toSet()' collectors option to suggest 'Collectors.toCollection()' instead of 'toList' and 'toSet' collectors. This inspection only reports if the language level of the project or module is 8 or higher.",
+ "markdown": "Detects transformations outside a Stream API chain that could be incorporated into it.\n\nExample:\n\n\n List list = stream.collect(Collectors.toList());\n list.sort(null);\n return list.toArray(new String[list.size()]);\n\nAfter the conversion:\n\n\n return stream.sorted().toArray(String[]::new);\n\n\nNote that sometimes the converted stream chain may replace explicit `ArrayList` with `Collectors.toList()` or explicit\n`HashSet` with `Collectors.toSet()`. The current library implementation uses these collections internally. However,\nthis approach is not very reliable and might change in the future altering the semantics of your code.\n\nIf you are concerned about it, use the **Do not suggest 'toList()' or 'toSet()' collectors** option to suggest\n`Collectors.toCollection()` instead of `toList` and `toSet` collectors.\n\nThis inspection only reports if the language level of the project or module is 8 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FuseStreamOperations",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConditionalExpressionWithIdenticalBranches",
+ "shortDescription": {
+ "text": "Conditional expression with identical branches"
+ },
+ "fullDescription": {
+ "text": "Reports conditional expressions with identical 'then' and 'else' branches. Such expressions almost certainly indicate bugs. The inspection provides a fix that collapses conditional expressions. Example: 'int y = x == 10 ? 4 : 4;' After the quick-fix is applied: 'int y = 4;'",
+ "markdown": "Reports conditional expressions with identical `then` and `else` branches.\n\nSuch expressions almost certainly indicate bugs. The inspection provides a fix that collapses conditional expressions.\n\nExample:\n\n\n int y = x == 10 ? 4 : 4;\n\nAfter the quick-fix is applied:\n\n\n int y = 4;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConditionalExpressionWithIdenticalBranches",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DefaultNotLastCaseInSwitch",
+ "shortDescription": {
+ "text": "'default' not last case in 'switch'"
+ },
+ "fullDescription": {
+ "text": "Reports 'switch' statements or expressions in which the 'default' branch is positioned before another case. Such a construct is unnecessarily confusing. A quick-fix is provided to move the 'default' branch to the last position, if possible. Example: 'switch (n) {\n default:\n System.out.println();\n break;\n case 1:\n break;\n }' After the quick-fix is applied: 'switch (n) {\n case 1:\n break;\n default:\n System.out.println();\n break;\n }'",
+ "markdown": "Reports `switch` statements or expressions in which the `default` branch is positioned before another case. Such a construct is unnecessarily confusing. A quick-fix is provided to move the `default` branch to the last position, if possible.\n\n**Example:**\n\n\n switch (n) {\n default:\n System.out.println();\n break;\n case 1:\n break;\n }\n\nAfter the quick-fix is applied:\n\n\n switch (n) {\n case 1:\n break;\n default:\n System.out.println();\n break;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DefaultNotLastCaseInSwitch",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NullThrown",
+ "shortDescription": {
+ "text": "'null' thrown"
+ },
+ "fullDescription": {
+ "text": "Reports 'null' literals that are used as the argument of a 'throw' statement. Such constructs produce a 'java.lang.NullPointerException' that usually should not be thrown programmatically.",
+ "markdown": "Reports `null` literals that are used as the argument of a `throw` statement.\n\nSuch constructs produce a `java.lang.NullPointerException` that usually should not be thrown programmatically."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NullThrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LocalCanBeFinal",
+ "shortDescription": {
+ "text": "Local variable or parameter can be 'final'"
+ },
+ "fullDescription": {
+ "text": "Reports parameters or local variables that may have the 'final' modifier added to their declaration. Example: 'ArrayList list = new ArrayList();\n fill(list);\n return list;' After the quick-fix is applied: 'final ArrayList list = new ArrayList();\n fill(list);\n return list;' Use the inspection's options to define whether parameters or local variables should be reported.",
+ "markdown": "Reports parameters or local variables that may have the `final` modifier added to their declaration.\n\nExample:\n\n\n ArrayList list = new ArrayList();\n fill(list);\n return list;\n\nAfter the quick-fix is applied:\n\n\n final ArrayList list = new ArrayList();\n fill(list);\n return list;\n\n\nUse the inspection's options to define whether parameters or local variables should be reported."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LocalCanBeFinal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FieldMayBeStatic",
+ "shortDescription": {
+ "text": "Field can be made 'static'"
+ },
+ "fullDescription": {
+ "text": "Reports instance variables that can safely be made 'static'. A field can be static if it is declared 'final' and initialized with a constant. Example: 'public final String str = \"sample\";' The inspection does not report final fields that can be implicitly written. Use the \"Annotations\" button to modify the list of annotations that assume implicit field write.",
+ "markdown": "Reports instance variables that can safely be made `static`. A field can be static if it is declared `final` and initialized with a constant.\n\n**Example:**\n\n\n public final String str = \"sample\";\n\n\nThe inspection does not report final fields that can be implicitly written. Use the \"Annotations\" button to modify\nthe list of annotations that assume implicit field write."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FieldMayBeStatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArrayEquals",
+ "shortDescription": {
+ "text": "'equals()' called on array"
+ },
+ "fullDescription": {
+ "text": "Reports 'equals()' calls that compare two arrays. Calling 'equals()' on an array compares identity and is equivalent to using '=='. Use 'Arrays.equals()' to compare the contents of two arrays, or 'Arrays.deepEquals()' for multi-dimensional arrays. Example: 'void sample(int[] first, int[] second){\n if (first.equals(second)) return;\n }' After the quick-fix is applied: 'void sample(int[] first, int[] second){\n if (Arrays.equals(first, second)) return;\n }'",
+ "markdown": "Reports `equals()` calls that compare two arrays.\n\nCalling `equals()` on an array compares identity and is equivalent to using `==`.\nUse `Arrays.equals()` to compare the contents of two arrays, or `Arrays.deepEquals()` for\nmulti-dimensional arrays.\n\n**Example:**\n\n\n void sample(int[] first, int[] second){\n if (first.equals(second)) return;\n }\n\nAfter the quick-fix is applied:\n\n\n void sample(int[] first, int[] second){\n if (Arrays.equals(first, second)) return;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ArrayEquals",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ProblematicVarargsMethodOverride",
+ "shortDescription": {
+ "text": "Non-varargs method overrides varargs method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that override a variable arity (a.k.a. varargs) method but replace the variable arity parameter with an array parameter. Though this code is valid, it may be confusing and should be avoided.",
+ "markdown": "Reports methods that override a variable arity (a.k.a. varargs) method but replace the variable arity parameter with an array parameter. Though this code is valid, it may be confusing and should be avoided."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ProblematicVarargsMethodOverride",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MisspelledHeader",
+ "shortDescription": {
+ "text": "Unknown or misspelled header name"
+ },
+ "fullDescription": {
+ "text": "Reports any unknown and probably misspelled header names and provides possible variants.",
+ "markdown": "Reports any unknown and probably misspelled header names and provides possible variants."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MisspelledHeader",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Manifest",
+ "index": 90,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OnlyOneElementUsed",
+ "shortDescription": {
+ "text": "Only one element is used"
+ },
+ "fullDescription": {
+ "text": "Reports lists, arrays, and strings where exactly one element is queried right upon the creation. Such expressions may appear after refactoring and usually could be replaced with an accessed element. Example: 'System.out.println(new int[] {1,2,3,4,5}[2]);' After the quick-fix is applied: 'System.out.println(3);' New in 2022.3",
+ "markdown": "Reports lists, arrays, and strings where exactly one element is queried right upon the creation. Such expressions may appear after refactoring and usually could be replaced with an accessed element.\n\nExample:\n\n\n System.out.println(new int[] {1,2,3,4,5}[2]);\n\nAfter the quick-fix is applied:\n\n\n System.out.println(3);\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OnlyOneElementUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AtomicFieldUpdaterIssues",
+ "shortDescription": {
+ "text": "Inconsistent 'AtomicFieldUpdater' declaration"
+ },
+ "fullDescription": {
+ "text": "Reports issues with 'AtomicLongFieldUpdater', 'AtomicIntegerFieldUpdater', or 'AtomicReferenceFieldUpdater' fields (the 'java.util.concurrent.atomic' package). The reported issues are identical to the runtime problems that can happen with atomic field updaters: specified field not found, specified field not accessible, specified field has a wrong type, and so on. Examples: 'class A {\n private static volatile int value = 0;\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater((A.class), \"value\"); // warning: Field 'value' has 'static' modifier\n }' 'class B {\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater(B.class, \"value\"); // warning: No field named 'value' found in class 'B'\n }'",
+ "markdown": "Reports issues with `AtomicLongFieldUpdater`, `AtomicIntegerFieldUpdater`, or `AtomicReferenceFieldUpdater` fields (the `java.util.concurrent.atomic` package).\n\nThe reported issues are identical to the runtime problems that can happen with atomic field updaters:\nspecified field not found, specified field not accessible, specified field has a wrong type, and so on.\n\n**Examples:**\n\n*\n\n\n class A {\n private static volatile int value = 0;\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater((A.class), \"value\"); // warning: Field 'value' has 'static' modifier\n }\n \n*\n\n\n class B {\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater(B.class, \"value\"); // warning: No field named 'value' found in class 'B'\n }\n \n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AtomicFieldUpdaterIssues",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BadExceptionThrown",
+ "shortDescription": {
+ "text": "Prohibited exception thrown"
+ },
+ "fullDescription": {
+ "text": "Reports 'throw' statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as 'java.lang.Exception' or 'java.io.IOException'. Example: 'void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }' Use the Prohibited exceptions list to specify which exceptions should be reported.",
+ "markdown": "Reports `throw` statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as `java.lang.Exception` or `java.io.IOException`.\n\n**Example:**\n\n\n void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ProhibitedExceptionThrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryBoxing",
+ "shortDescription": {
+ "text": "Unnecessary boxing"
+ },
+ "fullDescription": {
+ "text": "Reports explicit boxing, that is wrapping of primitive values in objects. Explicit manual boxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = new Integer(1);' → 'Integer i = Integer.valueOf(1);' 'int i = Integer.valueOf(1);' → 'int i = 1;' Use the Only report truly superfluously boxed expressions option to report only truly superfluous boxing, where a boxed value is immediately unboxed either implicitly or explicitly. In this case, the entire boxing-unboxing step can be removed. The inspection doesn't report simple explicit boxing. This inspection only reports if the language level of the project or module is 5 or higher.",
+ "markdown": "Reports explicit boxing, that is wrapping of primitive values in objects.\n\nExplicit manual boxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = new Integer(1);` → `Integer i = Integer.valueOf(1);`\n* `int i = Integer.valueOf(1);` → `int i = 1;`\n\n\nUse the **Only report truly superfluously boxed expressions** option to report only truly superfluous boxing,\nwhere a boxed value is immediately unboxed either implicitly or explicitly.\nIn this case, the entire boxing-unboxing step can be removed. The inspection doesn't report simple explicit boxing.\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": "UnnecessaryBoxing",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 53,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PackageNamingConvention",
+ "shortDescription": {
+ "text": "Package naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports packages whose names are either too short, too long, or do not follow the specified regular expression pattern. Example: 'package io;' Use the options to specify the minimum and maximum length of the package name as well as a regular expression that matches valid package names (regular expressions are in standard 'java.util.regex' format).",
+ "markdown": "Reports packages whose names are either too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:**\n\n\n package io;\n\n\nUse the options to specify the minimum and maximum length of the package name\nas well as a regular expression that matches valid package names\n(regular expressions are in standard `java.util.regex` format)."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PackageNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 51,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Anonymous2MethodRef",
+ "shortDescription": {
+ "text": "Anonymous type can be replaced with method reference"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous classes which can be replaced with method references. Note that if an anonymous class is converted into an unbound method reference, the same method reference object can be reused by the Java runtime during subsequent invocations. On the other hand, when an anonymous class is used, separate objects are created every time. Thus, applying the quick-fix can cause the semantics change in rare cases, e.g. when anonymous class instances are used as 'HashMap' keys. Example: 'Runnable r = new Runnable() {\n @Override\n public void run() {\n System.out.println();\n }\n };' The quick-fix changes this code to the compact form: 'Runnable r = System.out::println;'. Use the Report when interface is not annotated with @FunctionalInterface option to enable this inspection for interfaces which are not annotated with @FunctionalInterface. This inspection only reports if the language level of the project or module is 8 or higher.",
+ "markdown": "Reports anonymous classes which can be replaced with method references.\n\n\nNote that if an anonymous class is converted into an unbound method reference, the same method reference object\ncan be reused by the Java runtime during subsequent invocations. On the other hand, when an anonymous class is used,\nseparate objects are created every time. Thus, applying the quick-fix can cause the semantics change in rare cases,\ne.g. when anonymous class instances are used as `HashMap` keys.\n\n**Example:**\n\n\n Runnable r = new Runnable() {\n @Override\n public void run() {\n System.out.println();\n }\n };\n\nThe quick-fix changes this code to the compact form: `Runnable r = System.out::println;`.\n\nUse the **Report when interface is not annotated with @FunctionalInterface** option to enable this inspection for\ninterfaces which are not annotated with @FunctionalInterface.\n\nThis inspection only reports if the language level of the project or module is 8 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Anonymous2MethodRef",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PublicMethodNotExposedInInterface",
+ "shortDescription": {
+ "text": "'public' method not exposed in interface"
+ },
+ "fullDescription": {
+ "text": "Reports 'public' methods in classes which are not exposed in an interface. Exposing all 'public' methods via an interface is important for maintaining loose coupling, and may be necessary for certain component-based programming styles. Example: 'interface Person {\n String getName();\n}\n\nclass PersonImpl implements Person {\n private String name;\n\n // ok: method is exposed in interface\n @Override\n public String getName() {\n return name;\n }\n\n // warning: method is public\n // but not exposed in interface\n public void setName() {\n this.name = name;\n }\n}' Use the Ignore if annotated by list to specify special annotations. Methods annotated with one of these annotations will be ignored by this inspection. Use the Ignore if the containing class does not implement a non-library interface option to ignore methods from classes which do not implement any interface from the project.",
+ "markdown": "Reports `public` methods in classes which are not exposed in an interface.\n\nExposing all `public` methods via an interface is important for\nmaintaining loose coupling, and may be necessary for certain component-based programming styles.\n\nExample:\n\n\n interface Person {\n String getName();\n }\n\n class PersonImpl implements Person {\n private String name;\n\n // ok: method is exposed in interface\n @Override\n public String getName() {\n return name;\n }\n\n // warning: method is public\n // but not exposed in interface\n public void setName() {\n this.name = name;\n }\n }\n\n\nUse the **Ignore if annotated by** list to specify special annotations. Methods annotated with one of\nthese annotations will be ignored by this inspection.\n\n\nUse the **Ignore if the containing class does not implement a non-library interface** option to ignore methods from classes which do not\nimplement any interface from the project."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PublicMethodNotExposedInInterface",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 75,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableHasSerialVersionUIDField",
+ "shortDescription": {
+ "text": "Serializable class without 'serialVersionUID'"
+ },
+ "fullDescription": {
+ "text": "Reports classes that implement 'Serializable' and do not declare a 'serialVersionUID' field. Without a 'serialVersionUID' field, any change to the class will make previously serialized versions unreadable. Example: 'class Main implements Serializable {\n }' After the quick-fix is applied: 'class Main implements Serializable {\n private static final long serialVersionUID = -1446398935944895849L;\n }' When using a language level of JDK 14 or higher, the quickfix will also add the 'java.io.Serial' annotation. 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 classes that implement `Serializable` and do not declare a `serialVersionUID` field.\n\n\nWithout a `serialVersionUID` field, any change to the class will make previously serialized versions unreadable.\n\n**Example:**\n\n\n class Main implements Serializable {\n }\n\nAfter the quick-fix is applied:\n\n\n class Main implements Serializable {\n private static final long serialVersionUID = -1446398935944895849L;\n }\n\nWhen using a language level of JDK 14 or higher, the quickfix will also add the `java.io.Serial` annotation.\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": "serial",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThrowableNotThrown",
+ "shortDescription": {
+ "text": "'Throwable' not thrown"
+ },
+ "fullDescription": {
+ "text": "Reports instantiations of 'Throwable' or its subclasses, where the created 'Throwable' is never actually thrown. Additionally, this inspection reports method calls that return instances of 'Throwable' or its subclasses, when the result of the method call is not thrown. Calls to methods annotated with the Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation will not be reported. Example: 'void check(String s) {\n if (s == null) {\n new NullPointerException(\"s\");\n }\n // ...\n }'",
+ "markdown": "Reports instantiations of `Throwable` or its subclasses, where the created `Throwable` is never actually thrown. Additionally, this inspection reports method calls that return instances of `Throwable` or its subclasses, when the result of the method call is not thrown.\n\nCalls to methods annotated with the Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\n\n**Example:**\n\n\n void check(String s) {\n if (s == null) {\n new NullPointerException(\"s\");\n }\n // ...\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThrowableNotThrown",
+ "cweIds": [
+ 390,
+ 703
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CapturingCleaner",
+ "shortDescription": {
+ "text": "Cleaner captures object reference"
+ },
+ "fullDescription": {
+ "text": "Reports 'Runnable' passed to a 'Cleaner.register()' capturing reference being registered. If the reference is captured, it will never be phantom reachable and the cleaning action will never be invoked. Possible sources of this problem: Lambda using non-static methods, fields, or 'this' itself Non-static inner class (anonymous or not) always captures this reference in java up to 18 version Instance method reference Access to outer class non-static members from non-static inner class Sample of code that will be reported: 'int fileDescriptor;\n Cleaner.Cleanable cleanable = Cleaner.create().register(this, () -> {\n System.out.println(\"adsad\");\n //this is captured via fileDescriptor\n fileDescriptor = 0;\n });' This inspection only reports if the language level of the project or module is 9 or higher. New in 2018.1",
+ "markdown": "Reports `Runnable` passed to a `Cleaner.register()` capturing reference being registered. If the reference is captured, it will never be phantom reachable and the cleaning action will never be invoked.\n\nPossible sources of this problem:\n\n* Lambda using non-static methods, fields, or `this` itself\n* Non-static inner class (anonymous or not) always captures this reference in java up to 18 version\n* Instance method reference\n* Access to outer class non-static members from non-static inner class\n\nSample of code that will be reported:\n\n\n int fileDescriptor;\n Cleaner.Cleanable cleanable = Cleaner.create().register(this, () -> {\n System.out.println(\"adsad\");\n //this is captured via fileDescriptor\n fileDescriptor = 0;\n });\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CapturingCleaner",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadStartInConstruction",
+ "shortDescription": {
+ "text": "Call to 'Thread.start()' during object construction"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'start()' on 'java.lang.Thread' or any of its subclasses during object construction. While occasionally useful, such constructs should be avoided due to inheritance issues. Subclasses of a class that launches a thread during the object construction will not have finished any initialization logic of their own before the thread has launched. This inspection does not report if the class that starts a thread is declared 'final'. Example: 'class MyThread extends Thread {\n MyThread() {\n start();\n }\n }'",
+ "markdown": "Reports calls to `start()` on `java.lang.Thread` or any of its subclasses during object construction.\n\n\nWhile occasionally useful, such constructs should be avoided due to inheritance issues.\nSubclasses of a class that launches a thread during the object construction will not have finished\nany initialization logic of their own before the thread has launched.\n\nThis inspection does not report if the class that starts a thread is declared `final`.\n\n**Example:**\n\n\n class MyThread extends Thread {\n MyThread() {\n start();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToThreadStartDuringObjectConstruction",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TestCaseWithNoTestMethods",
+ "shortDescription": {
+ "text": "Test class without tests"
+ },
+ "fullDescription": {
+ "text": "Reports non-'abstract' test cases without any test methods. Such test cases usually indicate unfinished code or could be a refactoring leftover that should be removed. Example: 'public class CrucialTest {\n @Before\n public void setUp() {\n System.out.println(\"setting up\");\n }\n }' Use the Ignore test cases which have superclasses with test methods option to ignore test cases which have super classes with test methods.",
+ "markdown": "Reports non-`abstract` test cases without any test methods. Such test cases usually indicate unfinished code or could be a refactoring leftover that should be removed.\n\nExample:\n\n\n public class CrucialTest {\n @Before\n public void setUp() {\n System.out.println(\"setting up\");\n }\n }\n\n\nUse the **Ignore test cases which have superclasses with test methods** option to ignore test cases which have super classes\nwith test methods."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JUnitTestCaseWithNoTests",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchStatementWithTooManyBranches",
+ "shortDescription": {
+ "text": "Maximum 'switch' branches"
+ },
+ "fullDescription": {
+ "text": "Reports 'switch' statements or expressions with too many 'case' labels. Such a long switch statement may be confusing and should probably be refactored. Sometimes, it is not a problem (for example, a domain is very complicated and has enums with a lot of constants). Example: 'switch (x) {\n case 1 -> {}\n case 2 -> {}\n case 3 -> {}\n case 4 -> {}\n case 5 -> {}\n case 6 -> {}\n case 7 -> {}\n case 8 -> {}\n case 9 -> {}\n case 10 -> {}\n case 11,12,13 -> {}\n default -> {}\n }' Use the Maximum number of branches field to specify the maximum number of 'case' labels expected.",
+ "markdown": "Reports `switch` statements or expressions with too many `case` labels.\n\nSuch a long switch statement may be confusing and should probably be refactored.\nSometimes, it is not a problem (for example, a domain is very complicated and has enums with a lot of constants).\n\nExample:\n\n\n switch (x) {\n case 1 -> {}\n case 2 -> {}\n case 3 -> {}\n case 4 -> {}\n case 5 -> {}\n case 6 -> {}\n case 7 -> {}\n case 8 -> {}\n case 9 -> {}\n case 10 -> {}\n case 11,12,13 -> {}\n default -> {}\n }\n\nUse the **Maximum number of branches** field to specify the maximum number of `case` labels expected."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SwitchStatementWithTooManyBranches",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MismatchedArrayReadWrite",
+ "shortDescription": {
+ "text": "Mismatched read and write of array"
+ },
+ "fullDescription": {
+ "text": "Reports arrays whose contents are read but not updated, or updated but not read. Such inconsistent reads and writes are pointless and probably indicate dead, incomplete or erroneous code. Example: 'final int[] bar = new int[3];\n bar[2] = 3;'",
+ "markdown": "Reports arrays whose contents are read but not updated, or updated but not read. Such inconsistent reads and writes are pointless and probably indicate dead, incomplete or erroneous code.\n\n**Example:**\n\n\n final int[] bar = new int[3];\n bar[2] = 3;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MismatchedReadAndWriteOfArray",
+ "cweIds": [
+ 561,
+ 563
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarilyQualifiedStaticUsage",
+ "shortDescription": {
+ "text": "Unnecessarily qualified static access"
+ },
+ "fullDescription": {
+ "text": "Reports usages of static members qualified with the class name. Such qualification is unnecessary and may be safely removed. Example: '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 }' After the quick-fix is applied: '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 }' Use the inspection options to toggle the reporting for: Static fields access: 'void bar() { System.out.println(Foo.x); }' Calls to static methods: 'void bar() { Foo.foo(); }' Also, you can configure the inspection to only report static member usage in a static context. In this case, only 'static void baz() { Foo.foo(); }' will be reported.",
+ "markdown": "Reports usages of static members qualified with the class name.\n\n\nSuch qualification is unnecessary and may be safely removed.\n\n**Example:**\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\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();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }\n\n\nUse the inspection options to toggle the reporting for:\n\n* Static fields access: \n `void bar() { System.out.println(Foo.x); }`\n\n* Calls to static methods: \n `void bar() { Foo.foo(); }`\n\n\nAlso, you can configure the inspection to only report static member usage\nin a static context. In this case, only `static void baz() { Foo.foo(); }` will be reported."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessarilyQualifiedStaticUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoopConditionNotUpdatedInsideLoop",
+ "shortDescription": {
+ "text": "Loop variable not updated inside loop"
+ },
+ "fullDescription": {
+ "text": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop. Such variables and parameters are usually used by mistake as they may cause an infinite loop if they are executed. Example: 'void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }' Configure the inspection: Use the Ignore possible non-local changes option to disable this inspection if the condition can be updated indirectly (e.g. via the called method or concurrently from another thread).",
+ "markdown": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop.\n\nSuch variables and parameters are usually used by mistake as they\nmay cause an infinite loop if they are executed.\n\nExample:\n\n\n void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore possible non-local changes** option to disable this inspection\nif the condition can be updated indirectly (e.g. via the called method or concurrently from another thread)."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LoopConditionNotUpdatedInsideLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CollectionsMustHaveInitialCapacity",
+ "shortDescription": {
+ "text": "Collection without initial capacity"
+ },
+ "fullDescription": {
+ "text": "Reports attempts to instantiate a new 'Collection' object without specifying an initial capacity. If no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing to specify initial capacities for collections may result in performance issues if space needs to be reallocated and memory copied when the initial capacity is exceeded. This inspection checks allocations of classes listed in the inspection's settings. Example: 'new HashMap();' Use the following options to configure the inspection: List collection classes that should be checked. Whether to ignore field initializers.",
+ "markdown": "Reports attempts to instantiate a new `Collection` object without specifying an initial capacity.\n\n\nIf no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing\nto specify initial capacities for collections may result in performance issues if space needs to be reallocated and\nmemory copied when the initial capacity is exceeded.\nThis inspection checks allocations of classes listed in the inspection's settings.\n\n**Example:**\n\n\n new HashMap();\n\nUse the following options to configure the inspection:\n\n* List collection classes that should be checked.\n* Whether to ignore field initializers."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CollectionWithoutInitialCapacity",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SystemGetProperty",
+ "shortDescription": {
+ "text": "Call to 'System.getProperty(str)' could be simplified"
+ },
+ "fullDescription": {
+ "text": "Reports the usage of method 'System.getProperty(str)' and suggests a fix in 2 cases: 'System.getProperty(\"path.separator\")' -> 'File.pathSeparator' 'System.getProperty(\"line.separator\")' -> 'System.lineSeparator()' The second one is not only less error-prone but is likely to be faster, as 'System.lineSeparator()' returns cached value, while 'System.getProperty(\"line.separator\")' each time calls to Properties (Hashtable or CHM depending on implementation).",
+ "markdown": "Reports the usage of method `System.getProperty(str)` and suggests a fix in 2 cases:\n\n* `System.getProperty(\"path.separator\")` -\\> `File.pathSeparator`\n* `System.getProperty(\"line.separator\")` -\\> `System.lineSeparator()`\n\nThe second one is not only less error-prone but is likely to be faster, as `System.lineSeparator()` returns cached value, while `System.getProperty(\"line.separator\")` each time calls to Properties (Hashtable or CHM depending on implementation)."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SystemGetProperty",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DoubleCheckedLocking",
+ "shortDescription": {
+ "text": "Double-checked locking"
+ },
+ "fullDescription": {
+ "text": "Reports double-checked locking. Double-checked locking tries to initialize a field on demand and in a thread-safe manner, while avoiding the cost of synchronization. Unfortunately it is not thread-safe when used on a field that is not declared 'volatile'. When using Java 1.4 or earlier, double-checked locking doesn't work even with a 'volatile' field. Read the article linked above for a detailed explanation of the problem. Example of incorrect double-checked locking: 'class Foo {\n private Helper helper = null;\n public Helper getHelper() {\n if (helper == null)\n synchronized(this) {\n if (helper == null) helper = new Helper();\n }\n return helper;\n }\n }\n // other functions and members...\n }'",
+ "markdown": "Reports [double-checked locking](https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html).\n\n\nDouble-checked locking tries to initialize a field on demand and in a thread-safe manner, while avoiding the cost of synchronization.\nUnfortunately it is not thread-safe when used on a field that is not declared `volatile`.\nWhen using Java 1.4 or earlier, double-checked locking doesn't work even with a `volatile` field.\nRead the article linked above for a detailed explanation of the problem.\n\nExample of incorrect double-checked locking:\n\n\n class Foo {\n private Helper helper = null;\n public Helper getHelper() {\n if (helper == null)\n synchronized(this) {\n if (helper == null) helper = new Helper();\n }\n return helper;\n }\n }\n // other functions and members...\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DoubleCheckedLocking",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassOnlyUsedInOneModule",
+ "shortDescription": {
+ "text": "Class only used from one other module"
+ },
+ "fullDescription": {
+ "text": "Reports classes that: do not depend on any other class in their module depend on classes from a different module are a dependency only for classes from this other module Such classes could be moved into the module 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:\n\n* do not depend on any other class in their module\n* depend on classes from a different module\n* are a dependency only for classes from this other module\n\nSuch classes could be moved into the module 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": "ClassOnlyUsedInOneModule",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Modularization issues",
+ "index": 67,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TryStatementWithMultipleResources",
+ "shortDescription": {
+ "text": "'try' statement with multiple resources can be split"
+ },
+ "fullDescription": {
+ "text": "Reports 'try' statements with multiple resources that can be automatically split into multiple try-with-resources statements. This conversion can be useful for further refactoring (for example, for extracting the nested 'try' statement into a separate method). Example: 'try (FileInputStream in = new FileInputStream(\"in.txt\");\n FileOutputStream out = new FileOutputStream(\"out.txt\")) {\n /*read and write*/\n }' After the quick-fix is applied: 'try (FileInputStream in = new FileInputStream(\"in.txt\")) {\n try (FileOutputStream out = new FileOutputStream(\"out.txt\")) {\n /*read and write*/\n }\n }'",
+ "markdown": "Reports `try` statements with multiple resources that can be automatically split into multiple try-with-resources statements.\n\nThis conversion can be useful for further refactoring\n(for example, for extracting the nested `try` statement into a separate method).\n\nExample:\n\n\n try (FileInputStream in = new FileInputStream(\"in.txt\");\n FileOutputStream out = new FileOutputStream(\"out.txt\")) {\n /*read and write*/\n }\n\nAfter the quick-fix is applied:\n\n\n try (FileInputStream in = new FileInputStream(\"in.txt\")) {\n try (FileOutputStream out = new FileOutputStream(\"out.txt\")) {\n /*read and write*/\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "TryStatementWithMultipleResources",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CloneableImplementsClone",
+ "shortDescription": {
+ "text": "Cloneable class without 'clone()' method"
+ },
+ "fullDescription": {
+ "text": "Reports classes implementing the 'Cloneable' interface that don't override the 'clone()' method. Such classes use the default implementation of 'clone()', which isn't 'public' but 'protected', and which does not copy the mutable state of the class. A quick-fix is available to generate a basic 'clone()' method, which can be used as a basis for a properly functioning 'clone()' method expected from a 'Cloneable' class. Example: 'public class Data implements Cloneable {\n private String[] names;\n }' After the quick-fix is applied: 'public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' Use the Ignore classes cloneable due to inheritance option to ignore classes that are 'Cloneable' because they inherit from the 'Cloneable' class. Use the Ignore when Cloneable is necessary to call clone() method of super class option to ignore classes that require implementing 'Cloneable' because they call the 'clone()' method from a superclass.",
+ "markdown": "Reports classes implementing the `Cloneable` interface that don't override the `clone()` method.\n\nSuch classes use the default implementation of `clone()`,\nwhich isn't `public` but `protected`, and which does not copy the mutable state of the class.\n\nA quick-fix is available to generate a basic `clone()` method,\nwhich can be used as a basis for a properly functioning `clone()` method\nexpected from a `Cloneable` class.\n\n**Example:**\n\n\n public class Data implements Cloneable {\n private String[] names;\n }\n\nAfter the quick-fix is applied:\n\n\n public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nUse the **Ignore classes cloneable due to inheritance** option to ignore classes that are\n`Cloneable` because they inherit from the `Cloneable` class.\n\nUse the **Ignore when Cloneable is necessary to call clone() method of super class**\noption to ignore classes that require implementing `Cloneable` because they call the `clone()` method from a superclass."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CloneableClassWithoutClone",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Cloning issues",
+ "index": 79,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TypeMayBeWeakened",
+ "shortDescription": {
+ "text": "Type may be weakened"
+ },
+ "fullDescription": {
+ "text": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable. Example: '// Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }' Enable the Only weaken to an interface checkbox below to only report a problem when the type can be weakened to an interface type. Enable the Do not suggest weakening variable declared as 'var' checkbox below to prevent reporting on local variables declared using the 'var' keyword (Java 10+) Stop classes are intended to prevent weakening to classes lower than stop classes, even if it is possible. In some cases, this may improve readability.",
+ "markdown": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable.\n\nExample:\n\n\n // Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }\n\n\nEnable the **Only weaken to an interface** checkbox below\nto only report a problem when the type can be weakened to an interface type.\n\n\nEnable the **Do not suggest weakening variable declared as 'var'** checkbox below\nto prevent reporting on local variables declared using the 'var' keyword (Java 10+)\n\n\n**Stop classes** are intended to prevent weakening to classes\nlower than stop classes, even if it is possible.\nIn some cases, this may improve readability."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TypeMayBeWeakened",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 75,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OctalAndDecimalIntegersMixed",
+ "shortDescription": {
+ "text": "Octal and decimal integers in same array"
+ },
+ "fullDescription": {
+ "text": "Reports mixed octal and decimal integer literals in a single array initializer. This situation might happen when you copy a list of numbers into an array initializer. Some numbers in the array might be zero-padded and the compiler will interpret them as octal. Example: 'int[] elapsed = {1, 13, 052};' After the quick-fix that removes a leading zero is applied: 'int[] elapsed = {1, 13, 52};' If it is an octal number (for example, after a variable inline), then you can use another quick-fix that converts octal to decimal: 'int[] elapsed = {1, 13, 42};'",
+ "markdown": "Reports mixed octal and decimal integer literals in a single array initializer. This situation might happen when you copy a list of numbers into an array initializer. Some numbers in the array might be zero-padded and the compiler will interpret them as octal.\n\n**Example:**\n\n int[] elapsed = {1, 13, 052};\n\nAfter the quick-fix that removes a leading zero is applied:\n\n int[] elapsed = {1, 13, 52};\n\nIf it is an octal number (for example, after a variable inline), then you can use another quick-fix that converts octal to decimal:\n`int[] elapsed = {1, 13, 42};`"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OctalAndDecimalIntegersInSameArray",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfObsoleteAssert",
+ "shortDescription": {
+ "text": "Usage of obsolete 'junit.framework.Assert' method"
+ },
+ "fullDescription": {
+ "text": "Reports any calls to methods from the 'junit.framework.Assert' class. This class is obsolete and the calls can be replaced by calls to methods from the 'org.junit.Assert' class. For example: 'import org.junit.*;\n public class NecessaryTest {\n @Test\n public void testIt() {\n junit.framework.Assert.assertEquals(\"expected\", \"actual\");\n }\n }' After the quick fix is applied, the result looks like the following: 'import org.junit;\n public class NecessaryTest {\n\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }'",
+ "markdown": "Reports any calls to methods from the `junit.framework.Assert` class. This class is obsolete and the calls can be replaced by calls to methods from the `org.junit.Assert` class.\n\nFor example:\n\n\n import org.junit.*;\n public class NecessaryTest {\n @Test\n public void testIt() {\n junit.framework.Assert.assertEquals(\"expected\", \"actual\");\n }\n }\n\nAfter the quick fix is applied, the result looks like the following:\n\n\n import org.junit;\n public class NecessaryTest {\n\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UseOfObsoleteAssert",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JUnit",
+ "index": 74,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Deprecation",
+ "shortDescription": {
+ "text": "Deprecated API usage"
+ },
+ "fullDescription": {
+ "text": "Reports usages of deprecated classes, fields, and methods. A quick-fix is available to automatically convert the deprecated usage, when the necessary information can be extracted from the Javadoc of the deprecated member. Example: 'class Interesting {\n\n /**\n * @deprecated Use {@link #newHotness()} instead\n */\n @Deprecated\n public void oldAndBusted() {}\n\n public void newHotness() {}\n }\n class ElseWhere {\n void x(Interesting i) {\n i.oldAndBusted(); // deprecated warning here\n }\n }' After the quick-fix is applied: 'class Interesting {\n\n /**\n * @deprecated Use {@link #newHotness()} instead\n */\n @Deprecated\n public void oldAndBusted() {}\n\n public void newHotness() {}\n }\n class ElseWhere {\n void x(Interesting i) {\n i.newHotness();\n }\n }' By default, the inspection doesn't produce a warning if it's impossible or hard to avoid it. For example, the following code won't be reported: 'abstract class A { //library code\n @Deprecated\n abstract void m();\n }\n class B extends A { //project code\n @Override\n void m() {\n //doSmth;\n }\n }' Configure the inspection: Use the options to disable this inspection inside deprecated members, overrides of abstract deprecated methods, non-static import statements, methods of deprecated classes, or same top-level classes.",
+ "markdown": "Reports usages of deprecated classes, fields, and methods. A quick-fix is available to automatically convert the deprecated usage, when the necessary information can be extracted from the Javadoc of the deprecated member.\n\n**Example:**\n\n\n class Interesting {\n\n /**\n * @deprecated Use {@link #newHotness()} instead\n */\n @Deprecated\n public void oldAndBusted() {}\n\n public void newHotness() {}\n }\n class ElseWhere {\n void x(Interesting i) {\n i.oldAndBusted(); // deprecated warning here\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Interesting {\n\n /**\n * @deprecated Use {@link #newHotness()} instead\n */\n @Deprecated\n public void oldAndBusted() {}\n\n public void newHotness() {}\n }\n class ElseWhere {\n void x(Interesting i) {\n i.newHotness();\n }\n }\n\nBy default, the inspection doesn't produce a warning if it's impossible or hard to avoid it. For example,\nthe following code won't be reported:\n\n\n abstract class A { //library code\n @Deprecated\n abstract void m();\n }\n class B extends A { //project code\n @Override\n void m() {\n //doSmth;\n }\n }\n\nConfigure the inspection:\n\n\nUse the options to disable this inspection inside deprecated members,\noverrides of abstract deprecated methods, non-static import statements, methods of deprecated classes, or same top-level classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "deprecation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 50,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MisspelledMethodName",
+ "shortDescription": {
+ "text": "Method names differing only by case"
+ },
+ "fullDescription": {
+ "text": "Reports cases in which multiple methods of a class have the names that differ only by case. Such names may be very confusing. Example: 'public int hashcode() { // reported, should be hashCode probably?\n return 0;\n }' A quick-fix that renames such methods is available only in the editor. Use the Ignore methods overriding/implementing a super method option to ignore methods overriding or implementing a method from the superclass.",
+ "markdown": "Reports cases in which multiple methods of a class have the names that differ only by case. Such names may be very confusing.\n\n**Example:**\n\n\n public int hashcode() { // reported, should be hashCode probably?\n return 0;\n }\n\nA quick-fix that renames such methods is available only in the editor.\n\nUse the **Ignore methods overriding/implementing a super method** option to ignore methods overriding or implementing a method from\nthe superclass."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodNamesDifferingOnlyByCase",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 85,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonSerializableObjectBoundToHttpSession",
+ "shortDescription": {
+ "text": "Non-serializable object bound to 'HttpSession'"
+ },
+ "fullDescription": {
+ "text": "Reports objects of classes not implementing 'java.io.Serializable' used as arguments to 'javax.servlet.http.HttpSession.setAttribute()' or 'javax.servlet.http.HttpSession.putValue()'. Such objects will not be serialized if the 'HttpSession' is passivated or migrated, and may result in difficult-to-diagnose bugs. This inspection assumes objects of the types 'java.util.Collection' and 'java.util.Map' to be 'Serializable', unless type parameters are non-'Serializable'. Example: 'void foo(HttpSession session) {\n session.setAttribute(\"foo\", new NonSerializable());\n }\n static class NonSerializable {}'",
+ "markdown": "Reports objects of classes not implementing `java.io.Serializable` used as arguments to `javax.servlet.http.HttpSession.setAttribute()` or `javax.servlet.http.HttpSession.putValue()`.\n\n\nSuch objects will not be serialized if the `HttpSession` is passivated or migrated,\nand may result in difficult-to-diagnose bugs.\n\n\nThis inspection assumes objects of the types `java.util.Collection` and\n`java.util.Map` to be `Serializable`,\nunless type parameters are non-`Serializable`.\n\n**Example:**\n\n\n void foo(HttpSession session) {\n session.setAttribute(\"foo\", new NonSerializable());\n }\n static class NonSerializable {}\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonSerializableObjectBoundToHttpSession",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConditionSignal",
+ "shortDescription": {
+ "text": "Call to 'signal()' instead of 'signalAll()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'java.util.concurrent.locks.Condition.signal()'. While occasionally useful, in almost all cases 'signalAll()' is a better and safer choice.",
+ "markdown": "Reports calls to `java.util.concurrent.locks.Condition.signal()`. While occasionally useful, in almost all cases `signalAll()` is a better and safer choice."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToSignalInsteadOfSignalAll",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadLocalNotStaticFinal",
+ "shortDescription": {
+ "text": "'ThreadLocal' field not declared 'static final'"
+ },
+ "fullDescription": {
+ "text": "Reports fields of type 'java.lang.ThreadLocal' that are not declared 'static final'. In the most common case, a 'java.lang.ThreadLocal' instance associates state with a thread. A non-static non-final 'java.lang.ThreadLocal' field associates state with an instance-thread combination. This is usually unnecessary and quite often is a bug that can cause memory leaks and incorrect behavior. A quick-fix is suggested to make the field 'static final'. Example: 'private ThreadLocal tl = ThreadLocal.withInitial(() -> Boolean.TRUE);'",
+ "markdown": "Reports fields of type `java.lang.ThreadLocal` that are not declared `static final`.\n\n\nIn the most common case, a `java.lang.ThreadLocal` instance associates state with a thread.\nA non-static non-final `java.lang.ThreadLocal` field associates state with an instance-thread combination.\nThis is usually unnecessary and quite often is a bug that can cause memory leaks and incorrect behavior.\n\n\nA quick-fix is suggested to make the field `static final`.\n\n\n**Example:**\n\n\n private ThreadLocal tl = ThreadLocal.withInitial(() -> Boolean.TRUE);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThreadLocalNotStaticFinal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AccessStaticViaInstance",
+ "shortDescription": {
+ "text": "Access static member via instance reference"
+ },
+ "fullDescription": {
+ "text": "Reports references to 'static' methods and fields via a class instance rather than the class itself. Even though referring to static members via instance variables is allowed by The Java Language Specification, this makes the code confusing as the reader may think that the result of the method depends on the instance. The quick-fix replaces the instance variable with the class name. Example: 'String s1 = s.valueOf(0);' After the quick-fix is applied: 'String s = String.valueOf(0);'",
+ "markdown": "Reports references to `static` methods and fields via a class instance rather than the class itself.\n\nEven though referring to static members via instance variables is allowed by The Java Language Specification,\nthis makes the code confusing as the reader may think that the result of the method depends on the instance.\n\nThe quick-fix replaces the instance variable with the class name.\n\nExample:\n\n\n String s1 = s.valueOf(0);\n\nAfter the quick-fix is applied:\n\n\n String s = String.valueOf(0);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AccessStaticViaInstance",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PublicMethodWithoutLogging",
+ "shortDescription": {
+ "text": "'public' method without logging"
+ },
+ "fullDescription": {
+ "text": "Reports any public methods that do not contain a logging statement. This inspection does not report simple getters and setters. For example: 'public class Crucial {\n private static final Logger LOG = LoggerFactory.getLogger(Crucial.class);\n public void doImportantStuff() {\n // warning on this method\n }\n\n public void doOtherStuff() {\n LOG.info(\"do other stuff\");\n }\n }' Use the table below to specify Logger class names. Public methods that do not use instance methods of the specified classes will be reported by this inspection.",
+ "markdown": "Reports any public methods that do not contain a logging statement. This inspection does not report simple getters and setters.\n\nFor example:\n\n\n public class Crucial {\n private static finalLogger LOG = LoggerFactory.getLogger(Crucial.class);\n public void doImportantStuff() {\n // warning on this method\n }\n\n public void doOtherStuff() {\n LOG.info(\"do other stuff\");\n }\n }\n\n\nUse the table below to specify Logger class names.\nPublic methods that do not use instance methods of the specified classes will be reported by this inspection."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PublicMethodWithoutLogging",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 66,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassNestingDepth",
+ "shortDescription": {
+ "text": "Inner class too deeply nested"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose number of nested inner classes exceeds the specified maximum. Nesting inner classes inside other inner classes is confusing and indicates that a refactoring may be necessary. Use the Nesting limit field to specify the maximum allowed nesting depth for a class.",
+ "markdown": "Reports classes whose number of nested inner classes exceeds the specified maximum.\n\nNesting inner classes inside other inner classes is confusing and indicates that a refactoring may be necessary.\n\nUse the **Nesting limit** field to specify the maximum allowed nesting depth for a class."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InnerClassTooDeeplyNested",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 84,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CallToNativeMethodWhileLocked",
+ "shortDescription": {
+ "text": "Call to a 'native' method while locked"
+ },
+ "fullDescription": {
+ "text": "Reports calls 'native' methods within a 'synchronized' block or method. When possible, it's better to keep calls to 'native' methods out of the synchronized context because such calls cause an expensive context switch and may lead to performance issues. Example: 'native void nativeMethod();\n\n void example(){\n synchronized (lock){\n nativeMethod();//warning\n }\n }'",
+ "markdown": "Reports calls `native` methods within a `synchronized` block or method.\n\n\nWhen possible, it's better to keep calls to `native` methods out of the synchronized context\nbecause such calls cause an expensive context switch and may lead to performance issues.\n\n**Example:**\n\n\n native void nativeMethod();\n\n void example(){\n synchronized (lock){\n nativeMethod();//warning\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToNativeMethodWhileLocked",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Dependency",
+ "shortDescription": {
+ "text": "Illegal package dependencies"
+ },
+ "fullDescription": {
+ "text": "Reports illegal dependencies between scopes according to the dependency rules given. Dependency rules can be used to prohibit usage from a scope to another scope. Use the Configure dependency rules button below to customize validation rules.",
+ "markdown": "Reports illegal dependencies between scopes according to the dependency rules given. Dependency rules can be used to prohibit usage from a scope to another scope.\n\nUse the **Configure dependency rules** button below to customize validation rules."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "Dependency",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestingDepth",
+ "shortDescription": {
+ "text": "Overly nested method"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose body contain too deeply nested statements. Methods with too deep statement nesting may be confusing and are a good sign that refactoring may be necessary. Use the Nesting depth limit field to specify the maximum allowed nesting depth for a method.",
+ "markdown": "Reports methods whose body contain too deeply nested statements.\n\nMethods with too deep statement\nnesting may be confusing and are a good sign that refactoring may be necessary.\n\nUse the **Nesting depth limit** field to specify the maximum allowed nesting depth for a method."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyNestedMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 93,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LambdaParameterTypeCanBeSpecified",
+ "shortDescription": {
+ "text": "Lambda parameter type can be specified"
+ },
+ "fullDescription": {
+ "text": "Reports lambda parameters that do not have their type specified and suggests adding the missing type declarations. Example: 'Function length = a -> a.length();' After the quick-fix is applied: 'Function length = (String a) -> a.length();' This inspection only reports if the language level of the project or module is 8 or higher.",
+ "markdown": "Reports lambda parameters that do not have their type specified and suggests adding the missing type declarations.\n\nExample:\n\n\n Function length = a -> a.length();\n\nAfter the quick-fix is applied:\n\n\n Function length = (String a) -> a.length();\n\nThis inspection only reports if the language level of the project or module is 8 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LambdaParameterTypeCanBeSpecified",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantExplicitChronoField",
+ "shortDescription": {
+ "text": "Calls of 'java.time' methods with explicit 'ChronoField' or 'ChronoUnit' arguments can be simplified"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.time' method calls with 'java.time.temporal.ChronoField' and 'java.time.temporal.ChronoUnit' as arguments when these calls can be replaced with calls of more specific methods. Example: 'LocalTime localTime = LocalTime.now();\nint minute = localTime.get(ChronoField.MINUTE_OF_HOUR);' After the quick-fix is applied: 'LocalTime localTime = LocalTime.now();\nint minute = localTime.getMinute();' New in 2023.2",
+ "markdown": "Reports `java.time` method calls with `java.time.temporal.ChronoField` and `java.time.temporal.ChronoUnit` as arguments when these calls can be replaced with calls of more specific methods.\n\nExample:\n\n\n LocalTime localTime = LocalTime.now();\n int minute = localTime.get(ChronoField.MINUTE_OF_HOUR);\n\nAfter the quick-fix is applied:\n\n\n LocalTime localTime = LocalTime.now();\n int minute = localTime.getMinute();\n\nNew in 2023.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantExplicitChronoField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TextLabelInSwitchStatement",
+ "shortDescription": {
+ "text": "Text label in 'switch' statement"
+ },
+ "fullDescription": {
+ "text": "Reports labeled statements inside of 'switch' statements. While occasionally intended, this construction is often the result of a typo. Example: 'switch (x) {\n case 1:\n case2: //warning: Text label 'case2:' in 'switch' statement\n case 3:\n break;\n }'",
+ "markdown": "Reports labeled statements inside of `switch` statements. While occasionally intended, this construction is often the result of a typo.\n\n**Example:**\n\n\n switch (x) {\n case 1:\n case2: //warning: Text label 'case2:' in 'switch' statement\n case 3:\n break;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TextLabelInSwitchStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PackageVisibleInnerClass",
+ "shortDescription": {
+ "text": "Package-visible nested class"
+ },
+ "fullDescription": {
+ "text": "Reports nested classes that are declared without any access modifier (also known as package-private). Example: 'public class Outer {\n static class Nested {} // warning\n class Inner {} // warning\n enum Mode {} // warning depends on the setting\n interface I {} // warning depends on the setting\n }' Configure the inspection: Use the Ignore package-visible inner enums option to ignore package-private inner enums. Use the Ignore package-visible inner interfaces option to ignore package-private inner interfaces.",
+ "markdown": "Reports nested classes that are declared without any access modifier (also known as package-private).\n\n**Example:**\n\n\n public class Outer {\n static class Nested {} // warning\n class Inner {} // warning\n enum Mode {} // warning depends on the setting\n interface I {} // warning depends on the setting\n }\n\nConfigure the inspection:\n\n* Use the **Ignore package-visible inner enums** option to ignore package-private inner enums.\n* Use the **Ignore package-visible inner interfaces** option to ignore package-private inner interfaces."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PackageVisibleInnerClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Encapsulation",
+ "index": 57,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryUnaryMinus",
+ "shortDescription": {
+ "text": "Unnecessary unary minus"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary unary minuses. Such expressions might be hard to understand and might contain errors. For example: 'void unaryMinus(int i) {\n int x = - -i;\n }' The following quick fixes are suggested here: Remove '-' operators before the 'i' variable: 'void unaryMinus(int i) {\n int x = i;\n }' Replace '-' operators with the prefix decrement operator: 'void unaryMinus(int i) {\n int x = --i;\n }' Another example: 'void unaryMinus(int i) {\n i += - 8;\n }' After the quick-fix is applied: 'void unaryMinus(int i) {\n i -= 8;\n }'",
+ "markdown": "Reports unnecessary unary minuses. Such expressions might be hard to understand and might contain errors.\n\n**For example:**\n\n void unaryMinus(int i) {\n int x = - -i;\n }\n\nThe following quick fixes are suggested here:\n\n* Remove `-` operators before the `i` variable:\n\n void unaryMinus(int i) {\n int x = i;\n }\n\n* Replace `-` operators with the prefix decrement operator:\n\n void unaryMinus(int i) {\n int x = --i;\n }\n\n**Another example:**\n\n void unaryMinus(int i) {\n i += - 8;\n }\n\nAfter the quick-fix is applied:\n\n void unaryMinus(int i) {\n i -= 8;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryUnaryMinus",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WriteOnlyObject",
+ "shortDescription": {
+ "text": "Write-only object"
+ },
+ "fullDescription": {
+ "text": "Reports objects that are modified but never queried. The inspection relies on the method mutation contract, which could be inferred or pre-annotated for some library methods. This inspection does not report collections, maps, and string builders, as these types are reported by other more precise inspections. Example: 'AtomicReference ref = new AtomicReference<>();\n ref.set(\"hello\"); // ref is never used again' Use the Ignore impure constructors option to control whether to process objects created by constructor or method whose purity is not known. Unchecking the option may introduce some false-positives if the object reference is intentionally leaked during the construction. New in 2021.2",
+ "markdown": "Reports objects that are modified but never queried.\n\nThe inspection relies on the method mutation contract, which could be inferred\nor pre-annotated for some library methods. This inspection does not report collections, maps, and string builders, as these types\nare reported by other more precise inspections.\n\nExample:\n\n\n AtomicReference ref = new AtomicReference<>();\n ref.set(\"hello\"); // ref is never used again\n\n\nUse the **Ignore impure constructors** option to control whether to process objects created by constructor or method whose purity is not known.\nUnchecking the option may introduce some false-positives if the object reference is intentionally leaked during the construction.\n**New in 2021.2**"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WriteOnlyObject",
+ "cweIds": [
+ 563
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodMayBeStatic",
+ "shortDescription": {
+ "text": "Method can be made 'static'"
+ },
+ "fullDescription": {
+ "text": "Reports methods that can safely be made 'static'. Making methods static when possible can reduce memory consumption and improve your code quality. A method can be 'static' if: it is not 'synchronized', 'native' or 'abstract', does not reference any of non-static methods and non-static fields from the containing class, is not an override and is not overridden in a subclass. Use the following options to configure the inspection: Whether to report only 'private' and 'final' methods, which increases the performance of this inspection. Whether to ignore empty methods. Whether to ignore default methods in interface when using Java 8 or higher. Whether to let the quick-fix replace instance qualifiers with class references in calls to methods which are made 'static', that is, call 'myClass.m()' would be replaced with 'MyClass.m()'.",
+ "markdown": "Reports methods that can safely be made `static`. Making methods static when possible can reduce memory consumption and improve your code quality.\n\nA method can be `static` if:\n\n* it is not `synchronized`, `native` or `abstract`,\n* does not reference any of non-static methods and non-static fields from the containing class,\n* is not an override and is not overridden in a subclass.\n\nUse the following options to configure the inspection:\n\n* Whether to report only `private` and `final` methods, which increases the performance of this inspection.\n* Whether to ignore empty methods.\n* Whether to ignore default methods in interface when using Java 8 or higher.\n* Whether to let the quick-fix replace instance qualifiers with class references in calls to methods which are made `static`, that is, call `myClass.m()` would be replaced with `MyClass.m()`."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodMayBeStatic",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TestMethodWithoutAssertion",
+ "shortDescription": {
+ "text": "Test method without assertions"
+ },
+ "fullDescription": {
+ "text": "Reports test methods that do not contain any assertions. Such methods may indicate either incomplete or weak test cases. Example: 'public class ExtensiveTest {\n\n @Test\n public void testAlive() {\n System.out.println(\"nothing\");\n }\n }' Configure the inspection: Use the table to specify the combinations of fully qualified class name and method name regular expression that should qualify as assertions. Class names also match subclasses. Use the 'assert' keyword is considered an assertion option to specify if the Java 'assert' statements using the 'assert' keyword should be considered an assertion. Use the Ignore test methods which declare exceptions option to ignore the test methods that declare exceptions. This can be useful when you have tests that will throw an exception on failure and thus don't need any assertions.",
+ "markdown": "Reports test methods that do not contain any assertions. Such methods may indicate either incomplete or weak test cases.\n\n**Example:**\n\n\n public class ExtensiveTest {\n\n @Test\n public void testAlive() {\n System.out.println(\"nothing\");\n }\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the combinations of fully qualified class name and method name regular expression that should qualify as assertions. Class names also match subclasses.\n* Use the **'assert' keyword is considered an assertion** option to specify if the Java `assert` statements using the `assert` keyword should be considered an assertion.\n* Use the **Ignore test methods which declare exceptions** option to ignore the test methods that declare exceptions. This can be useful when you have tests that will throw an exception on failure and thus don't need any assertions."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TestMethodWithoutAssertion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JUnitMixedFramework",
+ "shortDescription": {
+ "text": "JUnit API usage from multiple versions in a single TestCase"
+ },
+ "fullDescription": {
+ "text": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case. Example (JUnit 4 annotation in JUnit 3 test case): 'public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }' After the quick-fix is applied: 'public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }' Example (JUnit 5 annotation in JUnit 4 test case): 'public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }' After the quick-fix is applied: 'public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }'",
+ "markdown": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case.\n\nExample (JUnit 4 annotation in JUnit 3 test case):\n\n\n public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }\n\nExample (JUnit 5 annotation in JUnit 4 test case):\n\n\n public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JUnitMixedFramework",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SocketResource",
+ "shortDescription": {
+ "text": "Socket opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports socket resources that are not safely closed. Socket resources reported by this inspection include 'java.net.Socket', 'java.net.DatagramSocket', and 'java.net.ServerSocket'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'byte[] getMessage(ServerSocket socket) throws IOException {\n Socket client = socket.accept(); //socket is not closed\n return client.getInputStream().readAllBytes();\n }' Use the following options to configure the inspection: Whether a socket 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 socket resources that are not safely closed. Socket resources reported by this inspection include `java.net.Socket`, `java.net.DatagramSocket`, and `java.net.ServerSocket`.\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 byte[] getMessage(ServerSocket socket) throws IOException {\n Socket client = socket.accept(); //socket is not closed\n return client.getInputStream().readAllBytes();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a socket 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": "SocketOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 47,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TypeParameterHidesVisibleType",
+ "shortDescription": {
+ "text": "Type parameter hides visible type"
+ },
+ "fullDescription": {
+ "text": "Reports type parameters that have the same names as the visible types in the current scope. Such parameter names may be confusing. Example: 'abstract class MyList extends AbstractList {\n private List elements;\n // type parameter 'T' hides type parameter 'T'\n public T[] toArray(T[] array) {\n return elements.toArray(array);\n }\n}'",
+ "markdown": "Reports type parameters that have the same names as the visible types in the current scope. Such parameter names may be confusing.\n\nExample:\n\n\n abstract class MyList extends AbstractList {\n private List elements;\n // type parameter 'T' hides type parameter 'T'\n public T[] toArray(T[] array) {\n return elements.toArray(array);\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TypeParameterHidesVisibleType",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringTokenizerDelimiter",
+ "shortDescription": {
+ "text": "Duplicated delimiters in 'StringTokenizer'"
+ },
+ "fullDescription": {
+ "text": "Reports 'StringTokenizer()' constructor calls or 'nextToken()' method calls that contain duplicate characters in the delimiter argument. Example: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }' After the quick-fix is applied: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }'",
+ "markdown": "Reports `StringTokenizer()` constructor calls or `nextToken()` method calls that contain duplicate characters in the delimiter argument.\n\n**Example:**\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringTokenizerDelimiter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MaskedAssertion",
+ "shortDescription": {
+ "text": "Assertion is suppressed by 'catch'"
+ },
+ "fullDescription": {
+ "text": "Reports 'assert' statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown 'AssertionError' will be caught and silently ignored. Example 1: 'void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 2: '@Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 3: '@Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' New in 2020.3",
+ "markdown": "Reports `assert` statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown `AssertionError` will be caught and silently ignored.\n\n**Example 1:**\n\n\n void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 2:**\n\n\n @Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 3:**\n\n\n @Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MaskedAssertion",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Test frameworks",
+ "index": 94,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReflectionForUnavailableAnnotation",
+ "shortDescription": {
+ "text": "Reflective access to a source-only annotation"
+ },
+ "fullDescription": {
+ "text": "Reports attempts to reflectively check for the presence of a non-runtime annotation. Using 'Class.isAnnotationPresent()' to test for an annotation whose retention policy is set to 'SOURCE' or 'CLASS' (the default) will always have a negative result. This mistake is easy to overlook. Example: '{\n getClass().isAnnotationPresent(SourceAnnotation.class); //always false\n }\n\n @Retention(RetentionPolicy.SOURCE)\n @interface SourceAnnotation {}'",
+ "markdown": "Reports attempts to reflectively check for the presence of a non-runtime annotation.\n\nUsing `Class.isAnnotationPresent()` to test for an annotation\nwhose retention policy is set to `SOURCE` or `CLASS`\n(the default) will always have a negative result. This mistake is easy to overlook.\n\n**Example:**\n\n\n {\n getClass().isAnnotationPresent(SourceAnnotation.class); //always false\n }\n\n @Retention(RetentionPolicy.SOURCE)\n @interface SourceAnnotation {}\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReflectionForUnavailableAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstantiatingObjectToGetClassObject",
+ "shortDescription": {
+ "text": "Instantiating object to get 'Class' object"
+ },
+ "fullDescription": {
+ "text": "Reports code that instantiates a class to get its class object. It is more performant to access the class object directly by name. Example: 'Class> c = new Sample().getClass();' After the quick-fix is applied: 'Class> c = Sample.class;'",
+ "markdown": "Reports code that instantiates a class to get its class object.\n\nIt is more performant to access the class object\ndirectly by name.\n\n**Example:**\n\n\n Class> c = new Sample().getClass();\n\nAfter the quick-fix is applied:\n\n\n Class> c = Sample.class;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstantiatingObjectToGetClassObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithMultipleLoggers",
+ "shortDescription": {
+ "text": "Class with multiple loggers"
+ },
+ "fullDescription": {
+ "text": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application. For example: 'public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }' Use the table below to specify Logger class names. Classes which declare multiple fields that have the type of one of the specified classes will be reported by this inspection.",
+ "markdown": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application.\n\nFor example:\n\n\n public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }\n\n\nUse the table below to specify Logger class names.\nClasses which declare multiple fields that have the type of one of the specified classes will be reported by this inspection."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassWithMultipleLoggers",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Logging",
+ "index": 66,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ShiftOutOfRange",
+ "shortDescription": {
+ "text": "Shift operation by inappropriate constant"
+ },
+ "fullDescription": {
+ "text": "Reports shift operations where the shift value is a constant outside the reasonable range. Integer shift operations outside the range '0..31' and long shift operations outside the range '0..63' are reported. Shifting by negative or overly large values is almost certainly a coding error. Example: 'int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;'",
+ "markdown": "Reports shift operations where the shift value is a constant outside the reasonable range.\n\nInteger shift operations outside the range `0..31` and long shift operations outside the\nrange `0..63` are reported. Shifting by negative or overly large values is almost certainly\na coding error.\n\n**Example:**\n\n\n int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ShiftOutOfRange",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Bitwise operation issues",
+ "index": 95,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadRun",
+ "shortDescription": {
+ "text": "Call to 'Thread.run()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'run()' on 'java.lang.Thread' or any of its subclasses. While occasionally intended, this is usually a mistake, because 'run()' doesn't start a new thread. To execute the code in a separate thread, 'start()' should be used.",
+ "markdown": "Reports calls to `run()` on `java.lang.Thread` or any of its subclasses.\n\n\nWhile occasionally intended, this is usually a mistake, because `run()` doesn't start a new thread.\nTo execute the code in a separate thread, `start()` should be used."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToThreadRun",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EscapedSpace",
+ "shortDescription": {
+ "text": "Non-terminal use of '\\s' escape sequence"
+ },
+ "fullDescription": {
+ "text": "Reports '\\s' escape sequences anywhere except at text-block line endings or within a series of several escaped spaces. Such usages can be confusing or a mistake, especially if the string is interpreted as a regular expression. The '\\s' escape sequence is intended to encode a space at the end of text-block lines where normal spaces are trimmed. In other locations, as well as in regular string or char literals, '\\s' is identical to an ordinary space character ('\" \"'). Example: 'if (str.matches(\"\\s+\")) {...}' Here it's likely that '\"\\\\s+\"' was intended (to match any whitespace character). If not, using 'str.matches(\" +\")' would be less confusing. A quick-fix is provided that replaces '\\s' escapes with space characters. This inspection reports only if the language level of the project or module is 15 or higher. New in 2022.3",
+ "markdown": "Reports `\\s` escape sequences anywhere except at text-block line endings or within a series of several escaped spaces. Such usages can be confusing or a mistake, especially if the string is interpreted as a regular expression. The `\\s` escape sequence is intended to encode a space at the end of text-block lines where normal spaces are trimmed. In other locations, as well as in regular string or char literals, `\\s` is identical to an ordinary space character (`\" \"`).\n\n**Example:**\n\n\n if (str.matches(\"\\s+\")) {...}\n\nHere it's likely that `\"\\\\s+\"` was intended (to match any whitespace character). If not, using `str.matches(\" +\")` would be less confusing.\n\n\nA quick-fix is provided that replaces `\\s` escapes with space characters.\n\nThis inspection reports only if the language level of the project or module is 15 or higher.\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EscapedSpace",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtendsThrowable",
+ "shortDescription": {
+ "text": "Class directly extends 'Throwable'"
+ },
+ "fullDescription": {
+ "text": "Reports classes that directly extend 'java.lang.Throwable'. Extending 'java.lang.Throwable' directly is generally considered bad practice. It is usually enough to extend 'java.lang.RuntimeException', 'java.lang.Exception', or - in special cases - 'java.lang.Error'. Example: 'class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable''",
+ "markdown": "Reports classes that directly extend `java.lang.Throwable`.\n\nExtending `java.lang.Throwable` directly is generally considered bad practice.\nIt is usually enough to extend `java.lang.RuntimeException`, `java.lang.Exception`, or - in special\ncases - `java.lang.Error`.\n\n**Example:**\n\n\n class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExtendsThrowable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AutoBoxing",
+ "shortDescription": {
+ "text": "Auto-boxing"
+ },
+ "fullDescription": {
+ "text": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance. Example: 'Integer x = 42;' The quick-fix makes the conversion explicit: 'Integer x = Integer.valueOf(42);' AutoBoxing appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions.",
+ "markdown": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance.\n\n**Example:**\n\n Integer x = 42;\n\nThe quick-fix makes the conversion explicit:\n\n Integer x = Integer.valueOf(42);\n\n\n*AutoBoxing* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AutoBoxing",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InterfaceNeverImplemented",
+ "shortDescription": {
+ "text": "Interface which has no concrete subclass"
+ },
+ "fullDescription": {
+ "text": "Reports interfaces that have no concrete subclasses. Configure the inspection: Use the list below to add annotations. Interfaces declared with one of these annotations will be ignored by the inspection. Use the checkbox below to ignore interfaces that only declare constant fields. Such interfaces may still be usable even without implementations.",
+ "markdown": "Reports interfaces that have no concrete subclasses.\n\nConfigure the inspection:\n\n* Use the list below to add annotations. Interfaces declared with one of these annotations will be ignored by the inspection.\n* Use the checkbox below to ignore interfaces that only declare constant fields. Such interfaces may still be usable even without implementations."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InterfaceNeverImplemented",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ContinueStatement",
+ "shortDescription": {
+ "text": "'continue' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'continue' statements. 'continue' statements complicate refactoring and can be confusing. Example: 'void foo(List strs) {\n for (String str : strs) {\n if (str.contains(\"skip\")) continue;\n handleStr(str);\n }\n }'",
+ "markdown": "Reports `continue` statements.\n\n`continue` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void foo(List strs) {\n for (String str : strs) {\n if (str.contains(\"skip\")) continue;\n handleStr(str);\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ContinueStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadDeathRethrown",
+ "shortDescription": {
+ "text": "'ThreadDeath' not rethrown"
+ },
+ "fullDescription": {
+ "text": "Reports 'try' statements that catch 'java.lang.ThreadDeath' and do not rethrow the exception. Example: 'try {\n executeInParallel(request);\n } catch (ThreadDeath ex) { // warning: ThreadDeath 'ex' not rethrown\n return false;\n }'",
+ "markdown": "Reports `try` statements that catch `java.lang.ThreadDeath` and do not rethrow the exception.\n\n**Example:**\n\n\n try {\n executeInParallel(request);\n } catch (ThreadDeath ex) { // warning: ThreadDeath 'ex' not rethrown\n return false;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThreadDeathNotRethrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MisorderedAssertEqualsArguments",
+ "shortDescription": {
+ "text": "Misordered 'assertEquals()' arguments"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'assertEquals()' that have the expected argument and the actual argument in the wrong order. For JUnit 3, 4, and 5 the correct order is '(expected, actual)'. For TestNG the correct order is '(actual, expected)'. Such calls will behave fine for assertions that pass, but may give confusing error reports on failure. Use the quick-fix to flip the order of the arguments. Example (JUnit): 'assertEquals(actual, expected)' After the quick-fix is applied: 'assertEquals(expected, actual)'",
+ "markdown": "Reports calls to `assertEquals()` that have the expected argument and the actual argument in the wrong order.\n\n\nFor JUnit 3, 4, and 5 the correct order is `(expected, actual)`.\nFor TestNG the correct order is `(actual, expected)`.\n\n\nSuch calls will behave fine for assertions that pass, but may give confusing error reports on failure.\nUse the quick-fix to flip the order of the arguments.\n\n**Example (JUnit):**\n\n\n assertEquals(actual, expected)\n\nAfter the quick-fix is applied:\n\n\n assertEquals(expected, actual)\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MisorderedAssertEqualsArguments",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Test frameworks",
+ "index": 94,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticVariableInitialization",
+ "shortDescription": {
+ "text": "Static field may not be initialized"
+ },
+ "fullDescription": {
+ "text": "Reports 'static' variables that may be uninitialized upon class initialization. Example: 'class Foo {\n public static int bar;\n\n static { }\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 may be uninitialized upon class initialization.\n\n**Example:**\n\n\n class Foo {\n public static int bar;\n\n static { }\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": "StaticVariableMayNotBeInitialized",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 29,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstantAssertCondition",
+ "shortDescription": {
+ "text": "Constant condition in 'assert' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'assert' statement conditions that are constants. 'assert' statements with constant conditions will either always fail or always succeed. Such statements might be left over after a refactoring and are probably not intended. Example: 'void foo() {\n assert true;\n }'",
+ "markdown": "Reports `assert` statement conditions that are constants. `assert` statements with constant conditions will either always fail or always succeed. Such statements might be left over after a refactoring and are probably not intended.\n\n**Example:**\n\n\n void foo() {\n assert true;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstantAssertCondition",
+ "cweIds": [
+ 570,
+ 571
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaReflectionInvocation",
+ "shortDescription": {
+ "text": "Reflective invocation arguments mismatch"
+ },
+ "fullDescription": {
+ "text": "Reports cases in which the arguments provided to 'Method.invoke()' and 'Constructor.newInstance()' do not match the signature specified in 'Class.getMethod()' and 'Class.getConstructor()'. Example: 'Method m = myObj.getClass().getMethod(\"myMethod\", int.class);\n // the argument should be an int value\n m.invoke(myObj, \"abc\");' New in 2017.2",
+ "markdown": "Reports cases in which the arguments provided to `Method.invoke()` and `Constructor.newInstance()` do not match the signature specified in `Class.getMethod()` and `Class.getConstructor()`.\n\nExample:\n\n\n Method m = myObj.getClass().getMethod(\"myMethod\", int.class);\n // the argument should be an **int** value\n m.invoke(myObj, \"abc\");\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavaReflectionInvocation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Reflective access",
+ "index": 96,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CaughtExceptionImmediatelyRethrown",
+ "shortDescription": {
+ "text": "Caught exception is immediately rethrown"
+ },
+ "fullDescription": {
+ "text": "Reports 'catch' blocks that immediately rethrow the caught exception without performing any action on it. Such 'catch' blocks are unnecessary and have no error handling. Example: 'try {\n new FileInputStream(\"\");\n } catch (FileNotFoundException e) {\n throw e;\n }'",
+ "markdown": "Reports `catch` blocks that immediately rethrow the caught exception without performing any action on it. Such `catch` blocks are unnecessary and have no error handling.\n\n**Example:**\n\n\n try {\n new FileInputStream(\"\");\n } catch (FileNotFoundException e) {\n throw e;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CaughtExceptionImmediatelyRethrown",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CloneCallsConstructors",
+ "shortDescription": {
+ "text": "'clone()' instantiates objects with constructor"
+ },
+ "fullDescription": {
+ "text": "Reports calls to object constructors inside 'clone()' methods. It is considered good practice to call 'clone()' to instantiate objects inside of a 'clone()' method instead of creating them directly to support later subclassing. This inspection will not report 'clone()' methods declared as 'final' or 'clone()' methods on 'final' classes.",
+ "markdown": "Reports calls to object constructors inside `clone()` methods.\n\nIt is considered good practice to call `clone()` to instantiate objects inside of a `clone()` method\ninstead of creating them directly to support later subclassing.\nThis inspection will not report\n`clone()` methods declared as `final`\nor `clone()` methods on `final` classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CloneCallsConstructors",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Cloning issues",
+ "index": 79,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryModuleDependencyInspection",
+ "shortDescription": {
+ "text": "Unnecessary module dependency"
+ },
+ "fullDescription": {
+ "text": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies.",
+ "markdown": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryModuleDependencyInspection",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArrayHashCode",
+ "shortDescription": {
+ "text": "'hashCode()' called on array"
+ },
+ "fullDescription": {
+ "text": "Reports incorrect hash code calculation for arrays. In order to correctly calculate the hash code for an array, use: 'Arrays.hashcode()' for linear arrays 'Arrays.deepHashcode()' for multidimensional arrays These methods should also be used with 'Objects.hash()' when the sequence of input values includes arrays, for example: 'Objects.hash(string, Arrays.hashcode(array))'",
+ "markdown": "Reports incorrect hash code calculation for arrays.\n\nIn order to\ncorrectly calculate the hash code for an array, use:\n\n* `Arrays.hashcode()` for linear arrays\n* `Arrays.deepHashcode()` for multidimensional arrays\n\nThese methods should also be used with `Objects.hash()` when the sequence of input values includes arrays, for example: `Objects.hash(string, Arrays.hashcode(array))`"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ArrayHashCode",
+ "cweIds": [
+ 328
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitNotInLoop",
+ "shortDescription": {
+ "text": "'wait()' not called in loop"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'wait()' that are not made inside a loop. 'wait()' is normally used to suspend a thread until some condition becomes true. As the thread could have been waken up for a different reason, the condition should be checked after the 'wait()' call returns. A loop is a simple way to achieve this. Example: 'class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n if (count >= 10) wait();\n ++count;\n }\n }' Good code should look like this: 'class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n while (count >= 10) wait();\n ++count;\n }\n }'",
+ "markdown": "Reports calls to `wait()` that are not made inside a loop.\n\n\n`wait()` is normally used to suspend a thread until some condition becomes true.\nAs the thread could have been waken up for a different reason,\nthe condition should be checked after the `wait()` call returns.\nA loop is a simple way to achieve this.\n\n**Example:**\n\n\n class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n if (count >= 10) wait();\n ++count;\n }\n }\n\nGood code should look like this:\n\n\n class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n while (count >= 10) wait();\n ++count;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitNotInLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ArraysAsListWithZeroOrOneArgument",
+ "shortDescription": {
+ "text": "Call to 'Arrays.asList()' with too few arguments"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Arrays.asList()' with at most one argument. Such calls could be replaced with 'Collections.singletonList()', 'Collections.emptyList()', or 'List.of()' on JDK 9 and later, which will save some memory. In particular, 'Collections.emptyList()' and 'List.of()' with no arguments always return a shared instance, while 'Arrays.asList()' with no arguments creates a new object every time it's called. Note: the lists returned by 'Collections.singletonList()' and 'List.of()' are immutable, while the list returned 'Arrays.asList()' allows calling the 'set()' method. This may break the code in rare cases. Example: 'List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");' After the quick-fix is applied: 'List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");'",
+ "markdown": "Reports calls to `Arrays.asList()` with at most one argument.\n\n\nSuch calls could be replaced\nwith `Collections.singletonList()`, `Collections.emptyList()`,\nor `List.of()` on JDK 9 and later, which will save some memory.\n\nIn particular, `Collections.emptyList()` and `List.of()` with no arguments\nalways return a shared instance,\nwhile `Arrays.asList()` with no arguments creates a new object every time it's called.\n\nNote: the lists returned by `Collections.singletonList()` and `List.of()` are immutable,\nwhile the list returned `Arrays.asList()` allows calling the `set()` method.\nThis may break the code in rare cases.\n\n**Example:**\n\n\n List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");\n\nAfter the quick-fix is applied:\n\n\n List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ArraysAsListWithZeroOrOneArgument",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExternalizableWithSerializationMethods",
+ "shortDescription": {
+ "text": "Externalizable class with 'readObject()' or 'writeObject()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'Externalizable' classes that define 'readObject()' or 'writeObject()' methods. These methods are not called for serialization of 'Externalizable' objects. Example: 'abstract class Crucial implements Externalizable {\n int value;\n private void readObject(ObjectInputStream in) {\n value = in.readInt();\n }\n }'",
+ "markdown": "Reports `Externalizable` classes that define `readObject()` or `writeObject()` methods. These methods are not called for serialization of `Externalizable` objects.\n\n**Example:**\n\n\n abstract class Crucial implements Externalizable {\n int value;\n private void readObject(ObjectInputStream in) {\n value = in.readInt();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExternalizableClassWithSerializationMethods",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnstableApiUsage",
+ "shortDescription": {
+ "text": "Unstable API Usage"
+ },
+ "fullDescription": {
+ "text": "Reports usages of an API marked with one of the annotations as unstable. Such an API may be changed or removed in future versions, breaking the code that uses it. The annotations which are used to mark unstable APIs are shown in the list below. By default, the inspection ignores usages of unstable APIs if their declarations are located in sources of the same project. In such cases it'll be possible to update the usages when you change APIs. However, it may be inconvenient if the project is big, so one can switch off the Ignore API declared in this project option to report the usages of unstable APIs declared in both the project sources and libraries.",
+ "markdown": "Reports usages of an API marked with one of the annotations as unstable. Such an API may be changed or removed in future versions, breaking the code that uses it.\n\nThe annotations which are used to mark unstable APIs are shown in the list below.\n\nBy default, the inspection ignores usages of unstable APIs\nif their declarations are located in sources of the same project. In such cases it'll be possible to update the usages when you change APIs.\nHowever, it may be inconvenient if the project is big, so one can switch off the **Ignore API declared in this project** option to report\nthe usages of unstable APIs declared in both the project sources and libraries."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnstableApiUsage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SafeLock",
+ "shortDescription": {
+ "text": "Lock acquired but not safely unlocked"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.util.concurrent.locks.Lock' resources that are not acquired in front of a 'try' block or not unlocked in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. Example: 'lock.lock(); // will be reported since the 'finally' block is missing\n try {\n doSmthWithLock();\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n lock.unlock();'",
+ "markdown": "Reports `java.util.concurrent.locks.Lock` resources that are not acquired in front of a `try` block or not unlocked 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 lock.lock(); // will be reported since the 'finally' block is missing\n try {\n doSmthWithLock();\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n lock.unlock();\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LockAcquiredButNotSafelyReleased",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavaLangInvokeHandleSignature",
+ "shortDescription": {
+ "text": "MethodHandle/VarHandle type mismatch"
+ },
+ "fullDescription": {
+ "text": "Reports 'MethodHandle' and 'VarHandle' factory method calls that don't match any method or field. Also reports arguments to 'MethodHandle.invoke()' and similar methods, that don't match the 'MethodHandle' signature and arguments to 'VarHandle.set()' that don't match the 'VarHandle' type. Examples: MethodHandle mh = MethodHandles.lookup().findVirtual(\n MyClass.class, \"foo\", MethodType.methodType(void.class, int.class));\n // the argument should be an int value\n mh.invoke(myObj, \"abc\");\n // the argument should be String.class\n VarHandle vh = MethodHandles.lookup().findVarHandle(\n MyClass.class, \"text\", int.class);\n VarHandle vh = MethodHandles.lookup().findVarHandle(\n MyClass.class, \"text\", String.class);\n // the argument should be a String value\n vh.set(myObj, 42);\n New in 2017.2",
+ "markdown": "Reports `MethodHandle` and `VarHandle` factory method calls that don't match any method or field.\n\nAlso reports arguments to `MethodHandle.invoke()` and similar methods, that don't match the `MethodHandle` signature\nand arguments to `VarHandle.set()` that don't match the `VarHandle` type.\n\n\nExamples:\n\n```\n MethodHandle mh = MethodHandles.lookup().findVirtual(\n MyClass.class, \"foo\", MethodType.methodType(void.class, int.class));\n // the argument should be an int value\n mh.invoke(myObj, \"abc\");\n```\n\n```\n // the argument should be String.class\n VarHandle vh = MethodHandles.lookup().findVarHandle(\n MyClass.class, \"text\", int.class);\n```\n\n```\n VarHandle vh = MethodHandles.lookup().findVarHandle(\n MyClass.class, \"text\", String.class);\n // the argument should be a String value\n vh.set(myObj, 42);\n```\n\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavaLangInvokeHandleSignature",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Reflective access",
+ "index": 96,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LambdaUnfriendlyMethodOverload",
+ "shortDescription": {
+ "text": "Lambda-unfriendly method overload"
+ },
+ "fullDescription": {
+ "text": "Reports overloaded methods that take functional interfaces with conflicting abstract method signatures. Such overloads introduce ambiguity and require callers to cast lambdas to a specific type or specify lambda parameter types explicitly. It is preferable to give the overloaded methods different names to eliminate ambiguity. Example: 'interface MyExecutor {\n void execute(Supplier> supplier);\n void execute(Callable> callable);\n }' Here, 'Supplier' and 'Callable' are functional interfaces whose single abstract methods do not take any parameters and return a non-void value. As a result, the type of the lambda cannot be inferred at the call site unless an explicit cast is used.",
+ "markdown": "Reports overloaded methods that take functional interfaces with conflicting abstract method signatures.\n\nSuch overloads introduce ambiguity and require callers to cast lambdas to a specific type or specify lambda parameter types explicitly.\nIt is preferable to give the overloaded methods different names to eliminate ambiguity.\n\nExample:\n\n\n interface MyExecutor {\n void execute(Supplier> supplier);\n void execute(Callable> callable);\n }\n\n\nHere, `Supplier` and `Callable` are functional interfaces\nwhose single abstract methods do not take any parameters and return a non-void value.\nAs a result, the type of the lambda cannot be inferred at the call site unless an explicit cast is used."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LambdaUnfriendlyMethodOverload",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 85,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReturnThis",
+ "shortDescription": {
+ "text": "Return of 'this'"
+ },
+ "fullDescription": {
+ "text": "Reports methods returning 'this'. While such a return is valid, it is rarely necessary, and usually indicates that the method is intended to be used as part of a chain of similar method calls (for example, 'buffer.append(\"foo\").append(\"bar\").append(\"baz\")'). Such chains are frowned upon by many coding standards. Example: 'public Builder append(String str) {\n // [...]\n return this;\n }'",
+ "markdown": "Reports methods returning `this`.\n\n\nWhile such a return is valid, it is rarely necessary, and usually indicates that the method is intended to be used\nas part of a chain of similar method calls (for example, `buffer.append(\"foo\").append(\"bar\").append(\"baz\")`).\nSuch chains are frowned upon by many coding standards.\n\n**Example:**\n\n\n public Builder append(String str) {\n // [...]\n return this;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReturnOfThis",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CanBeFinal",
+ "shortDescription": {
+ "text": "Declaration can have 'final' modifier"
+ },
+ "fullDescription": {
+ "text": "Reports fields, methods, or classes that may have the 'final' modifier added to their declarations. Final classes can't be extended, final methods can't be overridden, and final fields can't be reassigned. Example: 'public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }' After the quick-fix is applied: 'public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }' Use the Report classes and Report methods options to define which declarations are to be reported.",
+ "markdown": "Reports fields, methods, or classes that may have the `final` modifier added to their declarations.\n\nFinal classes can't be extended, final methods can't be overridden, and final fields can't be reassigned.\n\n**Example:**\n\n\n public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }\n\nUse the **Report classes** and **Report methods** options to define which declarations are to be reported."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CanBeFinal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableRecordContainsIgnoredMembers",
+ "shortDescription": {
+ "text": "'record' contains ignored members"
+ },
+ "fullDescription": {
+ "text": "Reports serialization methods or fields defined in a 'record' class. Serialization methods include 'writeObject()', 'readObject()', 'readObjectNoData()', 'writeExternal()', and 'readExternal()' and the field 'serialPersistentFields'. These members are not used for the serialization or deserialization of records and therefore unnecessary. Examples: 'record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }' 'record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }' This inspection only reports if the language level of the project or module is 14 or higher. New in 2020.3",
+ "markdown": "Reports serialization methods or fields defined in a `record` class. Serialization methods include `writeObject()`, `readObject()`, `readObjectNoData()`, `writeExternal()`, and `readExternal()` and the field `serialPersistentFields`. These members are not used for the serialization or deserialization of records and therefore unnecessary.\n\n**Examples:**\n\n\n record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\n\n record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }\n\nThis inspection only reports if the language level of the project or module is 14 or higher.\n\nNew in 2020.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableRecordContainsIgnoredMembers",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryLabelOnBreakStatement",
+ "shortDescription": {
+ "text": "Unnecessary label on 'break' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'break' statements with unnecessary labels. Such labels do not change the control flow but make the code difficult to follow. Example: 'label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break label;\n //doSmth\n }' After the quick-fix is applied: 'label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break;\n //doSmth\n }'",
+ "markdown": "Reports `break` statements with unnecessary labels. Such labels do not change the control flow but make the code difficult to follow.\n\n**Example:**\n\n\n label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break label;\n //doSmth\n }\n\nAfter the quick-fix is applied:\n\n\n label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break;\n //doSmth\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryLabelOnBreakStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NakedNotify",
+ "shortDescription": {
+ "text": "'notify()' or 'notifyAll()' without corresponding state change"
+ },
+ "fullDescription": {
+ "text": "Reports 'Object.notify()' or 'Object.notifyAll()' being called without any detectable state change occurring. Normally, 'Object.notify()' and 'Object.notifyAll()' are used to inform other threads that a state change has occurred. That state change should occur in a synchronized context that contains the 'Object.notify()' or 'Object.notifyAll()' call, and prior to the call. While not having such a state change isn't necessarily incorrect, it is certainly worth examining. Example: 'synchronized (this) {\n notify();\n }\n // no state change\n synchronized (this) {\n notify(); // this notify might be redundant\n }'",
+ "markdown": "Reports `Object.notify()` or `Object.notifyAll()` being called without any detectable state change occurring.\n\n\nNormally, `Object.notify()` and `Object.notifyAll()` are used to inform other threads that a state change has\noccurred. That state change should occur in a synchronized context that contains the `Object.notify()` or\n`Object.notifyAll()` call, and prior to the call. While not having such a state change isn't necessarily incorrect, it is\ncertainly worth examining.\n\n**Example:**\n\n\n synchronized (this) {\n notify();\n }\n // no state change\n synchronized (this) {\n notify(); // this notify might be redundant\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NakedNotify",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassCoupling",
+ "shortDescription": {
+ "text": "Overly coupled class"
+ },
+ "fullDescription": {
+ "text": "Reports classes that reference too many other classes. Classes with too high coupling can be very fragile, and should probably be split into smaller classes. Configure the inspection: Use the Class coupling limit field to specify the maximum allowed coupling for a class. Use the Include couplings to java system classes option to specify whether references to system classes (those in the 'java.'or 'javax.' packages) should be counted. Use the Include couplings to library classes option to specify whether references to any library classes should be counted.",
+ "markdown": "Reports classes that reference too many other classes.\n\nClasses with too high coupling can be very fragile, and should probably be split into smaller classes.\n\nConfigure the inspection:\n\n* Use the **Class coupling limit** field to specify the maximum allowed coupling for a class.\n* Use the **Include couplings to java system classes** option to specify whether references to system classes (those in the `java.`or `javax.` packages) should be counted.\n* Use the **Include couplings to library classes** option to specify whether references to any library classes should be counted."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyCoupledClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class metrics",
+ "index": 84,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarilyQualifiedInnerClassAccess",
+ "shortDescription": {
+ "text": "Unnecessarily qualified inner class access"
+ },
+ "fullDescription": {
+ "text": "Reports any references to inner classes that are unnecessarily qualified with the name of the enclosing class. Such a qualification can be safely removed, which sometimes adds an import for the inner class. Example: 'class X {\n X.Y foo;\n class Y{}\n }' After the quick-fix is applied: 'class X {\n Y foo;\n class Y{}\n }' Use the Ignore references for which an import is needed option to ignore references to inner classes, where removing the qualification adds an import.",
+ "markdown": "Reports any references to inner classes that are unnecessarily qualified with the name of the enclosing class.\n\nSuch a qualification can be safely removed, which sometimes adds an import for the inner class.\n\nExample:\n\n\n class X {\n X.Y foo;\n class Y{}\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n Y foo;\n class Y{}\n }\n\nUse the **Ignore references for which an import is needed** option to ignore references to inner classes, where\nremoving the qualification adds an import."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "UnnecessarilyQualifiedInnerClassAccess",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EmptySynchronizedStatement",
+ "shortDescription": {
+ "text": "Empty 'synchronized' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'synchronized' statements with empty bodies. Empty 'synchronized' statements are sometimes used to wait for other threads to release a particular resource. However, there is no guarantee that the same resource won't be acquired again right after the empty 'synchronized' statement finishes. For proper synchronization, the resource should be utilized inside the 'synchronized' block. Also, an empty 'synchronized' block may appear after a refactoring when redundant code was removed. In this case, the 'synchronized' block itself will be redundant and should be removed as well. Example: 'synchronized(lock) {}' A quick-fix is suggested to remove the empty synchronized statement. This inspection is disabled in JSP files.",
+ "markdown": "Reports `synchronized` statements with empty bodies.\n\n\nEmpty `synchronized` statements are sometimes used to wait for other threads to\nrelease a particular resource. However, there is no guarantee that the same resource\nwon't be acquired again right after the empty `synchronized` statement finishes.\nFor proper synchronization, the resource should be utilized inside the `synchronized` block.\n\n\nAlso, an empty `synchronized` block may appear after a refactoring\nwhen redundant code was removed. In this case, the `synchronized` block\nitself will be redundant and should be removed as well.\n\nExample:\n\n\n synchronized(lock) {}\n\n\nA quick-fix is suggested to remove the empty synchronized statement.\n\n\nThis inspection is disabled in JSP files."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EmptySynchronizedStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TextBlockMigration",
+ "shortDescription": {
+ "text": "Text block can be used"
+ },
+ "fullDescription": {
+ "text": "Reports 'String' concatenations that can be simplified by replacing them with text blocks. Requirements: '\\n' occurs two or more times. Text blocks are not concatenated. Use the Apply to single string literals option to suggest the fix for single literals containing line breaks. Example: 'String html = \"\\n\" +\n \" \\n\" +\n \" Hello, world
\\n\" +\n \" \\n\" +\n \"\\n\";' After the quick-fix is applied: 'String html = \"\"\"\n \n \n Hello, world
\n \n \n \"\"\";' This inspection only reports if the language level of the project or module is 15 or higher. New in 2019.3",
+ "markdown": "Reports `String` concatenations that can be simplified by replacing them with text blocks.\n\nRequirements:\n\n* `\\n` occurs two or more times.\n* Text blocks are not concatenated.\n\n\nUse the **Apply to single string literals** option to suggest the fix for single literals containing line breaks.\n\n\n**Example:**\n\n\n String html = \"\\n\" +\n \" \\n\" +\n \" Hello, world
\\n\" +\n \" \\n\" +\n \"\\n\";\n\nAfter the quick-fix is applied:\n\n\n String html = \"\"\"\n \n \n Hello, world
\n \n \n \"\"\";\n\nThis inspection only reports if the language level of the project or module is 15 or higher.\n\nNew in 2019.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TextBlockMigration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 15",
+ "index": 98,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectAllocationInLoop",
+ "shortDescription": {
+ "text": "Object allocation in loop"
+ },
+ "fullDescription": {
+ "text": "Reports object or array allocations inside loops. While not necessarily a problem, an object allocation inside a loop is a great place to look for memory leaks and performance issues. The inspection reports the following constructs: Explicit allocations via 'new' operator Methods known to return new object Instance-bound method references Lambdas that capture variables or 'this' reference Example: '// Explicit allocation\n for (Status status : Status.values()) {\n declarationsMap.put(status, new ArrayList<>());\n }\n\n // Lambda captures variable\n String message = \"Engine running.\";\n for (Engine engine : engines) {\n if (!isRunning(engine)) {\n logger.warn(() -> {\n return String.format(message);\n });\n }\n }\n\n // Instance-bound method reference\n for(Node node : nodes) {\n descriptor = node.getDescription();\n descriptor.ifPresent(dynamicTestExecutor::execute);\n }'",
+ "markdown": "Reports object or array allocations inside loops. While not necessarily a problem, an object allocation inside a loop is a great place to look for memory leaks and performance issues.\n\n\nThe inspection reports the following constructs:\n\n* Explicit allocations via `new` operator\n* Methods known to return new object\n* Instance-bound method references\n* Lambdas that capture variables or `this` reference\n\n**Example:**\n\n\n // Explicit allocation\n for (Status status : Status.values()) {\n declarationsMap.put(status, new ArrayList<>());\n }\n\n // Lambda captures variable\n String message = \"Engine running.\";\n for (Engine engine : engines) {\n if (!isRunning(engine)) {\n logger.warn(() -> {\n return String.format(message);\n });\n }\n }\n\n // Instance-bound method reference\n for(Node node : nodes) {\n descriptor = node.getDescription();\n descriptor.ifPresent(dynamicTestExecutor::execute);\n }\n\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ObjectAllocationInLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavadocLinkAsPlainText",
+ "shortDescription": {
+ "text": "Link specified as plain text"
+ },
+ "fullDescription": {
+ "text": "Reports plain text links in Javadoc comments. The quick-fix suggests to wrap the link in an '' tag. Example: 'class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }' After the quick-fix is applied: 'class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }' New in 2022.1",
+ "markdown": "Reports plain text links in Javadoc comments.\n\n\nThe quick-fix suggests to wrap the link in an `` tag.\n\n**Example:**\n\n\n class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }\n\nNew in 2022.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JavadocLinkAsPlainText",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 45,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonFinalClone",
+ "shortDescription": {
+ "text": "Non-final 'clone()' in secure context"
+ },
+ "fullDescription": {
+ "text": "Reports 'clone()' methods without the 'final' modifier. Since 'clone()' can be used to instantiate objects without using a constructor, allowing the 'clone()' method to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the 'clone()' method or the enclosing class itself 'final'. Example: 'class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }'",
+ "markdown": "Reports `clone()` methods without the `final` modifier.\n\n\nSince `clone()` can be used to instantiate objects without using a constructor, allowing the `clone()`\nmethod to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the\n`clone()` method or the enclosing class itself `final`.\n\n**Example:**\n\n\n class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonFinalClone",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 31,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SharedThreadLocalRandom",
+ "shortDescription": {
+ "text": "'ThreadLocalRandom' instance might be shared"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.util.concurrent.ThreadLocalRandom' instances which might be shared between threads. A 'ThreadLocalRandom' should not be shared between threads because that is not thread-safe. The inspection reports instances that are assigned to a field used as a method argument, or assigned to a local variable and used in anonymous or nested classes as they might get shared between threads. Usages of 'ThreadLocalRandom' should typically look like 'ThreadLocalRandom.current().nextInt(...)' (or 'nextDouble(...)' etc.). When all usages are in this form, 'ThreadLocalRandom' instances cannot be used accidentally by multiple threads. Example: 'class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }' Use the options to list methods that are safe to be passed to 'ThreadLocalRandom' instances as an argument. It's possible to use regular expressions for method names.",
+ "markdown": "Reports `java.util.concurrent.ThreadLocalRandom` instances which might be shared between threads.\n\n\nA `ThreadLocalRandom` should not be shared between threads because that is not thread-safe.\nThe inspection reports instances that are assigned to a field used as a method argument,\nor assigned to a local variable and used in anonymous or nested classes as they might get shared between threads.\n\n\nUsages of `ThreadLocalRandom` should typically look like `ThreadLocalRandom.current().nextInt(...)`\n(or `nextDouble(...)` etc.).\nWhen all usages are in this form, `ThreadLocalRandom` instances cannot be used accidentally by multiple threads.\n\n**Example:**\n\n\n class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }\n \n\nUse the options to list methods that are safe to be passed to `ThreadLocalRandom` instances as an argument.\nIt's possible to use regular expressions for method names."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SharedThreadLocalRandom",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ChainedEquality",
+ "shortDescription": {
+ "text": "Chained equality comparisons"
+ },
+ "fullDescription": {
+ "text": "Reports chained equality comparisons. Such comparisons may be confusing: 'a == b == c' means '(a == b) == c', but possibly 'a == b && a == c' is intended. Example: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }' You can use parentheses to make the comparison less confusing: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }'",
+ "markdown": "Reports chained equality comparisons.\n\nSuch comparisons may be confusing: `a == b == c` means `(a == b) == c`,\nbut possibly `a == b && a == c` is intended.\n\n**Example:**\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }\n\nYou can use parentheses to make the comparison less confusing:\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ChainedEqualityComparisons",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbstractMethodOverridesConcreteMethod",
+ "shortDescription": {
+ "text": "Abstract method overrides concrete method"
+ },
+ "fullDescription": {
+ "text": "Reports 'abstract' methods that override concrete super methods. Methods overridden from 'java.lang.Object' are not reported by this inspection.",
+ "markdown": "Reports `abstract` methods that override concrete super methods.\n\nMethods overridden from `java.lang.Object` are not reported by this inspection."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbstractMethodOverridesConcreteMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LossyConversionCompoundAssignment",
+ "shortDescription": {
+ "text": "Possibly lossy implicit cast in compound assignment"
+ },
+ "fullDescription": {
+ "text": "Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable. During such compound assignments, an implicit cast occurs, potentially resulting in lossy conversions. Example: 'long c = 1;\n c += 1.2;' After the quick-fix is applied: 'long c = 1;\n c += (long) 1.2;' New in 2023.2",
+ "markdown": "Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable.\n\n\nDuring such compound assignments, an implicit cast occurs, potentially resulting in lossy conversions.\n\nExample:\n\n\n long c = 1;\n c += 1.2;\n\nAfter the quick-fix is applied:\n\n\n long c = 1;\n c += (long) 1.2;\n\nNew in 2023.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "lossy-conversions",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThrowFromFinallyBlock",
+ "shortDescription": {
+ "text": "'throw' inside 'finally' block"
+ },
+ "fullDescription": {
+ "text": "Reports 'throw' statements inside 'finally' blocks. While occasionally intended, such 'throw' statements may conceal exceptions thrown from 'try'-'catch' and thus tremendously complicate the debugging process.",
+ "markdown": "Reports `throw` statements inside `finally` blocks.\n\nWhile occasionally intended, such `throw` statements may conceal exceptions thrown from `try`-`catch` and thus\ntremendously complicate the debugging process."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThrowFromFinallyBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StaticNonFinalField",
+ "shortDescription": {
+ "text": "'static', non-'final' field"
+ },
+ "fullDescription": {
+ "text": "Reports non-'final' 'static' fields. A quick-fix is available to add the 'final' modifier to a non-'final' 'static' field. This inspection doesn't check fields' mutability. For example, adding the 'final' modifier to a field that has a value being set somewhere will cause a compilation error. Use the Only report 'public' fields option so that the inspection reported only 'public' fields.",
+ "markdown": "Reports non-`final` `static` fields.\n\nA quick-fix is available to add the `final` modifier to a non-`final` `static` field.\n\nThis inspection doesn't check fields' mutability. For example, adding the `final` modifier to a field that has a value\nbeing set somewhere will cause a compilation error.\n\n\nUse the **Only report 'public' fields** option so that the inspection reported only `public` fields."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StaticNonFinalField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CodeBlock2Expr",
+ "shortDescription": {
+ "text": "Statement lambda can be replaced with expression lambda"
+ },
+ "fullDescription": {
+ "text": "Reports lambda expressions with code block bodies when expression-style bodies can be used instead. The result of the conversion is shorter and more clear. Example: 'Comparable c = o -> {return 0;};' After the quick-fix is applied: 'Comparable c = o -> 0;'",
+ "markdown": "Reports lambda expressions with code block bodies when expression-style bodies can be used instead. The result of the conversion is shorter and more clear.\n\nExample:\n\n\n Comparable c = o -> {return 0;};\n\nAfter the quick-fix is applied:\n\n\n Comparable c = o -> 0;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CodeBlock2Expr",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifyForEach",
+ "shortDescription": {
+ "text": "Simplifiable forEach() call"
+ },
+ "fullDescription": {
+ "text": "Reports 'forEach()' calls that can be replaced with a more concise method or from which intermediate steps can be extracted. Example: 'List findNStrings(List list, int n) {\n List other = new ArrayList<>();\n list.forEach(s -> {\n if(s.length() > n) other.add(s);\n });\n return other;\n }' After the quick-fix is applied: 'List findNStrings(List list, int n) {\n List other = list.stream()\n .filter(s -> s.length() > n)\n .collect(Collectors.toList());\n return other;\n }' This inspection only reports if the language level of the project or module is 8 or higher. New in 2017.3",
+ "markdown": "Reports `forEach()` calls that can be replaced with a more concise method or from which intermediate steps can be extracted.\n\n**Example:**\n\n\n List findNStrings(List list, int n) {\n List other = new ArrayList<>();\n list.forEach(s -> {\n if(s.length() > n) other.add(s);\n });\n return other;\n }\n\nAfter the quick-fix is applied:\n\n\n List findNStrings(List list, int n) {\n List other = list.stream()\n .filter(s -> s.length() > n)\n .collect(Collectors.toList());\n return other;\n }\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nNew in 2017.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "SimplifyForEach",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Since15",
+ "shortDescription": {
+ "text": "Usages of API which isn't available at the configured language level"
+ },
+ "fullDescription": {
+ "text": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things: Highlight usage of generified classes when the language level is below Java 7. Highlight when default methods are not overridden and the language level is below Java 8. Highlight usage of API when the language level is lower than marked using the '@since' tag in the documentation. Use the Forbid API usages option to forbid usages of the API in respect to the project or custom language level.",
+ "markdown": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things:\n\n* Highlight usage of generified classes when the language level is below Java 7.\n* Highlight when default methods are not overridden and the language level is below Java 8.\n* Highlight usage of API when the language level is lower than marked using the `@since` tag in the documentation.\n\n\nUse the **Forbid API usages** option to forbid usages of the API in respect to the project or custom language level."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "Since15",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EmptyMethod",
+ "shortDescription": {
+ "text": "Empty method"
+ },
+ "fullDescription": {
+ "text": "Reports empty methods that can be removed. Methods are considered empty if they are empty themselves and if they are overridden or implemented by empty methods only. Note that methods containing only comments and the 'super()' call with own parameters are also considered empty. The inspection ignores methods with special annotations, for example, the 'javax.ejb.Init' and 'javax.ejb.Remove' EJB annotations . The quick-fix safely removes unnecessary methods. Configure the inspection: Use the Comments and javadoc count as content option to select whether methods with comments should be treated as non-empty. Use the Additional special annotations option to configure additional annotations that should be ignored by this inspection.",
+ "markdown": "Reports empty methods that can be removed.\n\nMethods are considered empty if they are empty themselves and if they are overridden or\nimplemented by empty methods only. Note that methods containing only comments and the `super()` call with own parameters are\nalso considered empty.\n\nThe inspection ignores methods with special annotations, for example, the `javax.ejb.Init` and `javax.ejb.Remove` EJB annotations .\n\nThe quick-fix safely removes unnecessary methods.\n\nConfigure the inspection:\n\n* Use the **Comments and javadoc count as content** option to select whether methods with comments should be treated as non-empty.\n* Use the **Additional special annotations** option to configure additional annotations that should be ignored by this inspection."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EmptyMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantFieldInitialization",
+ "shortDescription": {
+ "text": "Redundant field initialization"
+ },
+ "fullDescription": {
+ "text": "Reports fields explicitly initialized to their default values. Example: 'class Foo {\n int foo = 0;\n List bar = null;\n }' After the quick-fix is applied: 'class Foo {\n int foo;\n List bar;\n }' Use the inspection settings to only report explicit 'null' initialization, for example: 'class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }'",
+ "markdown": "Reports fields explicitly initialized to their default values.\n\n**Example:**\n\n\n class Foo {\n int foo = 0;\n List bar = null;\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int foo;\n List bar;\n }\n\n\nUse the inspection settings to only report explicit `null` initialization, for example:\n\n\n class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantFieldInitialization",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifiableEqualsExpression",
+ "shortDescription": {
+ "text": "Unnecessary 'null' check before 'equals()' call"
+ },
+ "fullDescription": {
+ "text": "Reports comparisons to 'null' that are followed by a call to 'equals()' with a constant argument. Example: 'if (s != null && s.equals(\"literal\")) {}' After the quick-fix is applied: 'if (\"literal\".equals(s)) {}' Use the inspection settings to report 'equals()' calls with a non-constant argument when the argument to 'equals()' is proven not to be 'null'.",
+ "markdown": "Reports comparisons to `null` that are followed by a call to `equals()` with a constant argument.\n\n**Example:**\n\n\n if (s != null && s.equals(\"literal\")) {}\n\nAfter the quick-fix is applied:\n\n\n if (\"literal\".equals(s)) {}\n\n\nUse the inspection settings to report `equals()` calls with a non-constant argument\nwhen the argument to `equals()` is proven not to be `null`."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifiableEqualsExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonCommentSourceStatements",
+ "shortDescription": {
+ "text": "Overly long method"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose number of statements exceeds the specified maximum. Methods with too many statements may be confusing and are a good sign that refactoring is necessary. The following statements are not counted: empty statements (semicolons) block statements 'for' loop initialization statements, that is, 'int i = ...' within a 'for(int i = ...;...)' statement 'for' loop update statements, that is, 'i += 2' within a 'for(int i = ...;...; i += 2)' statement Use the Maximum statements per method field to specify the maximum allowed number of statements in a method.",
+ "markdown": "Reports methods whose number of statements exceeds the specified maximum.\n\nMethods with too many statements may be confusing and are a good sign that refactoring is necessary.\n\nThe following statements are not counted:\n\n* empty statements (semicolons)\n* block statements\n* `for` loop initialization statements, that is, `int i = ...` within a `for(int i = ...;...)` statement\n* `for` loop update statements, that is, `i += 2` within a `for(int i = ...;...; i += 2)` statement\n\nUse the **Maximum statements per method** field to specify the maximum allowed number of statements in a method."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyLongMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 93,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConfusingMainMethod",
+ "shortDescription": {
+ "text": "Confusing 'main()' method"
+ },
+ "fullDescription": {
+ "text": "Reports methods that are named \"main\", but do not have the 'public static void main(String[])' signature in Java up to 21. Starting from Java 21 Preview, inspection doesn't highlight in case of package-private, protected or instance main methods, also without parameters. Additionally main methods located in anonymous or local classes are reported. Anonymous and local classes do not have a fully qualified name and thus can't be run. Such methods may be confusing, as methods named \"main\" are expected to be application entry points. Example: 'class Main {\n void main(String[] args) {} // warning here because there are no \"public static\" modifiers\n }' A quick-fix that renames such methods is available only in the editor.",
+ "markdown": "Reports methods that are named \"main\", but do not have the `public static void main(String[])` signature in Java up to 21. Starting from Java 21 Preview, inspection doesn't highlight in case of package-private, protected or instance main methods, also without parameters. Additionally main methods located in anonymous or local classes are reported. Anonymous and local classes do not have a fully qualified name and thus can't be run.\n\nSuch methods may be confusing, as methods named \"main\"\nare expected to be application entry points.\n\n**Example:**\n\n\n class Main {\n void main(String[] args) {} // warning here because there are no \"public static\" modifiers\n }\n\nA quick-fix that renames such methods is available only in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConfusingMainMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReadObjectInitialization",
+ "shortDescription": {
+ "text": "Instance field may not be initialized by 'readObject()'"
+ },
+ "fullDescription": {
+ "text": "Reports fields that are not guaranteed to be initialized after the object is deserialized by the 'readObject()' method. The inspection doesn't report transient fields. Note: This inspection uses a very conservative control flow algorithm, and may incorrectly report fields as uninitialized. Example: 'class DataObject implements Serializable {\n String s; // s is not initialized in readObject\n int i;\n\n private void readObject(ObjectInputStream stream) throws IOException {\n i = stream.readInt();\n }\n}'",
+ "markdown": "Reports fields that are not guaranteed to be initialized after the object is deserialized by the `readObject()` method.\n\nThe inspection doesn't report transient fields.\n\n\nNote: This inspection uses a very conservative control flow algorithm, and may incorrectly report fields\nas uninitialized.\n\n**Example:**\n\n\n class DataObject implements Serializable {\n String s; // s is not initialized in readObject\n int i;\n\n private void readObject(ObjectInputStream stream) throws IOException {\n i = stream.readInt();\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstanceVariableMayNotBeInitializedByReadObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonAtomicOperationOnVolatileField",
+ "shortDescription": {
+ "text": "Non-atomic operation on 'volatile' field"
+ },
+ "fullDescription": {
+ "text": "Reports non-atomic operations on volatile fields. An example of a non-atomic operation is updating the field using the increment operator. As the operation involves read and write, and other modifications may happen in between, data may become corrupted. The operation can be made atomic by surrounding it with a 'synchronized' block or using one of the classes from the 'java.util.concurrent.atomic' package. Example: 'private volatile int v = 1;\n\n void foo() {\n v = 2 * v;\n }'",
+ "markdown": "Reports non-atomic operations on volatile fields.\n\n\nAn example of a non-atomic operation is updating the field using the increment operator.\nAs the operation involves read and write, and other modifications may happen in between, data may become corrupted.\nThe operation can be made atomic by surrounding it with a `synchronized` block or\nusing one of the classes from the `java.util.concurrent.atomic` package.\n\n**Example:**\n\n\n private volatile int v = 1;\n\n void foo() {\n v = 2 * v;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonAtomicOperationOnVolatileField",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "QuestionableName",
+ "shortDescription": {
+ "text": "Questionable name"
+ },
+ "fullDescription": {
+ "text": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards. Example: 'int aa = 42;' Rename quick-fix is suggested only in the editor. Use the option to list names that should be reported.",
+ "markdown": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards.\n\n**Example:**\n\n\n int aa = 42;\n\nRename quick-fix is suggested only in the editor.\n\n\nUse the option to list names that should be reported."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "QuestionableName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 51,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MultipleVariablesInDeclaration",
+ "shortDescription": {
+ "text": "Multiple variables in one declaration"
+ },
+ "fullDescription": {
+ "text": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable. Some coding standards prohibit such declarations. Example: 'int x = 1, y = 2;' After the quick-fix is applied: 'int x = 1;\n int y = 2;' Configure the inspection: Use the Ignore 'for' loop declarations option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example: 'for (int i = 0, max = list.size(); i > max; i++) {}' Use the Only warn on different array dimensions in a single declaration option to only warn when variables with different array dimensions are declared in a single declaration, for example: 'String s = \"\", array[];' New in 2019.2",
+ "markdown": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable.\n\nSome coding standards prohibit such declarations.\n\nExample:\n\n\n int x = 1, y = 2;\n\nAfter the quick-fix is applied:\n\n\n int x = 1;\n int y = 2;\n\nConfigure the inspection:\n\n* Use the **Ignore 'for' loop declarations** option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example:\n\n\n for (int i = 0, max = list.size(); i > max; i++) {}\n\n* Use the **Only warn on different array dimensions in a single declaration** option to only warn when variables with different array dimensions are declared in a single declaration, for example:\n\n\n String s = \"\", array[];\n\nNew in 2019.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MultipleVariablesInDeclaration",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IOResource",
+ "shortDescription": {
+ "text": "I/O resource opened but not safely closed"
+ },
+ "fullDescription": {
+ "text": "Reports I/O resources that are not safely closed. I/O resources checked by this inspection include 'java.io.InputStream', 'java.io.OutputStream', 'java.io.Reader', 'java.io.Writer', 'java.util.zip.ZipFile', 'java.io.Closeable' and 'java.io.RandomAccessFile'. I/O resources wrapped by other I/O resources are not reported, as the wrapped resource will be closed by the wrapping resource. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void save() throws IOException {\n FileWriter writer = new FileWriter(\"filename.txt\"); //warning\n writer.write(\"sample\");\n }' Use the following options to configure the inspection: List I/O resource classes that do not need to be closed and should be ignored by this inspection. Whether an I/O 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 I/O resources that are not safely closed. I/O resources checked by this inspection include `java.io.InputStream`, `java.io.OutputStream`, `java.io.Reader`, `java.io.Writer`, `java.util.zip.ZipFile`, `java.io.Closeable` and `java.io.RandomAccessFile`.\n\n\nI/O resources wrapped by other I/O resources are not reported, as the wrapped resource will be closed by the wrapping 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 save() throws IOException {\n FileWriter writer = new FileWriter(\"filename.txt\"); //warning\n writer.write(\"sample\");\n }\n\n\nUse the following options to configure the inspection:\n\n* List I/O resource classes that do not need to be closed and should be ignored by this inspection.\n* Whether an I/O 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": "IOResourceOpenedButNotSafelyClosed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 47,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantLengthCheck",
+ "shortDescription": {
+ "text": "Redundant array length check"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly. Example: 'void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }' A quick-fix is suggested to unwrap or remove the length check: 'void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }' New in 2022.3",
+ "markdown": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly.\n\nExample:\n\n\n void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }\n\nA quick-fix is suggested to unwrap or remove the length check:\n\n\n void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantLengthCheck",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UNCHECKED_WARNING",
+ "shortDescription": {
+ "text": "Unchecked warning"
+ },
+ "fullDescription": {
+ "text": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger 'ClassCastException' at runtime. Example: 'List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment'",
+ "markdown": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger `ClassCastException` at runtime.\n\nExample:\n\n\n List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "unchecked",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Compiler issues",
+ "index": 87,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DataFlowIssue",
+ "shortDescription": {
+ "text": "Nullability and data flow problems"
+ },
+ "fullDescription": {
+ "text": "Reports code constructs that always violate nullability contracts, may throw exceptions, or are just redundant, based on data flow analysis. Examples: 'if (array.length < index) {\n System.out.println(array[index]);\n} // Array index is always out of bounds\n\nif (str == null) System.out.println(\"str is null\");\nSystem.out.println(str.trim());\n// the last statement may throw an NPE\n\n@NotNull\nInteger square(@Nullable Integer input) {\n // the method contract is violated\n return input == null ? null : input * input;\n}' The inspection behavior may be controlled by a number of annotations, such as nullability annotations, '@Contract' annotation, '@Range' annotation and so on. Configure the inspection: Use the Suggest @Nullable annotation for methods/fields/parameters where nullable values are used option to warn when a nullable value is passed as an argument to a method with a non-annotated parameter, stored into non-annotated field, or returned from a non-annotated method. In this case, the inspection will suggest propagating the '@Nullable' annotation. You can also configure nullability annotations using the Configure Annotations button. Use the Treat non-annotated members and parameters as @Nullable option to assume that non-annotated members can be null, so they must not be used in non-null context. Use the Report not-null required parameter with null-literal argument usages option to report method parameters that cannot be null (e.g. immediately dereferenced in the method body), but there are call sites where a 'null' literal is passed. Use the Report nullable methods that always return a non-null value option to report methods that are annotated as '@Nullable', but always return non-null value. In this case, it's suggested that you change the annotation to '@NotNull'. Use the Ignore assert statements option to control how the inspection treats 'assert' statements. By default, the option is disabled, which means that the assertions are assumed to be executed (-ea mode). If the option is enabled, the assertions will be completely ignored (-da mode). Use the Report problems that happen only on some code paths option to control whether to report problems that may happen only on some code path. If this option is disabled, warnings like exception is possible will not be reported. The inspection will report only warnings like exception will definitely occur. This mode may greatly reduce the number of false-positives, especially if the code is not consistently annotated with nullability and contract annotations. That is why it can be useful for finding the most important problems in legacy code bases. Before IntelliJ IDEA 2022.3, this inspection was part of the \"Constant Conditions & Exceptions\" inspection. Now, it is split into two inspections: \"Constant Values\" and \"Nullability and data flow problems\".",
+ "markdown": "Reports code constructs that always violate nullability contracts, may throw exceptions, or are just redundant, based on data flow analysis.\n\nExamples:\n\n if (array.length < index) {\n System.out.println(array[index]);\n } // Array index is always out of bounds\n\n if (str == null) System.out.println(\"str is null\");\n System.out.println(str.trim());\n // the last statement may throw an NPE\n\n @NotNull\n Integer square(@Nullable Integer input) {\n // the method contract is violated\n return input == null ? null : input * input;\n }\n\n\nThe inspection behavior may be controlled by a number of annotations, such as\n[nullability](https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html) annotations,\n[@Contract](https://www.jetbrains.com/help/idea/contract-annotations.html) annotation,\n`@Range` annotation and so on.\n\nConfigure the inspection:\n\n* Use the **Suggest @Nullable annotation for methods/fields/parameters where nullable values are used** option to warn when a nullable value is passed as an argument to a method with a non-annotated parameter, stored into non-annotated field, or returned from a non-annotated method. In this case, the inspection will suggest propagating the `@Nullable` annotation. You can also configure nullability annotations using the **Configure Annotations** button.\n* Use the **Treat non-annotated members and parameters as @Nullable** option to assume that non-annotated members can be null, so they must not be used in non-null context.\n* Use the **Report not-null required parameter with null-literal argument usages** option to report method parameters that cannot be null (e.g. immediately dereferenced in the method body), but there are call sites where a `null` literal is passed.\n* Use the **Report nullable methods that always return a non-null value** option to report methods that are annotated as `@Nullable`, but always return non-null value. In this case, it's suggested that you change the annotation to `@NotNull`.\n* Use the **Ignore assert statements** option to control how the inspection treats `assert` statements. By default, the option is disabled, which means that the assertions are assumed to be executed (-ea mode). If the option is enabled, the assertions will be completely ignored (-da mode).\n* Use the **Report problems that happen only on some code paths** option to control whether to report problems that may happen only on some code path. If this option is disabled, warnings like *exception is possible* will not be reported. The inspection will report only warnings like *exception will definitely occur*. This mode may greatly reduce the number of false-positives, especially if the code is not consistently annotated with nullability and contract annotations. That is why it can be useful for finding the most important problems in legacy code bases.\n\n\nBefore IntelliJ IDEA 2022.3, this inspection was part of the \"Constant Conditions \\& Exceptions\" inspection.\nNow, it is split into two inspections:\n\"Constant Values\" and \"Nullability and data flow problems\"."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DataFlowIssue",
+ "cweIds": [
+ 129,
+ 252,
+ 253,
+ 394,
+ 395,
+ 476,
+ 570,
+ 571,
+ 690
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterCanBeLocal",
+ "shortDescription": {
+ "text": "Value passed as parameter never read"
+ },
+ "fullDescription": {
+ "text": "Reports redundant method parameters that can be replaced with local variables. If all local usages of a parameter are preceded by assignments to that parameter, the parameter can be removed and its usages replaced with local variables. It makes no sense to have such a parameter, as values that are passed to it are overwritten. Usually, the problem appears as a result of refactoring. Example: 'void test(int p) {\n p = 1;\n System.out.print(p);\n }' After the quick-fix is applied: 'void test() {\n int p = 1;\n System.out.print(p);\n }'",
+ "markdown": "Reports redundant method parameters that can be replaced with local variables.\n\nIf all local usages of a parameter are preceded by assignments to that parameter, the\nparameter can be removed and its usages replaced with local variables.\nIt makes no sense to have such a parameter, as values that are passed to it are overwritten.\nUsually, the problem appears as a result of refactoring.\n\nExample:\n\n\n void test(int p) {\n p = 1;\n System.out.print(p);\n }\n\nAfter the quick-fix is applied:\n\n\n void test() {\n int p = 1;\n System.out.print(p);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ParameterCanBeLocal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CallToSimpleGetterInClass",
+ "shortDescription": {
+ "text": "Call to simple getter from within class"
+ },
+ "fullDescription": {
+ "text": "Reports calls to a simple property getter from within the property's class. A simple property getter is defined as one which simply returns the value of a field, and does no other calculations. Such simple getter calls can be safely inlined using the quick-fix. Some coding standards also suggest against the use of simple getters for code clarity reasons. Example: 'public class Salient {\n private String name;\n\n public String getName() {\n return name;\n }\n\n @Override\n public String toString() {\n return getName();\n }\n }' After the quick-fix is applied: 'public class Salient {\n private String name;\n\n public String getName() {\n return name;\n }\n\n @Override\n public String toString() {\n return name;\n }\n }' Use the following options to configure the inspection: Whether to only report getter calls on 'this', not on objects of the same type passed in as a parameter. Whether to ignore non-'private' getters.",
+ "markdown": "Reports calls to a simple property getter from within the property's class.\n\n\nA simple property getter is defined as one which simply returns the value of a field,\nand does no other calculations. Such simple getter calls can be safely inlined using the quick-fix.\nSome coding standards also suggest against the use of simple getters for code clarity reasons.\n\n**Example:**\n\n\n public class Salient {\n private String name;\n\n public String getName() {\n return name;\n }\n\n @Override\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Salient {\n private String name;\n\n public String getName() {\n return name;\n }\n\n @Override\n public String toString() {\n return name;\n }\n }\n\nUse the following options to configure the inspection:\n\n* Whether to only report getter calls on `this`, not on objects of the same type passed in as a parameter.\n* Whether to ignore non-`private` getters."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToSimpleGetterFromWithinClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SwitchStatementDensity",
+ "shortDescription": {
+ "text": "'switch' statement with too low of a branch density"
+ },
+ "fullDescription": {
+ "text": "Reports 'switch' statements or expressions with a too low ratio of switch labels to executable statements. Such 'switch' statements may be confusing and should probably be refactored. Example: 'switch (i) { // one case and 5 executable statements -> 20% density\n case 1:\n System.out.println(\"1\");\n System.out.println(\"2\");\n System.out.println(\"3\");\n System.out.println(\"4\");\n System.out.println(\"5\");\n break;\n }' Use the Minimum density of branches field to specify the allowed ratio of the switch labels to executable statements.",
+ "markdown": "Reports `switch` statements or expressions with a too low ratio of switch labels to executable statements.\n\nSuch `switch` statements\nmay be confusing and should probably be refactored.\n\nExample:\n\n\n switch (i) { // one case and 5 executable statements -> 20% density\n case 1:\n System.out.println(\"1\");\n System.out.println(\"2\");\n System.out.println(\"3\");\n System.out.println(\"4\");\n System.out.println(\"5\");\n break;\n }\n\n\nUse the **Minimum density of branches** field to specify the allowed ratio of the switch labels to executable statements."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SwitchStatementDensity",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonSerializableFieldInSerializableClass",
+ "shortDescription": {
+ "text": "Non-serializable field in a 'Serializable' class"
+ },
+ "fullDescription": {
+ "text": "Reports non-serializable fields in classes that implement 'java.io.Serializable'. Such fields will result in runtime exceptions if the object is serialized. Fields declared 'transient' or 'static' are not reported, nor are fields of classes that have a 'writeObject' method defined. This inspection assumes fields of the types 'java.util.Collection' and 'java.util.Map' to be 'Serializable', unless the types they are declared in are non-'Serializable'. Example: 'class NonSerializableClass {}\n\n public class SerializableClass implements Serializable {\n NonSerializableClass clazz; // warning: Non-serializable field 'clazz' in a Serializable class\n static NonSerializableClass staticClazz; // no warnings\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. List annotations that will make the inspection ignore the annotated fields. Whether to ignore fields initialized with an anonymous class.",
+ "markdown": "Reports non-serializable fields in classes that implement `java.io.Serializable`. Such fields will result in runtime exceptions if the object is serialized.\n\n\nFields declared\n`transient` or `static`\nare not reported, nor are fields of classes that have a `writeObject` method defined.\n\n\nThis inspection assumes fields of the types\n`java.util.Collection` and\n`java.util.Map` to be\n`Serializable`, unless the types\nthey are declared in are non-`Serializable`.\n\n**Example:**\n\n\n class NonSerializableClass {}\n\n public class SerializableClass implements Serializable {\n NonSerializableClass clazz; // warning: Non-serializable field 'clazz' in a Serializable class\n static NonSerializableClass staticClazz; // no warnings\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* List annotations that will make the inspection ignore the annotated fields.\n* Whether to ignore fields initialized with an anonymous class."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonSerializableFieldInSerializableClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MismatchedJavadocCode",
+ "shortDescription": {
+ "text": "Mismatch between Javadoc and code"
+ },
+ "fullDescription": {
+ "text": "Reports parts of method specification written in English that contradict with the method declaration. This includes: Method specified to return 'true' or 'false' but its return type is not boolean. Method specified to return 'null' but it's annotated as '@NotNull' or its return type is primitive. Method specified to return list but its return type is set or array. And so on. Example: '/**\n * @return true if user is found, false otherwise\n */\n User findUser(String name);' Note that false-positives are possible, as this inspection tries to interpret a human language. However, if the inspection reports incorrectly, it's still possible that the description is confusing and should be rewritten. New in 2022.3",
+ "markdown": "Reports parts of method specification written in English that contradict with the method declaration. This includes:\n\n* Method specified to return `true` or `false` but its return type is not boolean.\n* Method specified to return `null` but it's annotated as `@NotNull` or its return type is primitive.\n* Method specified to return list but its return type is set or array.\n* And so on.\n\n**Example:**\n\n\n /**\n * @return true if user is found, false otherwise\n */\n User findUser(String name);\n\n\nNote that false-positives are possible, as this inspection tries to interpret a human language. However, if the inspection reports\nincorrectly, it's still possible that the description is confusing and should be rewritten.\n\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MismatchedJavadocCode",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 45,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EnhancedSwitchMigration",
+ "shortDescription": {
+ "text": "Statement can be replaced with enhanced 'switch'"
+ },
+ "fullDescription": {
+ "text": "Reports 'switch' statements that can be automatically replaced with enhanced 'switch' statements or expressions. Example: 'double getPrice(String fruit) {\n // Switch statement can be replaced with enhanced 'switch'\n switch (fruit) {\n case \"Apple\":\n return 1.0;\n case \"Orange\":\n return 1.5;\n case \"Mango\":\n return 2.0;\n default:\n throw new IllegalArgumentException();\n }\n }' After the quick-fix is applied: 'double getPrice(String fruit) {\n return switch (fruit) {\n case \"Apple\" -> 1.0;\n case \"Orange\" -> 1.5;\n case \"Mango\" -> 2.0;\n default -> throw new IllegalArgumentException();\n };\n }' Use the Show warning only if conversion to expression is possible option not to warn about conversion to 'switch' statement. Use the Maximum number of statements in one branch to convert to switch expression option warn about conversion to expression only if each branch has less than the given number of statements. This inspection only reports if the language level of the project or module is 14 or higher New in 2019.1",
+ "markdown": "Reports `switch` statements that can be automatically replaced with enhanced `switch` statements or expressions.\n\n**Example:**\n\n\n double getPrice(String fruit) {\n // Switch statement can be replaced with enhanced 'switch'\n switch (fruit) {\n case \"Apple\":\n return 1.0;\n case \"Orange\":\n return 1.5;\n case \"Mango\":\n return 2.0;\n default:\n throw new IllegalArgumentException();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n double getPrice(String fruit) {\n return switch (fruit) {\n case \"Apple\" -> 1.0;\n case \"Orange\" -> 1.5;\n case \"Mango\" -> 2.0;\n default -> throw new IllegalArgumentException();\n };\n }\n \n\n* Use the **Show warning only if conversion to expression is possible** option not to warn about conversion to `switch` statement.\n* Use the **Maximum number of statements in one branch to convert to switch expression** option warn about conversion to expression only if each branch has less than the given number of statements.\n\nThis inspection only reports if the language level of the project or module is 14 or higher\n\nNew in 2019.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EnhancedSwitchMigration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 14",
+ "index": 99,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimplifiableAnnotation",
+ "shortDescription": {
+ "text": "Simplifiable annotation"
+ },
+ "fullDescription": {
+ "text": "Reports annotations that can be simplified to their single-element or marker shorthand form. Problems reported: Redundant 'value=' in annotation name-value pairs Redundant braces around array values that contain only a single value Redundant whitespace between the @-sign and the name of annotations Redundant whitespace between annotation names and parameter lists Redundant parentheses in annotations without any parameters Example: '@interface Foo { String[] value(); }\n\n @ Foo({\"foo\"})\n public String name;' After the quick-fix is applied: '@interface Foo { String[] value(); }\n\n @Foo(\"foo\")\n public String name;'",
+ "markdown": "Reports annotations that can be simplified to their single-element or marker shorthand form.\n\n\nProblems reported:\n\n* Redundant `value=` in annotation name-value pairs\n* Redundant braces around array values that contain only a single value\n* Redundant whitespace between the @-sign and the name of annotations\n* Redundant whitespace between annotation names and parameter lists\n* Redundant parentheses in annotations without any parameters\n\n**Example:**\n\n\n @interface Foo { String[] value(); }\n\n @ Foo({\"foo\"})\n public String name;\n\nAfter the quick-fix is applied:\n\n\n @interface Foo { String[] value(); }\n\n @Foo(\"foo\")\n public String name;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimplifiableAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DoubleLiteralMayBeFloatLiteral",
+ "shortDescription": {
+ "text": "Cast to 'float' can be 'float' literal"
+ },
+ "fullDescription": {
+ "text": "Reports 'double' literal expressions that are immediately cast to 'float'. Such literal expressions can be replaced with equivalent 'float' literals. Example: 'float f = (float)1.1;' After the quick-fix is applied: 'float f = 1.1f;'",
+ "markdown": "Reports `double` literal expressions that are immediately cast to `float`.\n\nSuch literal expressions can be replaced with equivalent `float` literals.\n\n**Example:**\n\n float f = (float)1.1;\n\nAfter the quick-fix is applied:\n\n float f = 1.1f;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DoubleLiteralMayBeFloatLiteral",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues/Cast",
+ "index": 101,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Guava",
+ "shortDescription": {
+ "text": "Guava's functional primitives can be replaced with Java"
+ },
+ "fullDescription": {
+ "text": "Reports usages of Guava's functional primitives that can be migrated to standard Java API calls. For example, the inspection reports usages of classes and interfaces like 'FluentIterable', 'Optional', 'Function', 'Predicate', or 'Supplier'. Example: 'ImmutableList results = FluentIterable.from(List.of(1, 2, 3)).transform(Object::toString).toList();' After the quick-fix is applied: 'List results = List.of(1, 2, 3).stream().map(Object::toString).collect(Collectors.toList());' The quick-fix may change the semantics. Some lazy-evaluated Guava's iterables can be transformed to eager-evaluated. This inspection only reports if the language level of the project or module is 8 or higher.",
+ "markdown": "Reports usages of Guava's functional primitives that can be migrated to standard Java API calls.\n\nFor example, the inspection reports usages of classes and interfaces like `FluentIterable`, `Optional`, `Function`,\n`Predicate`, or `Supplier`.\n\nExample:\n\n\n ImmutableList results = FluentIterable.from(List.of(1, 2, 3)).transform(Object::toString).toList();\n\nAfter the quick-fix is applied:\n\n\n List results = List.of(1, 2, 3).stream().map(Object::toString).collect(Collectors.toList());\n\n\nThe quick-fix may change the semantics. Some lazy-evaluated Guava's iterables can be transformed to eager-evaluated.\n\nThis inspection only reports if the language level of the project or module is 8 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Guava",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NoopMethodInAbstractClass",
+ "shortDescription": {
+ "text": "No-op method in 'abstract' class"
+ },
+ "fullDescription": {
+ "text": "Reports no-op (for \"no operation\") methods in 'abstract' classes. It is usually a better design to make such methods 'abstract' themselves so that classes inheriting these methods provide their implementations. Example: 'abstract class Test {\n protected void doTest() {\n }\n }'",
+ "markdown": "Reports no-op (for \"no operation\") methods in `abstract` classes.\n\nIt is usually a better\ndesign to make such methods `abstract` themselves so that classes inheriting these\nmethods provide their implementations.\n\n**Example:**\n\n\n abstract class Test {\n protected void doTest() {\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NoopMethodInAbstractClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverloadedMethodsWithSameNumberOfParameters",
+ "shortDescription": {
+ "text": "Overloaded methods with same number of parameters"
+ },
+ "fullDescription": {
+ "text": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called. Example: 'class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }' Use the option to ignore overloaded methods whose parameter types are definitely incompatible.",
+ "markdown": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called.\n\n**Example:**\n\n\n class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }\n\n\nUse the option to ignore overloaded methods whose parameter types are definitely incompatible."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverloadedMethodsWithSameNumberOfParameters",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 85,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverridableMethodCallDuringObjectConstruction",
+ "shortDescription": {
+ "text": "Overridable method called during object construction"
+ },
+ "fullDescription": {
+ "text": "Reports calls to overridable 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 Methods are overridable if they are not declared as 'final', 'static', or 'private'. Package-local methods are considered safe, even though they are overridable. Such calls may result in subtle bugs, as object initialization may happen before the method call. Example: 'class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n }' This inspection shares the functionality with the following inspections: Abstract 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 overridable 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* Methods are overridable if they are not declared as `final`, `static`, or `private`. Package-local methods are considered safe, even though they are overridable. Such calls may result in subtle bugs, as object initialization may happen before the method call.\n* **Example:**\n\n\n class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n }\n\n* This inspection shares the functionality with the following inspections:\n * Abstract method called during object construction\n * Overridden method called during object construction\n* Only one inspection should be enabled at once to prevent warning duplication."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverridableMethodCallDuringObjectConstruction",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 29,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverlyLongLambda",
+ "shortDescription": {
+ "text": "Overly long lambda expression"
+ },
+ "fullDescription": {
+ "text": "Reports lambda expressions whose number of statements exceeds the specified maximum. Lambda expressions that are too long may be confusing, and it is often better to extract the statements into a separate method. The following statements are not counted: empty statements (semicolons) block statements 'for' loop initialization statements, that is, 'int i = ...' within a 'for(int i = ...;...)' statement 'for' loop update statements, that is, 'i += 2' within a 'for(int i = ...;...; i += 2)' statement Use the Non-comment source statements limit field to specify the maximum allowed number of statements in a lambda expression.",
+ "markdown": "Reports lambda expressions whose number of statements exceeds the specified maximum.\n\nLambda expressions that are too long may be confusing, and it is often better to extract the statements into a separate method.\n\n\nThe following statements are not counted:\n\n* empty statements (semicolons)\n* block statements\n* `for` loop initialization statements, that is, `int i = ...` within a `for(int i = ...;...)` statement\n* `for` loop update statements, that is, `i += 2` within a `for(int i = ...;...; i += 2)` statement\n\nUse the **Non-comment source statements limit** field to specify the maximum allowed number of statements in a lambda expression."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyLongLambda",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 93,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingDeprecatedAnnotation",
+ "shortDescription": {
+ "text": "Missing '@Deprecated' annotation"
+ },
+ "fullDescription": {
+ "text": "Reports module declarations, classes, fields, or methods that have the '@deprecated' Javadoc tag but do not have the '@java.lang.Deprecated' annotation. Example: '/**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }' After the quick-fix is applied: '/**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }' This inspection reports only if the language level of the project or module is 5 or higher. Use the checkbox below to report members annotated with '@Deprecated' without an explanation in a Javadoc '@deprecated' tag.",
+ "markdown": "Reports module declarations, classes, fields, or methods that have the `@deprecated` Javadoc tag but do not have the `@java.lang.Deprecated` annotation.\n\n**Example:**\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }\n\nAfter the quick-fix is applied:\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }\n\nThis inspection reports only if the language level of the project or module is 5 or higher.\n\n\nUse the checkbox below to report members annotated with `@Deprecated` without\nan explanation in a Javadoc `@deprecated` tag."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MissingDeprecatedAnnotation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 45,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParametersPerMethod",
+ "shortDescription": {
+ "text": "Method with too many parameters"
+ },
+ "fullDescription": {
+ "text": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary. Methods that have super methods are not reported. Use the Parameter limit field to specify the maximum allowed number of parameters for a method.",
+ "markdown": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary.\n\nMethods that have super methods are not reported.\n\nUse the **Parameter limit** field to specify the maximum allowed number of parameters for a method."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodWithTooManyParameters",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 93,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ImplicitCallToSuper",
+ "shortDescription": {
+ "text": "Implicit call to 'super()'"
+ },
+ "fullDescription": {
+ "text": "Reports constructors that do not begin with a call to \"super\" constructor or another constructor of the same class. Such constructors can be thought of as implicitly beginning with a call to 'super()'. Some coding standards prefer that such calls to 'super()' be made explicitly. Example: 'class Foo {\n Foo() {}\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n super();\n }\n }' Use the inspection settings to ignore classes extending directly from 'Object'. For instance: 'class Foo {\n Foo() {} // Not reported\n }\n\n class Bar extends Foo {\n Bar() {} // Implicit call to 'super()'\n }'",
+ "markdown": "Reports constructors that do not begin with a call to \"super\" constructor or another constructor of the same class.\n\nSuch constructors can be thought of as implicitly beginning with a\ncall to `super()`. Some coding standards prefer that such calls to\n`super()` be made explicitly.\n\n**Example:**\n\n\n class Foo {\n Foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\n\nUse the inspection settings to ignore classes extending directly from `Object`.\nFor instance:\n\n\n class Foo {\n Foo() {} // Not reported\n }\n\n class Bar extends Foo {\n Bar() {} // Implicit call to 'super()'\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ImplicitCallToSuper",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringTemplateMigration",
+ "shortDescription": {
+ "text": "String template can be used"
+ },
+ "fullDescription": {
+ "text": "Reports 'String' concatenations that can be simplified by replacing them with the string template. Example: 'String name = \"Bob\";\n String greeting = \"Hello, \" + name + \". You are \" + 29 + \" years old.\";' After the quick-fix is applied: 'String name = \"Bob\";\n String greeting = STR.\"Hello, \\{name}. You are 29 years old.\";' This inspection only reports if the language level of the project or module is 21 or higher. New in 2023.3",
+ "markdown": "Reports `String` concatenations that can be simplified by replacing them with the string template.\n\n**Example:**\n\n\n String name = \"Bob\";\n String greeting = \"Hello, \" + name + \". You are \" + 29 + \" years old.\";\n\nAfter the quick-fix is applied:\n\n\n String name = \"Bob\";\n String greeting = STR.\"Hello, \\{name}. You are 29 years old.\";\n\nThis inspection only reports if the language level of the project or module is 21 or higher.\n\nNew in 2023.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringTemplateMigration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 21",
+ "index": 102,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MustAlreadyBeRemovedApi",
+ "shortDescription": {
+ "text": "API must already be removed"
+ },
+ "fullDescription": {
+ "text": "Reports declarations marked with '@ApiStatus.ScheduledForRemoval' that should have been removed in the current version of the declaring library. It compares the specified scheduled removal version with the version that you can set below. Specify the version as a string separated with dots and optionally postfixed with 'alpha', 'beta', 'snapshot', or 'eap'. Examples of valid versions: '1.0', '2.3.1', '2018.1', '7.5-snapshot', '3.0-eap'. Version comparison is intuitive: '1.0 < 2.0', '1.0-eap < 1.0', '2.3-snapshot < 2.3' and so on. For detailed comparison logic, refer to the implementation of VersionComparatorUtil.",
+ "markdown": "Reports declarations marked with `@ApiStatus.ScheduledForRemoval` that should have been removed in the current version of the declaring library.\n\nIt compares the specified scheduled removal version with the version that you can set below.\n\n\nSpecify the version as a string separated with dots and optionally postfixed with\n`alpha`, `beta`, `snapshot`, or `eap`.\n\nExamples of valid versions: `1.0`, `2.3.1`, `2018.1`, `7.5-snapshot`, `3.0-eap`.\n\n\nVersion comparison is intuitive: `1.0 < 2.0`, `1.0-eap < 1.0`, `2.3-snapshot < 2.3` and so on.\nFor detailed comparison logic, refer to the implementation of [VersionComparatorUtil](https://github.com/JetBrains/intellij-community/blob/master/platform/util-rt/src/com/intellij/util/text/VersionComparatorUtil.java)."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "MustAlreadyBeRemovedApi",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CachedNumberConstructorCall",
+ "shortDescription": {
+ "text": "Number constructor call with primitive argument"
+ },
+ "fullDescription": {
+ "text": "Reports instantiations of new 'Long', 'Integer', 'Short', or 'Byte' objects that have a primitive 'long', 'integer', 'short', or 'byte' argument. It is recommended that you use the static method 'valueOf()' introduced in Java 5. By default, this method caches objects for values between -128 and 127 inclusive. Example: 'Integer i = new Integer(1);\n Long l = new Long(1L);' After the quick-fix is applied, the code changes to: 'Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);' This inspection only reports if the language level of the project or module is 5 or higher Use the Ignore new number expressions with a String argument option to ignore calls to number constructors with a 'String' argument. Use the Report only when constructor is @Deprecated option to only report calls to deprecated constructors. 'Long', 'Integer', 'Short' and 'Byte' constructors are deprecated since JDK 9.",
+ "markdown": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CachedNumberConstructorCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CloneDeclaresCloneNotSupported",
+ "shortDescription": {
+ "text": "'clone()' does not declare 'CloneNotSupportedException'"
+ },
+ "fullDescription": {
+ "text": "Reports 'clone()' methods that do not declare 'throws CloneNotSupportedException'. If 'throws CloneNotSupportedException' is not declared, the method's subclasses will not be able to prohibit cloning in the standard way. This inspection does not report 'clone()' methods declared 'final' and 'clone()' methods on 'final' classes. Configure the inspection: Use the Only warn on 'protected' clone methods option to indicate that this inspection should only warn on 'protected clone()' methods. The Effective Java book (second and third edition) recommends omitting the 'CloneNotSupportedException' declaration on 'public' methods, because the methods that do not throw checked exceptions are easier to use. Example: 'public class Example implements Cloneable {\n // method doesn't declare 'throws CloneNotSupportedException'\n protected Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n return null;\n }\n }\n }'",
+ "markdown": "Reports `clone()` methods that do not declare `throws CloneNotSupportedException`.\n\nIf `throws CloneNotSupportedException` is not declared, the method's subclasses will not be able to prohibit cloning\nin the standard way. This inspection does not report `clone()` methods declared `final`\nand `clone()` methods on `final` classes.\n\nConfigure the inspection:\n\nUse the **Only warn on 'protected' clone methods** option to indicate that this inspection should only warn on `protected clone()` methods.\nThe *Effective Java* book (second and third edition) recommends omitting the `CloneNotSupportedException`\ndeclaration on `public` methods, because the methods that do not throw checked exceptions are easier to use.\n\nExample:\n\n\n public class Example implements Cloneable {\n // method doesn't declare 'throws CloneNotSupportedException'\n protected Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n return null;\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CloneDoesntDeclareCloneNotSupportedException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Cloning issues",
+ "index": 79,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BooleanExpressionMayBeConditional",
+ "shortDescription": {
+ "text": "Boolean expression could be replaced with conditional expression"
+ },
+ "fullDescription": {
+ "text": "Reports any 'boolean' expressions which can be formulated in a more compact and, arguably, clear way than by using a conditional expression. Use the quick-fix to replace the 'boolean' expression by a conditional expression. Example: 'a && b || !a && c;' After the quick-fix is applied: 'a ? b : c;'",
+ "markdown": "Reports any `boolean` expressions which can be formulated in a more compact and, arguably, clear way than by using a conditional expression.\n\nUse the quick-fix to replace the `boolean` expression by a conditional expression.\n\n**Example:**\n\n\n a && b || !a && c;\n\nAfter the quick-fix is applied:\n\n\n a ? b : c;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "BooleanExpressionMayBeConditional",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FieldHidesSuperclassField",
+ "shortDescription": {
+ "text": "Subclass field hides superclass field"
+ },
+ "fullDescription": {
+ "text": "Reports fields in a derived class that are named identically a field of a superclass. Java fields cannot be overridden in derived classes, so the field in the derived class will hide the field from the superclass. As a result of such naming, you may accidentally use the field of the derived class where the identically named field of a base class is intended. A quick-fix is suggested to rename the field in the derived class. Example: 'class Parent {\n Parent parent;\n}\nclass Child extends Parent {\n Child parent;\n}' You can configure the following options for this inspection: Ignore non-accessible fields - indicates whether this inspection should report all name clashes, or only clashes with fields which are visible from the subclass. Ignore static fields hiding static fields - ignore 'static' fields which hide 'static' fields in base classes.",
+ "markdown": "Reports fields in a derived class that are named identically a field of a superclass. Java fields cannot be overridden in derived classes, so the field in the derived class will hide the field from the superclass.\n\n\nAs a result of such naming, you may accidentally use the field of the derived class\nwhere the identically named field of a base class is intended.\n\nA quick-fix is suggested to rename the field in the derived class.\n\n**Example:**\n\n class Parent {\n Parent parent;\n }\n class Child extends Parent {\n Child parent;\n }\n\n\nYou can configure the following options for this inspection:\n\n1. **Ignore non-accessible fields** - indicates whether this inspection should report all name clashes, or only clashes with fields which are visible from the subclass.\n2. **Ignore static fields hiding static fields** - ignore `static` fields which hide `static` fields in base classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FieldNameHidesFieldInSuperclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryExplicitNumericCast",
+ "shortDescription": {
+ "text": "Unnecessary explicit numeric cast"
+ },
+ "fullDescription": {
+ "text": "Reports primitive numeric casts that would be inserted implicitly by the compiler. Also, reports any primitive numeric casts that the compiler will remove. Example: 'int x = (short)5; // The cast will be removed by the javac tool' After the quick-fix is applied: 'int x = 5;'",
+ "markdown": "Reports primitive numeric casts that would be inserted implicitly by the compiler. Also, reports any primitive numeric casts that the compiler will remove.\n\n**Example:**\n\n int x = (short)5; // The cast will be removed by the javac tool\n\nAfter the quick-fix is applied:\n`int x = 5;`"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryExplicitNumericCast",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues/Cast",
+ "index": 101,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SimpleDateFormatWithoutLocale",
+ "shortDescription": {
+ "text": "'SimpleDateFormat' without locale"
+ },
+ "fullDescription": {
+ "text": "Reports instantiations of 'java.util.SimpleDateFormat' or 'java.time.format.DateTimeFormatter' that do not specify a 'java.util.Locale'. These calls will use the platform default locale, which depends on the OS settings. This can lead to surprising behaviour when the code is run on a different platform or the OS settings are changed. 'Example:' 'new SimpleDateFormat(\"yyyy\");\n DateTimeFormatter.ofPattern(\"d/M/y\");'",
+ "markdown": "Reports instantiations of `java.util.SimpleDateFormat` or `java.time.format.DateTimeFormatter` that do not specify a `java.util.Locale`. These calls will use the platform default locale, which depends on the OS settings. This can lead to surprising behaviour when the code is run on a different platform or the OS settings are changed.\n\n`Example:`\n\n\n new SimpleDateFormat(\"yyyy\");\n DateTimeFormatter.ofPattern(\"d/M/y\");\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SimpleDateFormatWithoutLocale",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 9,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnnotationClass",
+ "shortDescription": {
+ "text": "Annotation interface"
+ },
+ "fullDescription": {
+ "text": "Reports annotation interfaces. Such interfaces are not supported under Java 1.4 and earlier.",
+ "markdown": "Reports annotation interfaces. Such interfaces are not supported under Java 1.4 and earlier."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AnnotationClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level issues",
+ "index": 62,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TransientFieldNotInitialized",
+ "shortDescription": {
+ "text": "Transient field is not initialized on deserialization"
+ },
+ "fullDescription": {
+ "text": "Reports 'transient' fields that are initialized during normal object construction, but whose class does not have a 'readObject' method. As 'transient' fields are not serialized they need to be initialized separately in a 'readObject()' method during deserialization. Any 'transient' fields that are not initialized during normal object construction are considered to use the default initialization and are not reported by this inspection. Example: 'class Person implements Serializable {\n transient String name = \"Default\"; //warning, can actually be a null after deserialization\n transient String surname; //null is considered the default value and not reported\n }'",
+ "markdown": "Reports `transient` fields that are initialized during normal object construction, but whose class does not have a `readObject` method.\n\n\nAs `transient` fields are not serialized they need\nto be initialized separately in a `readObject()` method\nduring deserialization.\n\n\nAny `transient` fields that\nare not initialized during normal object construction are considered to use the default\ninitialization and are not reported by this inspection.\n\n**Example:**\n\n\n class Person implements Serializable {\n transient String name = \"Default\"; //warning, can actually be a null after deserialization\n transient String surname; //null is considered the default value and not reported\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TransientFieldNotInitialized",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PropertyValueSetToItself",
+ "shortDescription": {
+ "text": "Property value set to itself"
+ },
+ "fullDescription": {
+ "text": "Reports calls of setter methods with the same object getter as a value. Usually, this code does nothing and probably was not intended. For example: 'bean.setPayerId(bean.getPayerId());'",
+ "markdown": "Reports calls of setter methods with the same object getter as a value. Usually, this code does nothing and probably was not intended.\n\n**For example:**\n\n bean.setPayerId(bean.getPayerId());\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PropertyValueSetToItself",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JavaBeans issues",
+ "index": 34,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Finalize",
+ "shortDescription": {
+ "text": "'finalize()' should not be overridden"
+ },
+ "fullDescription": {
+ "text": "Reports overriding the 'Object.finalize()' method. According to the 'Object.finalize()' documentation: The finalization mechanism is inherently problematic. Finalization can lead to performance issues, deadlocks, and hangs. Errors in finalizers can lead to resource leaks; there is no way to cancel finalization if it is no longer necessary; and no ordering is specified among calls to 'finalize' methods of different objects. Furthermore, there are no guarantees regarding the timing of finalization. The 'finalize' method might be called on a finalizable object only after an indefinite delay, if at all. Configure the inspection: Use the Ignore for trivial 'finalize()' implementations option to ignore 'finalize()' implementations with an empty method body or a body containing only 'if' statements that have a condition which evaluates to 'false' and is a compile-time constant. For performance reasons it can be beneficial to override a non-trivial 'finalize()' with an empty implementation in a subclass. An empty final 'finalize()' implementation can also be used to prevent subclasses from overriding.",
+ "markdown": "Reports overriding the `Object.finalize()` method.\n\nAccording to the `Object.finalize()` documentation:\n>\n> The finalization mechanism is inherently problematic. Finalization can lead\n> to performance issues, deadlocks, and hangs. Errors in finalizers can lead\n> to resource leaks; there is no way to cancel finalization if it is no longer\n> necessary; and no ordering is specified among calls to `finalize`\n> methods of different objects. Furthermore, there are no guarantees regarding\n> the timing of finalization. The `finalize` method might be called\n> on a finalizable object only after an indefinite delay, if at all.\n\nConfigure the inspection:\n\n* Use the **Ignore for trivial 'finalize()' implementations** option to ignore `finalize()` implementations with an empty method body or a body containing only `if` statements that have a condition which evaluates to `false` and is a compile-time constant. For performance reasons it can be beneficial to override a non-trivial `finalize()` with an empty implementation in a subclass. An empty final `finalize()` implementation can also be used to prevent subclasses from overriding."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FinalizeDeclaration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Finalization",
+ "index": 64,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JUnit3StyleTestMethodInJUnit4Class",
+ "shortDescription": {
+ "text": "Old style JUnit test method in JUnit 4 class"
+ },
+ "fullDescription": {
+ "text": "Reports JUnit 3 style test methods that are located inside a class that does not extend the JUnit 3 'TestCase' class and contains JUnit 4 or JUnit 5 '@Test' annotated methods. Such test methods cannot be run.",
+ "markdown": "Reports JUnit 3 style test methods that are located inside a class that does not extend the JUnit 3 `TestCase` class and contains JUnit 4 or JUnit 5 `@Test` annotated methods. Such test methods cannot be run."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JUnit3StyleTestMethodInJUnit4Class",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/JUnit",
+ "index": 74,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PointlessArithmeticExpression",
+ "shortDescription": {
+ "text": "Pointless arithmetic expression"
+ },
+ "fullDescription": {
+ "text": "Reports pointless arithmetic expressions. Such expressions include adding or subtracting zero, multiplying by zero or one, and division by one. Such expressions may be the result of automated refactorings and they are unlikely to be what the developer intended to do. The quick-fix simplifies such expressions. Example: 'void f(int a) {\n int x = a - a;\n int y = a + 0;\n int res = x / x;\n }' After the quick-fix is applied: 'void f(int a) {\n int x = 0;\n int y = a;\n int res = 1;\n }' Note that in rare cases, the suggested replacement might not be completely equivalent to the original code for all possible inputs. For example, the inspection suggests replacing 'x / x' with '1'. However, if 'x' is zero, the original code throws 'ArithmeticException' or results in 'NaN'. Also, if 'x' is 'NaN', then the result is also 'NaN'. It's very unlikely that such behavior is intended.",
+ "markdown": "Reports pointless arithmetic expressions. Such expressions include adding or subtracting zero, multiplying by zero or one, and division by one.\n\nSuch expressions may be the result of automated refactorings and they are unlikely to be what the developer intended to do.\n\nThe quick-fix simplifies such expressions.\n\n**Example:**\n\n\n void f(int a) {\n int x = a - a;\n int y = a + 0;\n int res = x / x;\n }\n\nAfter the quick-fix is applied:\n\n\n void f(int a) {\n int x = 0;\n int y = a;\n int res = 1;\n }\n\n\nNote that in rare cases, the suggested replacement might not be completely equivalent to the original code\nfor all possible inputs. For example, the inspection suggests replacing `x / x` with `1`.\nHowever, if `x` is zero, the original code throws `ArithmeticException` or results in `NaN`.\nAlso, if `x` is `NaN`, then the result is also `NaN`. It's very unlikely that such behavior is intended."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PointlessArithmeticExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "OverlyLargePrimitiveArrayInitializer",
+ "shortDescription": {
+ "text": "Overly large initializer for array of primitive type"
+ },
+ "fullDescription": {
+ "text": "Reports array initializer expressions for primitive arrays that contain too many elements. Such initializers may result in overly large class files because code must be generated to initialize each array element. In memory or bandwidth constrained environments, it may be more efficient to load large arrays of primitives from resource files. 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. Use the option to specify the maximum number of elements to allow in primitive array initializers.",
+ "markdown": "Reports array initializer expressions for primitive arrays that contain too many elements. Such initializers may result in overly large class files because code must be generated to initialize each array element. In memory or bandwidth constrained environments, it may be more efficient to load large arrays of primitives from resource files.\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\nUse the option to specify the maximum number of elements to allow in primitive array initializers."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OverlyLargePrimitiveArrayInitializer",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 22,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassInitializer",
+ "shortDescription": {
+ "text": "Non-'static' initializer"
+ },
+ "fullDescription": {
+ "text": "Reports non-'static' initializers in classes. Some coding standards prohibit instance initializers and recommend using constructors or field initializers for initialization. Also, deleting the 'static' keyword may accidentally create non-'static' initializers and result in obscure bugs. This inspection doesn't report instance initializers in anonymous classes. Use the Only warn when the class has one or more constructors option to ignore instance initializers in classes that don't have any constructors.",
+ "markdown": "Reports non-`static` initializers in classes.\n\nSome coding standards prohibit instance initializers and recommend using constructors or field initializers for initialization.\nAlso, deleting the `static` keyword may accidentally create non-`static` initializers and result in obscure bugs.\n\nThis inspection doesn't report instance initializers in anonymous classes.\n\n\nUse the **Only warn when the class has one or more constructors** option to ignore instance initializers in classes that don't have any constructors."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonStaticInitializer",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectNotify",
+ "shortDescription": {
+ "text": "Call to 'notify()' instead of 'notifyAll()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Object.notify()'. While occasionally useful, in almost all cases 'Object.notifyAll()' is a better choice because calling 'Object.notify()' may lead to deadlocks. See Doug Lea's Concurrent Programming in Java for a discussion.",
+ "markdown": "Reports calls to `Object.notify()`. While occasionally useful, in almost all cases `Object.notifyAll()` is a better choice because calling `Object.notify()` may lead to deadlocks. See Doug Lea's *Concurrent Programming in Java* for a discussion."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToNotifyInsteadOfNotifyAll",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ContinueOrBreakFromFinallyBlock",
+ "shortDescription": {
+ "text": "'continue' or 'break' inside 'finally' block"
+ },
+ "fullDescription": {
+ "text": "Reports 'break' or 'continue' statements inside of 'finally' blocks. While occasionally intended, such statements are very confusing, may mask thrown exceptions, and complicate debugging. Example: 'while (true) {\n try {\n throwingMethod();\n } finally {\n continue;\n }\n }'",
+ "markdown": "Reports `break` or `continue` statements inside of `finally` blocks.\n\nWhile occasionally intended, such statements are very confusing, may mask thrown exceptions, and complicate debugging.\n\n**Example:**\n\n\n while (true) {\n try {\n throwingMethod();\n } finally {\n continue;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ContinueOrBreakFromFinallyBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LengthOneStringsInConcatenation",
+ "shortDescription": {
+ "text": "Single character string concatenation"
+ },
+ "fullDescription": {
+ "text": "Reports concatenation with string literals that consist of one character. These literals may be replaced with equivalent character literals, gaining some performance enhancement. Example: 'String hello = hell + \"o\";' After the quick-fix is applied: 'String hello = hell + 'o';'",
+ "markdown": "Reports concatenation with string literals that consist of one character.\n\nThese literals may be replaced with equivalent character literals, gaining some performance enhancement.\n\n**Example:**\n\n\n String hello = hell + \"o\";\n\nAfter the quick-fix is applied:\n\n\n String hello = hell + 'o';\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "SingleCharacterStringConcatenation",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryThis",
+ "shortDescription": {
+ "text": "Unnecessary 'this' qualifier"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary 'this' qualifier. Using 'this' to disambiguate a code reference is discouraged by many coding styles and may easily become unnecessary via automatic refactorings. Example: 'class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }' After the quick-fix is applied: 'class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }' Use the inspection settings to ignore assignments to fields. For instance, 'this.x = 2;' won't be reported, but 'int y = this.x;' will be.",
+ "markdown": "Reports unnecessary `this` qualifier.\n\n\nUsing `this` to disambiguate a code reference is discouraged by many coding styles\nand may easily become unnecessary\nvia automatic refactorings.\n\n**Example:**\n\n\n class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }\n\n\nUse the inspection settings to ignore assignments to fields.\nFor instance, `this.x = 2;` won't be reported, but `int y = this.x;` will be."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryThis",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstanceVariableUninitializedUse",
+ "shortDescription": {
+ "text": "Instance field used before initialization"
+ },
+ "fullDescription": {
+ "text": "Reports instance variables that are read before initialization. The inspection ignores equality checks with 'null'. Example: 'class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore if annotated by option to specify special annotations. The inspection will ignore fields annotated with one of these annotations. Use the Ignore primitive fields option to ignore uninitialized primitive fields.",
+ "markdown": "Reports instance variables that are read before initialization.\n\nThe inspection ignores equality checks with `null`.\n\n**Example:**\n\n\n class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection will ignore fields\nannotated with one of these annotations.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InstanceVariableUsedBeforeInitialized",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Initialization",
+ "index": 29,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithTooManyTransitiveDependencies",
+ "shortDescription": {
+ "text": "Class with too many transitive dependencies"
+ },
+ "fullDescription": {
+ "text": "Reports classes that are directly or indirectly dependent on too many other classes. Modifications to any dependency of such a class may require changing the class thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of transitive dependencies field to specify the maximum allowed number of direct or indirect 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 or indirectly dependent on too many other classes.\n\nModifications to any dependency of such a class may require changing the class thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of transitive dependencies** field to specify the maximum allowed number of direct or indirect dependencies\nfor 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": "ClassWithTooManyTransitiveDependencies",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 86,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExplicitArrayFilling",
+ "shortDescription": {
+ "text": "Explicit array filling"
+ },
+ "fullDescription": {
+ "text": "Reports loops that can be replaced with 'Arrays.setAll()' or 'Arrays.fill()' calls. This inspection suggests replacing loops with 'Arrays.setAll()' if the language level of the project or module is 8 or higher. Replacing loops with 'Arrays.fill()' is possible with any language level. Example: 'for (int i=0; i list, int from, int to) {\n for (int i = from; i < to; i++) {\n list.remove(from);\n }\n }' After the quick-fix is applied: 'void removeRange(List list, int from, int to) {\n if (to > from) {\n list.subList(from, to).clear();\n }\n }' The quick-fix adds a range check automatically to prevent a possible 'IndexOutOfBoundsException' when the minimal value is bigger than the maximal value. It can be removed if such a situation is impossible in your code. New in 2018.2",
+ "markdown": "Reports `List.remove(index)` called in a loop that can be replaced with `List.subList().clear()`.\n\nThe replacement\nis more efficient for most `List` implementations when many elements are deleted.\n\nExample:\n\n\n void removeRange(List list, int from, int to) {\n for (int i = from; i < to; i++) {\n list.remove(from);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void removeRange(List list, int from, int to) {\n if (to > from) {\n list.subList(from, to).clear();\n }\n }\n\n\nThe quick-fix adds a range check automatically to prevent a possible `IndexOutOfBoundsException` when the minimal value is bigger\nthan the maximal value. It can be removed if such a situation is impossible in your code.\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ListRemoveInLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReturnFromFinallyBlock",
+ "shortDescription": {
+ "text": "'return' inside 'finally' block"
+ },
+ "fullDescription": {
+ "text": "Reports 'return' statements inside of 'finally' blocks. While occasionally intended, such 'return' statements may mask thrown exceptions and complicate debugging. Example: 'try {\n foo();\n } finally {\n if (bar()) return;\n }'",
+ "markdown": "Reports `return` statements inside of `finally` blocks.\n\nWhile occasionally intended, such `return` statements may mask thrown exceptions\nand complicate debugging.\n\n**Example:**\n\n\n try {\n foo();\n } finally {\n if (bar()) return;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReturnInsideFinallyBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MissingOverrideAnnotation",
+ "shortDescription": {
+ "text": "Missing '@Override' annotation"
+ },
+ "fullDescription": {
+ "text": "Reports methods overriding superclass methods but are not annotated with '@java.lang.Override'. Annotating methods with '@java.lang.Override' improves code readability since it shows the intent. In addition, the compiler emits an error when a signature of the overridden method doesn't match the superclass method. Example: 'class X {\n public String toString() {\n return \"hello world\";\n }\n }' After the quick-fix is applied: 'class X {\n @Override\n public String toString() {\n return \"hello world\";\n }\n }' Configure the inspection: Use the Ignore 'equals()', 'hashCode()' and 'toString()' option to ignore these 'java.lang.Object' methods: 'equals()', 'hashCode()', and 'toString()'. The risk that these methods will disappear and your code won't be compiling anymore due to the '@Override' annotation is relatively small. Use the Ignore methods in anonymous classes option to ignore methods in anonymous classes. Disable the Highlight method when its overriding methods do not all have the '@Override' annotation option to only warn on the methods missing an '@Override' annotation, and not on overridden methods where one or more descendants are missing an '@Override' annotation. This inspection only reports if the language level of the project or module is 5 or higher.",
+ "markdown": "Reports methods overriding superclass methods but are not annotated with `@java.lang.Override`.\n\n\nAnnotating methods with `@java.lang.Override` improves code readability since it shows the intent.\nIn addition, the compiler emits an error when a signature of the overridden method doesn't match the superclass method.\n\n**Example:**\n\n\n class X {\n public String toString() {\n return \"hello world\";\n }\n }\n \nAfter the quick-fix is applied:\n\n\n class X {\n @Override\n public String toString() {\n return \"hello world\";\n }\n }\n \nConfigure the inspection:\n\n* Use the **Ignore 'equals()', 'hashCode()' and 'toString()'** option to ignore these `java.lang.Object` methods: `equals()`, `hashCode()`, and `toString()`. The risk that these methods will disappear and your code won't be compiling anymore due to the `@Override` annotation is relatively small.\n* Use the **Ignore methods in anonymous classes** option to ignore methods in anonymous classes.\n* Disable the **Highlight method when its overriding methods do not all have the '@Override' annotation** option to only warn on the methods missing an `@Override` annotation, and not on overridden methods where one or more descendants are missing an `@Override` annotation.\n\nThis inspection only reports if the language level of the project or module is 5 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "override",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantExplicitClose",
+ "shortDescription": {
+ "text": "Redundant 'close()'"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessary calls to 'close()' at the end of a try-with-resources block and suggests removing them. Example: 'try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n ac.close();\n }' After the quick-fix is applied: 'try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n }' New in 2018.1",
+ "markdown": "Reports unnecessary calls to `close()` at the end of a try-with-resources block and suggests removing them.\n\n**Example**:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n ac.close();\n }\n\nAfter the quick-fix is applied:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n }\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantExplicitClose",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssertStatement",
+ "shortDescription": {
+ "text": "'assert' statement"
+ },
+ "fullDescription": {
+ "text": "Reports 'assert' statements. By default, 'assert' statements are disabled during execution in the production environment. Consider using logger or exceptions instead. The 'assert' statements are not supported in Java 1.3 and earlier JVM.",
+ "markdown": "Reports `assert` statements. By default, `assert` statements are disabled during execution in the production environment. Consider using logger or exceptions instead.\n\nThe `assert` statements are not supported in Java 1.3 and earlier JVM."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssertStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level issues",
+ "index": 62,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CharUsedInArithmeticContext",
+ "shortDescription": {
+ "text": "'char' expression used in arithmetic context"
+ },
+ "fullDescription": {
+ "text": "Reports expressions of the 'char' type used in addition or subtraction expressions. Such code is not necessarily an issue but may result in bugs (for example, if a string is expected). Example: 'int a = 'a' + 42;' After the quick-fix is applied: 'int a = (int) 'a' + 42;' For the 'String' context: 'int i1 = 1;\nint i2 = 2;\nSystem.out.println(i2 + '-' + i1 + \" = \" + (i2 - i1));' After the quick-fix is applied: 'System.out.println(i2 + \"-\" + i1 + \" = \" + (i2 - i1));'",
+ "markdown": "Reports expressions of the `char` type used in addition or subtraction expressions.\n\nSuch code is not necessarily an issue but may result in bugs (for example,\nif a string is expected).\n\n**Example:** `int a = 'a' + 42;`\n\nAfter the quick-fix is applied: `int a = (int) 'a' + 42;`\n\nFor the `String` context:\n\n int i1 = 1;\n int i2 = 2;\n System.out.println(i2 + '-' + i1 + \" = \" + (i2 - i1));\n\nAfter the quick-fix is applied:\n`System.out.println(i2 + \"-\" + i1 + \" = \" + (i2 - i1));`"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CharUsedInArithmeticContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringEqualsCharSequence",
+ "shortDescription": {
+ "text": "'String.equals()' called with 'CharSequence' argument"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'String.equals()' with a 'CharSequence' as the argument. 'String.equals()' can only return 'true' for 'String' arguments. To compare the contents of a 'String' with a non-'String' 'CharSequence' argument, use the 'contentEquals()' method. Example: 'boolean equals(String s, CharSequence ch) {\n return s.equals(ch);\n }' After quick-fix is applied: 'boolean equals(String s, CharSequence ch) {\n return s.contentEquals(ch);\n }' New in 2017.3",
+ "markdown": "Reports calls to `String.equals()` with a `CharSequence` as the argument.\n\n\n`String.equals()` can only return `true` for `String` arguments.\nTo compare the contents of a `String` with a non-`String` `CharSequence` argument,\nuse the `contentEquals()` method.\n\n**Example:**\n\n\n boolean equals(String s, CharSequence ch) {\n return s.equals(ch);\n }\n\nAfter quick-fix is applied:\n\n\n boolean equals(String s, CharSequence ch) {\n return s.contentEquals(ch);\n }\n\n\nNew in 2017.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringEqualsCharSequence",
+ "cweIds": [
+ 597
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TestFailedLine",
+ "shortDescription": {
+ "text": "Failed line in test"
+ },
+ "fullDescription": {
+ "text": "Reports failed method calls or assertions in tests. It helps detect the failed line in code faster and start debugging it immediately. Example: '@Test\n fun foo() {\n assertEquals(1, 0) // highlighted\n }'",
+ "markdown": "Reports failed method calls or assertions in tests. It helps detect the failed line in code faster and start debugging it immediately.\n\n**Example:**\n\n\n @Test\n fun foo() {\n assertEquals(1, 0) // highlighted\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TestFailedLine",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessarySemicolon",
+ "shortDescription": {
+ "text": "Unnecessary semicolon"
+ },
+ "fullDescription": {
+ "text": "Reports any unnecessary semicolons, including semicolons that are used between class members, inside block statements, or after class definitions. Even though these semicolons are valid in Java, they are redundant and may be removed. Example: 'class C {\n ;\n void m() throws Exception {\n try (AutoCloseable r1 = createAutoCloseable();) {\n ;\n }\n }\n ;\n }' After the quick-fix is applied: 'class C {\n void m() throws Exception {\n try (AutoCloseable r1 = createAutoCloseable()) {\n }\n }\n }'",
+ "markdown": "Reports any unnecessary semicolons, including semicolons that are used between class members, inside block statements, or after class definitions.\n\nEven though these semicolons are valid in Java, they are redundant and may be removed.\n\nExample:\n\n\n class C {\n ;\n void m() throws Exception {\n try (AutoCloseable r1 = createAutoCloseable();) {\n ;\n }\n }\n ;\n }\n\nAfter the quick-fix is applied:\n\n\n class C {\n void m() throws Exception {\n try (AutoCloseable r1 = createAutoCloseable()) {\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessarySemicolon",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssertEqualsMayBeAssertSame",
+ "shortDescription": {
+ "text": "'assertEquals()' may be 'assertSame()'"
+ },
+ "fullDescription": {
+ "text": "Reports JUnit 'assertEquals()' calls that can be replaced with an equivalent 'assertSame()' call. This is possible when the arguments are instances of a 'final' class that does not override the 'Object.equals()' method and makes it explicit that the object identity is compared. Suggests replacing 'assertEquals()' with 'assertSame()'. Example: '@Test\n public void testObjectType() {\n Object o = getObject();\n Assert.assertEquals(String.class, o.getClass());\n }' After the quick fix is applied: '@Test\n public void testSort() {\n Object o = getObject();\n Assert.assertSame(String.class, o.getClass());\n }'",
+ "markdown": "Reports JUnit `assertEquals()` calls that can be replaced with an equivalent `assertSame()` call. This is possible when the arguments are instances of a `final` class that does not override the `Object.equals()` method and makes it explicit that the object identity is compared.\n\nSuggests replacing `assertEquals()` with `assertSame()`.\n\n**Example:**\n\n\n @Test\n public void testObjectType() {\n Object o = getObject();\n Assert.assertEquals(String.class, o.getClass());\n }\n\nAfter the quick fix is applied:\n\n\n @Test\n public void testSort() {\n Object o = getObject();\n Assert.assertSame(String.class, o.getClass());\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssertEqualsMayBeAssertSame",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PublicStaticCollectionField",
+ "shortDescription": {
+ "text": "'public static' collection field"
+ },
+ "fullDescription": {
+ "text": "Reports modifiable 'public' 'static' Collection fields. Even though they are often used to store collections of constant values, these fields nonetheless represent a security hazard, as their contents may be modified even if the field is declared as 'final'. Example: 'public static final List EVENTS = new ArrayList<>();'\n Use the table in the Options section to specify methods returning unmodifiable collections. 'public' 'static' collection fields initialized with these methods will not be reported.",
+ "markdown": "Reports modifiable `public` `static` Collection fields.\n\nEven though they are often used to store collections of constant values, these fields nonetheless represent a security\nhazard, as their contents may be modified even if the field is declared as `final`.\n\n**Example:**\n\n\n public static final List EVENTS = new ArrayList<>();\n \n\nUse the table in the **Options** section to specify methods returning unmodifiable collections.\n`public` `static` collection fields initialized with these methods will not be reported."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PublicStaticCollectionField",
+ "cweIds": [
+ 732
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 31,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtendsConcreteCollection",
+ "shortDescription": {
+ "text": "Class explicitly extends a 'Collection' class"
+ },
+ "fullDescription": {
+ "text": "Reports classes that extend concrete subclasses of the 'java.util.Collection' or 'java.util.Map' classes. Subclassing concrete collection types is a common yet poor practice. It is considerably more brittle than delegating collection calls.",
+ "markdown": "Reports classes that extend concrete subclasses of the `java.util.Collection` or `java.util.Map` classes.\n\n\nSubclassing concrete collection types is a common yet poor practice. It is considerably more brittle than delegating collection calls."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassExtendsConcreteCollection",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JavadocBlankLines",
+ "shortDescription": {
+ "text": "Blank line should be replaced with 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": 45,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ObjectInstantiationInEqualsHashCode",
+ "shortDescription": {
+ "text": "Object instantiation inside 'equals()' or 'hashCode()'"
+ },
+ "fullDescription": {
+ "text": "Reports construction of (temporary) new objects inside 'equals()', 'hashCode()', 'compareTo()', and 'Comparator.compare()' methods. Besides constructor invocations, new objects can also be created by autoboxing or iterator creation inside a 'foreach' statement. This can cause performance problems, for example, when objects are added to a 'Set' or 'Map', where these methods will be called often. The inspection will not report when the objects are created in a 'throw' or 'assert' statement. Example: 'class Person {\n private String name;\n private int age;\n\n public boolean equals(Object o) {\n return Arrays.equals(new Object[] {name, age}, new Object[] {((Foo)o).name, ((Foo)o).age});\n }\n\n public int hashCode() {\n return (name + age).hashCode();\n }\n }' In this example, two additional arrays are created inside 'equals()', usages of 'age' field require boxing, and 'name + age' implicitly creates a new string.",
+ "markdown": "Reports construction of (temporary) new objects inside `equals()`, `hashCode()`, `compareTo()`, and `Comparator.compare()` methods.\n\n\nBesides constructor invocations, new objects can also be created by autoboxing or iterator creation inside a\n`foreach` statement.\nThis can cause performance problems, for example, when objects are added to a `Set` or `Map`,\nwhere these methods will be called often.\n\n\nThe inspection will not report when the objects are created in a `throw` or `assert` statement.\n\n**Example:**\n\n\n class Person {\n private String name;\n private int age;\n\n public boolean equals(Object o) {\n return Arrays.equals(new Object[] {name, age}, new Object[] {((Foo)o).name, ((Foo)o).age});\n }\n\n public int hashCode() {\n return (name + age).hashCode();\n }\n }\n\n\nIn this example, two additional arrays are created inside `equals()`, usages of `age` field require boxing,\nand `name + age` implicitly creates a new string."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ObjectInstantiationInEqualsHashCode",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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 }'",
+ "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"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TypeParameterExtendsFinalClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnconditionalWait",
+ "shortDescription": {
+ "text": "Unconditional 'wait()' call"
+ },
+ "fullDescription": {
+ "text": "Reports 'wait()' being called unconditionally within a synchronized context. Normally, 'wait()' is used to block a thread until some condition is true. If 'wait()' is called unconditionally, it often indicates that the condition was checked before a lock was acquired. In that case a data race may occur, with the condition becoming true between the time it was checked and the time the lock was acquired. While constructs found by this inspection are not necessarily incorrect, they are certainly worth examining. Example: 'class Bar {\n void foo() throws InterruptedException {\n synchronized (this) {\n wait(); // warning\n }\n }\n }'",
+ "markdown": "Reports `wait()` being called unconditionally within a synchronized context.\n\n\nNormally, `wait()` is used to block a thread until some condition is true. If\n`wait()` is called unconditionally, it often indicates that the condition was\nchecked before a lock was acquired. In that case a data race may occur, with the condition\nbecoming true between the time it was checked and the time the lock was acquired.\n\n\nWhile constructs found by this inspection are not necessarily incorrect, they are certainly worth examining.\n\n**Example:**\n\n\n class Bar {\n void foo() throws InterruptedException {\n synchronized (this) {\n wait(); // warning\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnconditionalWait",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 58,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 24,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodOverridesInaccessibleMethodOfSuper",
+ "shortDescription": {
+ "text": "Method overrides inaccessible method of superclass"
+ },
+ "fullDescription": {
+ "text": "Reports methods with the same signature as an inaccessible method of a superclass, for example, a private method, or a package-private method of a superclass in another package. Such method names may be confusing because the method in the subclass may look like an override when in fact it hides the inaccessible method of the superclass. Moreover, if the visibility of the method in the superclass changes later, it may either silently change the semantics of the subclass or cause a compilation error. A quick-fix is suggested to rename the method. Example: 'public class Super {\n private void test() {\n }\n }\n\n public class Sub extends Super {\n void test() { // making 'Super.test()' public causes a compilation error\n // making 'Super.test()' package-private makes 'Sub.test()' an override\n }\n }'",
+ "markdown": "Reports methods with the same signature as an inaccessible method of a superclass, for example, a private method, or a package-private method of a superclass in another package.\n\n\nSuch method names may be confusing because the method in the subclass may look like an override when in fact\nit hides the inaccessible method of the superclass.\nMoreover, if the visibility of the method in the superclass changes later,\nit may either silently change the semantics of the subclass or cause a compilation error.\n\nA quick-fix is suggested to rename the method.\n\n**Example:**\n\n\n public class Super {\n private void test() {\n }\n }\n\n public class Sub extends Super {\n void test() { // making 'Super.test()' public causes a compilation error\n // making 'Super.test()' package-private makes 'Sub.test()' an override\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodOverridesInaccessibleMethodOfSuper",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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.",
+ "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."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "resource",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Resource management",
+ "index": 47,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IntLiteralMayBeLongLiteral",
+ "shortDescription": {
+ "text": "Cast to 'long' can be 'long' literal"
+ },
+ "fullDescription": {
+ "text": "Reports 'int' literal expressions that are immediately cast to 'long'. Such literal expressions can be replaced with equivalent 'long' literals. Example: 'Long l = (long)42;' After the quick-fix is applied: 'Long l = 42L;'",
+ "markdown": "Reports `int` literal expressions that are immediately cast to `long`.\n\nSuch literal expressions can be replaced with equivalent `long` literals.\n\n**Example:**\n\n Long l = (long)42;\n\nAfter the quick-fix is applied:\n\n Long l = 42L;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IntLiteralMayBeLongLiteral",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues/Cast",
+ "index": 101,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SingleCharacterStartsWith",
+ "shortDescription": {
+ "text": "Single character 'startsWith()' or 'endsWith()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'String.startsWith()' and 'String.endsWith()' where single character string literals are passed as an argument. A quick-fix is suggested to replace such calls with more efficiently implemented 'String.charAt()'. However, the performance gain of such change is minimal and the code becomes less readable because of the extra non-zero length check, so it is recommended to apply the quick-fix only inside tight loops. 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: 'boolean startsWithX(String s) {\n return s.startsWith(\"x\");\n }' After the quick-fix is applied: 'boolean startsWithX(String s) {\n return !s.isEmpty() && s.charAt(0) == 'x';\n }'",
+ "markdown": "Reports calls to `String.startsWith()` and `String.endsWith()` where single character string literals are passed as an argument.\n\n\nA quick-fix is suggested to replace such calls with more efficiently implemented `String.charAt()`.\n\n\nHowever, the performance gain of such change is minimal and the code becomes less readable because of the extra non-zero length check,\nso it is recommended to apply the quick-fix only inside tight loops.\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 boolean startsWithX(String s) {\n return s.startsWith(\"x\");\n }\n\nAfter the quick-fix is applied:\n\n\n boolean startsWithX(String s) {\n return !s.isEmpty() && s.charAt(0) == 'x';\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SingleCharacterStartsWith",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 22,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UtilityClassCanBeEnum",
+ "shortDescription": {
+ "text": "Utility class can be 'enum'"
+ },
+ "fullDescription": {
+ "text": "Reports utility classes that can be converted to enums. Some coding style guidelines require implementing utility classes as enums to avoid code coverage issues in 'private' constructors. Example: 'class StringUtils {\n public static final String EMPTY = \"\";\n }' After the quick-fix is applied: 'enum StringUtils {\n ;\n public static final String EMPTY = \"\";\n }'",
+ "markdown": "Reports utility classes that can be converted to enums.\n\nSome coding style guidelines require implementing utility classes as enums\nto avoid code coverage issues in `private` constructors.\n\n**Example:**\n\n\n class StringUtils {\n public static final String EMPTY = \"\";\n }\n\nAfter the quick-fix is applied:\n\n\n enum StringUtils {\n ;\n public static final String EMPTY = \"\";\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UtilityClassCanBeEnum",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtendsObject",
+ "shortDescription": {
+ "text": "Class explicitly extends 'Object'"
+ },
+ "fullDescription": {
+ "text": "Reports any classes that are explicitly declared to extend 'java.lang.Object'. Such declaration is redundant and can be safely removed. Example: 'class MyClass extends Object {\n }' The quick-fix removes the redundant 'extends Object' clause: 'class MyClass {\n }'",
+ "markdown": "Reports any classes that are explicitly declared to extend `java.lang.Object`.\n\nSuch declaration is redundant and can be safely removed.\n\nExample:\n\n\n class MyClass extends Object {\n }\n\nThe quick-fix removes the redundant `extends Object` clause:\n\n\n class MyClass {\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassExplicitlyExtendsObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SuperTearDownInFinally",
+ "shortDescription": {
+ "text": "JUnit 3 'super.tearDown()' is not called from 'finally' block"
+ },
+ "fullDescription": {
+ "text": "Reports calls of the JUnit 3's 'super.tearDown()' method that are not performed inside a 'finally' block. If an exception is thrown before 'super.tearDown()' is called it could lead to inconsistencies and leaks. Example: 'public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n Files.delete(path);\n super.tearDown();\n }\n }' Improved code: 'public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n try {\n Files.delete(path);\n } finally {\n super.tearDown();\n }\n }\n }'",
+ "markdown": "Reports calls of the JUnit 3's `super.tearDown()` method that are not performed inside a `finally` block. If an exception is thrown before `super.tearDown()` is called it could lead to inconsistencies and leaks.\n\n**Example:**\n\n\n public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n Files.delete(path);\n super.tearDown();\n }\n }\n\nImproved code:\n\n\n public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n try {\n Files.delete(path);\n } finally {\n super.tearDown();\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SuperTearDownInFinally",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReassignedVariable",
+ "shortDescription": {
+ "text": "Reassigned variable"
+ },
+ "fullDescription": {
+ "text": "Reports reassigned variables, which complicate reading and understanding the code. Example: 'int value = 2 * (height + width);\n System.out.println(\"perimeter: \" + value);\n\n value = height * width;\n System.out.println(\"area: \" + value);'",
+ "markdown": "Reports reassigned variables, which complicate reading and understanding the code.\n\nExample:\n\n\n int value = 2 * (height + width);\n System.out.println(\"perimeter: \" + value);\n\n value = height * width;\n System.out.println(\"area: \" + value);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "ReassignedVariable",
+ "ideaSeverity": "TEXT ATTRIBUTES",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodNameSameAsClassName",
+ "shortDescription": {
+ "text": "Method name same as class name"
+ },
+ "fullDescription": {
+ "text": "Reports methods that are named identically to their class. While such naming is allowed by the Java language, by convention it is reserved for defining constructors. Using it for methods is probably a mistake or bad practice. Example: 'class MyClass {\n int val;\n\n // Method MyClass named identically to its containing class.\n // Likely, 'void' was added by mistake.\n void MyClass(int val) {\n this.val = val;\n }\n }' When appropriate, a quick-fix converts the method to a constructor: 'class MyClass {\n int val;\n\n MyClass(int val) {\n this.val = val;\n }\n }' Another quick-fix renames the method.",
+ "markdown": "Reports methods that are named identically to their class. While such naming is allowed by the Java language, by convention it is reserved for defining constructors. Using it for methods is probably a mistake or bad practice.\n\n**Example:**\n\n\n class MyClass {\n int val;\n\n // Method MyClass named identically to its containing class.\n // Likely, 'void' was added by mistake.\n void MyClass(int val) {\n this.val = val;\n }\n }\n\nWhen appropriate, a quick-fix converts the method to a constructor:\n\n\n class MyClass {\n int val;\n\n MyClass(int val) {\n this.val = val;\n }\n }\n\nAnother quick-fix renames the method."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodNameSameAsClassName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 85,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LocalVariableNamingConvention",
+ "shortDescription": {
+ "text": "Local variable naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports local variables whose names are too short, too long, or do not follow the specified regular expression pattern. Example: 'int X = 42;' should be reported if the inspection is enabled with the default settings in which a variable 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 local variable names. Specify 0 in order not to check the length of names. Regular expressions should be specified in the standard java.util.regex format. Use checkboxes to ignore 'for'-loop and 'catch' section parameters.",
+ "markdown": "Reports local variables whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** `int X = 42;`\nshould be reported if the inspection is enabled with the default settings in which a variable 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 local variable names.\nSpecify **0** in order not to check the length of names. Regular expressions should be specified in the standard **java.util.regex** format.\n\nUse checkboxes to ignore `for`-loop and `catch` section parameters."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LocalVariableNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 51,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryJavaDocLink",
+ "shortDescription": {
+ "text": "Unnecessary Javadoc link"
+ },
+ "fullDescription": {
+ "text": "Reports Javadoc '@see', '{@link}', and '{@linkplain}' tags that refer to the method owning the comment, the super method of the method owning the comment, or the class containing the comment. Such links are unnecessary and can be safely removed with this inspection's quick-fix. The quick-fix will remove the entire Javadoc comment if the tag is its only content. Example: 'class Example {\n /**\n * @see Example#method\n */\n public void method() { }\n }' After the quick-fix is applied: 'class Example {\n public void method() { }\n}' Use the checkbox below to ignore inline links ('{@link}' and '{@linkplain}') to super methods. Although a link to all super methods is automatically added by the Javadoc tool, an inline link to the super method may sometimes be needed in texts of the Javadoc comments.",
+ "markdown": "Reports Javadoc `@see`, `{@link}`, and `{@linkplain}` tags that refer to the method owning the comment, the super method of the method owning the comment, or the class containing the comment.\n\nSuch links are unnecessary and can be safely removed with this inspection's quick-fix. The\nquick-fix will remove the entire Javadoc comment if the tag is its only content.\n\n**Example:**\n\n\n class Example {\n /**\n * @see Example#method\n */\n public void method() { }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n public void method() { }\n }\n\n\nUse the checkbox below to ignore inline links (`{@link}` and `{@linkplain}`)\nto super methods. Although a link to all super methods is automatically added by the\nJavadoc tool, an inline link to the super method may sometimes be needed in texts of the Javadoc comments."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryJavaDocLink",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Javadoc",
+ "index": 45,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EmptyTryBlock",
+ "shortDescription": {
+ "text": "Empty 'try' block"
+ },
+ "fullDescription": {
+ "text": "Reports empty 'try' blocks, including try-with-resources statements. 'try' blocks with comments are considered empty. This inspection doesn't report empty 'try' blocks found in JSP files.",
+ "markdown": "Reports empty `try` blocks, including try-with-resources statements.\n\n`try` blocks with comments are considered empty.\n\n\nThis inspection doesn't report empty `try` blocks found in JSP files."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EmptyTryBlock",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestedSwitchStatement",
+ "shortDescription": {
+ "text": "Nested 'switch' statement"
+ },
+ "fullDescription": {
+ "text": "Reports nested 'switch' statements or expressions. Nested 'switch' statements may result in extremely confusing code. These statements may be extracted to a separate method. Example: 'int res = switch (i) {\n case 0 -> 0;\n default -> switch (i) {\n case 100 -> 0;\n default -> i;\n };\n };'",
+ "markdown": "Reports nested `switch` statements or expressions.\n\nNested `switch` statements\nmay result in extremely confusing code. These statements may be extracted to a separate method.\n\nExample:\n\n\n int res = switch (i) {\n case 0 -> 0;\n default -> switch (i) {\n case 100 -> 0;\n default -> i;\n };\n };\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NestedSwitchStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CollectionsFieldAccessReplaceableByMethodCall",
+ "shortDescription": {
+ "text": "Reference to empty collection field can be replaced with method call"
+ },
+ "fullDescription": {
+ "text": "Reports usages of 'java.util.Collections' fields: 'EMPTY_LIST', 'EMPTY_MAP' or 'EMPTY_SET'. These field usages may be replaced with the following method calls: 'emptyList()', 'emptyMap()', or 'emptySet()'. Such method calls prevent unchecked warnings by the compiler because the type parameters can be inferred. Example: 'List emptyList = Collections.EMPTY_LIST;' After the quick-fix is applied: 'List emptyList = Collections.emptyList();' This inspection only reports if the language level of the project or module is 5 or higher.",
+ "markdown": "Reports usages of `java.util.Collections` fields: `EMPTY_LIST`, `EMPTY_MAP` or `EMPTY_SET`. These field usages may be replaced with the following method calls: `emptyList()`, `emptyMap()`, or `emptySet()`. Such method calls prevent unchecked warnings by the compiler because the type parameters can be inferred.\n\n**Example:**\n\n\n List emptyList = Collections.EMPTY_LIST;\n\nAfter the quick-fix is applied:\n\n\n List emptyList = Collections.emptyList();\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": "CollectionsFieldAccessReplaceableByMethodCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 53,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssertWithSideEffects",
+ "shortDescription": {
+ "text": "'assert' statement with side effects"
+ },
+ "fullDescription": {
+ "text": "Reports 'assert' statements that cause side effects. Since assertions can be switched off, these side effects are not guaranteed, which can cause subtle bugs. Common unwanted side effects detected by this inspection are modifications of variables and fields. When methods calls are involved, they are analyzed one level deep. Example: 'assert i++ < 10;'",
+ "markdown": "Reports `assert` statements that cause side effects.\n\n\nSince assertions can be switched off,\nthese side effects are not guaranteed, which can cause subtle bugs. Common unwanted side effects detected by this inspection are\nmodifications of variables and fields. When methods calls are involved, they are analyzed one level deep.\n\n**Example:**\n\n\n assert i++ < 10;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssertWithSideEffects",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WaitOrAwaitWithoutTimeout",
+ "shortDescription": {
+ "text": "'wait()' or 'await()' without timeout"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Object.wait()' or 'Condition.await()' without specifying a timeout. Such calls may be dangerous in high-availability programs, as failures in one component may result in blockages of the waiting component if 'notify()'/'notifyAll()' or 'signal()'/'signalAll()' never get called. Example: 'void foo(Object bar) throws InterruptedException {\n bar.wait();\n }'",
+ "markdown": "Reports calls to `Object.wait()` or `Condition.await()` without specifying a timeout.\n\n\nSuch calls may be dangerous in high-availability programs, as failures in one\ncomponent may result in blockages of the waiting component\nif `notify()`/`notifyAll()`\nor `signal()`/`signalAll()` never get called.\n\n**Example:**\n\n\n void foo(Object bar) throws InterruptedException {\n bar.wait();\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "WaitOrAwaitWithoutTimeout",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FinalClass",
+ "shortDescription": {
+ "text": "Class is closed to inheritance"
+ },
+ "fullDescription": {
+ "text": "Reports classes that are declared 'final'. Final classes that extend a 'sealed' class or interface are not reported. Such classes can't be inherited and may indicate a lack of object-oriented design. Some coding standards discourage 'final' classes. Example: 'public final class Main {\n }' After the quick-fix is applied: 'public class Main {\n }'",
+ "markdown": "Reports classes that are declared `final`. Final classes that extend a `sealed` class or interface are not reported. Such classes can't be inherited and may indicate a lack of object-oriented design. Some coding standards discourage `final` classes.\n\n**Example:**\n\n\n public final class Main {\n }\n\nAfter the quick-fix is applied:\n\n\n public class Main {\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FinalClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LiteralAsArgToStringEquals",
+ "shortDescription": {
+ "text": "String literal may be 'equals()' qualifier"
+ },
+ "fullDescription": {
+ "text": "Reports 'String.equals()' or 'String.equalsIgnoreCase()' calls with a string literal argument. Some coding standards specify that string literals should be the qualifier of 'equals()', rather than argument, thus minimizing 'NullPointerException'-s. A quick-fix is available to exchange the literal and the expression. Example: 'boolean isFoo(String value) {\n return value.equals(\"foo\");\n }' After the quick-fix is applied: 'boolean isFoo(String value) {\n return \"foo\".equals(value);\n }'",
+ "markdown": "Reports `String.equals()` or `String.equalsIgnoreCase()` calls with a string literal argument.\n\nSome coding standards specify that string literals should be the qualifier of `equals()`, rather than\nargument, thus minimizing `NullPointerException`-s.\n\nA quick-fix is available to exchange the literal and the expression.\n\n**Example:**\n\n\n boolean isFoo(String value) {\n return value.equals(\"foo\");\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isFoo(String value) {\n return \"foo\".equals(value);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LiteralAsArgToStringEquals",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryEmptyArrayUsage",
+ "shortDescription": {
+ "text": "Unnecessary zero length array usage"
+ },
+ "fullDescription": {
+ "text": "Reports allocations of arrays with known lengths of zero when there is a constant for that in the class of the array's element type. As zero-length arrays are immutable, you can save memory reusing the same array instance. Example: 'class Item {\n // Public zero-length array constant that can be reused \n public static final Item[] EMPTY_ARRAY = new Item[0];\n }\n class EmptyNode {\n Item[] getChildren() {\n // Unnecessary zero-length array creation\n return new Item[0];\n }\n }' After the quick-fix is applied: 'class EmptyNode {\n Item[] getChildren() {\n return Item.EMPTY_ARRAY;\n }\n }'",
+ "markdown": "Reports allocations of arrays with known lengths of zero when there is a constant for that in the class of the array's element type. As zero-length arrays are immutable, you can save memory reusing the same array instance.\n\n**Example:**\n\n\n class Item {\n // Public zero-length array constant that can be reused \n public static final Item[] EMPTY_ARRAY = new Item[0];\n }\n class EmptyNode {\n Item[] getChildren() {\n // Unnecessary zero-length array creation\n return new Item[0];\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class EmptyNode {\n Item[] getChildren() {\n return Item.EMPTY_ARRAY;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstantForZeroLengthArrayAllocation",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Memory",
+ "index": 71,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DuplicateExpressions",
+ "shortDescription": {
+ "text": "Multiple occurrences of the same expression"
+ },
+ "fullDescription": {
+ "text": "Reports multiple equivalent occurrences of the same expression within a method (or constructor, or class initializer) if the result of the expression can be reused. The expression is reported if it's free of side effects and its result is always the same (in terms of 'Object.equals()'). The examples of such expressions are 'a + b', 'Math.max(a, b)', 'a.equals(b)', 's.substring(a,b)'. To make sure the result is always the same, it's verified that the variables used in the expression don't change their values between the occurrences of the expression. Such expressions may contain methods of immutable classes like 'String', 'BigDecimal', and so on, and of utility classes like 'Objects', 'Math' (except 'random()'). The well-known methods, such as 'Object.equals()', 'Object.hashCode()', 'Object.toString()', 'Comparable.compareTo()', and 'Comparator.compare()' are OK as well because they normally don't have any observable side effects. Use the Expression complexity threshold option to specify the minimal expression complexity threshold. Specifying bigger numbers will remove reports on short expressions. 'Path.of' and 'Paths.get' calls are treated as equivalent calls if they have the same arguments. These calls are always reported no matter how complex their arguments are. This behaviour can be tweaked using different complexity threshold. New in 2018.3",
+ "markdown": "Reports multiple equivalent occurrences of the same expression within a method (or constructor, or class initializer) if the result of the expression can be reused.\n\n\nThe expression is reported if it's free of side effects and its result is always the same (in terms of `Object.equals()`).\nThe examples of such expressions are `a + b`, `Math.max(a, b)`, `a.equals(b)`,\n`s.substring(a,b)`. To make sure the result is always the same, it's verified that the variables used in the expression don't\nchange their values between the occurrences of the expression.\n\n\nSuch expressions may contain methods of immutable classes like `String`, `BigDecimal`, and so on,\nand of utility classes like `Objects`, `Math` (except `random()`).\nThe well-known methods, such as `Object.equals()`, `Object.hashCode()`, `Object.toString()`,\n`Comparable.compareTo()`, and `Comparator.compare()` are OK as well because they normally don't have\nany observable side effects.\n\n\nUse the **Expression complexity threshold** option to specify the minimal expression complexity threshold. Specifying bigger\nnumbers will remove reports on short expressions.\n\n\n`Path.of` and `Paths.get` calls are treated as equivalent calls if they have the same arguments. These calls\nare always reported no matter how complex their arguments are. This behaviour can be tweaked using different complexity threshold.\n\nNew in 2018.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "DuplicateExpressions",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 57,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BooleanConstructor",
+ "shortDescription": {
+ "text": "Boolean constructor call"
+ },
+ "fullDescription": {
+ "text": "Reports creation of 'Boolean' objects. Constructing new 'Boolean' objects is rarely necessary, and may cause performance problems if done often enough. Also, 'Boolean' constructors are deprecated since Java 9 and could be removed or made inaccessible in future Java versions. Example: 'Boolean b1 = new Boolean(true);\n Boolean b2 = new Boolean(str);' After the quick-fix is applied: 'Boolean b1 = Boolean.TRUE;\n Boolean b2 = Boolean.valueOf(str);'",
+ "markdown": "Reports creation of `Boolean` objects.\n\n\nConstructing new `Boolean` objects is rarely necessary,\nand may cause performance problems if done often enough. Also, `Boolean`\nconstructors are deprecated since Java 9 and could be removed or made\ninaccessible in future Java versions.\n\n**Example:**\n\n\n Boolean b1 = new Boolean(true);\n Boolean b2 = new Boolean(str);\n\nAfter the quick-fix is applied:\n\n\n Boolean b1 = Boolean.TRUE;\n Boolean b2 = Boolean.valueOf(str);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BooleanConstructorCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 58,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TooBroadScope",
+ "shortDescription": {
+ "text": "Scope of variable is too broad"
+ },
+ "fullDescription": {
+ "text": "Reports any variable declarations that can be moved to a smaller scope. This inspection is especially useful for Pascal style declarations at the beginning of a method. Additionally variables with too broad a scope are also often left behind after refactorings. Example: 'StringBuilder sb = new StringBuilder();\n System.out.println();\n sb.append(1);' After the quick-fix is applied: 'System.out.println();\n StringBuilder sb = new StringBuilder();\n sb.append(1);' Configure the inspection: Use the Only report variables that can be moved into inner blocks option to report only those variables that can be moved inside deeper code blocks. For example, when the option is enabled, the movement will not be suggested for the 'sb' variable above. However, it will be suggested for the following code: 'StringBuilder sb = new StringBuilder(a);\n if (flag) {\n sb.append(1);\n }' Use the Report variables with a new expression as initializer (potentially unsafe) option to report variables that are initialized with a new expression. This makes the inspection potentially unsafe when the constructor has non-local side effects. For example, when the option is enabled, the movement will be suggested for the 'foo' variable: 'class Foo {\n static List fooList = new ArrayList<>();\n String bar;\n\n Foo(String bar) {\n this.bar = bar;\n fooList.add(this);\n }\n\n public static void main(String[] args) {\n // movement is possible even though is unsafe\n Foo foo = new Foo(\"bar\");\n System.out.println(fooList.size());\n System.out.println(foo.bar);\n }\n }'",
+ "markdown": "Reports any variable declarations that can be moved to a smaller scope.\n\nThis inspection is especially\nuseful for *Pascal style* declarations at the beginning of a method. Additionally variables with too broad a\nscope are also often left behind after refactorings.\n\n**Example:**\n\n\n StringBuilder sb = new StringBuilder();\n System.out.println();\n sb.append(1);\n\nAfter the quick-fix is applied:\n\n\n System.out.println();\n StringBuilder sb = new StringBuilder();\n sb.append(1);\n\nConfigure the inspection:\n\n* Use the **Only report variables that can be moved into inner blocks** option to report only those variables that can be moved inside deeper code blocks. For example, when the option is enabled, the movement will not be suggested for the `sb` variable above. However, it will be suggested for the following code:\n\n\n StringBuilder sb = new StringBuilder(a);\n if (flag) {\n sb.append(1);\n }\n\n* Use the **Report variables with a new expression as initializer\n (potentially unsafe)** option to report variables that are initialized with a new expression. This makes the inspection potentially unsafe when the constructor has non-local side effects. For example, when the option is enabled, the movement will be suggested for the `foo` variable:\n\n\n class Foo {\n static List fooList = new ArrayList<>();\n String bar;\n\n Foo(String bar) {\n this.bar = bar;\n fooList.add(this);\n }\n\n public static void main(String[] args) {\n // movement is possible even though is unsafe\n Foo foo = new Foo(\"bar\");\n System.out.println(fooList.size());\n System.out.println(foo.bar);\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "TooBroadScope",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Data flow",
+ "index": 24,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThrowableSupplierOnlyThrowException",
+ "shortDescription": {
+ "text": "Throwable supplier never returns a value"
+ },
+ "fullDescription": {
+ "text": "Reports 'Supplier' lambdas in 'Optional.orElseThrow()' calls that throw an exception, instead of returning it. Example: 'optional.orElseThrow(() -> {\n throw new RuntimeException();\n});' After the quick-fix is applied: 'optional.orElseThrow(() -> new RuntimeException());' New in 2023.1",
+ "markdown": "Reports `Supplier` lambdas in `Optional.orElseThrow()` calls that throw an exception, instead of returning it.\n\n**Example:**\n\n\n optional.orElseThrow(() -> {\n throw new RuntimeException();\n });\n\nAfter the quick-fix is applied:\n\n\n optional.orElseThrow(() -> new RuntimeException());\n\nNew in 2023.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ThrowableSupplierOnlyThrowException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IfStatementMissingBreakInLoop",
+ "shortDescription": {
+ "text": "Early loop exit in 'if' condition"
+ },
+ "fullDescription": {
+ "text": "Reports loops with an 'if' statement that can end with 'break' without changing the semantics. This prevents redundant loop iterations. Example: 'boolean found = false;\n for (int i = 0; i < arr.length; i++) {\n if (Objects.equals(value, arr[i])) {\n found = true;\n }\n }' After the quick-fix is applied: 'boolean found = false;\n for (int i = 0; i < arr.length; i++) {\n if (Objects.equals(value, arr[i])) {\n found = true;\n break;\n }\n }' New in 2019.2",
+ "markdown": "Reports loops with an `if` statement that can end with `break` without changing the semantics. This prevents redundant loop iterations.\n\n**Example:**\n\n\n boolean found = false;\n for (int i = 0; i < arr.length; i++) {\n if (Objects.equals(value, arr[i])) {\n found = true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n boolean found = false;\n for (int i = 0; i < arr.length; i++) {\n if (Objects.equals(value, arr[i])) {\n found = true;\n break;\n }\n }\n\nNew in 2019.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IfStatementMissingBreakInLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantStreamOptionalCall",
+ "shortDescription": {
+ "text": "Redundant step in 'Stream' or 'Optional' call chain"
+ },
+ "fullDescription": {
+ "text": "Reports redundant 'Stream' or 'Optional' calls like 'map(x -> x)', 'filter(x -> true)' or redundant 'sorted()' or 'distinct()' calls. Note that a mapping operation in code like 'streamOfIntegers.map(Integer::valueOf)' works as 'requireNonNull()' check: if the stream contains 'null', it throws a 'NullPointerException', thus it's not absolutely redundant. Disable the Report redundant boxing in Stream.map() option if you do not want such cases to be reported. This inspection only reports if the language level of the project or module is 8 or higher.",
+ "markdown": "Reports redundant `Stream` or `Optional` calls like `map(x -> x)`, `filter(x -> true)` or redundant `sorted()` or `distinct()` calls.\n\nNote that a mapping operation in code like `streamOfIntegers.map(Integer::valueOf)`\nworks as `requireNonNull()` check:\nif the stream contains `null`, it throws a `NullPointerException`, thus it's not absolutely redundant.\nDisable the **Report redundant boxing in Stream.map()** option if you do not want such cases to be reported.\n\nThis inspection only reports if the language level of the project or module is 8 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantStreamOptionalCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThreadPriority",
+ "shortDescription": {
+ "text": "Call to 'Thread.setPriority()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'Thread.setPriority()'. Modifying priorities of threads is an inherently non-portable operation, as no guarantees are given in the Java specification of how priorities are used in scheduling threads, or even whether they are used at all.",
+ "markdown": "Reports calls to `Thread.setPriority()`. Modifying priorities of threads is an inherently non-portable operation, as no guarantees are given in the Java specification of how priorities are used in scheduling threads, or even whether they are used at all."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToThreadSetPriority",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JUnitMalformedDeclaration",
+ "shortDescription": {
+ "text": "JUnit malformed declaration"
+ },
+ "fullDescription": {
+ "text": "Reports JUnit test member declarations that are malformed and are likely not recognized by the JUnit test framework. The following problems are reported by this inspection: Test classes that can't be constructed Fields annotated by '@RegisterExtension' that have the wrong type or are not declared as static when it is required Static or private inner classes annotated with '@Nested' Parameterized tests that are defined without a source Parameterized tests with a '@MethodSource' that has an unknown, non-static or no-arg target Mismatched types between parameterized test method parameter and the specified '@ValueSource' or '@EnumSource' values Tests that are annotated by more than one of '@Test', '@ParameterizedTest' or '@RepeatedTest' 'setup()' or 'tearDown()' methods that are not public, whose return type is not void or take arguments 'suite()' methods that are private, take arguments or are not static Methods annotated by '@BeforeClass', '@AfterClass', '@BeforeAll' or '@AfterAll' that are not public, not static, whose return type is not void or do not have a valid parameter list Methods annotated by '@Before', '@After', '@BeforeEach' or '@AfterEach' that are not public, whose return type is not void or take arguments Injected 'RepetitionInfo' in '@BeforeAll' or '@AfterAll' methods Injected 'RepetitionInfo' in '@BeforeEach' or '@AfterEach' methods that are used by '@Test' annotated tests Fields and methods annotated by '@DataPoint' or '@DataPoints' that are not public or not static Fields and methods annotated by '@Rule' that are not public or not a subtype of 'TestRule' or 'MethodRule' Fields and methods annotated by '@ClassRule' that are not public, not static or not a subtype of 'TestRule' Methods inside a subclass of 'TestCase' with a 'test' prefix that are not public, whose return type is not void, take arguments or are static Methods annotated by '@Test' that are not public, whose return type is not void, take arguments or are static Note that in Kotlin, suspending functions do have arguments and a non-void return type. Therefore, they also will not be executed by the JUnit test runner. This inspection will also report about this problem. Malformed '@Before' method example (Java): '@Before private int foo(int arg) { ... }' After the quick-fix is applied: '@Before public void foo() { ... }' Missing method source example (Kotlin): 'class Example {\n @MethodSource(\"parameters\")\n @ParameterizedTest\n fun foo(param: String) { ... }\n }' After the quick-fix is applied: 'class Example {\n @MethodSource(\"parameters\")\n @ParameterizedTest\n fun foo(param: String) { ... }\n\n companion object {\n @JvmStatic\n fun parameters(): Stream {\n TODO(\"Not yet implemented\")\n }\n }\n }' Use the inspection options to specify annotations. Any parameter annotated with one of these annotations will not be reported.",
+ "markdown": "Reports JUnit test member declarations that are malformed and are likely not recognized by the JUnit test framework. The following problems are reported by this inspection:\n\n* Test classes that can't be constructed\n* Fields annotated by `@RegisterExtension` that have the wrong type or are not declared as static when it is required\n* Static or private inner classes annotated with `@Nested`\n* Parameterized tests that are defined without a source\n* Parameterized tests with a `@MethodSource` that has an unknown, non-static or no-arg target\n* Mismatched types between parameterized test method parameter and the specified `@ValueSource` or `@EnumSource` values\n* Tests that are annotated by more than one of `@Test`, `@ParameterizedTest` or `@RepeatedTest`\n* `setup()` or `tearDown()` methods that are not public, whose return type is not void or take arguments\n* `suite()` methods that are private, take arguments or are not static\n* Methods annotated by `@BeforeClass`, `@AfterClass`, `@BeforeAll` or `@AfterAll` that are not public, not static, whose return type is not void or do not have a valid parameter list\n* Methods annotated by `@Before`, `@After`, `@BeforeEach` or `@AfterEach` that are not public, whose return type is not void or take arguments\n* Injected `RepetitionInfo` in `@BeforeAll` or `@AfterAll` methods\n* Injected `RepetitionInfo` in `@BeforeEach` or `@AfterEach` methods that are used by `@Test` annotated tests\n* Fields and methods annotated by `@DataPoint` or `@DataPoints` that are not public or not static\n* Fields and methods annotated by `@Rule` that are not public or not a subtype of `TestRule` or `MethodRule`\n* Fields and methods annotated by `@ClassRule` that are not public, not static or not a subtype of `TestRule`\n* Methods inside a subclass of `TestCase` with a `test` prefix that are not public, whose return type is not void, take arguments or are static\n* Methods annotated by `@Test` that are not public, whose return type is not void, take arguments or are static\n\nNote that in Kotlin, suspending functions do have arguments and a non-void return type. Therefore, they also will not be executed by the JUnit test runner. This inspection will also report about this problem.\n\n**Malformed `@Before` method example (Java):**\n\n @Before private int foo(int arg) { ... } \n\nAfter the quick-fix is applied:\n\n @Before public void foo() { ... } \n\n**Missing method source example (Kotlin):**\n\n\n class Example {\n @MethodSource(\"parameters\")\n @ParameterizedTest\n fun foo(param: String) { ... }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n @MethodSource(\"parameters\")\n @ParameterizedTest\n fun foo(param: String) { ... }\n\n companion object {\n @JvmStatic\n fun parameters(): Stream {\n TODO(\"Not yet implemented\")\n }\n }\n }\n\nUse the inspection options to specify annotations. Any parameter annotated with one of these annotations will not be reported."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "JUnitMalformedDeclaration",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 93,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantStringFormatCall",
+ "shortDescription": {
+ "text": "Redundant call to 'String.format()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to methods like 'format()' and 'printf()' that can be safely removed or simplified. Example: 'System.out.println(String.format(\"Total count: %d\", 42));' After the quick-fix is applied: 'System.out.printf(\"Total count: %d%n\", 42);'",
+ "markdown": "Reports calls to methods like `format()` and `printf()` that can be safely removed or simplified.\n\n**Example:**\n\n\n System.out.println(String.format(\"Total count: %d\", 42));\n\nAfter the quick-fix is applied:\n\n\n System.out.printf(\"Total count: %d%n\", 42);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantStringFormatCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonFinalFieldOfException",
+ "shortDescription": {
+ "text": "Non-final field of 'Exception' class"
+ },
+ "fullDescription": {
+ "text": "Reports fields in subclasses of 'java.lang.Exception' that are not declared 'final'. Data on exception objects should not be modified because this may result in losing the error context for later debugging and logging. Example: 'public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }'",
+ "markdown": "Reports fields in subclasses of `java.lang.Exception` that are not declared `final`.\n\nData on exception objects should not be modified\nbecause this may result in losing the error context for later debugging and logging.\n\n**Example:**\n\n\n public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NonFinalFieldOfException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PointlessNullCheck",
+ "shortDescription": {
+ "text": "Unnecessary 'null' check before method call"
+ },
+ "fullDescription": {
+ "text": "Reports 'null' checks followed by a method call that will definitely return 'false' when 'null' is passed (e.g. 'Class.isInstance'). Such a check seems excessive as the method call will always return 'false' in this case. Example: 'if (x != null && myClass.isInstance(x)) { ... }' After the quick-fix is applied: 'if (myClass.isInstance(x)) { ... }'",
+ "markdown": "Reports `null` checks followed by a method call that will definitely return `false` when `null` is passed (e.g. `Class.isInstance`).\n\nSuch a check seems excessive as the method call will always return `false` in this case.\n\n**Example:**\n\n\n if (x != null && myClass.isInstance(x)) { ... }\n\nAfter the quick-fix is applied:\n\n\n if (myClass.isInstance(x)) { ... }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PointlessNullCheck",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodOverridesStaticMethod",
+ "shortDescription": {
+ "text": "Method tries to override 'static' method of superclass"
+ },
+ "fullDescription": {
+ "text": "Reports 'static' methods with a signature identical to a 'static' method of a superclass. Such a method may look like an override when in fact it hides the method from the superclass because 'static' methods in Java cannot be overridden. Example: 'class Parent {\n static void method(){}\n }\n\n class Example extends Parent {\n static void method(){} //warning\n }'",
+ "markdown": "Reports `static` methods with a signature identical to a `static` method of a superclass. Such a method may look like an override when in fact it hides the method from the superclass because `static` methods in Java cannot be overridden.\n\n**Example:**\n\n\n class Parent {\n static void method(){}\n }\n\n class Example extends Parent {\n static void method(){} //warning\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodOverridesStaticMethodOfSuperclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnclearBinaryExpression",
+ "shortDescription": {
+ "text": "Multiple operators with different precedence"
+ },
+ "fullDescription": {
+ "text": "Reports binary, conditional, or 'instanceof' expressions that consist of different operators without parentheses. Such expressions can be less readable due to different precedence rules of operators. Example: 'int n = 3 + 9 * 8 + 1;' After quick-fix is applied: 'int n = 3 + (9 * 8) + 1;'",
+ "markdown": "Reports binary, conditional, or `instanceof` expressions that consist of different operators without parentheses. Such expressions can be less readable due to different precedence rules of operators.\n\nExample:\n\n\n int n = 3 + 9 * 8 + 1;\n\nAfter quick-fix is applied:\n\n\n int n = 3 + (9 * 8) + 1;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "UnclearExpression",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantCompareToJavaTime",
+ "shortDescription": {
+ "text": "Expression with 'java.time' 'compareTo()' call can be simplified"
+ },
+ "fullDescription": {
+ "text": "Reports 'java.time' comparisons with 'compareTo()' calls that can be replaced with 'isAfter()', 'isBefore()' or 'isEqual()' calls. Example: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;' After the quick-fix is applied: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);' New in 2022.3",
+ "markdown": "Reports `java.time` comparisons with `compareTo()` calls that can be replaced with `isAfter()`, `isBefore()` or `isEqual()` calls.\n\nExample:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;\n\nAfter the quick-fix is applied:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantCompareToJavaTime",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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\";' 'var' keyword appeared in Java 10. This inspection can help to downgrade for backward compatibility with earlier Java versions.",
+ "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\n\n`var` *keyword* appeared in Java 10.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "VariableTypeCanBeExplicit",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 10",
+ "index": 109,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ChainedMethodCall",
+ "shortDescription": {
+ "text": "Chained method calls"
+ },
+ "fullDescription": {
+ "text": "Reports method calls whose target is another method call. The quick-fix suggests to introduce a local variable. Example: 'class X {\n int foo(File f) {\n return f.getName().length();\n }\n }' After the quick-fix is applied: 'class X {\n int foo(File f) {\n final String name = f.getName();\n return name.length();\n }\n }' Use the inspection options to toggle warnings for the following cases: chained method calls in field initializers, for instance, 'private final int i = new Random().nextInt();' chained method calls operating on the same type, for instance, 'new StringBuilder().append(\"x: \").append(new X()).append(\"y: \").append(new Y()).toString();'.",
+ "markdown": "Reports method calls whose target is another method call. The quick-fix suggests to introduce a local variable.\n\n**Example:**\n\n\n class X {\n int foo(File f) {\n return f.getName().length();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n int foo(File f) {\n final String name = f.getName();\n return name.length();\n }\n }\n\nUse the inspection options to toggle warnings for the following cases:\n\n*\n chained method calls in field initializers,\n for instance, `private final int i = new Random().nextInt();`\n\n*\n chained method calls operating on the same type,\n for instance, `new StringBuilder().append(\"x: \").append(new X()).append(\"y: \").append(new Y()).toString();`."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ChainedMethodCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UtilityClassWithoutPrivateConstructor",
+ "shortDescription": {
+ "text": "Utility class without 'private' constructor"
+ },
+ "fullDescription": {
+ "text": "Reports utility classes without 'private' constructors. Utility classes have all fields and methods declared as 'static'. Creating 'private' constructors in utility classes prevents them from being accidentally instantiated. Use the Ignore if annotated by option to specify special annotations. The inspection ignores classes marked with one of these annotations. Use the Ignore classes with only a main method option to ignore classes with no methods other than the main one.",
+ "markdown": "Reports utility classes without `private` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating `private`\nconstructors in utility classes prevents them from being accidentally instantiated.\n\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection ignores classes marked with one of\nthese annotations.\n\n\nUse the **Ignore classes with only a main method** option to ignore classes with no methods other than the main one."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UtilityClassWithoutPrivateConstructor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtendsUtilityClass",
+ "shortDescription": {
+ "text": "Class extends utility class"
+ },
+ "fullDescription": {
+ "text": "Reports classes that extend a utility class. A utility class is a non-empty class in which all fields and methods are static. Extending a utility class also allows for inadvertent object instantiation of the utility class, because the constructor cannot be made private in order to allow extension. Configure the inspection: Use the Ignore if overriding class is a utility class option to ignore any classes that override a utility class but are also utility classes themselves.",
+ "markdown": "Reports classes that extend a utility class.\n\n\nA utility class is a non-empty class in which all fields and methods are static.\nExtending a utility class also allows for inadvertent object instantiation of the\nutility class, because the constructor cannot be made private in order to allow extension.\n\n\nConfigure the inspection:\n\n* Use the **Ignore if overriding class is a utility class** option to ignore any classes that override a utility class but are also utility classes themselves."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExtendsUtilityClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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 only reports if the language level of the project or module is 8 or higher.",
+ "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 only reports if the language level of the project or module is 8 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java8ListSort",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssertEqualsCalledOnArray",
+ "shortDescription": {
+ "text": "'assertEquals()' called on array"
+ },
+ "fullDescription": {
+ "text": "Reports JUnit 'assertEquals()' calls with arguments of an array type. Such methods compare the arrays' identities instead of the arrays' contents. Array contents should be checked with the 'assertArrayEquals()' method. Example: '@Test\n public void testSort() {\n int[] actual = {248, 496, 0, 56};\n Arrays.sort(actual);\n Assert.assertEquals(new int[] {0, 56, 248, 496}, actual);\n }' After the quick-fix is applied: '@Test\n public void testSort() {\n int[] actual = {248, 496, 0, 56};\n Arrays.sort(actual);\n Assert.assertArrayEquals(new int[] {0, 56, 248, 496}, actual);\n }'",
+ "markdown": "Reports JUnit `assertEquals()` calls with arguments of an array type. Such methods compare the arrays' identities instead of the arrays' contents. Array contents should be checked with the `assertArrayEquals()` method.\n\n**Example:**\n\n\n @Test\n public void testSort() {\n int[] actual = {248, 496, 0, 56};\n Arrays.sort(actual);\n Assert.assertEquals(new int[] {0, 56, 248, 496}, actual);\n }\n\nAfter the quick-fix is applied:\n\n\n @Test\n public void testSort() {\n int[] actual = {248, 496, 0, 56};\n Arrays.sort(actual);\n Assert.assertArrayEquals(new int[] {0, 56, 248, 496}, actual);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssertEqualsCalledOnArray",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssertMessageNotString",
+ "shortDescription": {
+ "text": "'assert' message is not a string"
+ },
+ "fullDescription": {
+ "text": "Reports 'assert' messages that are not of the 'java.lang.String' type. Using a string provides more information to help diagnose the failure or the assertion reason. Example: 'void foo(List myList) {\n assert myList.isEmpty() : false;\n }' Use the Only warn when the 'assert' message type is 'boolean' or 'java.lang.Boolean' option to only warn when the 'assert' message type is 'boolean' or 'java.lang.Boolean'. A 'boolean' detail message is unlikely to provide additional information about an assertion failure and could result from a mistakenly entered ':' instead of '&'.",
+ "markdown": "Reports `assert` messages that are not of the `java.lang.String` type.\n\nUsing a string provides more information to help diagnose the failure\nor the assertion reason.\n\n**Example:**\n\n\n void foo(List myList) {\n assert myList.isEmpty() : false;\n }\n\n\nUse the **Only warn when the `assert` message type is 'boolean' or 'java.lang.Boolean'** option to only warn when the `assert` message type is `boolean` or `java.lang.Boolean`.\nA `boolean` detail message is unlikely to provide additional information about an assertion failure\nand could result from a mistakenly entered `:` instead of `&`."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssertMessageNotString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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));'",
+ "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"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparatorCombinators",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PatternVariableCanBeUsed",
+ "shortDescription": {
+ "text": "Pattern variable can be used"
+ },
+ "fullDescription": {
+ "text": "Reports local variable declarations that can be replaced with pattern variables, which are usually more compact. Example: 'if (obj instanceof String) {\n String str = (String) obj;\n System.out.println(str);\n }' Can be replaced with: 'if (obj instanceof String str) {\n System.out.println(str);\n }' This inspection only reports if the language level of the project or module is 16 or higher New in 2020.1",
+ "markdown": "Reports local variable declarations that can be replaced with pattern variables, which are usually more compact.\n\n**Example:**\n\n\n if (obj instanceof String) {\n String str = (String) obj;\n System.out.println(str);\n }\n\nCan be replaced with:\n\n\n if (obj instanceof String str) {\n System.out.println(str);\n }\n\nThis inspection only reports if the language level of the project or module is 16 or higher\n\nNew in 2020.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PatternVariableCanBeUsed",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 16",
+ "index": 110,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 111,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 29,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AnonymousClassVariableHidesContainingMethodVariable",
+ "shortDescription": {
+ "text": "Anonymous class variable hides variable in containing method"
+ },
+ "fullDescription": {
+ "text": "Reports fields in an anonymous class that are named identically to local variables or parameters of the containing method or lambda expression. As a result of such naming, you may accidentally use the anonymous class field where the identically named variable or parameter from the containing method is intended. A quick-fix is suggested to rename the field. Example: 'class Test {\n public Test(String value) {\n Object foo = new Object() {\n private String value = \"TEST\";\n public void foo() {\n System.out.println(value); //the field is accessed, not the parameter\n }\n };\n }\n }'",
+ "markdown": "Reports fields in an anonymous class that are named identically to local variables or parameters of the containing method or lambda expression.\n\n\nAs a result of such naming, you may accidentally use the anonymous class field where\nthe identically named variable or parameter from the containing method is intended.\n\nA quick-fix is suggested to rename the field.\n\n**Example:**\n\n\n class Test {\n public Test(String value) {\n Object foo = new Object() {\n private String value = \"TEST\";\n public void foo() {\n System.out.println(value); //the field is accessed, not the parameter\n }\n };\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AnonymousClassVariableHidesContainingMethodVariable",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodRefCanBeReplacedWithLambda",
+ "shortDescription": {
+ "text": "Method reference can be replaced with lambda"
+ },
+ "fullDescription": {
+ "text": "Reports method references, like 'MyClass::myMethod' and 'myObject::myMethod', and suggests replacing them with an equivalent lambda expression. Lambda expressions can be easier to modify than method references. Example: 'System.out::println' After the quick-fix is applied: 's -> System.out.println(s)' By default, this inspection does not highlight the code in the editor, but only provides a quick-fix.",
+ "markdown": "Reports method references, like `MyClass::myMethod` and `myObject::myMethod`, and suggests replacing them with an equivalent lambda expression.\n\nLambda expressions can be easier to modify than method references.\n\nExample:\n\n\n System.out::println\n\nAfter the quick-fix is applied:\n\n\n s -> System.out.println(s)\n\nBy default, this inspection does not highlight the code in the editor, but only provides a quick-fix."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "MethodRefCanBeReplacedWithLambda",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NestedSynchronizedStatement",
+ "shortDescription": {
+ "text": "Nested 'synchronized' statement"
+ },
+ "fullDescription": {
+ "text": "Reports nested 'synchronized' statements. It is recommended to avoid nested synchronization if possible, because in some cases it may lead to a deadlock. Example: 'synchronized (lockA){\n //thread 1 is waiting for lockB\n synchronized (lockB){ //warning\n }\n }\n ...\n synchronized (lockB) {\n //thread 2 is waiting for lockA\n synchronized (lockA) { //warning\n }\n }'",
+ "markdown": "Reports nested `synchronized` statements. It is recommended to avoid nested synchronization if possible, because in some cases it may lead to a deadlock.\n\n**Example:**\n\n\n synchronized (lockA){\n //thread 1 is waiting for lockB\n synchronized (lockB){ //warning\n }\n }\n ...\n synchronized (lockB) {\n //thread 2 is waiting for lockA\n synchronized (lockA) { //warning\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NestedSynchronizedStatement",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IncorrectDateTimeFormat",
+ "shortDescription": {
+ "text": "Incorrect 'DateTimeFormat' pattern"
+ },
+ "fullDescription": {
+ "text": "Reports incorrect date time format patterns. The following errors are reported: Unsupported pattern letters, like \"TT\" Using reserved characters, like \"#\" Incorrect use of padding Unbalanced brackets Incorrect amount of consecutive pattern letters Examples: 'DateTimeFormatter.ofPattern(\"[][]]\"); // Closing ']' without previous opening '['\n DateTimeFormatter.ofPattern(\"TT\"); // Illegal pattern letter 'T'\n DateTimeFormatter.ofPattern(\"{\"); // Use of reserved character '{'\n DateTimeFormatter.ofPattern(\"MMMMMM\"); // Too many consecutive pattern letters 'M'' New in 2022.3",
+ "markdown": "Reports incorrect date time format patterns.\n\nThe following errors are reported:\n\n* Unsupported pattern letters, like \"TT\"\n* Using reserved characters, like \"#\"\n* Incorrect use of padding\n* Unbalanced brackets\n* Incorrect amount of consecutive pattern letters\n\nExamples:\n\n\n DateTimeFormatter.ofPattern(\"[][]]\"); // Closing ']' without previous opening '['\n DateTimeFormatter.ofPattern(\"TT\"); // Illegal pattern letter 'T'\n DateTimeFormatter.ofPattern(\"{\"); // Use of reserved character '{'\n DateTimeFormatter.ofPattern(\"MMMMMM\"); // Too many consecutive pattern letters 'M'\n\nNew in 2022.3"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IncorrectDateTimeFormat",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": "IC"
+ }
+ },
+ "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": 87,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": "IC"
+ }
+ },
+ "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": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryFullyQualifiedName",
+ "shortDescription": {
+ "text": "Unnecessary fully qualified name"
+ },
+ "fullDescription": {
+ "text": "Reports fully qualified class names that can be shortened. The quick-fix shortens fully qualified names and adds import statements if necessary. Example: 'class ListWrapper {\n java.util.List l;\n }' After the quick-fix is applied: 'import java.util.List;\n class ListWrapper {\n List l;\n }' Configure the inspection: Use the Ignore in Java 9 module statements option to ignore fully qualified names inside the Java 9 'provides' and 'uses' module statements. In Settings | Editor | Code Style | Java | Imports, use the following options to configure the inspection: Use the Insert imports for inner classes option if references to inner classes should be qualified with the outer class. Use the Use fully qualified class names in JavaDoc option to allow fully qualified names in Javadocs.",
+ "markdown": "Reports fully qualified class names that can be shortened.\n\nThe quick-fix shortens fully qualified names and adds import statements if necessary.\n\nExample:\n\n\n class ListWrapper {\n java.util.List l;\n }\n\nAfter the quick-fix is applied:\n\n\n import java.util.List;\n class ListWrapper {\n List l;\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore in Java 9 module statements** option to ignore fully qualified names inside the Java 9\n`provides` and `uses` module statements.\n\n\nIn [Settings \\| Editor \\| Code Style \\| Java \\| Imports](settings://preferences.sourceCode.Java?JavaDoc%20Inner),\nuse the following options to configure the inspection:\n\n* Use the **Insert imports for inner classes** option if references to inner classes should be qualified with the outer class.\n* Use the **Use fully qualified class names in JavaDoc** option to allow fully qualified names in Javadocs."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "UnnecessaryFullyQualifiedName",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NegatedConditional",
+ "shortDescription": {
+ "text": "Conditional expression with negated condition"
+ },
+ "fullDescription": {
+ "text": "Reports conditional expressions whose conditions are negated. Flipping the order of the conditional expression branches usually increases the clarity of such statements. Use the Ignore '!= null' comparisons and Ignore '!= 0' comparisons options to ignore comparisons of the form 'obj != null' or 'num != 0'. Since 'obj != null' effectively means \"obj exists\", the meaning of the whole expression does not involve any negation and is therefore easy to understand. The same reasoning applies to 'num != 0' expressions, especially when using bit masks. These forms have the added benefit of mentioning the interesting case first. In most cases, the value for the '== null' branch is 'null' itself, like in the following examples: 'static String getName(Person p) {\n return p != null ? p.getName() : null;\n }\n\n static String getExecutableString(int fileMode) {\n return (fileMode & 0b001001001) != 0 ? \"executable\" : \"non-executable\";\n }'",
+ "markdown": "Reports conditional expressions whose conditions are negated.\n\nFlipping the order of the conditional expression branches usually increases the clarity of such statements.\n\n\nUse the **Ignore '!= null' comparisons** and **Ignore '!= 0' comparisons** options to ignore comparisons of the form\n`obj != null` or `num != 0`.\nSince `obj != null` effectively means \"obj exists\",\nthe meaning of the whole expression does not involve any negation\nand is therefore easy to understand.\n\n\nThe same reasoning applies to `num != 0` expressions, especially when using bit masks.\n\n\nThese forms have the added benefit of mentioning the interesting case first.\nIn most cases, the value for the `== null` branch is `null` itself,\nlike in the following examples:\n\n\n static String getName(Person p) {\n return p != null ? p.getName() : null;\n }\n\n static String getExecutableString(int fileMode) {\n return (fileMode & 0b001001001) != 0 ? \"executable\" : \"non-executable\";\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConditionalExpressionWithNegatedCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BooleanParameter",
+ "shortDescription": {
+ "text": "'public' method with 'boolean' parameter"
+ },
+ "fullDescription": {
+ "text": "Reports public methods that accept a 'boolean' parameter. It's almost always bad practice to add a 'boolean' parameter to a public method (part of an API) if that method is not a setter. When reading code using such a method, it can be difficult to decipher what the 'boolean' stands for without looking at the source or documentation. This problem is also known as the boolean trap. The 'boolean' parameter can often be replaced with an 'enum'. Example: '// Warning: it's hard to understand what the\n // boolean parameters mean when looking at\n // a call to this method\n public boolean setPermission(File f,\n int access,\n boolean enable,\n boolean ownerOnly) {\n // ...\n }' Use the Only report methods with multiple boolean parameters option to warn only when a method contains more than one boolean parameter.",
+ "markdown": "Reports public methods that accept a `boolean` parameter.\n\nIt's almost always bad practice to add a `boolean` parameter to a public method (part of an API) if that method is not a setter.\nWhen reading code using such a method, it can be difficult to decipher what the `boolean` stands for without looking at\nthe source or documentation.\n\nThis problem is also known as [the boolean trap](https://ariya.io/2011/08/hall-of-api-shame-boolean-trap).\nThe `boolean` parameter can often be replaced with an `enum`.\n\nExample:\n\n\n // Warning: it's hard to understand what the\n // boolean parameters mean when looking at\n // a call to this method\n public boolean setPermission(File f,\n int access,\n boolean enable,\n boolean ownerOnly) {\n // ...\n }\n\n\nUse the **Only report methods with multiple boolean parameters** option to warn only when a method contains more than one boolean parameter."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BooleanParameter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 75,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 31,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 31,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "TestInProductSource",
+ "shortDescription": {
+ "text": "Test in product source"
+ },
+ "fullDescription": {
+ "text": "Reports test classes and test methods that are located in production source trees. This most likely a mistake and can result in test code being shipped into production.",
+ "markdown": "Reports test classes and test methods that are located in production source trees. This most likely a mistake and can result in test code being shipped into production."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "TestInProductSource",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CopyConstructorMissesField",
+ "shortDescription": {
+ "text": "Copy constructor misses field"
+ },
+ "fullDescription": {
+ "text": "Reports copy constructors that don't copy all the fields of the class. 'final' fields with initializers and 'transient' fields are considered unnecessary to copy. Example: 'class Point {\n\n private int x;\n private int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n Point(Point other) {\n // fields x and y are not initialized\n }\n }' New in 2018.1",
+ "markdown": "Reports copy constructors that don't copy all the fields of the class.\n\n\n`final` fields with initializers and `transient` fields are considered unnecessary to copy.\n\n**Example:**\n\n\n class Point {\n\n private int x;\n private int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n Point(Point other) {\n // fields x and y are not initialized\n }\n }\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CopyConstructorMissesField",
+ "cweIds": [
+ 665
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CastCanBeRemovedNarrowingVariableType",
+ "shortDescription": {
+ "text": "Too weak variable type leads to unnecessary cast"
+ },
+ "fullDescription": {
+ "text": "Reports type casts that can be removed if the variable type is narrowed to the cast type. Example: 'Object x = \" string \";\n System.out.println(((String)x).trim());' Here, changing the type of 'x' to 'String' makes the cast redundant. The suggested quick-fix updates the variable type and removes all redundant casts on that variable: 'String x = \" string \";\n System.out.println(x.trim());' New in 2018.2",
+ "markdown": "Reports type casts that can be removed if the variable type is narrowed to the cast type.\n\nExample:\n\n\n Object x = \" string \";\n System.out.println(((String)x).trim());\n\n\nHere, changing the type of `x` to `String` makes the cast redundant. The suggested quick-fix updates the variable type and\nremoves all redundant casts on that variable:\n\n\n String x = \" string \";\n System.out.println(x.trim());\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CastCanBeRemovedNarrowingVariableType",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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 only reports if the language level of the project or module is 9 or higher.",
+ "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 only reports if the language level of the project or module is 9 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Java9ModuleExportsPackageToItself",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": "IC"
+ }
+ },
+ "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": 66,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 50,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssignmentToStaticFieldFromInstanceMethod",
+ "shortDescription": {
+ "text": "Assignment to static field from instance context"
+ },
+ "fullDescription": {
+ "text": "Reports assignment to, or modification of 'static' fields from within an instance method. Although legal, such assignments are tricky to do safely and are often a result of marking fields 'static' inadvertently. Example: 'class Counter {\n private static int count = 0;\n\n void increment() {\n // Warning: updating a static field\n // from an instance method\n count++;\n }\n }'",
+ "markdown": "Reports assignment to, or modification of `static` fields from within an instance method.\n\nAlthough legal, such assignments are tricky to do\nsafely and are often a result of marking fields `static` inadvertently.\n\n**Example:**\n\n\n class Counter {\n private static int count = 0;\n\n void increment() {\n // Warning: updating a static field\n // from an instance method\n count++;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssignmentToStaticFieldFromInstanceMethod",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Assignment issues",
+ "index": 35,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 66,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 71,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AbstractClassWithOnlyOneDirectInheritor",
+ "shortDescription": {
+ "text": "Abstract class with a single direct inheritor"
+ },
+ "fullDescription": {
+ "text": "Reports abstract classes that have precisely one direct inheritor. While such classes may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the abstract class with its inheritor. 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: 'abstract class Base {} // will be reported\n\n class Inheritor extends Base {}'",
+ "markdown": "Reports abstract classes that have precisely one direct inheritor. While such classes may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the abstract class with its inheritor.\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 abstract class Base {} // will be reported\n\n class Inheritor extends Base {}\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AbstractClassWithOnlyOneDirectInheritor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 22,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 84,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnsecureRandomNumberGeneration",
+ "shortDescription": {
+ "text": "Insecure random number generation"
+ },
+ "fullDescription": {
+ "text": "Reports any uses of 'java.lang.Random' or 'java.lang.Math.random()'. In secure environments, 'java.secure.SecureRandom' is a better choice, since is offers cryptographically secure random number generation. Example: 'long token = new Random().nextLong();'",
+ "markdown": "Reports any uses of `java.lang.Random` or `java.lang.Math.random()`.\n\n\nIn secure environments,\n`java.secure.SecureRandom` is a better choice, since is offers cryptographically secure\nrandom number generation.\n\n**Example:**\n\n\n long token = new Random().nextLong();\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnsecureRandomNumberGeneration",
+ "cweIds": [
+ 330
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Security",
+ "index": 31,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NullableProblems",
+ "shortDescription": {
+ "text": "@NotNull/@Nullable problems"
+ },
+ "fullDescription": {
+ "text": "Reports problems related to nullability annotations. Examples: Overriding methods are not annotated: 'abstract class A {\n @NotNull abstract String m();\n}\nclass B extends A {\n String m() { return \"empty string\"; }\n}' Annotated primitive types: '@NotNull int myFoo;' Both '@Nullable' and '@NotNull' are present on the same member: '@Nullable @NotNull String myFooString;' Collection of nullable elements is assigned into a collection of non-null elements: 'void testList(List<@Nullable String> nullableList) {\n List<@NotNull String> list2 = nullableList;\n}' Use the Configure Annotations button to specify nullability annotations and the checkboxes to fine-tune where the inspection should provide warnings. This inspection only reports if the language level of the project or module is 5 or higher, and nullability annotations are available on the classpath.",
+ "markdown": "Reports problems related to nullability annotations.\n\n**Examples:**\n\n* Overriding methods are not annotated:\n\n\n abstract class A {\n @NotNull abstract String m();\n }\n class B extends A {\n String m() { return \"empty string\"; }\n }\n \n* Annotated primitive types: `@NotNull int myFoo;`\n* Both `@Nullable` and `@NotNull` are present on the same member: `@Nullable @NotNull String myFooString;`\n* Collection of nullable elements is assigned into a collection of non-null elements:\n\n\n void testList(List<@Nullable String> nullableList) {\n List<@NotNull String> list2 = nullableList;\n }\n \nUse the **Configure Annotations** button to specify nullability annotations and the checkboxes to fine-tune where the inspection should provide warnings.\n\nThis inspection only reports if the language level of the project or module is 5 or higher,\nand nullability annotations are available on the classpath."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "NullableProblems",
+ "cweIds": [
+ 476,
+ 754
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs/Nullability problems",
+ "index": 115,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "EqualsBetweenInconvertibleTypes",
+ "shortDescription": {
+ "text": "'equals()' between objects of inconvertible types"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'equals()' where the target and argument are of incompatible types. While such a call might theoretically be useful, most likely it is a bug. Example: 'new HashSet().equals(new TreeSet());'",
+ "markdown": "Reports calls to `equals()` where the target and argument are of incompatible types.\n\nWhile such a call might theoretically be useful, most likely it is a bug.\n\n**Example:**\n\n\n new HashSet().equals(new TreeSet());\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "EqualsBetweenInconvertibleTypes",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 7,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SynchronizationOnGetClass",
+ "shortDescription": {
+ "text": "Synchronization on 'getClass()'"
+ },
+ "fullDescription": {
+ "text": "Reports synchronization on a call to 'getClass()'. If the class containing the synchronization is subclassed, the subclass will synchronize on a different class object. Usually the call to 'getClass()' can be replaced with a class literal expression, for example 'String.class'. An even better solution is synchronizing on a 'private static final' lock object, access to which can be completely controlled. Example: 'synchronized(getClass()) {}'",
+ "markdown": "Reports synchronization on a call to `getClass()`.\n\n\nIf the class containing the synchronization is subclassed, the subclass\nwill\nsynchronize on a different class object. Usually the call to `getClass()` can be replaced with a class literal expression, for\nexample `String.class`. An even better solution is synchronizing on a `private static final` lock object, access to\nwhich can be completely controlled.\n\n**Example:**\n\n synchronized(getClass()) {}\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SynchronizationOnGetClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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 }'",
+ "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"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "RedundantExplicitVariableType",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 10",
+ "index": 109,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DuplicateCondition",
+ "shortDescription": {
+ "text": "Duplicate condition"
+ },
+ "fullDescription": {
+ "text": "Reports duplicate conditions in '&&' and '||' expressions and branches of 'if' statements. While sometimes duplicate conditions are intended, in most cases they the result of an oversight. Example: 'boolean result = digit1 != digit2 || digit1 != digit2;' To ignore conditions that may produce side effects, use the Ignore conditions with side effects option. Disabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations. Example: 'if (iterator.next() != null || iterator.next() != null) {\n System.out.println(\"Got it\");\n }' Due to possible side effects of 'iterator.next()' (on the example), the warning will only be triggered if the Ignore conditions with side effects option is disabled.",
+ "markdown": "Reports duplicate conditions in `&&` and `||` expressions and branches of `if` statements. While sometimes duplicate conditions are intended, in most cases they the result of an oversight.\n\nExample:\n\n\n boolean result = digit1 != digit2 || digit1 != digit2;\n\n\nTo ignore conditions that may produce side effects, use the **Ignore conditions with side effects** option.\nDisabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations.\n\nExample:\n\n\n if (iterator.next() != null || iterator.next() != null) {\n System.out.println(\"Got it\");\n }\n\nDue to possible side effects of `iterator.next()` (on the example), the warning will only be\ntriggered if the **Ignore conditions with side effects** option is disabled."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DuplicateCondition",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ThrownExceptionsPerMethod",
+ "shortDescription": {
+ "text": "Method with too many exceptions declared"
+ },
+ "fullDescription": {
+ "text": "Reports methods that have too many types of exceptions in its 'throws' list. Methods with too many exceptions declared are a good sign that your error handling code is getting overly complex. Use the Exceptions thrown limit field to specify the maximum number of exception types a method is allowed to have in its 'throws' list.",
+ "markdown": "Reports methods that have too many types of exceptions in its `throws` list.\n\nMethods with too many exceptions declared are a good sign that your error handling code is getting overly complex.\n\nUse the **Exceptions thrown limit** field to specify the maximum number of exception types a method is allowed to have in its `throws` list."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodWithTooExceptionsDeclared",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Method metrics",
+ "index": 93,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantThrows",
+ "shortDescription": {
+ "text": "Redundant 'throws' clause"
+ },
+ "fullDescription": {
+ "text": "Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and overriding methods. The inspection ignores methods related to serialization, for example the methods 'readObject()' and 'writeObject()'. Example: 'void method() throws InterruptedException {\n System.out.println();\n }' The quick-fix removes unnecessary exceptions from the declaration and normalizes redundant 'try'-'catch' statements: 'void method() {\n System.out.println();\n }' Note: Some exceptions may not be reported during in-editor highlighting for performance reasons. 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 Ignore exceptions thrown by entry point methods option to not report exceptions thrown by for example 'main()' methods. Entry point methods can be configured in the settings of the Java | Declaration redundancy | Unused declaration inspection.",
+ "markdown": "Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and overriding methods.\n\nThe inspection ignores methods related to serialization, for example the methods `readObject()` and `writeObject()`.\n\n**Example:**\n\n\n void method() throws InterruptedException {\n System.out.println();\n }\n\nThe quick-fix removes unnecessary exceptions from the declaration and normalizes redundant `try`-`catch` statements:\n\n\n void method() {\n System.out.println();\n }\n\n\n**Note:** Some exceptions may not be reported during in-editor highlighting for performance reasons.\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 **Ignore exceptions thrown by entry point methods** option to not report exceptions thrown by\nfor example `main()` methods.\nEntry point methods can be configured in the settings of the\n[Java \\| Declaration redundancy \\| Unused declaration](settings://Errors?Unused%20Declaration%20entry%20point) inspection."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantThrows",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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)' 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\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": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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}'",
+ "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"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "LambdaBodyCanBeCodeBlock",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UseOfAnotherObjectsPrivateField",
+ "shortDescription": {
+ "text": "Accessing a non-public field of another object"
+ },
+ "fullDescription": {
+ "text": "Reports accesses to 'private' or 'protected' fields of another object. Java allows access to such fields for objects of the same class as the current object but some coding styles discourage this use. Additionally, such direct access to 'private' fields may fail in component-oriented architectures, such as Spring or Hibernate, that expect all access to other objects to be through method calls so the framework can mediate access using proxies. Example: 'public class Base {\n protected int bar;\n\n void increment(Base base) {\n bar++;\n base.bar++; // warning: direct access to another object's non-public field\n }\n }' A quick-fix to encapsulate the field is available. Configure the inspection: Use the Ignore accesses from the same class option to ignore access from the same class and only report access from inner or outer classes. To ignore access from inner classes as well, use the nested Ignore accesses from inner classes. Use the Ignore accesses from 'equals()' method to ignore access from an 'equals()' method.",
+ "markdown": "Reports accesses to `private` or `protected` fields of another object. Java allows access to such fields for objects of the same class as the current object but some coding styles discourage this use. Additionally, such direct access to `private` fields may fail in component-oriented architectures, such as Spring or Hibernate, that expect all access to other objects to be through method calls so the framework can mediate access using proxies.\n\n**Example:**\n\n\n public class Base {\n protected int bar;\n\n void increment(Base base) {\n bar++;\n base.bar++; // warning: direct access to another object's non-public field\n }\n }\n\nA quick-fix to encapsulate the field is available.\n\nConfigure the inspection:\n\n* Use the **Ignore accesses from the same class** option to ignore access from the same class and only report access from inner or outer classes.\n\n To ignore access from inner classes as well, use the nested **Ignore accesses from inner classes**.\n* Use the **Ignore accesses from 'equals()' method** to ignore access from an `equals()` method."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AccessingNonPublicFieldOfAnotherObject",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Encapsulation",
+ "index": 57,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PointlessBitwiseExpression",
+ "shortDescription": {
+ "text": "Pointless bitwise expression"
+ },
+ "fullDescription": {
+ "text": "Reports pointless bitwise expressions. Such expressions include applying the '&' operator to the maximum value for the given type, applying the 'or' operator to zero, and shifting by zero. Such expressions may be the result of automated refactorings not followed through to completion and are unlikely to be originally intended. Examples: '// Warning: operation is pointless and can be replaced with just `flags`\n // 0xFFFF_FFFF is the maximum value for an integer, and both literals are treated\n // as 32 bit integer literals.\n int bits = flags & 0xFFFF_FFFF;\n\n // Warning: operation is pointless and can be replaced with just `bits`\n // OR-ing with 0 always outputs the other operand.\n int or = bits | 0x0;\n\n // Warning: operation is pointless, as always results in 0\n int xor = or ^ or;'",
+ "markdown": "Reports pointless bitwise expressions.\n\n\nSuch expressions include applying the `&` operator to the maximum value for the given type, applying the\n`or` operator to zero, and shifting by zero. Such expressions may be the result of automated\nrefactorings not followed through to completion and are unlikely to be originally intended.\n\n**Examples:**\n\n\n // Warning: operation is pointless and can be replaced with just `flags`\n // 0xFFFF_FFFF is the maximum value for an integer, and both literals are treated\n // as 32 bit integer literals.\n int bits = flags & 0xFFFF_FFFF;\n\n // Warning: operation is pointless and can be replaced with just `bits`\n // OR-ing with 0 always outputs the other operand.\n int or = bits | 0x0;\n\n // Warning: operation is pointless, as always results in 0\n int xor = or ^ or;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "PointlessBitwiseExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Bitwise operation issues",
+ "index": 95,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 31,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 9,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DuplicateThrows",
+ "shortDescription": {
+ "text": "Duplicate throws"
+ },
+ "fullDescription": {
+ "text": "Reports duplicate exceptions in a method 'throws' list. Example: 'void f() throws Exception, Exception {}' After the quick-fix is applied: 'void f() throws Exception {}' Use the Ignore exceptions subclassing others option to ignore exceptions subclassing other exceptions.",
+ "markdown": "Reports duplicate exceptions in a method `throws` list.\n\nExample:\n\n\n void f() throws Exception, Exception {}\n\nAfter the quick-fix is applied:\n\n\n void f() throws Exception {}\n\n\nUse the **Ignore exceptions subclassing others** option to ignore exceptions subclassing other exceptions."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "DuplicateThrows",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnstableTypeUsedInSignature",
+ "shortDescription": {
+ "text": "Unstable type is used in signature"
+ },
+ "fullDescription": {
+ "text": "Reports declarations of classes, methods, and fields that reference an unstable API type in the signature, but are not marked with the same unstable annotation. This inspection ensures that the signatures of a public API do not expose any unstable (internal, experimental) types. For example, if a method returns an experimental class, the method itself is considered experimental because incompatible changes of the type (deletion or move to another package) lead to incompatible method signature changes. Use the list below to specify which annotations mark an unstable API.",
+ "markdown": "Reports declarations of classes, methods, and fields that reference an unstable API type in the signature, but are not marked with the same unstable annotation.\n\n\nThis inspection ensures that the signatures of a public API do not expose any *unstable* (internal, experimental) types.\nFor example, if a method returns an *experimental* class, the method itself is considered *experimental*\nbecause incompatible changes of the type (deletion or move to another package) lead to incompatible method signature changes.\n\nUse the list below to specify which annotations mark an unstable API."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnstableTypeUsedInSignature",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "PrivateMemberAccessBetweenOuterAndInnerClass",
+ "shortDescription": {
+ "text": "Synthetic accessor call"
+ },
+ "fullDescription": {
+ "text": "Reports references from a nested class to non-constant 'private' members of an outer class. For such references, javac will generate package-private synthetic accessor methods, which may compromise the security because members appearing to be private will in fact be accessible from the entire package. A nested class and its outer class are compiled to separate class files. The Java virtual machine normally prohibits access from a class to private fields and methods of another class. To enable access from a nested class to private members of an outer class, javac creates a package-private synthetic accessor method. By making the 'private' member package-private instead, the actual accessibility is made explicit. This also saves a little bit of memory, which may improve performance in resource constrained environments. This inspection only reports if the language level of the project or module is 10 or lower. Under Java 11 and higher accessor methods are not generated anymore, because of nest-based access control (JEP 181). Example: 'class Outer {\n private void x() {}\n\n class Inner {\n void y() {\n x();\n }\n }\n }' After the quick fix is applied: 'class Outer {\n void x() {}\n\n class Inner {\n void y() {\n x();\n }\n }\n }'",
+ "markdown": "Reports references from a nested class to non-constant `private` members of an outer class. For such references, javac will generate package-private synthetic accessor methods, which may compromise the security because members appearing to be private will in fact be accessible from the entire package.\n\n\nA nested class and its outer class are compiled to separate\nclass files. The Java virtual machine normally prohibits access from a class to private fields and methods of\nanother class. To enable access from a nested class to private members of an outer class, javac creates a package-private\nsynthetic accessor method.\n\n\nBy making the `private` member package-private instead, the actual accessibility is made explicit.\nThis also saves a little bit of memory, which may improve performance in resource constrained environments.\n\n\nThis inspection only reports if the language level of the project or module is 10 or lower.\nUnder Java 11 and higher accessor methods are not generated anymore,\nbecause of nest-based access control ([JEP 181](https://openjdk.org/jeps/181)).\n\n**Example:**\n\n\n class Outer {\n private void x() {}\n\n class Inner {\n void y() {\n x();\n }\n }\n }\n\nAfter the quick fix is applied:\n\n\n class Outer {\n void x() {}\n\n class Inner {\n void y() {\n x();\n }\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SyntheticAccessorCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 22,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassIndependentOfModule",
+ "shortDescription": {
+ "text": "Class independent of its module"
+ },
+ "fullDescription": {
+ "text": "Reports classes that: do not depend on any other class in their module are not a dependency for any other class in their module Such classes are an indication of ad-hoc or incoherent modularisation strategies, and may often profitably be moved. 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:\n\n* do not depend on any other class in their module\n* are not a dependency for any other class in their module\n\nSuch classes are an indication of ad-hoc or incoherent modularisation strategies,\nand may often profitably be moved.\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": "ClassIndependentOfModule",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Modularization issues",
+ "index": 67,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SystemRunFinalizersOnExit",
+ "shortDescription": {
+ "text": "Call to 'System.runFinalizersOnExit()'"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'System.runFinalizersOnExit()'. This call is one of the most dangerous in the Java language. It is inherently non-thread-safe, may result in data corruption, a deadlock, and may affect parts of the program far removed from its call point. It is deprecated and was removed in JDK 11, and its use is strongly discouraged. This inspection only reports if the language level of the project or module is 10 or lower.",
+ "markdown": "Reports calls to `System.runFinalizersOnExit()`.\n\n\nThis call is one of the most dangerous in the Java language. It is inherently non-thread-safe,\nmay result in data corruption, a deadlock, and may affect parts of the program far removed from its call point.\nIt is deprecated and was removed in JDK 11, and its use is strongly discouraged.\n\nThis inspection only reports if the language level of the project or module is 10 or lower."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToSystemRunFinalizersOnExit",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Threading issues",
+ "index": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReplaceInefficientStreamCount",
+ "shortDescription": {
+ "text": "Inefficient Stream API call chains ending with count()"
+ },
+ "fullDescription": {
+ "text": "Reports Stream API call chains ending with the 'count()' operation that could be optimized. The following call chains are replaced by this inspection: 'Collection.stream().count()' → 'Collection.size()'. In Java 8 'Collection.stream().count()' actually iterates over the collection elements to count them, while 'Collection.size()' is much faster for most of the collections. 'Stream.flatMap(Collection::stream).count()' → 'Stream.mapToLong(Collection::size).sum()'. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up. 'Stream.filter(o -> ...).count() > 0' → 'Stream.anyMatch(o -> ...)'. Unlike the original call, 'anyMatch()' may stop the computation as soon as a matching element is found. 'Stream.filter(o -> ...).count() == 0' → 'Stream.noneMatch(o -> ...)'. Similar to the above. Note that if the replacement involves a short-circuiting operation like 'anyMatch()', there could be a visible behavior change, if the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls.",
+ "markdown": "Reports Stream API call chains ending with the `count()` operation that could be optimized.\n\n\nThe following call chains are replaced by this inspection:\n\n* `Collection.stream().count()` → `Collection.size()`. In Java 8 `Collection.stream().count()` actually iterates over the collection elements to count them, while `Collection.size()` is much faster for most of the collections.\n* `Stream.flatMap(Collection::stream).count()` → `Stream.mapToLong(Collection::size).sum()`. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up.\n* `Stream.filter(o -> ...).count() > 0` → `Stream.anyMatch(o -> ...)`. Unlike the original call, `anyMatch()` may stop the computation as soon as a matching element is found.\n* `Stream.filter(o -> ...).count() == 0` → `Stream.noneMatch(o -> ...)`. Similar to the above.\n\n\nNote that if the replacement involves a short-circuiting operation like `anyMatch()`, there could be a visible behavior change,\nif the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReplaceInefficientStreamCount",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterTypePreventsOverriding",
+ "shortDescription": {
+ "text": "Parameter type prevents overriding"
+ },
+ "fullDescription": {
+ "text": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method. Example: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n}' After the quick-fix is applied: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n}'",
+ "markdown": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method.\n\n**Example:**\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ParameterTypePreventsOverriding",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": "IC"
+ }
+ },
+ "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 };' The inspection only reports if the language level of the project or module is 14 or higher. 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\nThe inspection only reports if the language level of the project or module is 14 or higher.\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": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtractMethodRecommender",
+ "shortDescription": {
+ "text": "Method can be extracted"
+ },
+ "fullDescription": {
+ "text": "Suggests extracting fragments of code to a separate method to make code more clear. This inspection has a number of heuristics to select good candidates for extraction, including the following ones. The extracted fragment has no non-local control flow The extracted fragment has exactly one output variable There are no similar uses of output variable inside the extracted fragment and outside it The extracted fragment has only few input parameters (no more than three by default; configured with the inspection option) The extracted fragment is not smaller than the configured length (500 characters by default) but no bigger than 60% of the containing method body",
+ "markdown": "Suggests extracting fragments of code to a separate method to make code more clear. This inspection has a number of heuristics to select good candidates for extraction, including the following ones.\n\n* The extracted fragment has no non-local control flow\n* The extracted fragment has exactly one output variable\n* There are no similar uses of output variable inside the extracted fragment and outside it\n* The extracted fragment has only few input parameters (no more than three by default; configured with the inspection option)\n* The extracted fragment is not smaller than the configured length (500 characters by default) but no bigger than 60% of the containing method body"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ExtractMethodRecommender",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code maturity",
+ "index": 50,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StringOperationCanBeSimplified",
+ "shortDescription": {
+ "text": "Redundant 'String' operation"
+ },
+ "fullDescription": {
+ "text": "Reports redundant calls to 'String' constructors and methods like 'toString()' or 'substring()' that can be replaced with a simpler expression. For example, calls to these methods can be safely removed in code like '\"string\".substring(0)', '\"string\".toString()', or 'new StringBuilder().toString().substring(1,3)'. Example: 'System.out.println(new String(\"message\"));' After the quick-fix is applied: 'System.out.println(\"message\");' Note that the quick-fix removes the redundant constructor call, and this may affect 'String' referential equality. If you need to preserve it, even though it is considered bad practice, suppress the warning or use the inspection setting to ignore redundant 'String' constructor calls. Use the Do not report String constructor calls option below to not report code like the example above. This will avoid changing the outcome of String comparisons with '==' or '!=' after applying the quick-fix in code that uses 'new String()' calls to guarantee a different object identity. New in 2018.1",
+ "markdown": "Reports redundant calls to `String` constructors and methods like `toString()` or `substring()` that can be replaced with a simpler expression.\n\nFor example, calls to these methods can be safely removed in code\nlike `\"string\".substring(0)`, `\"string\".toString()`, or\n`new StringBuilder().toString().substring(1,3)`.\n\nExample:\n\n\n System.out.println(new String(\"message\"));\n\nAfter the quick-fix is applied:\n\n\n System.out.println(\"message\");\n\n\nNote that the quick-fix removes the redundant constructor call, and this may affect `String` referential equality.\nIf you need to preserve it, even though it is considered bad practice, suppress the warning or use the inspection setting to ignore\nredundant `String` constructor calls.\n\n\nUse the **Do not report String constructor calls** option below to not report code like the example above.\nThis will avoid changing the outcome of String comparisons with `==` or `!=` after applying\nthe quick-fix in code that uses `new String()` calls to guarantee a different object identity.\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "StringOperationCanBeSimplified",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassReferencesSubclass",
+ "shortDescription": {
+ "text": "Class references one of its subclasses"
+ },
+ "fullDescription": {
+ "text": "Reports classes which contain references to one of their subclasses. Such references may be confusing and violate several rules of object-oriented design. Example: 'class Entity {\n // Warning: the class references its subclass\n void compare(SimpleEntity entity) {\n ...\n }\n }\n class SimpleEntity extends Entity {\n ...\n }'",
+ "markdown": "Reports classes which contain references to one of their subclasses. Such references may be confusing and violate several rules of object-oriented design.\n\nExample:\n\n\n class Entity {\n // Warning: the class references its subclass\n void compare(SimpleEntity entity) {\n ...\n }\n }\n class SimpleEntity extends Entity {\n ...\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassReferencesSubclass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 75,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 96,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "DateToString",
+ "shortDescription": {
+ "text": "Call to 'Date.toString()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'toString()' calls on 'java.util.Date' objects. Such calls are usually incorrect in an internationalized environment.",
+ "markdown": "Reports `toString()` calls on `java.util.Date` objects. Such calls are usually incorrect in an internationalized environment."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CallToDateToString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Internationalization",
+ "index": 9,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IterableUsedAsVararg",
+ "shortDescription": {
+ "text": "Iterable is used as vararg"
+ },
+ "fullDescription": {
+ "text": "Reports suspicious usages of 'Collection' or 'Iterable' in vararg method calls. For example, in the following method: ' boolean contains(T needle, T... haystack) {...}' a call like 'if(contains(\"item\", listOfStrings)) {...}' looks suspicious as the list will be wrapped into a single element array. Such code can be successfully compiled and will likely run without exceptions, but it's probably used by mistake. New in 2019.2",
+ "markdown": "Reports suspicious usages of `Collection` or `Iterable` in vararg method calls.\n\nFor example, in the following method:\n\n\n boolean contains(T needle, T... haystack) {...}\n\na call like\n\n\n if(contains(\"item\", listOfStrings)) {...}\n\nlooks suspicious as the list will be wrapped into a single element array.\nSuch code can be successfully compiled and will likely run without\nexceptions, but it's probably used by mistake.\n\nNew in 2019.2"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IterableUsedAsVararg",
+ "cweIds": [
+ 628
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MethodNameSameAsParentName",
+ "shortDescription": {
+ "text": "Method name same as parent class name"
+ },
+ "fullDescription": {
+ "text": "Reports methods that have the same name as the superclass of the method's class, as such a method name may be confusing. This inspection doesn't check interfaces or superclasses deep in the hierarchy. Example: 'class Parent {}\n class Child extends Parent {\n public Parent Parent() {\n return null;\n }\n }' A quick-fix that renames such methods is available only in the editor.",
+ "markdown": "Reports methods that have the same name as the superclass of the method's class, as such a method name may be confusing.\n\nThis inspection doesn't check interfaces or superclasses deep in the hierarchy.\n\n**Example:**\n\n\n class Parent {}\n class Child extends Parent {\n public Parent Parent() {\n return null;\n }\n }\n\nA quick-fix that renames such methods is available only in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MethodNameSameAsParentName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Method",
+ "index": 85,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 62,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LambdaParameterNamingConvention",
+ "shortDescription": {
+ "text": "Lambda parameter naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports lambda parameters whose names are too short, too long, or do not follow the specified regular expression pattern. Example: 'Function id = X -> 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 lambda 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 lambda parameters whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** `Function id = X -> 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 lambda parameter names.\nSpecify **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": "LambdaParameterNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 51,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LawOfDemeter",
+ "shortDescription": {
+ "text": "Law of Demeter"
+ },
+ "fullDescription": {
+ "text": "Reports Law of Demeter violations. The Law of Demeter is not really a law, but specifies a style guideline: never call a method on an object received from another call. The code that follows this guideline is easier to maintain, adapt, and refactor, has less coupling between methods, less duplication, and better information hiding. On the other hand, you may need to write many wrapper methods to meet this guideline. Example: 'boolean pay(Customer c, Invoice invoice) {\n int dollars = c.getWallet().contents; // violation\n if (dollars >= invoice.getAmount()) {\n Wallet w = c.getWallet();\n w.subtract(invoice.getAmount()); // violation\n return true;\n }\n return false;\n }' The above example might be better implemented as a method 'payInvoice(Invoice invoice)' in 'Customer'. Use the Ignore calls to library methods and access to library fields option to ignore Law of Demeter violations that can't be fixed without changing a library.",
+ "markdown": "Reports [Law of Demeter](https://en.wikipedia.org/wiki/Law_of_Demeter) violations.\n\n\nThe Law of Demeter is not really a law, but specifies a style guideline: never call a method on an object received from another call.\nThe code that follows this guideline is easier to maintain, adapt, and refactor, has less coupling between methods, less duplication,\nand better information hiding. On the other hand, you may need to write many wrapper methods to meet this guideline.\n\n**Example:**\n\n\n boolean pay(Customer c, Invoice invoice) {\n int dollars = c.getWallet().contents; // violation\n if (dollars >= invoice.getAmount()) {\n Wallet w = c.getWallet();\n w.subtract(invoice.getAmount()); // violation\n return true;\n }\n return false;\n }\n\nThe above example might be better implemented as a method `payInvoice(Invoice invoice)` in `Customer`.\n\n\nUse the **Ignore calls to library methods and access to library fields** option to ignore Law of Demeter violations\nthat can't be fixed without changing a library."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LawOfDemeter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Data flow",
+ "index": 24,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalUsedAsFieldOrParameterType",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 75,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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 only reports if the language level of the project or module is 5 or higher.",
+ "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 only reports if the language level of the project or module is 5 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ForLoopReplaceableByForEach",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 5",
+ "index": 53,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AmbiguousFieldAccess",
+ "shortDescription": {
+ "text": "Access to inherited field looks like access to element from surrounding code"
+ },
+ "fullDescription": {
+ "text": "Reports access to a superclass field from an anonymous, inner or local class, if a local variable, parameter, or field with the same name is available in the code surrounding the class. In this case it may seem that an element from the surrounding code is accessed, when in fact it is an access to a field from the superclass. To clarify the intent of the code, it is recommended to add an explicit 'super' qualifier to the field access. Example: 'class First {\n protected String ambiguous;\n }\n class Second {\n void foo(String ambiguous) {\n new First() {\n {\n System.out.println(ambiguous); // the field is accessed, not the parameter\n }\n };\n }\n }' After the quick-fix is applied: 'class First {\n protected String ambiguous;\n }\n class Second {\n void foo(String ambiguous) {\n new First() {\n {\n System.out.println(super.ambiguous);\n }\n };\n }\n }'",
+ "markdown": "Reports access to a superclass field from an anonymous, inner or local class, if a local variable, parameter, or field with the same name is available in the code surrounding the class. In this case it may seem that an element from the surrounding code is accessed, when in fact it is an access to a field from the superclass.\n\n\nTo clarify the intent of the code, it is recommended to add an explicit\n`super` qualifier to the field access.\n\n**Example:**\n\n\n class First {\n protected String ambiguous;\n }\n class Second {\n void foo(String ambiguous) {\n new First() {\n {\n System.out.println(ambiguous); // the field is accessed, not the parameter\n }\n };\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class First {\n protected String ambiguous;\n }\n class Second {\n void foo(String ambiguous) {\n new First() {\n {\n System.out.println(super.ambiguous);\n }\n };\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AmbiguousFieldAccess",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Visibility",
+ "index": 56,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "NonProtectedConstructorInAbstractClass",
+ "shortDescription": {
+ "text": "Public constructor in abstract class"
+ },
+ "fullDescription": {
+ "text": "Reports 'public' constructors of 'abstract' classes. Constructors of 'abstract' classes can only be called from the constructors of their subclasses, declaring them 'public' may be confusing. The quick-fix makes such constructors protected. Example: 'public abstract class Foo {\n public Foo () { // warning: has 'public' modifier\n /* ... */\n }\n }' After the quick-fix is applied: 'public abstract class Foo {\n protected Foo () {\n /* ... */\n }\n }' Configure the inspection: Use the Ignore for non-public classes option below to ignore 'public' constructors in non-public classes.",
+ "markdown": "Reports `public` constructors of `abstract` classes.\n\n\nConstructors of `abstract` classes can only be called from the constructors of\ntheir subclasses, declaring them `public` may be confusing.\n\nThe quick-fix makes such constructors protected.\n\n**Example:**\n\n\n public abstract class Foo {\n public Foo () { // warning: has 'public' modifier\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public abstract class Foo {\n protected Foo () {\n /* ... */\n }\n }\n\nConfigure the inspection:\n\nUse the **Ignore for non-public classes** option below to ignore `public` constructors in non-public classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstructorNotProtectedInAbstractClass",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 57,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ComparableImplementedButEqualsNotOverridden",
+ "shortDescription": {
+ "text": "'Comparable' implemented but 'equals()' not overridden"
+ },
+ "fullDescription": {
+ "text": "Reports classes that implement 'java.lang.Comparable' but do not override 'equals()'. If 'equals()' is not overridden, the 'equals()' implementation is not consistent with the 'compareTo()' implementation. If an object of such a class is added to a collection such as 'java.util.SortedSet', this collection will violate the contract of 'java.util.Set', which is defined in terms of 'equals()'. Example: 'class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n }' After the quick fix is applied: 'class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n\n @Override\n public boolean equals(Object o) {\n return o instanceof Length && compareTo((Length) o) == 0;\n }\n }'",
+ "markdown": "Reports classes that implement `java.lang.Comparable` but do not override `equals()`.\n\n\nIf `equals()`\nis not overridden, the `equals()` implementation is not consistent with\nthe `compareTo()` implementation. If an object of such a class is added\nto a collection such as `java.util.SortedSet`, this collection will violate\nthe contract of `java.util.Set`, which is defined in terms of\n`equals()`.\n\n**Example:**\n\n\n class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n }\n\nAfter the quick fix is applied:\n\n\n class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n\n @Override\n public boolean equals(Object o) {\n return o instanceof Length && compareTo((Length) o) == 0;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ComparableImplementedButEqualsNotOverridden",
+ "cweIds": [
+ 697
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "MapReplaceableByEnumMap",
+ "shortDescription": {
+ "text": "'Map' can be replaced with 'EnumMap'"
+ },
+ "fullDescription": {
+ "text": "Reports instantiations of 'java.util.Map' objects whose key types are enumerated classes. Such 'java.util.Map' objects can be replaced with 'java.util.EnumMap' objects. 'java.util.EnumMap' implementations can be much more efficient because the underlying data structure is a simple array. Example: 'Map myEnums = new HashMap<>();' After the quick-fix is applied: 'Map myEnums = new EnumMap<>(MyEnum.class);'",
+ "markdown": "Reports instantiations of `java.util.Map` objects whose key types are enumerated classes. Such `java.util.Map` objects can be replaced with `java.util.EnumMap` objects.\n\n\n`java.util.EnumMap` implementations can be much more efficient\nbecause the underlying data structure is a simple array.\n\n**Example:**\n\n\n Map myEnums = new HashMap<>();\n\nAfter the quick-fix is applied:\n\n\n Map myEnums = new EnumMap<>(MyEnum.class);\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "MapReplaceableByEnumMap",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance",
+ "index": 10,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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 only reports if the language level of the project or module is 15 or higher. 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 only reports if the language level of the project or module is 15 or higher.\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": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ReturnNull",
+ "shortDescription": {
+ "text": "Return of 'null'"
+ },
+ "fullDescription": {
+ "text": "Reports 'return' statements with 'null' return values. While occasionally useful, this construct may make the code more prone to failing with a 'NullPointerException'. If a method is designed to return 'null', it is suggested to mark it with the '@Nullable' annotation - such methods will be ignored by this inspection. Example: 'class Person {\n public String getName () {\n return null;\n }\n }' After the quick-fix is applied: 'class Person {\n @Nullable\n public String getName () {\n return null;\n }\n }' If the return type is 'java.util.Optional', an additional quick-fix to convert 'null' to 'Optional.empty()' is suggested. Use the following options to configure the inspection: Whether to ignore 'private' methods. This will also ignore return of 'null' from anonymous classes and lambdas. Whether 'null' values on array returns, collection object returns, plain object returns, or a combination of the three should be reported. Return of 'null' in methods with return type 'java.util.Optional' are always reported. Click Configure annotations to specify which annotations should be considered 'nullable'.",
+ "markdown": "Reports `return` statements with `null` return values. While occasionally useful, this construct may make the code more prone to failing with a `NullPointerException`.\n\n\nIf a method is designed to return `null`, it is suggested to mark it with the\n`@Nullable` annotation - such methods will be ignored by this inspection.\n\n**Example:**\n\n\n class Person {\n public String getName () {\n return null;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Person {\n @Nullable\n public String getName () {\n return null;\n }\n }\n\n\nIf the return type is `java.util.Optional`, an additional quick-fix to convert\n`null` to `Optional.empty()` is suggested.\n\n\nUse the following options to configure the inspection:\n\n* Whether to ignore `private` methods. This will also ignore return of `null` from anonymous classes and lambdas.\n* Whether `null` values on array returns, collection object returns, plain object returns, or a combination of the three should be reported. Return of `null` in methods with return type `java.util.Optional` are always reported.\n* Click **Configure annotations** to specify which annotations should be considered 'nullable'."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ReturnOfNull",
+ "cweIds": [
+ 252,
+ 476
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs/Nullability problems",
+ "index": 115,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 69,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "LoggingStringTemplateAsArgument",
+ "shortDescription": {
+ "text": "String template as argument to logging call"
+ },
+ "fullDescription": {
+ "text": "Reports string templates that are used as arguments to SLF4J and Log4j 2 logging methods. The method 'org.apache.logging.log4j.Logger.log()' and its overloads are supported only for all log levels option. String templates 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 (for Kotlin): 'val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")' After the quick-fix is applied (for Kotlin): 'val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)' Note that the suggested replacement might not be equivalent to the original code, for example, when string templates contain method calls or assignment expressions. Use the Warn on list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated. Use the Do not warn when only expressions with primitive types, their wrappers or String are included option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance. New in 2023.1",
+ "markdown": "Reports string templates that are used as arguments to **SLF4J** and **Log4j 2** logging methods. The method `org.apache.logging.log4j.Logger.log()` and its overloads are supported only for **all log levels** option. String templates 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 (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")\n\n**After the quick-fix is applied (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)\n\n\nNote that the suggested replacement might not be equivalent to the original code, for example,\nwhen string templates contain method calls or assignment expressions.\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated.\n* Use the **Do not warn when only expressions with primitive types, their wrappers or String are included** option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance.\n\nNew in 2023.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "LoggingStringTemplateAsArgument",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Logging",
+ "index": 46,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnpredictableBigDecimalConstructorCall",
+ "shortDescription": {
+ "text": "Unpredictable 'BigDecimal' constructor call"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'BigDecimal' constructors that accept a 'double' value. These constructors produce 'BigDecimal' that is exactly equal to the supplied 'double' value. However, because doubles are encoded in the IEEE 754 64-bit double-precision binary floating-point format, the exact value can be unexpected. For example, 'new BigDecimal(0.1)' yields a 'BigDecimal' object. Its value is '0.1000000000000000055511151231257827021181583404541015625' which is the nearest number to 0.1 representable as a double. To get 'BigDecimal' that stores the same value as written in the source code, use either 'new BigDecimal(\"0.1\")' or 'BigDecimal.valueOf(0.1)'. Example: 'class Constructor {\n void foo() {\n new BigDecimal(0.1);\n }\n }' After the quick-fix is applied: 'class Constructor {\n void foo() {\n new BigDecimal(\"0.1\");\n }\n }'",
+ "markdown": "Reports calls to `BigDecimal` constructors that accept a `double` value. These constructors produce `BigDecimal` that is exactly equal to the supplied `double` value. However, because doubles are encoded in the IEEE 754 64-bit double-precision binary floating-point format, the exact value can be unexpected.\n\nFor example, `new BigDecimal(0.1)` yields a `BigDecimal` object. Its value is\n`0.1000000000000000055511151231257827021181583404541015625`\nwhich is the nearest number to 0.1 representable as a double.\nTo get `BigDecimal` that stores the same value as written in the source code,\nuse either `new BigDecimal(\"0.1\")` or `BigDecimal.valueOf(0.1)`.\n\n**Example:**\n\n\n class Constructor {\n void foo() {\n new BigDecimal(0.1);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Constructor {\n void foo() {\n new BigDecimal(\"0.1\");\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnpredictableBigDecimalConstructorCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 52,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IntegerDivisionInFloatingPointContext",
+ "shortDescription": {
+ "text": "Integer division in floating-point context"
+ },
+ "fullDescription": {
+ "text": "Reports integer divisions where the result is used as a floating-point number. Such division is often an error and may have unexpected results due to the truncation that happens in integer division. Example: 'float x = 3.0F + 3 * 2 / 5;' After the quick-fix is applied: 'float x = 3.0F + ((float) (3 * 2)) /5;'",
+ "markdown": "Reports integer divisions where the result is used as a floating-point number. Such division is often an error and may have unexpected results due to the truncation that happens in integer division.\n\n**Example:**\n\n\n float x = 3.0F + 3 * 2 / 5;\n\nAfter the quick-fix is applied:\n\n\n float x = 3.0F + ((float) (3 * 2)) /5;\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IntegerDivisionInFloatingPointContext",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Numeric issues",
+ "index": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "AssertWithoutMessage",
+ "shortDescription": {
+ "text": "Message missing on assertion"
+ },
+ "fullDescription": {
+ "text": "Reports calls to 'assertXXX()' or 'fail()' without an error message string argument. An error message on assertion failure may help clarify the test case's intent. Example: 'assertTrue(checkValid());' After the quick-fix is applied: 'assertTrue(checkValid(), \"|\");' The message argument is added before or after the existing arguments according to the assertions framework that you use.",
+ "markdown": "Reports calls to `assertXXX()` or `fail()` without an error message string argument. An error message on assertion failure may help clarify the test case's intent.\n\n**Example:**\n\n\n assertTrue(checkValid());\n\nAfter the quick-fix is applied:\n\n assertTrue(checkValid(), \"|\");\n\n\nThe message argument is added before or after the existing arguments according to the assertions framework that you use."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "AssertWithoutMessage",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Test frameworks",
+ "index": 94,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConditionalBreakInInfiniteLoop",
+ "shortDescription": {
+ "text": "Conditional break inside loop"
+ },
+ "fullDescription": {
+ "text": "Reports conditional breaks at the beginning or at the end of a loop and suggests adding a loop condition instead to shorten the code. Example: 'while (true) {\n if (i == 23) break;\n i++;\n }' After the quick fix is applied: 'while (i != 23) {\n i++;\n }'",
+ "markdown": "Reports conditional breaks at the beginning or at the end of a loop and suggests adding a loop condition instead to shorten the code.\n\nExample:\n\n\n while (true) {\n if (i == 23) break;\n i++;\n }\n\nAfter the quick fix is applied:\n\n\n while (i != 23) {\n i++;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConditionalBreakInInfiniteLoop",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnqualifiedInnerClassAccess",
+ "shortDescription": {
+ "text": "Unqualified inner class access"
+ },
+ "fullDescription": {
+ "text": "Reports references to inner classes that are not qualified with the name of the enclosing class. Example: 'import foo.Foo.Bar;\n\n class Foo {\n class Bar {}\n }\n\n class Baz {\n void f(Bar bar) {}\n }' After the quick-fix is applied: 'class Foo {\n class Bar {}\n }\n\n class Baz {\n void f(Foo.Bar bar) {}\n }' Use the inspection settings to ignore references to inner classes within the same class, which therefore do not require an import.",
+ "markdown": "Reports references to inner classes that are not qualified with the name of the enclosing class.\n\n**Example:**\n\n\n import foo.Foo.Bar;\n\n class Foo {\n class Bar {}\n }\n\n class Baz {\n void f(Bar bar) {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n class Bar {}\n }\n\n class Baz {\n void f(Foo.Bar bar) {}\n }\n\n\nUse the inspection settings to ignore references to inner classes within the same class,\nwhich therefore do not require an import."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnqualifiedInnerClassAccess",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantClassCall",
+ "shortDescription": {
+ "text": "Redundant 'isInstance()' or 'cast()' call"
+ },
+ "fullDescription": {
+ "text": "Reports redundant calls of 'java.lang.Class' methods. For example, 'Xyz.class.isInstance(object)' can be replaced with 'object instanceof Xyz'. The instanceof check is preferred: even though the performance will probably be the same as these methods are intrinsics, they better indicate a static check. New in 2018.2",
+ "markdown": "Reports redundant calls of `java.lang.Class` methods.\n\nFor example, `Xyz.class.isInstance(object)` can be replaced with `object instanceof Xyz`.\nThe instanceof check is preferred: even though the performance will probably be the same as these methods are intrinsics,\nthey better indicate a static check.\n\nNew in 2018.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantClassCall",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnnecessaryStringEscape",
+ "shortDescription": {
+ "text": "Unnecessarily escaped character"
+ },
+ "fullDescription": {
+ "text": "Reports unnecessarily escaped characters in 'String' and optionally 'char' literals. Escaped tab characters '\\t' are not reported, because tab characters are invisible. Examples: 'String s = \"\\'Scare\\' quotes\";\n String t = \"\"\"\n All you need is\\n\\tLove\\n\"\"\";' After the quick-fix is applied: 'String s = \"'Scare' quotes\";\n String t = \"\"\"\n All you need is\n \\tLove\n \"\"\";' New in 2019.3",
+ "markdown": "Reports unnecessarily escaped characters in `String` and optionally `char` literals.\n\nEscaped tab characters `\\t` are not reported, because tab characters are invisible.\n\nExamples:\n\n\n String s = \"\\'Scare\\' quotes\";\n String t = \"\"\"\n All you need is\\n\\tLove\\n\"\"\";\n\nAfter the quick-fix is applied:\n\n\n String s = \"'Scare' quotes\";\n String t = \"\"\"\n All you need is\n \\tLove\n \"\"\";\n\nNew in 2019.3"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UnnecessaryStringEscape",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Verbose or redundant code constructs",
+ "index": 38,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "JUnit5AssertionsConverter",
+ "shortDescription": {
+ "text": "JUnit 5 obsolete assertions"
+ },
+ "fullDescription": {
+ "text": "Reports any calls to methods from the 'junit.framework.Assert', 'org.junit.Assert', or 'org.junit.Assume' classes inside JUnit 5 tests. Although the tests work properly, migration to 'org.junit.jupiter.api.Assertions'/'org.junit.jupiter.api.Assumptions' will help you avoid dependencies on old JUnit version. Example: 'import org.junit.Assert;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assert.assertEquals(4, 2 + 2);\n }\n }' After the quick-fix is applied: 'import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assertions.assertEquals(4, 2 + 2);\n }\n }'",
+ "markdown": "Reports any calls to methods from the `junit.framework.Assert`, `org.junit.Assert`, or `org.junit.Assume`\nclasses inside JUnit 5 tests.\n\nAlthough the tests work properly, migration to `org.junit.jupiter.api.Assertions`/`org.junit.jupiter.api.Assumptions`\nwill help you avoid dependencies on old JUnit version.\n\n**Example:**\n\n\n import org.junit.Assert;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assert.assertEquals(4, 2 + 2);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assertions.assertEquals(4, 2 + 2);\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "JUnit5AssertionsConverter",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages/Test frameworks",
+ "index": 92,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 28,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FieldCanBeLocal",
+ "shortDescription": {
+ "text": "Field can be local"
+ },
+ "fullDescription": {
+ "text": "Reports redundant class fields that can be replaced with local variables. If all local usages of a field are preceded by assignments to that field, the field can be removed, and its usages can be replaced with local variables.",
+ "markdown": "Reports redundant class fields that can be replaced with local variables.\n\nIf all local usages of a field are preceded by assignments to that field, the\nfield can be removed, and its usages can be replaced with local variables."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FieldCanBeLocal",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Class structure",
+ "index": 11,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UrlHashCode",
+ "shortDescription": {
+ "text": "Call to 'equals()' or 'hashCode()' on 'URL' object"
+ },
+ "fullDescription": {
+ "text": "Reports 'hashCode()' and 'equals()' calls on 'java.net.URL' objects and calls that add 'URL' objects to maps and sets. 'URL''s 'equals()' and 'hashCode()' methods can perform a DNS lookup to resolve the host name. This may cause significant delays, depending on the availability and speed of the network and the DNS server. Using 'java.net.URI' instead of 'java.net.URL' will avoid the DNS lookup. Example: 'boolean urlEquals(URL url1, URL url2) {\n return url1.equals(url2);\n }'",
+ "markdown": "Reports `hashCode()` and `equals()` calls on `java.net.URL` objects and calls that add `URL` objects to maps and sets.\n\n\n`URL`'s `equals()` and `hashCode()` methods can perform a DNS lookup to resolve the host name.\nThis may cause significant delays, depending on the availability and speed of the network and the DNS server.\nUsing `java.net.URI` instead of `java.net.URL` will avoid the DNS lookup.\n\n**Example:**\n\n\n boolean urlEquals(URL url1, URL url2) {\n return url1.equals(url2);\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "UrlHashCode",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "JVM languages",
+ "index": 2,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IfStatementWithIdenticalBranches",
+ "shortDescription": {
+ "text": "'if' statement with identical branches"
+ },
+ "fullDescription": {
+ "text": "Reports 'if' statements in which common parts can be extracted from the branches. These common parts are independent from the condition and make 'if' statements harder to understand. Example: 'if (x > 12) {\n doSomethingBefore();\n doSomethingDifferent1();\n doSomethingAfter();\n } else {\n doSomethingBefore();\n doSomethingDifferent2();\n doSomethingAfter();\n }' After the quick-fix is applied: 'doSomethingBefore();\n if (x > 12) {\n doSomethingDifferent1();\n } else {\n doSomethingDifferent2();\n }\n doSomethingAfter();' Updated in 2018.1",
+ "markdown": "Reports `if` statements in which common parts can be extracted from the branches.\n\nThese common parts are independent from the condition and make `if` statements harder to understand.\n\nExample:\n\n\n if (x > 12) {\n doSomethingBefore();\n doSomethingDifferent1();\n doSomethingAfter();\n } else {\n doSomethingBefore();\n doSomethingDifferent2();\n doSomethingAfter();\n }\n\nAfter the quick-fix is applied:\n\n\n doSomethingBefore();\n if (x > 12) {\n doSomethingDifferent1();\n } else {\n doSomethingDifferent2();\n }\n doSomethingAfter();\n\nUpdated in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "IfStatementWithIdenticalBranches",
+ "ideaSeverity": "WEAK WARNING",
+ "qodanaSeverity": "Moderate"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InterfaceWithOnlyOneDirectInheritor",
+ "shortDescription": {
+ "text": "Interface with a single direct inheritor"
+ },
+ "fullDescription": {
+ "text": "Reports interfaces that have precisely one direct inheritor. While such interfaces may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the interface with its inheritor. 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.",
+ "markdown": "Reports interfaces that have precisely one direct inheritor. While such interfaces may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the interface with its inheritor.\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."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "InterfaceWithOnlyOneDirectInheritor",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Performance/Embedded",
+ "index": 22,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "InstanceofChain",
+ "shortDescription": {
+ "text": "Chain of 'instanceof' checks"
+ },
+ "fullDescription": {
+ "text": "Reports any chains of 'if'-'else' statements all of whose conditions are 'instanceof' expressions or class equality expressions (e.g. comparison with 'String.class'). Such constructions usually indicate a failure in object-oriented design which dictates that such type-based dispatch should be done via polymorphic method calls rather than explicit chains of type tests. Example: 'double getArea(Shape shape) {\n // Warning: abstraction failure.\n // It would be better to declare a getArea()\n // abstract method in the shape interface\n // and implement it in every inheritor.\n if (shape instanceof Point) {\n return 0;\n }\n if (shape instanceof Circle) {\n return Math.PI *\n Math.pow(((Circle) shape).radius(), 2);\n }\n if (shape instanceof Rectangle) {\n return ((Rectangle) shape).width() *\n ((Rectangle) shape).height();\n }\n throw new IllegalArgumentException();\n }' Use the checkbox below to ignore 'instanceof' expressions on library classes.",
+ "markdown": "Reports any chains of `if`-`else` statements all of whose conditions are `instanceof` expressions or class equality expressions (e.g. comparison with `String.class`). Such constructions usually indicate a failure in object-oriented design which dictates that such type-based dispatch should be done via polymorphic method calls rather than explicit chains of type tests.\n\nExample:\n\n\n double getArea(Shape shape) {\n // Warning: abstraction failure.\n // It would be better to declare a getArea()\n // abstract method in the shape interface\n // and implement it in every inheritor.\n if (shape instanceof Point) {\n return 0;\n }\n if (shape instanceof Circle) {\n return Math.PI *\n Math.pow(((Circle) shape).radius(), 2);\n }\n if (shape instanceof Rectangle) {\n return ((Rectangle) shape).width() *\n ((Rectangle) shape).height();\n }\n throw new IllegalArgumentException();\n }\n\n\nUse the checkbox below to ignore `instanceof` expressions on library classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ChainOfInstanceofChecks",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 75,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "BlockMarkerComments",
+ "shortDescription": {
+ "text": "Block marker comment"
+ },
+ "fullDescription": {
+ "text": "Reports comments which are used as code block markers. The quick-fix removes such comments. Example: 'while (i < 10) {\n i++;\n } // end while' After the quick-fix is applied: 'while (i < 10) {\n i++;\n }'",
+ "markdown": "Reports comments which are used as code block markers. The quick-fix removes such comments.\n\nExample:\n\n\n while (i < 10) {\n i++;\n } // end while\n\nAfter the quick-fix is applied:\n\n\n while (i < 10) {\n i++;\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "BlockMarkerComments",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SerializableHasSerializationMethods",
+ "shortDescription": {
+ "text": "Serializable class without 'readObject()' and 'writeObject()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'Serializable' classes that do not implement 'readObject()' and 'writeObject()' methods. If 'readObject()' and 'writeObject()' methods are not implemented, the default serialization algorithms are used, which may be sub-optimal for performance and compatibility in many environments. 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' classes without non-static fields. Whether to ignore 'Serializable' anonymous classes.",
+ "markdown": "Reports `Serializable` classes that do not implement `readObject()` and `writeObject()` methods.\n\n\nIf `readObject()` and `writeObject()` methods are not implemented,\nthe default serialization algorithms are used,\nwhich may be sub-optimal for performance and compatibility in many environments.\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` classes without non-static fields.\n* Whether to ignore `Serializable` anonymous classes."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SerializableHasSerializationMethods",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Serialization issues",
+ "index": 19,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "IdempotentLoopBody",
+ "shortDescription": {
+ "text": "Idempotent loop body"
+ },
+ "fullDescription": {
+ "text": "Reports loops whose second and all subsequent iterations do not produce any additional side effects other than the one produced by the first iteration, which can indicate a programming error. Such loops may iterate only zero, one, or infinite number of times. If the infinite number of times case is unreachable, such a loop can be replaced with an 'if' statement. Otherwise, there's a possibility that the program can get stuck. Example: 'public void foo(String baseName, String names) {\n int suffix = 1;\n String name = baseName;\n while (names.contains(name)) {\n // error: suffix is not updated making loop body idempotent\n name = baseName + suffix;\n }\n }' New in 2018.1",
+ "markdown": "Reports loops whose second and all subsequent iterations do not produce any additional side effects other than the one produced by the first iteration, which can indicate a programming error.\n\nSuch loops may iterate only zero, one, or infinite number of times.\nIf the infinite number of times case is unreachable, such a loop can be replaced with an `if` statement.\nOtherwise, there's a possibility that the program can get stuck.\n\nExample:\n\n\n public void foo(String baseName, String names) {\n int suffix = 1;\n String name = baseName;\n while (names.contains(name)) {\n // error: suffix is not updated making loop body idempotent\n name = baseName + suffix;\n }\n }\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "IdempotentLoopBody",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "RedundantImplements",
+ "shortDescription": {
+ "text": "Redundant interface declaration"
+ },
+ "fullDescription": {
+ "text": "Reports interfaces in a class' 'implements' list or an interface's 'extends' list that are already implemented by a superclass or extended by a superinterface. Such declarations are unnecessary and may be safely removed. Example: 'class X implements One, Two {\n }\n interface One {}\n interface Two extends One {}' After the quick-fix is applied: 'class X implements Two {\n }\n interface One {}\n interface Two extends One {}' Use the options to not report on 'Serializable' or 'Externalizable' in an 'extends' or 'implements' list.",
+ "markdown": "Reports interfaces in a class' `implements` list or an interface's `extends` list that are already implemented by a superclass or extended by a superinterface. Such declarations are unnecessary and may be safely removed.\n\n**Example:**\n\n\n class X implements One, Two {\n }\n interface One {}\n interface Two extends One {}\n\nAfter the quick-fix is applied:\n\n\n class X implements Two {\n }\n interface One {}\n interface Two extends One {}\n\n\nUse the options to not report on `Serializable` or `Externalizable`\nin an `extends` or `implements` list."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "RedundantInterfaceDeclaration",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": "IC"
+ }
+ },
+ "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": 50,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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 }'",
+ "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"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalGetWithoutIsPresent",
+ "cweIds": [
+ 252,
+ 476
+ ],
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FrequentlyUsedInheritorInspection",
+ "shortDescription": {
+ "text": "Class may extend a commonly used base class"
+ },
+ "fullDescription": {
+ "text": "Reports classes or interfaces that can be replaced with an implementation or extension of a more specific commonly used class or interface. For this inspection to work, a superclass needs to be in project source files and the project needs to use the IntelliJ IDEA build system. Example: 'class MyInheritor implements A {} // B suggested on the A reference\n\n interface A {}\n\n abstract class B implements A {}\n\n abstract class C1 extends B {}\n abstract class C2 extends B {}\n abstract class C3 extends B {}\n abstract class C4 extends B {}\n abstract class C5 extends B {}' By default, this inspection doesn't highlight issues in the editor but only provides a quick-fix. New in 2017.2",
+ "markdown": "Reports classes or interfaces that can be replaced with an implementation or extension of a more specific commonly used class or interface.\n\nFor this inspection to work, a superclass needs to be in project source files and the project needs to use the IntelliJ IDEA build system.\n\n**Example:**\n\n\n class MyInheritor implements A {} // B suggested on the A reference\n\n interface A {}\n\n abstract class B implements A {}\n\n abstract class C1 extends B {}\n abstract class C2 extends B {}\n abstract class C3 extends B {}\n abstract class C4 extends B {}\n abstract class C5 extends B {}\n\nBy default, this inspection doesn't highlight issues in the editor but only provides a quick-fix.\n\nNew in 2017.2"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "FrequentlyUsedInheritorInspection",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Inheritance issues",
+ "index": 26,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 23,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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 only reports if the language level of the project or module is 8 or higher.",
+ "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 only reports if the language level of the project or module is 8 or higher."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "OptionalIsPresent",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Code style issues",
+ "index": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 8,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FieldNamingConvention",
+ "shortDescription": {
+ "text": "Field naming convention"
+ },
+ "fullDescription": {
+ "text": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant produces a warning because the length of its name is 3, which is less than 5: 'public static final int MAX = 42;'. A quick-fix that renames such fields is available only in the editor. Configure the inspection: Use the list in the Options section to specify which fields should be checked. Deselect the checkboxes for the fields for which you want to skip the check. For each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the provided input fields. 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 fields 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 constants, and the minimum specified length for a field name is 5 (the default), the following constant\nproduces a warning because the length of its name is 3, which is less than 5: `public static final int MAX = 42;`.\n\nA quick-fix that renames such fields is available only in the editor.\n\nConfigure the inspection:\n\nUse the list in the **Options** section to specify which fields should be checked. Deselect the checkboxes for the fields for which\nyou want to skip the check.\n\nFor each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the\nprovided input fields.\nSpecify **0** in the length fields to skip the corresponding checks.\n\nRegular expressions should be specified in the standard\n`java.util.regex` format."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FieldNamingConvention",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions",
+ "index": 51,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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 only reports if the language level of the project or module is 8 or higher. 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 only reports if the language level of the project or module is 8 or higher.\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": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ConstantConditionalExpression",
+ "shortDescription": {
+ "text": "Constant conditional expression"
+ },
+ "fullDescription": {
+ "text": "Reports conditional expressions in which the condition is either a 'true' or 'false' constant. These expressions sometimes occur as a result of automatic refactorings and may be simplified. Example: 'return true ? \"Yes\" : \"No\";' After quick-fix is applied: 'return \"Yes\";'",
+ "markdown": "Reports conditional expressions in which the condition is either a `true` or `false` constant. These expressions sometimes occur as a result of automatic refactorings and may be simplified.\n\nExample:\n\n\n return true ? \"Yes\" : \"No\";\n\nAfter quick-fix is applied:\n\n\n return \"Yes\";\n"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ConstantConditionalExpression",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Control flow issues",
+ "index": 27,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassNamePrefixedWithPackageName",
+ "shortDescription": {
+ "text": "Class name prefixed with package name"
+ },
+ "fullDescription": {
+ "text": "Reports classes whose names are prefixed with their package names, ignoring differences in capitalization. While occasionally having such names is reasonable, they are often used due to a poor naming scheme, may be redundant and annoying. Example: 'package byteCode;\n class ByteCodeAnalyzer {}' A quick-fix that renames such classes is available only in the editor.",
+ "markdown": "Reports classes whose names are prefixed with their package names, ignoring differences in capitalization.\n\nWhile occasionally having such names is reasonable, they are often used due to a poor naming scheme, may be redundant and\nannoying.\n\n**Example:**\n\n\n package byteCode;\n class ByteCodeAnalyzer {}\n\nA quick-fix that renames such classes is available only in the editor."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "ClassNamePrefixedWithPackageName",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Naming conventions/Class",
+ "index": 69,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SameParameterValue",
+ "shortDescription": {
+ "text": "Method parameter always has the same value"
+ },
+ "fullDescription": {
+ "text": "Reports method parameters that always have the same constant value. Example: 'static void printPoint(int x, int y) { // x is always 0\n System.out.println(x + \", \" + y);\n }\n\n public static void main(String[] args) {\n printPoint(0, 1);\n printPoint(0, 2);\n }' The quick-fix inlines the constant value. This may simplify the method implementation. Use the Ignore when a quick-fix can not be provided option to suppress the inspections when: the parameter is modified inside the method the parameter value that is being passed is a reference to an inaccessible field (Java ony) the parameter is a vararg (Java only) Use the Maximal method visibility option to control the maximum visibility of methods to be reported. Use the Minimal method usage count to report parameter field to specify the minimal number of method usages with the same parameter value.",
+ "markdown": "Reports method parameters that always have the same constant value.\n\nExample:\n\n\n static void printPoint(int x, int y) { // x is always 0\n System.out.println(x + \", \" + y);\n }\n\n public static void main(String[] args) {\n printPoint(0, 1);\n printPoint(0, 2);\n }\n\nThe quick-fix inlines the constant value. This may simplify the method implementation.\n\n\nUse the **Ignore when a quick-fix can not be provided** option to suppress the inspections when:\n\n* the parameter is modified inside the method\n* the parameter value that is being passed is a reference to an inaccessible field (Java ony)\n* the parameter is a vararg (Java only)\n\n\nUse the **Maximal method visibility** option to control the maximum visibility of methods to be reported.\n\n\nUse the **Minimal method usage count to report parameter** field to specify the minimal number of method usages with the same parameter value."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "SameParameterValue",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Declaration redundancy",
+ "index": 15,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CatchMayIgnoreException",
+ "shortDescription": {
+ "text": "Catch block may ignore exception"
+ },
+ "fullDescription": {
+ "text": "Reports 'catch' blocks that are empty or may ignore an exception. While occasionally intended, empty 'catch' blocks may complicate debugging. Also, ignoring a 'catch' parameter might be wrong. Finally, the static code analyzer reports if it detects that a 'catch' block may silently ignore important VM exceptions like 'NullPointerException'. Ignoring such an exception (without logging or rethrowing it) may hide a bug. The inspection won't report any 'catch' parameters named 'ignore' or 'ignored'. Conversely, the inspection will warn you about any 'catch' parameters named 'ignore' or 'ignored' that are actually in use. Additionally, the inspection won't report 'catch' parameters inside test sources named 'expected' or 'ok'. You can use a quick-fix to change the exception name to 'ignored'. For empty catch blocks, an additional quick-fix to generate the catch body is suggested. You can modify the \"Catch Statement Body\" template on the Code tab in Settings | Editor | File and Code Templates. Example: 'try {\n throwingMethod();\n } catch (IOException ex) {\n\n }' After the quick-fix is applied: 'try {\n System.out.println(System.in.read());\n } catch (IOException ignored) {\n\n }' Configure the inspection: Use the Do not warn when 'catch' block contains a comment option to ignore 'catch' blocks with comments. Use the Do not warn when 'catch' block is not empty option to ignore 'catch' blocks that contain statements or comments inside, while the variable itself is not used. Use the Do not warn when exception named 'ignore(d)' is not actually ignored option to ignore variables named 'ignored' if they are in use. New in 2018.1",
+ "markdown": "Reports `catch` blocks that are empty or may ignore an exception.\n\nWhile occasionally intended, empty `catch` blocks may complicate debugging.\nAlso, ignoring a `catch` parameter might be wrong.\nFinally, the static code analyzer reports if it detects that a `catch` block may silently ignore important VM\nexceptions like `NullPointerException`. Ignoring such an exception\n(without logging or rethrowing it) may hide a bug.\n\n\nThe inspection won't report any `catch` parameters named `ignore` or `ignored`.\nConversely, the inspection will warn you about any `catch` parameters named `ignore` or `ignored` that are actually in use.\nAdditionally, the inspection won't report `catch` parameters inside test sources named `expected` or `ok`.\n\n\nYou can use a quick-fix to change the exception name to `ignored`.\nFor empty **catch** blocks, an additional quick-fix to generate the **catch** body is suggested.\nYou can modify the \"Catch Statement Body\" template on the Code tab in\n[Settings \\| Editor \\| File and Code Templates](settings://fileTemplates).\n\n**Example:**\n\n\n try {\n throwingMethod();\n } catch (IOException ex) {\n\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n System.out.println(System.in.read());\n } catch (IOException ignored) {\n\n }\n\nConfigure the inspection:\n\n* Use the **Do not warn when 'catch' block contains a comment** option to ignore `catch` blocks with comments.\n* Use the **Do not warn when 'catch' block is not empty** option to ignore `catch` blocks that contain statements or comments inside, while the variable itself is not used.\n* Use the **Do not warn when exception named 'ignore(d)' is not actually ignored** option to ignore variables named `ignored` if they are in use.\n\nNew in 2018.1"
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CatchMayIgnoreException",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Error handling",
+ "index": 14,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ClassWithTooManyDependents",
+ "shortDescription": {
+ "text": "Class with too many dependents"
+ },
+ "fullDescription": {
+ "text": "Reports a class on which too many other classes are directly dependent. Any modification to such a class may require changing many other classes, which may be expensive. Only top-level classes are reported. Use the field below to specify the maximum allowed number of dependents 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 a class on which too many other classes are directly dependent.\n\nAny modification to such a class may require changing many other classes, which may be expensive.\n\nOnly top-level classes are reported.\n\nUse the field below to specify the maximum allowed number of dependents 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": "ClassWithTooManyDependents",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Dependency issues",
+ "index": 86,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 22,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 12,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "WrongPackageStatement",
+ "shortDescription": {
+ "text": "Wrong package statement"
+ },
+ "fullDescription": {
+ "text": "Detects 'package' statements that do not correspond to the project directory structure. Also, reports classes without 'package' statements if the class is not located directly in source root directory. While it's not strictly mandated by Java language, it's good to keep classes from package 'com.example.myapp' inside the 'com/example/myapp' directory under the source root. Failure to do this may confuse code readers and make some tools working incorrectly.",
+ "markdown": "Detects `package` statements that do not correspond to the project directory structure. Also, reports classes without `package` statements if the class is not located directly in source root directory.\n\nWhile it's not strictly mandated by Java language, it's good to keep classes\nfrom package `com.example.myapp` inside the `com/example/myapp` directory under\nthe source root. Failure to do this may confuse code readers and make some tools working incorrectly."
+ },
+ "defaultConfiguration": {
+ "enabled": true,
+ "level": "error",
+ "parameters": {
+ "suppressToolId": "WrongPackageStatement",
+ "ideaSeverity": "ERROR",
+ "qodanaSeverity": "Critical"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 31,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "FieldNotUsedInToString",
+ "shortDescription": {
+ "text": "Field not used in 'toString()' method"
+ },
+ "fullDescription": {
+ "text": "Reports any fields that are not used in the 'toString()' method of a class. This inspection can help discover the fields that were added after the 'toString()' method was created and for which the 'toString()' method was not updated. The quick-fix regenerates the 'toString()' method. In the Generate | toString() dialog, it is possible to exclude fields from this check. This inspection will also check for problems with getter methods if the Enable getters in code generation option is enabled there. Example: 'public class Relevant {\n private String name; // not used in toString()\n private int index;\n private int length;\n\n @Override\n public String toString() {\n return \"Relevant{\" + \"index=\" + index +\n \", length=\" + length + '}';\n }\n }' After the quick-fix is applied: 'public class Relevant {\n private String name;\n private int index;\n private int length;\n\n @Override\n public String toString() {\n return \"Relevant{\" + \"name='\" + name + '\\'' +\n \", index=\" + index + \", length=\" + length + '}';\n }\n }'",
+ "markdown": "Reports any fields that are not used in the `toString()` method of a class.\n\nThis inspection can help discover the\nfields that were added after the `toString()` method was created and for which the `toString()` method was not\nupdated. The quick-fix regenerates the `toString()` method.\n\n\nIn the **Generate \\| toString()** dialog, it is possible to exclude fields from this check.\nThis inspection will also check for problems with getter methods if the *Enable getters in code generation* option is enabled there.\n\nExample:\n\n\n public class Relevant {\n private String name; // not used in toString()\n private int index;\n private int length;\n\n @Override\n public String toString() {\n return \"Relevant{\" + \"index=\" + index +\n \", length=\" + length + '}';\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Relevant {\n private String name;\n private int index;\n private int length;\n\n @Override\n public String toString() {\n return \"Relevant{\" + \"name='\" + name + '\\'' +\n \", index=\" + index + \", length=\" + length + '}';\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "FieldNotUsedInToString",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/toString() issues",
+ "index": 119,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "UnresolvedClassReferenceRepair",
+ "shortDescription": {
+ "text": "Unresolved class reference"
+ },
+ "fullDescription": {
+ "text": "Reports an unresolved class reference. The quick-fix suggests trying to resolve reference.",
+ "markdown": "Reports an unresolved class reference.\n\nThe quick-fix suggests trying to resolve reference."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "note",
+ "parameters": {
+ "suppressToolId": "UnresolvedClassReferenceRepair",
+ "ideaSeverity": "INFORMATION",
+ "qodanaSeverity": "Info"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Abstraction issues",
+ "index": 75,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "CovariantEquals",
+ "shortDescription": {
+ "text": "Covariant 'equals()'"
+ },
+ "fullDescription": {
+ "text": "Reports 'equals()' methods taking an argument type other than 'java.lang.Object' if the containing class does not have other overloads of 'equals()' that take 'java.lang.Object' as its argument type. A covariant version of 'equals()' does not override the 'Object.equals(Object)' method. It may cause unexpected behavior at runtime. For example, if the class is used to construct one of the standard collection classes, which expect that the 'Object.equals(Object)' method is overridden. Example: 'class Foo {\n public boolean equals(Foo foo) { // warning\n return false;\n }\n }\n class Bar {\n public boolean equals(Bar bar) { // no warning here\n return false;\n }\n @Override\n public boolean equals(Object obj) {\n return false;\n }\n }'",
+ "markdown": "Reports `equals()` methods taking an argument type other than `java.lang.Object` if the containing class does not have other overloads of `equals()` that take `java.lang.Object` as its argument type.\n\n\nA covariant version of `equals()` does not override the\n`Object.equals(Object)` method. It may cause unexpected\nbehavior at runtime. For example, if the class is used to construct\none of the standard collection classes, which expect that the\n`Object.equals(Object)` method is overridden.\n\n**Example:**\n\n\n class Foo {\n public boolean equals(Foo foo) { // warning\n return false;\n }\n }\n class Bar {\n public boolean equals(Bar bar) { // no warning here\n return false;\n }\n @Override\n public boolean equals(Object obj) {\n return false;\n }\n }\n"
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "CovariantEquals",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Probable bugs",
+ "index": 13,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "Convert2Lambda",
+ "shortDescription": {
+ "text": "Anonymous type can be replaced with lambda"
+ },
+ "fullDescription": {
+ "text": "Reports anonymous classes which can be replaced with lambda expressions. Example: 'new Thread(new Runnable() {\n @Override\n public void run() {\n // run thread\n }\n });' After the quick-fix is applied: 'new Thread(() -> {\n // run thread\n });' Note that if an anonymous class is converted into a stateless lambda, the same lambda object can be reused by Java runtime during subsequent invocations. On the other hand, when an anonymous class is used, separate objects are created every time. Thus, applying the quick-fix can cause the semantics change in rare cases, e.g. when anonymous class instances are used as 'HashMap' keys. Lambda syntax is not supported in Java 1.7 and earlier JVMs. Use the Report when interface is not annotated with @FunctionalInterface option to ignore the cases in which an anonymous class implements an interface without '@FunctionalInterface' annotation.",
+ "markdown": "Reports anonymous classes which can be replaced with lambda expressions.\n\nExample:\n\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n // run thread\n }\n });\n\nAfter the quick-fix is applied:\n\n\n new Thread(() -> {\n // run thread\n });\n\n\nNote that if an anonymous class is converted into a stateless lambda, the same lambda object\ncan be reused by Java runtime during subsequent invocations. On the other hand, when an anonymous class is used,\nseparate objects are created every time. Thus, applying the quick-fix can cause the semantics change in rare cases,\ne.g. when anonymous class instances are used as `HashMap` keys.\n\nLambda syntax is not supported in Java 1.7 and earlier JVMs.\n\n\nUse the **Report when interface is not annotated with @FunctionalInterface** option to ignore the cases in which an anonymous\nclass implements an interface without `@FunctionalInterface` annotation."
+ },
+ "defaultConfiguration": {
+ "enabled": false,
+ "level": "warning",
+ "parameters": {
+ "suppressToolId": "Convert2Lambda",
+ "ideaSeverity": "WARNING",
+ "qodanaSeverity": "High"
+ }
+ },
+ "relationships": [
+ {
+ "target": {
+ "id": "Java/Java language level migration aids/Java 8",
+ "index": 60,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "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": 7,
+ "toolComponent": {
+ "name": "IC"
+ }
+ },
+ "kinds": [
+ "superset"
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ParameterizedParametersStaticCollection",
+ "shortDescription": {
+ "text": "Parameterized test class without data provider method"
+ },
+ "fullDescription": {
+ "text": "Reports JUnit 4 parameterized test classes that are annotated with '@RunWith(Parameterized.class)' but either do not include a data provider method annotated with '@Parameterized.Parameters' or this method has an incorrect signature. Such test classes cannot be run. The data provider method should be 'public' and 'static' and have a return type of 'Iterable' or 'Object[]'. Suggests creating an empty parameter provider method or changing the signature of the incorrect data provider method. Example: '@RunWith(Parameterized.class)\n public class ImportantTest {\n private int input;\n private int expected;\n\n ImportantTest(int input, int expected) {\n this.input = input;\n this.expected = expected;\n }\n\n // ... test cases\n }' After the quick-fix is applied: '@RunWith(Parameterized.class)\n public class ImportantTest {\n private int input;\n private int expected;\n\n ImportantTest(int input, int expected) {\n this.input = input;\n this.expected = expected;\n }\n\n @Parameters\n public static Iterable