From a1815b3afb1de2e9b79f16f26a35d35804560b45 Mon Sep 17 00:00:00 2001 From: nixel2007 Date: Mon, 4 Sep 2023 22:28:15 +0000 Subject: [PATCH] deploy: d9b2b5e962febeabefdd4541384a9e305f5230dc --- .../results/descriptions/Code_Inspection.json | 190 +- qodana/results/metaInformation.json | 4 +- qodana/results/promo.json | 310 +- qodana/results/qodana.sarif.json | 4260 ++++++++--------- qodana/results/result-allProblems.json | 30 +- 5 files changed, 2397 insertions(+), 2397 deletions(-) diff --git a/qodana/results/descriptions/Code_Inspection.json b/qodana/results/descriptions/Code_Inspection.json index 06fee3a9c43..6440c7e5321 100644 --- a/qodana/results/descriptions/Code_Inspection.json +++ b/qodana/results/descriptions/Code_Inspection.json @@ -270,18 +270,18 @@ "enabled": false, "description": "Reports call arguments with `Boolean` type without explicit parameter names specified.\n\n\nWhen multiple boolean literals are passed sequentially, it's easy to forget parameter ordering that could lead to mistakes.\nExplicit parameter names allow for easier code reading and understanding.\n\n**Example:**\n\n\n fun check(checkName: Boolean, checkAddress: Boolean, checkPhone: Boolean) {}\n\n fun usage() {\n check(true, false, true) // What does this mean?\n }\n\nThe quick-fix adds missing parameter names:\n\n\n fun check(checkName: Boolean, checkAddress: Boolean, checkPhone: Boolean) {}\n\n fun usage() {\n check(checkName = true, checkAddress = false, checkPhone = true)\n }\n" }, - { - "shortName": "ReplaceGuardClauseWithFunctionCall", - "displayName": "Guard clause can be replaced with Kotlin's function call", - "enabled": false, - "description": "Reports guard clauses that can be replaced with a function call.\n\n**Example:**\n\n fun test(foo: Int?) {\n if (foo == null) throw IllegalArgumentException(\"foo\") // replaceable clause\n }\n\nAfter the quick-fix is applied:\n\n fun test(foo: Int?) {\n checkNotNull(foo)\n }\n" - }, { "shortName": "ReplaceSizeZeroCheckWithIsEmpty", "displayName": "Size zero check can be replaced with 'isEmpty()'", "enabled": false, "description": "Reports `size == 0` checks on `Collections/Array/String` that should be replaced with `isEmpty()`.\n\nUsing `isEmpty()` makes your code simpler.\n\nThe quick-fix replaces the size check with `isEmpty()`.\n\n**Example:**\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.size == 0\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.isEmpty()\n }\n" }, + { + "shortName": "ReplaceGuardClauseWithFunctionCall", + "displayName": "Guard clause can be replaced with Kotlin's function call", + "enabled": false, + "description": "Reports guard clauses that can be replaced with a function call.\n\n**Example:**\n\n fun test(foo: Int?) {\n if (foo == null) throw IllegalArgumentException(\"foo\") // replaceable clause\n }\n\nAfter the quick-fix is applied:\n\n fun test(foo: Int?) {\n checkNotNull(foo)\n }\n" + }, { "shortName": "ReplaceToStringWithStringTemplate", "displayName": "Call of 'toString' could be replaced with string template", @@ -330,18 +330,18 @@ "enabled": false, "description": "Reports `if-then` expressions that can be folded into elvis (`?:`) expressions.\n\n**Example:**\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo\n\nThe quick fix converts the `if-then` expression into an elvis (`?:`) expression:\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"\n" }, - { - "shortName": "ReplaceStringFormatWithLiteral", - "displayName": "'String.format' call can be replaced with string templates", - "enabled": false, - "description": "Reports `String.format` calls that can be replaced with string templates.\n\nUsing string templates makes your code simpler.\n\nThe quick-fix replaces the call with a string template.\n\n**Example:**\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }\n" - }, { "shortName": "ReplaceNotNullAssertionWithElvisReturn", "displayName": "Not-null assertion can be replaced with 'return'", "enabled": false, "description": "Reports not-null assertion (`!!`) calls that can be replaced with the elvis operator and return (`?: return`).\n\nA not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of `!!` is good practice.\n\nThe quick-fix replaces the not-null assertion with `return` or `return null`.\n\n**Example:**\n\n\n fun test(number: Int?) {\n val x = number!!\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(number: Int?) {\n val x = number ?: return\n }\n" }, + { + "shortName": "ReplaceStringFormatWithLiteral", + "displayName": "'String.format' call can be replaced with string templates", + "enabled": false, + "description": "Reports `String.format` calls that can be replaced with string templates.\n\nUsing string templates makes your code simpler.\n\nThe quick-fix replaces the call with a string template.\n\n**Example:**\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }\n" + }, { "shortName": "ReplaceSubstringWithSubstringBefore", "displayName": "'substring' call should be replaced with 'substringBefore'", @@ -2704,18 +2704,18 @@ "enabled": true, "description": "Reports calls to `StringBuffer` and `StringBuilder` constructors with `char` as the argument. In this case, `char` is silently cast to an integer and interpreted as the initial capacity of the buffer.\n\n**Example:**\n\n\n new StringBuilder('(').append(\"1\").append(')');\n\nAfter the quick-fix is applied:\n\n\n new StringBuilder(\"(\").append(\"1\").append(')');\n" }, - { - "shortName": "ResultOfObjectAllocationIgnored", - "displayName": "Result of object allocation ignored", - "enabled": false, - "description": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." - }, { "shortName": "ClassGetClass", "displayName": "Suspicious 'Class.getClass()' call", "enabled": true, "description": "Reports `getClass()` methods that are called on a `java.lang.Class` instance.\n\nThis is usually a mistake as the result is always equivalent to `Class.class`.\nIf it's a mistake, then it's better to remove the `getClass()` call and use the qualifier directly.\nIf the behavior is intended, then it's better to write `Class.class` explicitly to avoid confusion.\n\nExample:\n\n\n void test(Class clazz) {\n String name = clazz.getClass().getName();\n }\n\nAfter one of the possible quick-fixes is applied:\n\n\n void test(Class clazz) {\n String name = clazz.getName();\n }\n\nNew in 2018.2" }, + { + "shortName": "ResultOfObjectAllocationIgnored", + "displayName": "Result of object allocation ignored", + "enabled": false, + "description": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." + }, { "shortName": "MisspelledEquals", "displayName": "'equal()' instead of 'equals()'", @@ -4870,18 +4870,18 @@ "enabled": false, "description": "Reports equality expressions which are negated by a prefix expression.\n\nSuch expressions can be simplified using the `!=` operator.\n\nExample:\n\n\n !(i == 1)\n\nAfter the quick-fix is applied:\n\n\n i != 1\n" }, - { - "shortName": "DoubleNegation", - "displayName": "Double negation", - "enabled": true, - "description": "Reports double negations that can be simplified.\n\nExample:\n\n\n if (!!functionCall()) {}\n\nAfter the quick-fix is applied:\n\n\n if (functionCall()) {}\n\nExample:\n\n\n if (!(a != b)) {}\n\nAfter the quick-fix is applied:\n\n\n if (a == b) {}\n" - }, { "shortName": "AssertionCanBeIf", "displayName": "Assertion can be replaced with 'if' statement", "enabled": false, "description": "Reports `assert` statements and suggests replacing them with `if` statements that throw `java.lang.AssertionError`.\n\nExample:\n\n\n assert param != null;\n\nAfter the quick-fix is applied:\n\n\n if (param == null) throw new AssertionError();\n" }, + { + "shortName": "DoubleNegation", + "displayName": "Double negation", + "enabled": true, + "description": "Reports double negations that can be simplified.\n\nExample:\n\n\n if (!!functionCall()) {}\n\nAfter the quick-fix is applied:\n\n\n if (functionCall()) {}\n\nExample:\n\n\n if (!(a != b)) {}\n\nAfter the quick-fix is applied:\n\n\n if (a == b) {}\n" + }, { "shortName": "BreakStatement", "displayName": "'break' statement", @@ -5511,71 +5511,6 @@ } ] }, - { - "name": "Properties files", - "inspections": [ - { - "shortName": "UnusedMessageFormatParameter", - "displayName": "Missing message format parameter", - "enabled": false, - "description": "Reports properties values that look like `java.text.MessageFormat` format strings but do not use some the parameters of the `{xx}` kind.\n\nExample:\n\n\n # parameter {0} is not used\n error.message=Something happened in line {1}\n \n" - }, - { - "shortName": "InconsistentResourceBundle", - "displayName": "Inconsistent resource bundle", - "enabled": false, - "description": "Reports problems in the properties files contained in the resource bundle.\n\n* **Report missing translation**\n\noption controls search for an untranslated properties. \nIt reports properties contained in parent properties file that are missing in inherited (unless it's a language dialect). \nE.g. having this resource bundle: \n**messages.properties** : **abc=xxx** \n**messages_fr.properties** : empty \nProperty **abc** will be reported as untranslated.\n\n* **Report inconsistent properties**\n\noption controls invalid resource bundle structure inspection. \nIt reports properties contained in inherited properties file that are missing in parent (or in sibling if there is no parent). \nE.g. having this resource bundle: \n**messages.properties** : empty \n**messages_fr.properties** : **abc=xxx** \nProperty **abc** translation here is not available for any language except French, and, thus, will be reported as missing in the (default) properties file **messages.properties** .\n\n* **Report properties overridden with the same value**\n\noption checks for properties which are copy-pasted into several properties files verbatim. \nE.g. in this resource bundle: \n**messages.properties** : **abc=xxx** \n**messages_fr.properties** : **abc=xxx** \nProperty **abc** will be reported as unnecessarily inherited in the file **messages_fr.properties** . \n\n* **Report properties overridden with different placeholders**\n\noption checks for properties which are overridden for placeholder consistency. \nE.g. in this resource bundle: \n**messages.properties** : \n**qwe={0}xxx{1}** \n**abc={0}yyy{1}** \n**messages_fr.properties** : \n**qwe={0}xxx{0}xxx{1}** \n**abc={0}yyy** \nProperty **abc** will be reported as property contains message format placeholders with value not corresponding to **messages.properties** . \n\n* **Report properties overridden with different values endings**\n\noption checks for properties which are overridden for ending consistency. \nE.g. in this resource bundle: \n**messages.properties** : \n**abc=xxxzzz** \n**messages_fr.properties** : \n**abc=xxx;** \nProperty **abc** will be reported as property contains special signs ( **'!'** , **'?'** , **'.'** , **':'** or **';'** ) at the end of value but value in **messages.properties** doesn't. " - }, - { - "shortName": "SuspiciousLocalesLanguages", - "displayName": "Suspicious resource bundle locale languages", - "enabled": false, - "description": "Reports locales with language codes that are not supported by Java." - }, - { - "shortName": "UseEllipsisInPropertyInspection", - "displayName": "Three dot characters instead of the ellipsis", - "enabled": false, - "description": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files." - }, - { - "shortName": "AlphaUnsortedPropertiesFile", - "displayName": "Properties file or resource bundle is alphabetically unsorted", - "enabled": false, - "description": "Reports alphabetically unsorted resource bundles or .properties files." - }, - { - "shortName": "TrailingSpacesInProperty", - "displayName": "Trailing spaces in property", - "enabled": false, - "description": "Reports properties whose keys or values end with a whitespace." - }, - { - "shortName": "UnusedProperty", - "displayName": "Unused property", - "enabled": false, - "description": "Reports properties that are not referenced outside of the .properties file they are contained in." - }, - { - "shortName": "WrongPropertyKeyValueDelimiter", - "displayName": "Property key/value delimiter doesn't match code style settings", - "enabled": false, - "description": "Reports properties in which key or value delimiters do not match code style settings." - }, - { - "shortName": "DuplicatePropertyInspection", - "displayName": "Duplicate property", - "enabled": false, - "description": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values.\n\nExample:\n\n\n property1=value;\n property2=value;\n\nThe **Options** list allows selecting the area in which the inspection should search for duplicates." - }, - { - "shortName": "UnresolvedPropertyKey", - "displayName": "Invalid property key", - "enabled": true, - "description": "Reports invalid arguments that are passed to methods with parameters annotated as `@PropertyKey`.\n\nThese arguments should be valid property keys in corresponding properties files.\nAlso, the inspection verifies that the `resourceBundle`\nargument of the `@PropertyKey` annotation is an existing resource bundle.\n\n\nUse the quick-fix to create a new property or to select an existing one.\n\nExample:\n\n\n @PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";\n" - } - ] - }, { "name": "EditorConfig", "inspections": [ @@ -5749,6 +5684,71 @@ } ] }, + { + "name": "Properties files", + "inspections": [ + { + "shortName": "UnusedMessageFormatParameter", + "displayName": "Missing message format parameter", + "enabled": false, + "description": "Reports properties values that look like `java.text.MessageFormat` format strings but do not use some the parameters of the `{xx}` kind.\n\nExample:\n\n\n # parameter {0} is not used\n error.message=Something happened in line {1}\n \n" + }, + { + "shortName": "InconsistentResourceBundle", + "displayName": "Inconsistent resource bundle", + "enabled": false, + "description": "Reports problems in the properties files contained in the resource bundle.\n\n* **Report missing translation**\n\noption controls search for an untranslated properties. \nIt reports properties contained in parent properties file that are missing in inherited (unless it's a language dialect). \nE.g. having this resource bundle: \n**messages.properties** : **abc=xxx** \n**messages_fr.properties** : empty \nProperty **abc** will be reported as untranslated.\n\n* **Report inconsistent properties**\n\noption controls invalid resource bundle structure inspection. \nIt reports properties contained in inherited properties file that are missing in parent (or in sibling if there is no parent). \nE.g. having this resource bundle: \n**messages.properties** : empty \n**messages_fr.properties** : **abc=xxx** \nProperty **abc** translation here is not available for any language except French, and, thus, will be reported as missing in the (default) properties file **messages.properties** .\n\n* **Report properties overridden with the same value**\n\noption checks for properties which are copy-pasted into several properties files verbatim. \nE.g. in this resource bundle: \n**messages.properties** : **abc=xxx** \n**messages_fr.properties** : **abc=xxx** \nProperty **abc** will be reported as unnecessarily inherited in the file **messages_fr.properties** . \n\n* **Report properties overridden with different placeholders**\n\noption checks for properties which are overridden for placeholder consistency. \nE.g. in this resource bundle: \n**messages.properties** : \n**qwe={0}xxx{1}** \n**abc={0}yyy{1}** \n**messages_fr.properties** : \n**qwe={0}xxx{0}xxx{1}** \n**abc={0}yyy** \nProperty **abc** will be reported as property contains message format placeholders with value not corresponding to **messages.properties** . \n\n* **Report properties overridden with different values endings**\n\noption checks for properties which are overridden for ending consistency. \nE.g. in this resource bundle: \n**messages.properties** : \n**abc=xxxzzz** \n**messages_fr.properties** : \n**abc=xxx;** \nProperty **abc** will be reported as property contains special signs ( **'!'** , **'?'** , **'.'** , **':'** or **';'** ) at the end of value but value in **messages.properties** doesn't. " + }, + { + "shortName": "SuspiciousLocalesLanguages", + "displayName": "Suspicious resource bundle locale languages", + "enabled": false, + "description": "Reports locales with language codes that are not supported by Java." + }, + { + "shortName": "UseEllipsisInPropertyInspection", + "displayName": "Three dot characters instead of the ellipsis", + "enabled": false, + "description": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files." + }, + { + "shortName": "AlphaUnsortedPropertiesFile", + "displayName": "Properties file or resource bundle is alphabetically unsorted", + "enabled": false, + "description": "Reports alphabetically unsorted resource bundles or .properties files." + }, + { + "shortName": "TrailingSpacesInProperty", + "displayName": "Trailing spaces in property", + "enabled": false, + "description": "Reports properties whose keys or values end with a whitespace." + }, + { + "shortName": "UnusedProperty", + "displayName": "Unused property", + "enabled": false, + "description": "Reports properties that are not referenced outside of the .properties file they are contained in." + }, + { + "shortName": "WrongPropertyKeyValueDelimiter", + "displayName": "Property key/value delimiter doesn't match code style settings", + "enabled": false, + "description": "Reports properties in which key or value delimiters do not match code style settings." + }, + { + "shortName": "DuplicatePropertyInspection", + "displayName": "Duplicate property", + "enabled": false, + "description": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values.\n\nExample:\n\n\n property1=value;\n property2=value;\n\nThe **Options** list allows selecting the area in which the inspection should search for duplicates." + }, + { + "shortName": "UnresolvedPropertyKey", + "displayName": "Invalid property key", + "enabled": true, + "description": "Reports invalid arguments that are passed to methods with parameters annotated as `@PropertyKey`.\n\nThese arguments should be valid property keys in corresponding properties files.\nAlso, the inspection verifies that the `resourceBundle`\nargument of the `@PropertyKey` annotation is an existing resource bundle.\n\n\nUse the quick-fix to create a new property or to select an existing one.\n\nExample:\n\n\n @PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";\n" + } + ] + }, { "name": "Java language level migration aids", "inspections": [ @@ -8466,17 +8466,17 @@ "enabled": false, "description": "Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. `(?:xxx)` instead of `(xxx)`.\n\n**Example:**\n\n\n (\\d\\d\\d\\d)\\1\n\nA better regex pattern could look like this:\n\n\n (?\\d\\d\\d\\d)\\k\n\nNew in 2017.2" }, - { - "shortName": "RegExpDuplicateAlternationBranch", - "displayName": "Duplicate branch in alternation", - "enabled": true, - "description": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression.\n\n**Example:**\n\n\n (alpha|bravo|charlie|alpha)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo|charlie)\n\nNew in 2017.1" - }, { "shortName": "RegExpRepeatedSpace", "displayName": "Consecutive spaces", "enabled": true, "description": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier.\n\n**Example:**\n\n\n ( )\n\nAfter the quick-fix is applied:\n\n\n ( {5})\n\n\nNew in 2017.1" + }, + { + "shortName": "RegExpDuplicateAlternationBranch", + "displayName": "Duplicate branch in alternation", + "enabled": true, + "description": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression.\n\n**Example:**\n\n\n (alpha|bravo|charlie|alpha)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo|charlie)\n\nNew in 2017.1" } ] }, diff --git a/qodana/results/metaInformation.json b/qodana/results/metaInformation.json index 6d4dc74560c..1939ac1720a 100644 --- a/qodana/results/metaInformation.json +++ b/qodana/results/metaInformation.json @@ -8,12 +8,12 @@ "vcs": { "sarifIdea": { "repositoryUri": "https://github.com/1c-syntax/bsl-language-server.git", - "revisionId": "c423b9563cedb0a1777a66ec0e933b0a972276a8", + "revisionId": "d9b2b5e962febeabefdd4541384a9e305f5230dc", "branch": "refs/heads/develop" } }, "deviceId": "200820300000000-b1a5-d275-f8e7-faf9fd093ee8", - "jobUrl": "https://github.com/1c-syntax/bsl-language-server/actions/runs/5788698550", + "jobUrl": "https://github.com/1c-syntax/bsl-language-server/actions/runs/6078022192", "repoUrl": "https://github.com/1c-syntax/bsl-language-server.git" } } \ No newline at end of file diff --git a/qodana/results/promo.json b/qodana/results/promo.json index e75e25ef4c7..2dd53f060c7 100644 --- a/qodana/results/promo.json +++ b/qodana/results/promo.json @@ -1,247 +1,247 @@ {"version":"3","listProblem":[{ "tool": "Code Inspection", - "category": "Code style issues", - "type": "Field may be 'final'", + "category": "Declaration redundancy", + "type": "Default annotation parameter value", "severity": "High", - "comment": "Field 'reportersOptions' may be 'final'", - "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", + "comment": "Redundant default parameter value assignment", + "detailsInfo": "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", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/cli/AnalyzeCommand.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/BadWordsDiagnostic.java", "language": "JAVA", - "line": 135, + "line": 50, "offset": 20, - "length": 16, + "length": 17, "code": { - "startLine": 133, - "length": 16, - "offset": 128, - "surroundingCode": " completionCandidates = ReportersKeys.class,\n description = \"Reporter key (${COMPLETION-CANDIDATES})\")\n private String[] reportersOptions = {};\n\n @Option(" + "startLine": 48, + "length": 17, + "offset": 68, + "surroundingCode": " @DiagnosticParameter(\n type = String.class,\n defaultValue = BAD_WORDS_DEFAULT\n )\n private Pattern badWords = CaseInsensitivePattern.compile(BAD_WORDS_DEFAULT);" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "FieldMayBeFinal" + "inspectionName": "DefaultAnnotationParam" }, - "hash": "efb2a2355a44d1d58603fab18d8ed664e7bb8001fe05e4f4aa299a158ded983b" + "hash": "0075b5ac0f587a18b42ec66d5835585bd8dd59fe5399780ae701a882e27920e2" },{ "tool": "Code Inspection", - "category": "Code style issues", - "type": "Field may be 'final'", - "severity": "High", - "comment": "Field 'maxParamsCount' may be 'final'", - "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", + "category": "RegExp", + "type": "Regular expression can be simplified", + "severity": "Moderate", + "comment": "'[*]' can be simplified to '*'", + "detailsInfo": "Reports regular expressions that can be simplified.\n\n**Example:**\n\n\n [a] xx* [ah-hz]\n\nAfter the quick-fix is applied:\n\n\n a x+ [ahz]\n\nNew in 2022.1", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/NumberOfParamsDiagnostic.java", - "language": "JAVA", - "line": 49, - "offset": 15, - "length": 14, + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UsingHardcodeSecretInformationDiagnostic.java", + "language": "RegExp", + "line": 67, + "offset": 75, + "length": 5, "code": { - "startLine": 47, - "length": 14, - "offset": 59, - "surroundingCode": " defaultValue = \"\" + MAX_PARAMS_COUNT\n )\n private int maxParamsCount = MAX_PARAMS_COUNT;\n\n @Override" + "startLine": 65, + "length": 5, + "offset": 80, + "surroundingCode": " );\n\n private static final Pattern PATTERN_CHECK_PASSWORD = Pattern.compile(\"^[\\\\*]+$\", Pattern.UNICODE_CASE);\n\n @DiagnosticParameter(" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "FieldMayBeFinal" + "inspectionName": "RegExpSimplifiable" }, - "hash": "e0fb20e2a737fc73e36a33c3f9cd5bb91e8a9bd5ace0181a8580c09034ac11bb" + "hash": "71340859aaa634a7436637ac31b215a4ec2cb5ab9376bb6a2eba5a45dfff2c41" },{ "tool": "Code Inspection", - "category": "Code style issues", - "type": "Field may be 'final'", + "category": "Verbose or redundant code constructs", + "type": "Concatenation with empty string", "severity": "High", - "comment": "Field 'maxOptionalParamsCount' may be 'final'", - "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", + "comment": "Empty string used in concatenation", + "detailsInfo": "Reports string concatenations where one of the arguments is the empty string. Such a concatenation is unnecessary. Sometimes, it's used as an idiom for converting non-`String` objects or primitives into `String`s, but in this case, it's clearer to use a method like `String.valueOf`.\n\n\nA quick-fix is suggested to simplify the concatenation.\n\n**Example:**\n\n\n void foo(int x, int y) {\n String s = \"\" + x + \" ; \" + y;\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(int x, int y) {\n String s = x + \" ; \" + y;\n }\n", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/NumberOfOptionalParamsDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SetPermissionsForNewObjectsDiagnostic.java", "language": "JAVA", - "line": 49, - "offset": 15, - "length": 22, + "line": 58, + "offset": 20, + "length": 2, "code": { - "startLine": 47, - "length": 22, + "startLine": 56, + "length": 2, "offset": 68, - "surroundingCode": " defaultValue = \"\" + MAX_OPTIONAL_PARAMS_COUNT\n )\n private int maxOptionalParamsCount = MAX_OPTIONAL_PARAMS_COUNT;\n\n @Override" + "surroundingCode": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + NAMES_FULL_ACCESS_ROLE\n )\n" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "FieldMayBeFinal" + "inspectionName": "TrivialStringConcatenation" }, - "hash": "3b353e4e0f223ad88815c18e5087e917fc5bb58f422cd5b74c16bed5cdf94dae" + "hash": "96e7e12a31a961f033b2af97c00150c7474a8fcb3adfdc8938bc5b9b506da507" },{ "tool": "Code Inspection", - "category": "Code style issues", - "type": "Field may be 'final'", + "category": "Verbose or redundant code constructs", + "type": "Concatenation with empty string", "severity": "High", - "comment": "Field 'useStrictValidation' may be 'final'", - "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", + "comment": "Empty string used in concatenation", + "detailsInfo": "Reports string concatenations where one of the arguments is the empty string. Such a concatenation is unnecessary. Sometimes, it's used as an idiom for converting non-`String` objects or primitives into `String`s, but in this case, it's clearer to use a method like `String.valueOf`.\n\n\nA quick-fix is suggested to simplify the concatenation.\n\n**Example:**\n\n\n void foo(int x, int y) {\n String s = \"\" + x + \" ; \" + y;\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(int x, int y) {\n String s = x + \" ; \" + y;\n }\n", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SpaceAtStartCommentDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", "language": "JAVA", - "line": 83, - "offset": 19, - "length": 19, + "line": 88, + "offset": 20, + "length": 2, "code": { - "startLine": 81, - "length": 19, + "startLine": 86, + "length": 2, "offset": 68, - "surroundingCode": " defaultValue = \"\" + USE_STRICT_VALIDATION\n )\n private boolean useStrictValidation = USE_STRICT_VALIDATION;\n\n public SpaceAtStartCommentDiagnostic() {" + "surroundingCode": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_LEFT\n )\n private String listForCheckLeft = DEFAULT_LIST_FOR_CHECK_LEFT;" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "FieldMayBeFinal" + "inspectionName": "TrivialStringConcatenation" }, - "hash": "f9cecdea954ae772066b1228214c05cede7e9f6ec9c50dcf221eb8c663ab79c4" + "hash": "fb15fb0d148d2601477d8fdf6280f4ebb4d472be87d1557eb2218490c821131d" },{ "tool": "Code Inspection", - "category": "Code style issues", - "type": "Field may be 'final'", + "category": "Verbose or redundant code constructs", + "type": "Concatenation with empty string", "severity": "High", - "comment": "Field 'maxValuesCount' may be 'final'", - "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", + "comment": "Empty string used in concatenation", + "detailsInfo": "Reports string concatenations where one of the arguments is the empty string. Such a concatenation is unnecessary. Sometimes, it's used as an idiom for converting non-`String` objects or primitives into `String`s, but in this case, it's clearer to use a method like `String.valueOf`.\n\n\nA quick-fix is suggested to simplify the concatenation.\n\n**Example:**\n\n\n void foo(int x, int y) {\n String s = \"\" + x + \" ; \" + y;\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(int x, int y) {\n String s = x + \" ; \" + y;\n }\n", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/NumberOfValuesInStructureConstructorDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", "language": "JAVA", - "line": 55, - "offset": 15, - "length": 14, + "line": 94, + "offset": 20, + "length": 2, "code": { - "startLine": 53, - "length": 14, - "offset": 59, - "surroundingCode": " defaultValue = \"\" + MAX_VALUES_COUNT\n )\n private int maxValuesCount = MAX_VALUES_COUNT;\n\n @Override" + "startLine": 92, + "length": 2, + "offset": 68, + "surroundingCode": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_RIGHT\n )\n private String listForCheckRight = DEFAULT_LIST_FOR_CHECK_RIGHT;" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "FieldMayBeFinal" + "inspectionName": "TrivialStringConcatenation" }, - "hash": "87c47d6aaf310152a66939cf27acab191df9f07b6046ae8912a8ede5f21fe64b" + "hash": "7eb40371ef86e50013987dd6bac35549e3b62bdfa1c65762e1b2bd3a3ac1ea2b" },{ "tool": "Code Inspection", - "category": "Code style issues", - "type": "Field may be 'final'", + "category": "Verbose or redundant code constructs", + "type": "Concatenation with empty string", "severity": "High", - "comment": "Field 'checkSpaceToRightOfUnary' may be 'final'", - "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", + "comment": "Empty string used in concatenation", + "detailsInfo": "Reports string concatenations where one of the arguments is the empty string. Such a concatenation is unnecessary. Sometimes, it's used as an idiom for converting non-`String` objects or primitives into `String`s, but in this case, it's clearer to use a method like `String.valueOf`.\n\n\nA quick-fix is suggested to simplify the concatenation.\n\n**Example:**\n\n\n void foo(int x, int y) {\n String s = \"\" + x + \" ; \" + y;\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(int x, int y) {\n String s = x + \" ; \" + y;\n }\n", "sources": [ { "type": "file", "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", "language": "JAVA", - "line": 108, - "offset": 19, - "length": 24, + "line": 100, + "offset": 20, + "length": 2, "code": { - "startLine": 106, - "length": 24, - "offset": 84, - "surroundingCode": " defaultValue = \"\" + DEFAULT_CHECK_SPACE_TO_RIGHT_OF_UNARY\n )\n private boolean checkSpaceToRightOfUnary = DEFAULT_CHECK_SPACE_TO_RIGHT_OF_UNARY;\n\n @DiagnosticParameter(" + "startLine": 98, + "length": 2, + "offset": 68, + "surroundingCode": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_LEFT_AND_RIGHT\n )\n private String listForCheckLeftAndRight = DEFAULT_LIST_FOR_CHECK_LEFT_AND_RIGHT;" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "FieldMayBeFinal" + "inspectionName": "TrivialStringConcatenation" }, - "hash": "7e21fcefd988ea8d9ce95a971c1e7044f6a0b350f8ce7919e237c50f23e484a5" + "hash": "acc1fddfdcfd240ef1a1973491f5c9a7a1a234e9fe816fa19231d8a187d483af" },{ "tool": "Code Inspection", - "category": "Code style issues", - "type": "Field may be 'final'", + "category": "Verbose or redundant code constructs", + "type": "Stream API call chain can be simplified", "severity": "High", - "comment": "Field 'listForCheckRight' may be 'final'", - "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", + "comment": "'collect(toList())' can be replaced with 'toList()'", + "detailsInfo": "Reports stream API call chains that can be simplified. Simplification will often avoid some temporary object creation during collection traversal.\n\n\nThe inspection replaces the following call chains:\n\n* `collection.stream().forEach()` → `collection.forEach()`\n* `collection.stream().collect(toList/toSet/toCollection())` → `new CollectionType<>(collection)`\n* `collection.stream().toArray()` → `collection.toArray()`\n* `Arrays.asList().stream()` → `Arrays.stream()` or `Stream.of()`\n* `IntStream.range(0, array.length).mapToObj(idx -> array[idx])` → `Arrays.stream(array)`\n* `IntStream.range(0, list.size()).mapToObj(idx -> list.get(idx))` → `list.stream()`\n* `Collections.singleton().stream()` → `Stream.of()`\n* `Collections.emptyList().stream()` → `Stream.empty()`\n* `stream.filter().findFirst().isPresent()` → `stream.anyMatch()`\n* `stream.collect(counting())` → `stream.count()`\n* `stream.collect(maxBy())` → `stream.max()`\n* `stream.collect(mapping())` → `stream.map().collect()`\n* `stream.collect(reducing())` → `stream.reduce()`\n* `stream.collect(summingInt())` → `stream.mapToInt().sum()`\n* `stream.mapToObj(x -> x)` → `stream.boxed()`\n* `stream.map(x -> {...; return x;})` → `stream.peek(x -> ...)`\n* `!stream.anyMatch()` → `stream.noneMatch()`\n* `!stream.anyMatch(x -> !(...))` → `stream.allMatch()`\n* `stream.map().anyMatch(Boolean::booleanValue)` → `stream.anyMatch()`\n* `IntStream.range(expr1, expr2).mapToObj(x -> array[x])` → `Arrays.stream(array, expr1, expr2)`\n* `Collection.nCopies(count, ...)` → `Stream.generate().limit(count)`\n* `stream.sorted(comparator).findFirst()` → `Stream.min(comparator)`\n* `optional.orElseGet(() -> { throw new ...; })` → `optional.orElseThrow()`\n\n\nNote that the replacement semantics may have minor differences in some cases. For example,\n`Collections.synchronizedList(...).stream().forEach()` is not synchronized while\n`Collections.synchronizedList(...).forEach()` is synchronized.\nAlso, `collect(Collectors.maxBy())` returns an empty `Optional` if the resulting element is\n`null` while `Stream.max()` throws `NullPointerException` in this case.", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RefOveruseDiagnostic.java", "language": "JAVA", - "line": 96, - "offset": 18, - "length": 17, + "line": 189, + "offset": 8, + "length": 28, "code": { - "startLine": 94, - "length": 17, - "offset": 74, - "surroundingCode": " defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_RIGHT\n )\n private String listForCheckRight = DEFAULT_LIST_FOR_CHECK_RIGHT;\n\n @DiagnosticParameter(" + "startLine": 187, + "length": 28, + "offset": 90, + "surroundingCode": " .map(SDBLParser.JoinPartContext::dataSource)\n .filter(Objects::nonNull)\n .collect(Collectors.toList());\n result.addAll(joinDataSources);\n" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "FieldMayBeFinal" + "inspectionName": "SimplifyStreamApiCallChains" }, - "hash": "abb038d57f734ce95201682f39a1b20cf60a23fc47c98ca095d545da1e701899" + "hash": "17d74d3e6d2050db19b35a82988c414d5df2b42f699edb07c1a6694ccbae1853" },{ "tool": "Code Inspection", - "category": "Code style issues", - "type": "Field may be 'final'", + "category": "Verbose or redundant code constructs", + "type": "Stream API call chain can be simplified", "severity": "High", - "comment": "Field 'allowMultipleCommas' may be 'final'", - "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", + "comment": "'collect(toList())' can be replaced with 'toList()'", + "detailsInfo": "Reports stream API call chains that can be simplified. Simplification will often avoid some temporary object creation during collection traversal.\n\n\nThe inspection replaces the following call chains:\n\n* `collection.stream().forEach()` → `collection.forEach()`\n* `collection.stream().collect(toList/toSet/toCollection())` → `new CollectionType<>(collection)`\n* `collection.stream().toArray()` → `collection.toArray()`\n* `Arrays.asList().stream()` → `Arrays.stream()` or `Stream.of()`\n* `IntStream.range(0, array.length).mapToObj(idx -> array[idx])` → `Arrays.stream(array)`\n* `IntStream.range(0, list.size()).mapToObj(idx -> list.get(idx))` → `list.stream()`\n* `Collections.singleton().stream()` → `Stream.of()`\n* `Collections.emptyList().stream()` → `Stream.empty()`\n* `stream.filter().findFirst().isPresent()` → `stream.anyMatch()`\n* `stream.collect(counting())` → `stream.count()`\n* `stream.collect(maxBy())` → `stream.max()`\n* `stream.collect(mapping())` → `stream.map().collect()`\n* `stream.collect(reducing())` → `stream.reduce()`\n* `stream.collect(summingInt())` → `stream.mapToInt().sum()`\n* `stream.mapToObj(x -> x)` → `stream.boxed()`\n* `stream.map(x -> {...; return x;})` → `stream.peek(x -> ...)`\n* `!stream.anyMatch()` → `stream.noneMatch()`\n* `!stream.anyMatch(x -> !(...))` → `stream.allMatch()`\n* `stream.map().anyMatch(Boolean::booleanValue)` → `stream.anyMatch()`\n* `IntStream.range(expr1, expr2).mapToObj(x -> array[x])` → `Arrays.stream(array, expr1, expr2)`\n* `Collection.nCopies(count, ...)` → `Stream.generate().limit(count)`\n* `stream.sorted(comparator).findFirst()` → `Stream.min(comparator)`\n* `optional.orElseGet(() -> { throw new ...; })` → `optional.orElseThrow()`\n\n\nNote that the replacement semantics may have minor differences in some cases. For example,\n`Collections.synchronizedList(...).stream().forEach()` is not synchronized while\n`Collections.synchronizedList(...).forEach()` is synchronized.\nAlso, `collect(Collectors.maxBy())` returns an empty `Optional` if the resulting element is\n`null` while `Stream.max()` throws `NullPointerException` in this case.", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RefOveruseDiagnostic.java", "language": "JAVA", - "line": 114, - "offset": 19, - "length": 19, + "line": 194, + "offset": 8, + "length": 28, "code": { - "startLine": 112, - "length": 19, - "offset": 76, - "surroundingCode": " defaultValue = \"\" + DEFAULT_ALLOW_MULTIPLE_COMMAS\n )\n private boolean allowMultipleCommas = DEFAULT_ALLOW_MULTIPLE_COMMAS;\n\n private String mainMessage;" + "startLine": 192, + "length": 28, + "offset": 149, + "surroundingCode": " var dataSourcesFromJoins = joinDataSources.stream()\n .flatMap(dataSourceContext1 -> getInnerDataSource(dataSourceContext1).stream())\n .collect(Collectors.toList());\n\n result.addAll(dataSourcesFromJoins);" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "FieldMayBeFinal" + "inspectionName": "SimplifyStreamApiCallChains" }, - "hash": "5e3f88f81e6609dbc0f651ceb14e725fcf9d8d2c89f8f89ff5e6e2eb4bfb4991" + "hash": "fe1cff73a4d212eda0419e55c9fb3511150ec7ced976a89aaaf44849d559b4db" },{ "tool": "Code Inspection", "category": "Code style issues", "type": "Field may be 'final'", "severity": "High", - "comment": "Field 'listForCheckLeft' may be 'final'", + "comment": "Field 'exitPoint' may be 'final'", "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ControlFlowGraph.java", "language": "JAVA", - "line": 90, - "offset": 18, - "length": 16, + "line": 35, + "offset": 22, + "length": 9, "code": { - "startLine": 88, - "length": 16, - "offset": 73, - "surroundingCode": " defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_LEFT\n )\n private String listForCheckLeft = DEFAULT_LIST_FOR_CHECK_LEFT;\n\n @DiagnosticParameter(" + "startLine": 33, + "length": 9, + "offset": 32, + "surroundingCode": "\n @Getter\n private ExitVertex exitPoint;\n\n ControlFlowGraph() {" } } ], @@ -249,27 +249,27 @@ "module": "bsl-language-server.main", "inspectionName": "FieldMayBeFinal" }, - "hash": "d457d8c541163b726a3f23a0fbdfc2ae02e50c282649e0f2685243917f6b4271" + "hash": "5fde6b97e131c264200fad1f6b6437d403538b270f5ba0c9c3e97658c2d8badb" },{ "tool": "Code Inspection", "category": "Code style issues", "type": "Field may be 'final'", "severity": "High", - "comment": "Field 'listForCheckLeftAndRight' may be 'final'", + "comment": "Field 'maxReturnsCount' may be 'final'", "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TooManyReturnsDiagnostic.java", "language": "JAVA", - "line": 102, - "offset": 18, - "length": 24, + "line": 60, + "offset": 15, + "length": 15, "code": { - "startLine": 100, - "length": 24, - "offset": 83, - "surroundingCode": " defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_LEFT_AND_RIGHT\n )\n private String listForCheckLeftAndRight = DEFAULT_LIST_FOR_CHECK_LEFT_AND_RIGHT;\n\n @DiagnosticParameter(" + "startLine": 58, + "length": 15, + "offset": 60, + "surroundingCode": " defaultValue = \"\" + MAX_RETURNS_COUNT\n )\n private int maxReturnsCount = MAX_RETURNS_COUNT;\n\n private static String leftSubStr(String inputString) {" } } ], @@ -277,27 +277,27 @@ "module": "bsl-language-server.main", "inspectionName": "FieldMayBeFinal" }, - "hash": "82b5ba611a4eb1fca6545e5cc822b4535e373a717e6d858ceefbe483689e4de7" + "hash": "5f3e2c52b8ad320491b1a66cd0092fb9227d929d589f841a66fca89c318682a4" },{ "tool": "Code Inspection", "category": "Code style issues", "type": "Field may be 'final'", "severity": "High", - "comment": "Field 'isAllowedMethodADD' may be 'final'", + "comment": "Field 'maxLineLength' may be 'final'", "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DuplicatedInsertionIntoCollectionDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java", "language": "JAVA", - "line": 83, - "offset": 19, - "length": 18, + "line": 62, + "offset": 15, + "length": 13, "code": { - "startLine": 81, - "length": 18, - "offset": 68, - "surroundingCode": " defaultValue = \"\" + IS_ALLOWED_METHOD_ADD\n )\n private boolean isAllowedMethodADD = IS_ALLOWED_METHOD_ADD;\n private Pattern methodPattern = INSERT_ADD_METHOD_PATTERN;\n" + "startLine": 60, + "length": 13, + "offset": 58, + "surroundingCode": " defaultValue = \"\" + MAX_LINE_LENGTH\n )\n private int maxLineLength = MAX_LINE_LENGTH;\n\n @DiagnosticParameter(" } } ], @@ -305,33 +305,33 @@ "module": "bsl-language-server.main", "inspectionName": "FieldMayBeFinal" }, - "hash": "a49c8aa361cb73d969fce7c0decd4f9f2063722846f78165b656adb53beb615f" + "hash": "85c58414dc44e34b845db47c2404b666bf3c68f99772ca6f70ec5b0de663d67c" },{ "tool": "Code Inspection", - "category": "Code maturity", - "type": "Commented out code", - "severity": "Moderate", - "comment": "Commented out code (6 lines)", - "detailsInfo": "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", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'checkMethodDescription' may be 'final'", + "detailsInfo": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java", "language": "JAVA", - "line": 72, - "offset": 1, - "length": 2, + "line": 68, + "offset": 19, + "length": 22, "code": { - "startLine": 70, - "length": 2, - "offset": 36, - "surroundingCode": " var range = params.getRange();\n\n// var ast = documentContext.getAst();\n// Trees.findAllRuleNodes(\n// ast," + "startLine": 66, + "length": 22, + "offset": 71, + "surroundingCode": " defaultValue = \"\" + CHECK_METHOD_DESCRIPTION\n )\n private boolean checkMethodDescription = CHECK_METHOD_DESCRIPTION;\n\n private final Map> tokensInOneLine = new HashMap<>();" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "CommentedOutCode" + "inspectionName": "FieldMayBeFinal" }, - "hash": "140fdd15ad1c0ab3d2ff0a809804359b9793a40bb71dca1f139d768129204d80" + "hash": "86a5f98338add7295ae35668b22c99b5d74a47cced2cc01e20e15f71306f6eac" }]} \ No newline at end of file diff --git a/qodana/results/qodana.sarif.json b/qodana/results/qodana.sarif.json index c642e9e7bcc..5c9a42cda03 100644 --- a/qodana/results/qodana.sarif.json +++ b/qodana/results/qodana.sarif.json @@ -456,14 +456,14 @@ } ] }, - { - "id": "Properties files", - "name": "Properties files" - }, { "id": "EditorConfig", "name": "EditorConfig" }, + { + "id": "Properties files", + "name": "Properties files" + }, { "id": "Java/Java language level migration aids", "name": "Java language level migration aids", @@ -779,13 +779,13 @@ ] }, { - "id": "Kotlin/Other problems", - "name": "Other problems", + "id": "Groovy/Probable bugs", + "name": "Probable bugs", "relationships": [ { "target": { - "id": "Kotlin", - "index": 3, + "id": "Groovy", + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -797,13 +797,13 @@ ] }, { - "id": "Groovy/Probable bugs", - "name": "Probable bugs", + "id": "Kotlin/Other problems", + "name": "Other problems", "relationships": [ { "target": { - "id": "Groovy", - "index": 20, + "id": "Kotlin", + "index": 3, "toolComponent": { "name": "QDJVMC" } @@ -2838,13 +2838,13 @@ ] }, { - "id": "ComparatorNotSerializable", + "id": "ClassWithOnlyPrivateConstructors", "shortDescription": { - "text": "'Comparator' class not declared 'Serializable'" + "text": "Class with only 'private' constructors should be declared 'final'" }, "fullDescription": { - "text": "Reports classes that implement 'java.lang.Comparator', but do not implement 'java.io.Serializable'. If a non-serializable comparator is used to construct an ordered collection such as a 'java.util.TreeMap' or 'java.util.TreeSet', then the collection will also be non-serializable. This can result in unexpected and difficult-to-diagnose bugs. Since subclasses of 'java.lang.Comparator' are often stateless, simply marking them serializable is a small cost to avoid such issues. Example: 'class Foo implements Comparator { // warning\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }' After the quick-fix is applied: 'class Foo implements Comparator, Serializable { // no warning here\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }'", - "markdown": "Reports classes that implement `java.lang.Comparator`, but do not implement `java.io.Serializable`.\n\n\nIf a non-serializable comparator is used to construct an ordered collection such\nas a `java.util.TreeMap` or `java.util.TreeSet`, then the\ncollection will also be non-serializable. This can result in unexpected and\ndifficult-to-diagnose bugs.\n\n\nSince subclasses of `java.lang.Comparator` are often stateless,\nsimply marking them serializable is a small cost to avoid such issues.\n\n**Example:**\n\n\n class Foo implements Comparator { // warning\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Comparator, Serializable { // no warning here\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }\n" + "text": "Reports classes with only 'private' constructors. A class that only has 'private' constructors cannot be extended outside a file and should be declared as 'final'.", + "markdown": "Reports classes with only `private` constructors.\n\nA class that only has `private` constructors cannot be extended outside a file and should be declared as `final`." }, "defaultConfiguration": { "enabled": false, @@ -2857,8 +2857,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 18, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -2870,13 +2870,13 @@ ] }, { - "id": "ClassWithOnlyPrivateConstructors", + "id": "ComparatorNotSerializable", "shortDescription": { - "text": "Class with only 'private' constructors should be declared 'final'" + "text": "'Comparator' class not declared 'Serializable'" }, "fullDescription": { - "text": "Reports classes with only 'private' constructors. A class that only has 'private' constructors cannot be extended outside a file and should be declared as 'final'.", - "markdown": "Reports classes with only `private` constructors.\n\nA class that only has `private` constructors cannot be extended outside a file and should be declared as `final`." + "text": "Reports classes that implement 'java.lang.Comparator', but do not implement 'java.io.Serializable'. If a non-serializable comparator is used to construct an ordered collection such as a 'java.util.TreeMap' or 'java.util.TreeSet', then the collection will also be non-serializable. This can result in unexpected and difficult-to-diagnose bugs. Since subclasses of 'java.lang.Comparator' are often stateless, simply marking them serializable is a small cost to avoid such issues. Example: 'class Foo implements Comparator { // warning\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }' After the quick-fix is applied: 'class Foo implements Comparator, Serializable { // no warning here\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }'", + "markdown": "Reports classes that implement `java.lang.Comparator`, but do not implement `java.io.Serializable`.\n\n\nIf a non-serializable comparator is used to construct an ordered collection such\nas a `java.util.TreeMap` or `java.util.TreeSet`, then the\ncollection will also be non-serializable. This can result in unexpected and\ndifficult-to-diagnose bugs.\n\n\nSince subclasses of `java.lang.Comparator` are often stateless,\nsimply marking them serializable is a small cost to avoid such issues.\n\n**Example:**\n\n\n class Foo implements Comparator { // warning\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Comparator, Serializable { // no warning here\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -2889,8 +2889,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 12, + "id": "Java/Serialization issues", + "index": 18, "toolComponent": { "name": "QDJVMC" } @@ -3318,16 +3318,16 @@ ] }, { - "id": "SuspiciousGetterSetter", + "id": "MismatchedStringCase", "shortDescription": { - "text": "Suspicious getter/setter" + "text": "Mismatched case in 'String' operation" }, "fullDescription": { - "text": "Reports getter or setter methods that access a field that is not expected by its name. For example, when 'getY()' returns the 'x' field. Usually, it might be a copy-paste error. Example: 'class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }' Use the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter.", - "markdown": "Reports getter or setter methods that access a field that is not expected by its name. For example, when `getY()` returns the `x` field. Usually, it might be a copy-paste error.\n\n**Example:**\n\n class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }\n\n\nUse the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter." + "text": "Reports 'String' method calls that always return the same value ('-1' or 'false') because a lowercase character is searched in an uppercase-only string or vice versa. Reported methods include 'equals', 'startsWith', 'endsWith', 'contains', 'indexOf', and 'lastIndexOf'. Example: if (columnName.toLowerCase().equals(\"ID\")) {...}\n New in 2019.3", + "markdown": "Reports `String` method calls that always return the same value (`-1` or `false`) because a lowercase character is searched in an uppercase-only string or vice versa.\n\nReported methods include `equals`, `startsWith`, `endsWith`, `contains`,\n`indexOf`, and `lastIndexOf`.\n\n**Example:**\n\n```\n if (columnName.toLowerCase().equals(\"ID\")) {...}\n```\n\nNew in 2019.3" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -3337,8 +3337,8 @@ "relationships": [ { "target": { - "id": "Java/JavaBeans issues", - "index": 35, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -3350,16 +3350,16 @@ ] }, { - "id": "MismatchedStringCase", + "id": "SuspiciousGetterSetter", "shortDescription": { - "text": "Mismatched case in 'String' operation" + "text": "Suspicious getter/setter" }, "fullDescription": { - "text": "Reports 'String' method calls that always return the same value ('-1' or 'false') because a lowercase character is searched in an uppercase-only string or vice versa. Reported methods include 'equals', 'startsWith', 'endsWith', 'contains', 'indexOf', and 'lastIndexOf'. Example: if (columnName.toLowerCase().equals(\"ID\")) {...}\n New in 2019.3", - "markdown": "Reports `String` method calls that always return the same value (`-1` or `false`) because a lowercase character is searched in an uppercase-only string or vice versa.\n\nReported methods include `equals`, `startsWith`, `endsWith`, `contains`,\n`indexOf`, and `lastIndexOf`.\n\n**Example:**\n\n```\n if (columnName.toLowerCase().equals(\"ID\")) {...}\n```\n\nNew in 2019.3" + "text": "Reports getter or setter methods that access a field that is not expected by its name. For example, when 'getY()' returns the 'x' field. Usually, it might be a copy-paste error. Example: 'class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }' Use the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter.", + "markdown": "Reports getter or setter methods that access a field that is not expected by its name. For example, when `getY()` returns the `x` field. Usually, it might be a copy-paste error.\n\n**Example:**\n\n class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }\n\n\nUse the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -3369,8 +3369,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/JavaBeans issues", + "index": 35, "toolComponent": { "name": "QDJVMC" } @@ -3382,20 +3382,20 @@ ] }, { - "id": "DoubleNegation", + "id": "AssertionCanBeIf", "shortDescription": { - "text": "Double negation" + "text": "Assertion can be replaced with 'if' statement" }, "fullDescription": { - "text": "Reports double negations that can be simplified. Example: 'if (!!functionCall()) {}' After the quick-fix is applied: 'if (functionCall()) {}' Example: 'if (!(a != b)) {}' After the quick-fix is applied: 'if (a == b) {}'", - "markdown": "Reports double negations that can be simplified.\n\nExample:\n\n\n if (!!functionCall()) {}\n\nAfter the quick-fix is applied:\n\n\n if (functionCall()) {}\n\nExample:\n\n\n if (!(a != b)) {}\n\nAfter the quick-fix is applied:\n\n\n if (a == b) {}\n" + "text": "Reports 'assert' statements and suggests replacing them with 'if' statements that throw 'java.lang.AssertionError'. Example: 'assert param != null;' After the quick-fix is applied: 'if (param == null) throw new AssertionError();'", + "markdown": "Reports `assert` statements and suggests replacing them with `if` statements that throw `java.lang.AssertionError`.\n\nExample:\n\n\n assert param != null;\n\nAfter the quick-fix is applied:\n\n\n if (param == null) throw new AssertionError();\n" }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ @@ -3414,20 +3414,20 @@ ] }, { - "id": "AssertionCanBeIf", + "id": "DoubleNegation", "shortDescription": { - "text": "Assertion can be replaced with 'if' statement" + "text": "Double negation" }, "fullDescription": { - "text": "Reports 'assert' statements and suggests replacing them with 'if' statements that throw 'java.lang.AssertionError'. Example: 'assert param != null;' After the quick-fix is applied: 'if (param == null) throw new AssertionError();'", - "markdown": "Reports `assert` statements and suggests replacing them with `if` statements that throw `java.lang.AssertionError`.\n\nExample:\n\n\n assert param != null;\n\nAfter the quick-fix is applied:\n\n\n if (param == null) throw new AssertionError();\n" + "text": "Reports double negations that can be simplified. Example: 'if (!!functionCall()) {}' After the quick-fix is applied: 'if (functionCall()) {}' Example: 'if (!(a != b)) {}' After the quick-fix is applied: 'if (a == b) {}'", + "markdown": "Reports double negations that can be simplified.\n\nExample:\n\n\n if (!!functionCall()) {}\n\nAfter the quick-fix is applied:\n\n\n if (functionCall()) {}\n\nExample:\n\n\n if (!(a != b)) {}\n\nAfter the quick-fix is applied:\n\n\n if (a == b) {}\n" }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ @@ -3542,13 +3542,13 @@ ] }, { - "id": "SingleClassImport", + "id": "WaitCalledOnCondition", "shortDescription": { - "text": "Single class import" + "text": "'wait()' called on 'java.util.concurrent.locks.Condition' object" }, "fullDescription": { - "text": "Reports 'import' statements that import single classes (as opposed to entire packages). 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 and clear the Use single class import checkbox. Thus this inspection is mostly useful for offline reporting on code bases that you don't intend to change.", - "markdown": "Reports `import` statements that import single classes (as opposed to entire packages).\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** command. Go to\n[Settings \\| Editor \\| Code Style \\| Java \\| Imports](settings://preferences.sourceCode.Java?Use%20single%20class%20import)\nand clear the **Use single class import** checkbox. Thus this inspection is mostly useful for\noffline reporting on code bases that you don't intend to change." + "text": "Reports calls to 'wait()' made on a 'java.util.concurrent.locks.Condition' object. This is probably a programming error, and some variant of the 'await()' method was intended instead. Example: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }' Good code would look like this: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }'", + "markdown": "Reports calls to `wait()` made on a `java.util.concurrent.locks.Condition` object. This is probably a programming error, and some variant of the `await()` method was intended instead.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }\n\nGood code would look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -3561,8 +3561,8 @@ "relationships": [ { "target": { - "id": "Java/Imports", - "index": 22, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -3574,13 +3574,13 @@ ] }, { - "id": "WaitCalledOnCondition", + "id": "NonSynchronizedMethodOverridesSynchronizedMethod", "shortDescription": { - "text": "'wait()' called on 'java.util.concurrent.locks.Condition' object" + "text": "Unsynchronized method overrides 'synchronized' method" }, "fullDescription": { - "text": "Reports calls to 'wait()' made on a 'java.util.concurrent.locks.Condition' object. This is probably a programming error, and some variant of the 'await()' method was intended instead. Example: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }' Good code would look like this: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }'", - "markdown": "Reports calls to `wait()` made on a `java.util.concurrent.locks.Condition` object. This is probably a programming error, and some variant of the `await()` method was intended instead.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }\n\nGood code would look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n" + "text": "Reports non-'synchronized' methods overriding 'synchronized' methods. The overridden method will not be automatically synchronized if the superclass method is declared as 'synchronized'. This may result in unexpected race conditions when using the subclass. Example: 'class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n }'", + "markdown": "Reports non-`synchronized` methods overriding `synchronized` methods.\n\n\nThe overridden method will not be automatically synchronized if the superclass method\nis declared as `synchronized`. This may result in unexpected race conditions when using the subclass.\n\n**Example:**\n\n\n class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n } \n" }, "defaultConfiguration": { "enabled": false, @@ -3606,13 +3606,13 @@ ] }, { - "id": "NonSynchronizedMethodOverridesSynchronizedMethod", + "id": "SingleClassImport", "shortDescription": { - "text": "Unsynchronized method overrides 'synchronized' method" + "text": "Single class import" }, "fullDescription": { - "text": "Reports non-'synchronized' methods overriding 'synchronized' methods. The overridden method will not be automatically synchronized if the superclass method is declared as 'synchronized'. This may result in unexpected race conditions when using the subclass. Example: 'class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n }'", - "markdown": "Reports non-`synchronized` methods overriding `synchronized` methods.\n\n\nThe overridden method will not be automatically synchronized if the superclass method\nis declared as `synchronized`. This may result in unexpected race conditions when using the subclass.\n\n**Example:**\n\n\n class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n } \n" + "text": "Reports 'import' statements that import single classes (as opposed to entire packages). 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 and clear the Use single class import checkbox. Thus this inspection is mostly useful for offline reporting on code bases that you don't intend to change.", + "markdown": "Reports `import` statements that import single classes (as opposed to entire packages).\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** command. Go to\n[Settings \\| Editor \\| Code Style \\| Java \\| Imports](settings://preferences.sourceCode.Java?Use%20single%20class%20import)\nand clear the **Use single class import** checkbox. Thus this inspection is mostly useful for\noffline reporting on code bases that you don't intend to change." }, "defaultConfiguration": { "enabled": false, @@ -3625,8 +3625,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Imports", + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -4118,27 +4118,27 @@ ] }, { - "id": "UnnecessaryBreak", + "id": "InsertLiteralUnderscores", "shortDescription": { - "text": "Unnecessary 'break' statement" + "text": "Unreadable numeric literal" }, "fullDescription": { - "text": "Reports any unnecessary 'break' statements. An 'break' statement is unnecessary if no other statements are executed after it has been removed. Example: 'switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }'", - "markdown": "Reports any unnecessary `break` statements.\n\nAn `break` statement is unnecessary if no other statements are executed after it has been removed.\n\n**Example:**\n\n\n switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }\n" + "text": "Reports long numeric literals without underscores and suggests adding them. Underscores make such literals easier to read. Example: '1000000' After the quick-fix is applied: '1_000_000' This inspection only reports if the language level of the project of module is 7 or higher. New in 2020.2", + "markdown": "Reports long numeric literals without underscores and suggests adding them. Underscores make such literals easier to read.\n\nExample:\n\n\n 1000000\n\nAfter the quick-fix is applied:\n\n\n 1_000_000\n\nThis inspection only reports if the language level of the project of module is 7 or higher.\n\nNew in 2020.2" }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -4150,27 +4150,27 @@ ] }, { - "id": "InsertLiteralUnderscores", + "id": "UnnecessaryBreak", "shortDescription": { - "text": "Unreadable numeric literal" + "text": "Unnecessary 'break' statement" }, "fullDescription": { - "text": "Reports long numeric literals without underscores and suggests adding them. Underscores make such literals easier to read. Example: '1000000' After the quick-fix is applied: '1_000_000' This inspection only reports if the language level of the project of module is 7 or higher. New in 2020.2", - "markdown": "Reports long numeric literals without underscores and suggests adding them. Underscores make such literals easier to read.\n\nExample:\n\n\n 1000000\n\nAfter the quick-fix is applied:\n\n\n 1_000_000\n\nThis inspection only reports if the language level of the project of module is 7 or higher.\n\nNew in 2020.2" + "text": "Reports any unnecessary 'break' statements. An 'break' statement is unnecessary if no other statements are executed after it has been removed. Example: 'switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }'", + "markdown": "Reports any unnecessary `break` statements.\n\nAn `break` statement is unnecessary if no other statements are executed after it has been removed.\n\n**Example:**\n\n\n switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }\n" }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 26, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -4438,13 +4438,13 @@ ] }, { - "id": "ResultOfObjectAllocationIgnored", + "id": "StaticGuardedByInstance", "shortDescription": { - "text": "Result of object allocation ignored" + "text": "Static member guarded by instance field or this" }, "fullDescription": { - "text": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way. Such allocation expressions are legal in Java, but are usually either unintended, or evidence of a very odd object initialization strategy. Use the options to list classes whose allocations should be ignored by this inspection.", - "markdown": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." + "text": "Reports '@GuardedBy' annotations on 'static' fields or methods in which the guard is either a non-static field or 'this'. Guarding a static element with a non-static element may result in excessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", + "markdown": "Reports `@GuardedBy` annotations on `static` fields or methods in which the guard is either a non-static field or `this`.\n\nGuarding a static element with a non-static element may result in\nexcessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" }, "defaultConfiguration": { "enabled": false, @@ -4457,8 +4457,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Concurrency annotation issues", + "index": 58, "toolComponent": { "name": "QDJVMC" } @@ -4470,16 +4470,16 @@ ] }, { - "id": "StaticGuardedByInstance", + "id": "ExternalizableWithoutPublicNoArgConstructor", "shortDescription": { - "text": "Static member guarded by instance field or this" + "text": "'Externalizable' class without 'public' no-arg constructor" }, "fullDescription": { - "text": "Reports '@GuardedBy' annotations on 'static' fields or methods in which the guard is either a non-static field or 'this'. Guarding a static element with a non-static element may result in excessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", - "markdown": "Reports `@GuardedBy` annotations on `static` fields or methods in which the guard is either a non-static field or `this`.\n\nGuarding a static element with a non-static element may result in\nexcessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" + "text": "Reports 'Externalizable' classes without a public no-argument constructor. When an 'Externalizable' object is reconstructed, an instance is created using the public no-arg constructor before the 'readExternal' method called. If a public no-arg constructor is not available, a 'java.io.InvalidClassException' will be thrown at runtime.", + "markdown": "Reports `Externalizable` classes without a public no-argument constructor.\n\nWhen an `Externalizable` object is reconstructed, an instance is created using the public\nno-arg constructor before the `readExternal` method called. If a public\nno-arg constructor is not available, a `java.io.InvalidClassException` will be\nthrown at runtime." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -4489,8 +4489,8 @@ "relationships": [ { "target": { - "id": "Java/Concurrency annotation issues", - "index": 58, + "id": "Java/Serialization issues", + "index": 18, "toolComponent": { "name": "QDJVMC" } @@ -4534,16 +4534,16 @@ ] }, { - "id": "ExternalizableWithoutPublicNoArgConstructor", + "id": "ResultOfObjectAllocationIgnored", "shortDescription": { - "text": "'Externalizable' class without 'public' no-arg constructor" + "text": "Result of object allocation ignored" }, "fullDescription": { - "text": "Reports 'Externalizable' classes without a public no-argument constructor. When an 'Externalizable' object is reconstructed, an instance is created using the public no-arg constructor before the 'readExternal' method called. If a public no-arg constructor is not available, a 'java.io.InvalidClassException' will be thrown at runtime.", - "markdown": "Reports `Externalizable` classes without a public no-argument constructor.\n\nWhen an `Externalizable` object is reconstructed, an instance is created using the public\nno-arg constructor before the `readExternal` method called. If a public\nno-arg constructor is not available, a `java.io.InvalidClassException` will be\nthrown at runtime." + "text": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way. Such allocation expressions are legal in Java, but are usually either unintended, or evidence of a very odd object initialization strategy. Use the options to list classes whose allocations should be ignored by this inspection.", + "markdown": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -4553,8 +4553,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 18, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -6069,38 +6069,6 @@ } ] }, - { - "id": "UnnecessaryContinue", - "shortDescription": { - "text": "Unnecessary 'continue' statement" - }, - "fullDescription": { - "text": "Reports 'continue' statements if they are the last reachable statements in the loop. These 'continue' statements are unnecessary and can be safely removed. Example: 'for (String element: elements) {\n System.out.println();\n continue;\n }' After the quick-fix is applied: 'for (String element: elements) {\n System.out.println();\n }' The inspection doesn't analyze JSP files. Use the Ignore in then branch of 'if' statement with 'else' branch option to ignore 'continue' statements when they are placed in a 'then' branch of a complete 'if'-'else' statement. Example: 'for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }'", - "markdown": "Reports `continue` statements if they are the last reachable statements in the loop. These `continue` statements are unnecessary and can be safely removed.\n\nExample:\n\n\n for (String element: elements) {\n System.out.println();\n continue;\n }\n\nAfter the quick-fix is applied:\n\n\n for (String element: elements) {\n System.out.println();\n }\n\nThe inspection doesn't analyze JSP files.\n\n\nUse the **Ignore in then branch of 'if' statement with 'else' branch** option to ignore\n`continue` statements when they are placed in a `then` branch of a complete\n`if`-`else` statement.\n\nExample:\n\n\n for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "InnerClassVariableHidesOuterClassVariable", "shortDescription": { @@ -6134,13 +6102,13 @@ ] }, { - "id": "UnnecessaryModifier", + "id": "UnnecessaryContinue", "shortDescription": { - "text": "Unnecessary modifier" + "text": "Unnecessary 'continue' statement" }, "fullDescription": { - "text": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same. Example 1: '// all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }' Example 2: 'final record R() {\n // all records are implicitly final\n }' Example 3: '// all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }'", - "markdown": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same.\n\n**Example 1:**\n\n\n // all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }\n\n**Example 2:**\n\n\n final record R() {\n // all records are implicitly final\n }\n\n**Example 3:**\n\n\n // all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }\n" + "text": "Reports 'continue' statements if they are the last reachable statements in the loop. These 'continue' statements are unnecessary and can be safely removed. Example: 'for (String element: elements) {\n System.out.println();\n continue;\n }' After the quick-fix is applied: 'for (String element: elements) {\n System.out.println();\n }' The inspection doesn't analyze JSP files. Use the Ignore in then branch of 'if' statement with 'else' branch option to ignore 'continue' statements when they are placed in a 'then' branch of a complete 'if'-'else' statement. Example: 'for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }'", + "markdown": "Reports `continue` statements if they are the last reachable statements in the loop. These `continue` statements are unnecessary and can be safely removed.\n\nExample:\n\n\n for (String element: elements) {\n System.out.println();\n continue;\n }\n\nAfter the quick-fix is applied:\n\n\n for (String element: elements) {\n System.out.println();\n }\n\nThe inspection doesn't analyze JSP files.\n\n\nUse the **Ignore in then branch of 'if' statement with 'else' branch** option to ignore\n`continue` statements when they are placed in a `then` branch of a complete\n`if`-`else` statement.\n\nExample:\n\n\n for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -6153,8 +6121,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -6197,6 +6165,38 @@ } ] }, + { + "id": "UnnecessaryModifier", + "shortDescription": { + "text": "Unnecessary modifier" + }, + "fullDescription": { + "text": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same. Example 1: '// all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }' Example 2: 'final record R() {\n // all records are implicitly final\n }' Example 3: '// all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }'", + "markdown": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same.\n\n**Example 1:**\n\n\n // all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }\n\n**Example 2:**\n\n\n final record R() {\n // all records are implicitly final\n }\n\n**Example 3:**\n\n\n // all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "ConditionalCanBePushedInsideExpression", "shortDescription": { @@ -6230,13 +6230,13 @@ ] }, { - "id": "CStyleArrayDeclaration", + "id": "CloneInNonCloneableClass", "shortDescription": { - "text": "C-style array declaration" + "text": "'clone()' method in non-Cloneable class" }, "fullDescription": { - "text": "Reports array declarations written in C-style syntax in which the array indicator brackets are placed after the variable name or after the method parameter list. Example: 'public String process(String value[])[] {\n return value;\n }' Most code styles prefer Java-style array declarations in which the array indicator brackets are attached to the type name, for example: 'public String[] process(String[] value) {\n return value;\n }' Configure the inspection: Use the Ignore C-style declarations in variables option to report C-style array declaration of method return types only.", - "markdown": "Reports array declarations written in C-style syntax in which the array indicator brackets are placed after the variable name or after the method parameter list.\n\nExample:\n\n\n public String process(String value[])[] {\n return value;\n }\n\nMost code styles prefer Java-style array declarations in which the array indicator brackets are attached to the type name, for example:\n\n\n public String[] process(String[] value) {\n return value;\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore C-style declarations in variables** option to report C-style array declaration of method return types only." + "text": "Reports classes that override the 'clone()' method but don't implement the 'Cloneable' interface. This usually represents a programming error. Use the Only warn on 'public' clone methods option to ignore methods that aren't 'public'. For classes designed to be inherited, you may choose to override 'clone()' and declare it as 'protected' without implementing the 'Cloneable' interface and decide whether to implement the 'Cloneable' interface in subclasses.", + "markdown": "Reports classes that override the `clone()` method but don't implement the `Cloneable` interface. This usually represents a programming error.\n\n\nUse the **Only warn on 'public' clone methods** option to ignore methods that aren't `public`.\n\nFor classes designed to be inherited, you may choose to override `clone()` and declare it as `protected`\nwithout implementing the `Cloneable` interface and decide whether to implement the `Cloneable` interface in subclasses." }, "defaultConfiguration": { "enabled": false, @@ -6249,8 +6249,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Cloning issues", + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -6262,13 +6262,13 @@ ] }, { - "id": "CloneInNonCloneableClass", + "id": "CStyleArrayDeclaration", "shortDescription": { - "text": "'clone()' method in non-Cloneable class" + "text": "C-style array declaration" }, "fullDescription": { - "text": "Reports classes that override the 'clone()' method but don't implement the 'Cloneable' interface. This usually represents a programming error. Use the Only warn on 'public' clone methods option to ignore methods that aren't 'public'. For classes designed to be inherited, you may choose to override 'clone()' and declare it as 'protected' without implementing the 'Cloneable' interface and decide whether to implement the 'Cloneable' interface in subclasses.", - "markdown": "Reports classes that override the `clone()` method but don't implement the `Cloneable` interface. This usually represents a programming error.\n\n\nUse the **Only warn on 'public' clone methods** option to ignore methods that aren't `public`.\n\nFor classes designed to be inherited, you may choose to override `clone()` and declare it as `protected`\nwithout implementing the `Cloneable` interface and decide whether to implement the `Cloneable` interface in subclasses." + "text": "Reports array declarations written in C-style syntax in which the array indicator brackets are placed after the variable name or after the method parameter list. Example: 'public String process(String value[])[] {\n return value;\n }' Most code styles prefer Java-style array declarations in which the array indicator brackets are attached to the type name, for example: 'public String[] process(String[] value) {\n return value;\n }' Configure the inspection: Use the Ignore C-style declarations in variables option to report C-style array declaration of method return types only.", + "markdown": "Reports array declarations written in C-style syntax in which the array indicator brackets are placed after the variable name or after the method parameter list.\n\nExample:\n\n\n public String process(String value[])[] {\n return value;\n }\n\nMost code styles prefer Java-style array declarations in which the array indicator brackets are attached to the type name, for example:\n\n\n public String[] process(String[] value) {\n return value;\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore C-style declarations in variables** option to report C-style array declaration of method return types only." }, "defaultConfiguration": { "enabled": false, @@ -6281,8 +6281,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 82, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -6582,16 +6582,16 @@ ] }, { - "id": "StringBufferField", + "id": "ClassEscapesItsScope", "shortDescription": { - "text": "'StringBuilder' field" + "text": "Non-accessible class is exposed" }, "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" + "text": "Reports usages of classes in a field or method signature when a class in a signature is less visible than the member itself. While legal Java, such members are useless outside of the visibility scope. Example: 'public' method which returns a 'private' inner 'class'. 'protected' field whose type is a package-local 'class'. In Java 9, a module may hide some of its classes by excluding their packages from export. So, if the signature of exported API contains a non-exported class, such an API is useless outside of the module. Configure the inspection: Use the Module's API exposes not exported classes (Java 9+) option to report about the module API that exposes unexported classes. Note that the option works if the language level of the project or module is 9 or higher. Use the Public API exposes non-accessible classes option to report about a public API that exposes non-accessible classes. Use the Package-local API exposes private classes option to report about package-local API that exposes 'private' classes.", + "markdown": "Reports usages of classes in a field or method signature when a class in a signature is less visible than the member itself. While legal Java, such members are useless outside of the visibility scope.\n\nExample:\n\n* `public` method which returns a `private` inner `class`.\n* `protected` field whose type is a package-local `class`.\n\n\nIn Java 9, a module may hide some of its classes by excluding their packages from export.\nSo, if the signature of exported API contains a non-exported class, such an API is useless outside of the module.\n\nConfigure the inspection:\n\n* Use the **Module's API exposes not exported classes (Java 9+)** option to report about the module API that exposes unexported classes. \n Note that the option works if the language level of the project or module is 9 or higher.\n* Use the **Public API exposes non-accessible classes** option to report about a public API that exposes non-accessible classes.\n* Use the **Package-local API exposes private classes** option to report about package-local API that exposes `private` classes." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -6601,8 +6601,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 72, + "id": "Java/Visibility", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -6614,16 +6614,16 @@ ] }, { - "id": "ClassEscapesItsScope", + "id": "StringBufferField", "shortDescription": { - "text": "Non-accessible class is exposed" + "text": "'StringBuilder' field" }, "fullDescription": { - "text": "Reports usages of classes in a field or method signature when a class in a signature is less visible than the member itself. While legal Java, such members are useless outside of the visibility scope. Example: 'public' method which returns a 'private' inner 'class'. 'protected' field whose type is a package-local 'class'. In Java 9, a module may hide some of its classes by excluding their packages from export. So, if the signature of exported API contains a non-exported class, such an API is useless outside of the module. Configure the inspection: Use the Module's API exposes not exported classes (Java 9+) option to report about the module API that exposes unexported classes. Note that the option works if the language level of the project or module is 9 or higher. Use the Public API exposes non-accessible classes option to report about a public API that exposes non-accessible classes. Use the Package-local API exposes private classes option to report about package-local API that exposes 'private' classes.", - "markdown": "Reports usages of classes in a field or method signature when a class in a signature is less visible than the member itself. While legal Java, such members are useless outside of the visibility scope.\n\nExample:\n\n* `public` method which returns a `private` inner `class`.\n* `protected` field whose type is a package-local `class`.\n\n\nIn Java 9, a module may hide some of its classes by excluding their packages from export.\nSo, if the signature of exported API contains a non-exported class, such an API is useless outside of the module.\n\nConfigure the inspection:\n\n* Use the **Module's API exposes not exported classes (Java 9+)** option to report about the module API that exposes unexported classes. \n Note that the option works if the language level of the project or module is 9 or higher.\n* Use the **Public API exposes non-accessible classes** option to report about a public API that exposes non-accessible classes.\n* Use the **Package-local API exposes private classes** option to report about package-local API that exposes `private` classes." + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -6633,8 +6633,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 54, + "id": "Java/Memory", + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -6646,13 +6646,13 @@ ] }, { - "id": "RedundantMethodOverride", + "id": "EqualsUsesNonFinalVariable", "shortDescription": { - "text": "Method is identical to its super method" + "text": "Non-final field referenced in 'equals()'" }, "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 checkbox below to run the inspection for the methods that override library methods. Checking library methods may slow down the inspection.", - "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 checkbox below to run the inspection for the methods that override library methods.\nChecking library methods may slow down the inspection." + "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, @@ -6665,8 +6665,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 25, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -6710,13 +6710,13 @@ ] }, { - "id": "EqualsUsesNonFinalVariable", + "id": "RedundantMethodOverride", "shortDescription": { - "text": "Non-final field referenced in 'equals()'" + "text": "Method is identical to its super method" }, "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" + "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 checkbox below to run the inspection for the methods that override library methods. Checking library methods may slow down the inspection.", + "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 checkbox below to run the inspection for the methods that override library methods.\nChecking library methods may slow down the inspection." }, "defaultConfiguration": { "enabled": false, @@ -6729,8 +6729,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Inheritance issues", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -6806,16 +6806,16 @@ ] }, { - "id": "SimplifiableBooleanExpression", + "id": "AutoUnboxing", "shortDescription": { - "text": "Simplifiable boolean expression" + "text": "Auto-unboxing" }, "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" + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -6825,8 +6825,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 27, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -6838,16 +6838,16 @@ ] }, { - "id": "AutoUnboxing", + "id": "SimplifiableBooleanExpression", "shortDescription": { - "text": "Auto-unboxing" + "text": "Simplifiable boolean expression" }, "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." + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -6857,8 +6857,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -7286,13 +7286,13 @@ ] }, { - "id": "MethodOverloadsParentMethod", + "id": "IncrementDecrementUsedAsExpression", "shortDescription": { - "text": "Possibly unintended overload of method from superclass" + "text": "Result of '++' or '--' used" }, "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." + "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, @@ -7305,8 +7305,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 54, + "id": "Java/Assignment issues", + "index": 36, "toolComponent": { "name": "QDJVMC" } @@ -7350,13 +7350,13 @@ ] }, { - "id": "IncrementDecrementUsedAsExpression", + "id": "MethodOverloadsParentMethod", "shortDescription": { - "text": "Result of '++' or '--' used" + "text": "Possibly unintended overload of method from superclass" }, "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" + "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, @@ -7369,8 +7369,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 36, + "id": "Java/Visibility", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -7574,27 +7574,27 @@ ] }, { - "id": "EqualsHashCodeCalledOnUrl", + "id": "NonStrictComparisonCanBeEquality", "shortDescription": { - "text": "'equals()' or 'hashCode()' called on 'URL' object" + "text": "Non-strict inequality '>=' or '<=' can be replaced with '=='" }, "fullDescription": { - "text": "Reports 'hashCode()' and 'equals()' calls on 'java.net.URL' objects. '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: 'int equalsHashCode(URL url1, URL url2) {\n return url1.hashCode() == url2.hashCode();\n }'", - "markdown": "Reports `hashCode()` and `equals()` calls on `java.net.URL` objects.\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 int equalsHashCode(URL url1, URL url2) {\n return url1.hashCode() == url2.hashCode();\n }\n" + "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 }\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```\n\nNew in 2022.2" }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -7606,27 +7606,27 @@ ] }, { - "id": "NonStrictComparisonCanBeEquality", + "id": "EqualsHashCodeCalledOnUrl", "shortDescription": { - "text": "Non-strict inequality '>=' or '<=' can be replaced with '=='" + "text": "'equals()' or 'hashCode()' called on 'URL' object" }, "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 }\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```\n\nNew in 2022.2" + "text": "Reports 'hashCode()' and 'equals()' calls on 'java.net.URL' objects. '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: 'int equalsHashCode(URL url1, URL url2) {\n return url1.hashCode() == url2.hashCode();\n }'", + "markdown": "Reports `hashCode()` and `equals()` calls on `java.net.URL` objects.\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 int equalsHashCode(URL url1, URL url2) {\n return url1.hashCode() == url2.hashCode();\n }\n" }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -8022,13 +8022,13 @@ ] }, { - "id": "JavacQuirks", + "id": "SuspiciousSystemArraycopy", "shortDescription": { - "text": "Javac quirks" + "text": "Suspicious 'System.arraycopy()' call" }, "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" + "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, @@ -8041,8 +8041,8 @@ "relationships": [ { "target": { - "id": "Java/Compiler issues", - "index": 90, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -8054,13 +8054,13 @@ ] }, { - "id": "SuspiciousSystemArraycopy", + "id": "JavacQuirks", "shortDescription": { - "text": "Suspicious 'System.arraycopy()' call" + "text": "Javac quirks" }, "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" + "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, @@ -8073,8 +8073,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Compiler issues", + "index": 90, "toolComponent": { "name": "QDJVMC" } @@ -8470,27 +8470,27 @@ ] }, { - "id": "NestedTryStatement", + "id": "LambdaCanBeMethodCall", "shortDescription": { - "text": "Nested 'try' statement" + "text": "Lambda can be replaced with method call" }, "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." + "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": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Java language level migration aids/Java 8", + "index": 61, "toolComponent": { "name": "QDJVMC" } @@ -8502,27 +8502,27 @@ ] }, { - "id": "LambdaCanBeMethodCall", + "id": "NestedTryStatement", "shortDescription": { - "text": "Lambda can be replaced with method call" + "text": "Nested 'try' statement" }, "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" + "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": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 8", - "index": 61, + "id": "Java/Error handling", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -8566,13 +8566,13 @@ ] }, { - "id": "Singleton", + "id": "NonStaticFinalLogger", "shortDescription": { - "text": "Singleton" + "text": "Non-constant logger" }, "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" + "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, @@ -8585,8 +8585,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 12, + "id": "Java/Logging", + "index": 67, "toolComponent": { "name": "QDJVMC" } @@ -8598,13 +8598,13 @@ ] }, { - "id": "NonFinalUtilityClass", + "id": "Singleton", "shortDescription": { - "text": "Utility class is not 'final'" + "text": "Singleton" }, "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" + "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, @@ -8630,13 +8630,13 @@ ] }, { - "id": "NonStaticFinalLogger", + "id": "NonFinalUtilityClass", "shortDescription": { - "text": "Non-constant logger" + "text": "Utility class is not 'final'" }, "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." + "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, @@ -8649,8 +8649,8 @@ "relationships": [ { "target": { - "id": "Java/Logging", - "index": 67, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -8918,27 +8918,27 @@ ] }, { - "id": "OnlyOneElementUsed", + "id": "MisspelledHeader", "shortDescription": { - "text": "Only one element is used" + "text": "Unknown or misspelled header name" }, "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" + "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": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, + "id": "Manifest", + "index": 93, "toolComponent": { "name": "QDJVMC" } @@ -8950,27 +8950,27 @@ ] }, { - "id": "MisspelledHeader", + "id": "OnlyOneElementUsed", "shortDescription": { - "text": "Unknown or misspelled header name" + "text": "Only one element is used" }, "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." + "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": "note", + "level": "warning", "parameters": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Manifest", - "index": 93, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -9398,16 +9398,16 @@ ] }, { - "id": "LoopConditionNotUpdatedInsideLoop", + "id": "UnnecessarilyQualifiedStaticUsage", "shortDescription": { - "text": "Loop variable not updated inside loop" + "text": "Unnecessarily qualified static access" }, "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)." + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -9417,8 +9417,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 27, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -9430,16 +9430,16 @@ ] }, { - "id": "UnnecessarilyQualifiedStaticUsage", + "id": "LoopConditionNotUpdatedInsideLoop", "shortDescription": { - "text": "Unnecessarily qualified static access" + "text": "Loop variable not updated inside loop" }, "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." + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -9449,8 +9449,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -10038,27 +10038,27 @@ ] }, { - "id": "NestingDepth", + "id": "LambdaParameterTypeCanBeSpecified", "shortDescription": { - "text": "Overly nested method" + "text": "Lambda parameter type can be specified" }, "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." + "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": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 95, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -10070,27 +10070,27 @@ ] }, { - "id": "LambdaParameterTypeCanBeSpecified", + "id": "NestingDepth", "shortDescription": { - "text": "Lambda parameter type can be specified" + "text": "Overly nested method" }, "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." + "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": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Method metrics", + "index": 95, "toolComponent": { "name": "QDJVMC" } @@ -10422,13 +10422,13 @@ ] }, { - "id": "MaskedAssertion", + "id": "StringTokenizerDelimiter", "shortDescription": { - "text": "Assertion is suppressed by 'catch'" + "text": "Duplicated delimiters in 'StringTokenizer'" }, "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" + "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, @@ -10441,8 +10441,8 @@ "relationships": [ { "target": { - "id": "Java/Test frameworks", - "index": 97, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -10454,13 +10454,13 @@ ] }, { - "id": "StringTokenizerDelimiter", + "id": "MaskedAssertion", "shortDescription": { - "text": "Duplicated delimiters in 'StringTokenizer'" + "text": "Assertion is suppressed by 'catch'" }, "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" + "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, @@ -10473,8 +10473,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Test frameworks", + "index": 97, "toolComponent": { "name": "QDJVMC" } @@ -10614,16 +10614,16 @@ ] }, { - "id": "EscapedSpace", + "id": "ThreadRun", "shortDescription": { - "text": "Non-terminal use of '\\s' escape sequence" + "text": "Call to 'Thread.run()'" }, "fullDescription": { - "text": "Reports uses of '\"\\s\"' escape sequence anywhere except text-block line endings or within series of several spaces. 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 literals, '\"\\s\"' is identical to an ordinary space character ('\" \"'). Use of '\"\\s\"' is confusing and can be a mistake, especially if the string is interpreted as a regular expression. 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. The quick-fix is provided that simply replaces '\\s' with a space character. This inspection reports only if the language level of the project or module is 15 or higher. New in 2022.3", - "markdown": "Reports uses of `\"\\s\"` escape sequence anywhere except text-block line endings or within series of several spaces. 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 literals, `\"\\s\"` is identical to an ordinary space character (`\" \"`). Use of `\"\\s\"` is confusing and can be a mistake, especially if the string is interpreted as a regular expression.\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\nThe quick-fix is provided that simply replaces `\\s` with a space character.\n\nThis inspection reports only if the language level of the project or module is 15 or higher.\n\nNew in 2022.3" + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -10633,8 +10633,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "JVM languages", + "index": 2, "toolComponent": { "name": "QDJVMC" } @@ -10646,16 +10646,16 @@ ] }, { - "id": "ThreadRun", + "id": "EscapedSpace", "shortDescription": { - "text": "Call to 'Thread.run()'" + "text": "Non-terminal use of '\\s' escape sequence" }, "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." + "text": "Reports uses of '\"\\s\"' escape sequence anywhere except text-block line endings or within series of several spaces. 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 literals, '\"\\s\"' is identical to an ordinary space character ('\" \"'). Use of '\"\\s\"' is confusing and can be a mistake, especially if the string is interpreted as a regular expression. 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. The quick-fix is provided that simply replaces '\\s' with a space character. This inspection reports only if the language level of the project or module is 15 or higher. New in 2022.3", + "markdown": "Reports uses of `\"\\s\"` escape sequence anywhere except text-block line endings or within series of several spaces. 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 literals, `\"\\s\"` is identical to an ordinary space character (`\" \"`). Use of `\"\\s\"` is confusing and can be a mistake, especially if the string is interpreted as a regular expression.\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\nThe quick-fix is provided that simply replaces `\\s` with a space character.\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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -10665,8 +10665,8 @@ "relationships": [ { "target": { - "id": "JVM languages", - "index": 2, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -10998,13 +10998,13 @@ ] }, { - "id": "CloneCallsConstructors", + "id": "UnnecessaryModuleDependencyInspection", "shortDescription": { - "text": "'clone()' instantiates objects with constructor" + "text": "Unnecessary module dependency" }, "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." + "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, @@ -11017,8 +11017,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 82, + "id": "Java/Declaration redundancy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -11030,13 +11030,13 @@ ] }, { - "id": "UnnecessaryModuleDependencyInspection", + "id": "CloneCallsConstructors", "shortDescription": { - "text": "Unnecessary module dependency" + "text": "'clone()' instantiates objects with constructor" }, "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." + "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, @@ -11049,8 +11049,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "Java/Cloning issues", + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -11094,13 +11094,13 @@ ] }, { - "id": "WaitNotInLoop", + "id": "ArraysAsListWithZeroOrOneArgument", "shortDescription": { - "text": "'wait()' not called in loop" + "text": "Call to 'Arrays.asList()' with too few arguments" }, "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" + "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, @@ -11113,8 +11113,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -11126,13 +11126,13 @@ ] }, { - "id": "ArraysAsListWithZeroOrOneArgument", + "id": "WaitNotInLoop", "shortDescription": { - "text": "Call to 'Arrays.asList()' with too few arguments" + "text": "'wait()' not called in loop" }, "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" + "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, @@ -11145,8 +11145,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -11317,38 +11317,6 @@ } ] }, - { - "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": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Code style issues", - "index": 11, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "CanBeFinal", "shortDescription": { @@ -11381,6 +11349,38 @@ } ] }, + { + "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": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "SerializableRecordContainsIgnoredMembers", "shortDescription": { @@ -11926,27 +11926,27 @@ ] }, { - "id": "EmptyMethod", + "id": "Since15", "shortDescription": { - "text": "Empty method" + "text": "Usages of API which isn't available at the configured language level" }, "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." + "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": "warning", + "level": "error", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "JVM languages", + "index": 2, "toolComponent": { "name": "QDJVMC" } @@ -11958,27 +11958,27 @@ ] }, { - "id": "Since15", + "id": "EmptyMethod", "shortDescription": { - "text": "Usages of API which isn't available at the configured language level" + "text": "Empty method" }, "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." + "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": "error", + "level": "warning", "parameters": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "JVM languages", - "index": 2, + "id": "Java/Declaration redundancy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -12694,13 +12694,13 @@ ] }, { - "id": "OverridableMethodCallDuringObjectConstruction", + "id": "OverloadedMethodsWithSameNumberOfParameters", "shortDescription": { - "text": "Overridable method called during object construction" + "text": "Overloaded methods with same number of parameters" }, "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." + "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, @@ -12713,8 +12713,8 @@ "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 28, + "id": "Java/Naming conventions/Method", + "index": 88, "toolComponent": { "name": "QDJVMC" } @@ -12726,13 +12726,13 @@ ] }, { - "id": "OverloadedMethodsWithSameNumberOfParameters", + "id": "OverridableMethodCallDuringObjectConstruction", "shortDescription": { - "text": "Overloaded methods with same number of parameters" + "text": "Overridable method called during object construction" }, "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." + "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, @@ -12745,8 +12745,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions/Method", - "index": 88, + "id": "Java/Initialization", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -12758,13 +12758,13 @@ ] }, { - "id": "MissingDeprecatedAnnotation", + "id": "OverlyLongLambda", "shortDescription": { - "text": "Missing '@Deprecated' annotation" + "text": "Overly long lambda expression" }, "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." + "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, @@ -12777,8 +12777,8 @@ "relationships": [ { "target": { - "id": "Java/Javadoc", - "index": 45, + "id": "Java/Method metrics", + "index": 95, "toolComponent": { "name": "QDJVMC" } @@ -12790,13 +12790,13 @@ ] }, { - "id": "OverlyLongLambda", + "id": "ImplicitCallToSuper", "shortDescription": { - "text": "Overly long lambda expression" + "text": "Implicit call to 'super()'" }, "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." + "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, @@ -12809,8 +12809,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 95, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -12822,13 +12822,13 @@ ] }, { - "id": "ImplicitCallToSuper", + "id": "ParametersPerMethod", "shortDescription": { - "text": "Implicit call to 'super()'" + "text": "Method with too many parameters" }, "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" + "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, @@ -12841,8 +12841,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Method metrics", + "index": 95, "toolComponent": { "name": "QDJVMC" } @@ -12854,13 +12854,13 @@ ] }, { - "id": "ParametersPerMethod", + "id": "MissingDeprecatedAnnotation", "shortDescription": { - "text": "Method with too many parameters" + "text": "Missing '@Deprecated' annotation" }, "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." + "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, @@ -12873,8 +12873,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 95, + "id": "Java/Javadoc", + "index": 45, "toolComponent": { "name": "QDJVMC" } @@ -13462,13 +13462,13 @@ ] }, { - "id": "ClassWithTooManyTransitiveDependencies", + "id": "InstanceVariableUninitializedUse", "shortDescription": { - "text": "Class with too many transitive dependencies" + "text": "Instance field used before initialization" }, "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." + "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, @@ -13481,8 +13481,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 89, + "id": "Java/Initialization", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -13494,13 +13494,13 @@ ] }, { - "id": "InstanceVariableUninitializedUse", + "id": "UnnecessaryThis", "shortDescription": { - "text": "Instance field used before initialization" + "text": "Unnecessary 'this' qualifier" }, "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." + "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, @@ -13513,8 +13513,8 @@ "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 28, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -13526,13 +13526,13 @@ ] }, { - "id": "UnnecessaryThis", + "id": "ClassWithTooManyTransitiveDependencies", "shortDescription": { - "text": "Unnecessary 'this' qualifier" + "text": "Class with too many transitive dependencies" }, "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." + "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, @@ -13545,8 +13545,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Dependency issues", + "index": 89, "toolComponent": { "name": "QDJVMC" } @@ -13558,13 +13558,13 @@ ] }, { - "id": "ExplicitArrayFilling", + "id": "LoopWithImplicitTerminationCondition", "shortDescription": { - "text": "Explicit array filling" + "text": "Loop with implicit termination condition" }, "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; // 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 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": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Inheritance issues", - "index": 25, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "UtilityClassWithPublicConstructor", "shortDescription": { @@ -14261,6 +14229,38 @@ } ] }, + { + "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 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 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": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "TrivialIf", "shortDescription": { @@ -14390,16 +14390,16 @@ ] }, { - "id": "AutoCloseableResource", + "id": "MethodOverridesInaccessibleMethodOfSuper", "shortDescription": { - "text": "AutoCloseable used without 'try'-with-resources" + "text": "Method overrides inaccessible method of superclass" }, "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." + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -14409,8 +14409,8 @@ "relationships": [ { "target": { - "id": "Java/Resource management", - "index": 46, + "id": "Java/Visibility", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -14422,16 +14422,16 @@ ] }, { - "id": "MethodOverridesInaccessibleMethodOfSuper", + "id": "AutoCloseableResource", "shortDescription": { - "text": "Method overrides inaccessible method of superclass" + "text": "AutoCloseable used without 'try'-with-resources" }, "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" + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -14441,8 +14441,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 54, + "id": "Java/Resource management", + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -14774,27 +14774,27 @@ ] }, { - "id": "ListenerMayUseAdapter", + "id": "ReassignedVariable", "shortDescription": { - "text": "Class may extend adapter instead of implementing listener" + "text": "Reassigned variable" }, "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." + "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": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "TEXT ATTRIBUTES", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 12, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -14806,27 +14806,27 @@ ] }, { - "id": "ReassignedVariable", + "id": "ListenerMayUseAdapter", "shortDescription": { - "text": "Reassigned variable" + "text": "Class may extend adapter instead of implementing listener" }, "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" + "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": "note", + "level": "warning", "parameters": { - "ideaSeverity": "TEXT ATTRIBUTES", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14934,16 +14934,16 @@ ] }, { - "id": "EmptyTryBlock", + "id": "NestedSwitchStatement", "shortDescription": { - "text": "Empty 'try' block" + "text": "Nested 'switch' statement" }, "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." + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -14953,8 +14953,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -14966,16 +14966,16 @@ ] }, { - "id": "NestedSwitchStatement", + "id": "EmptyTryBlock", "shortDescription": { - "text": "Nested 'switch' statement" + "text": "Empty 'try' block" }, "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" + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -14985,8 +14985,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 27, + "id": "Java/Error handling", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -15030,16 +15030,16 @@ ] }, { - "id": "AssertWithSideEffects", + "id": "WaitOrAwaitWithoutTimeout", "shortDescription": { - "text": "'assert' statement with side effects" + "text": "'wait()' or 'await()' without timeout" }, "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" + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -15049,8 +15049,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -15062,16 +15062,16 @@ ] }, { - "id": "WaitOrAwaitWithoutTimeout", + "id": "AssertWithSideEffects", "shortDescription": { - "text": "'wait()' or 'await()' without timeout" + "text": "'assert' statement with side effects" }, "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" + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -15081,8 +15081,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -15158,16 +15158,16 @@ ] }, { - "id": "LiteralAsArgToStringEquals", + "id": "UnnecessaryEmptyArrayUsage", "shortDescription": { - "text": "String literal may be 'equals()' qualifier" + "text": "Unnecessary zero length array usage" }, "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" + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -15177,8 +15177,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Memory", + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -15190,16 +15190,16 @@ ] }, { - "id": "UnnecessaryEmptyArrayUsage", + "id": "LiteralAsArgToStringEquals", "shortDescription": { - "text": "Unnecessary zero length array usage" + "text": "String literal may be 'equals()' qualifier" }, "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" + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -15209,8 +15209,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 72, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -15446,13 +15446,13 @@ ] }, { - "id": "IfStatementMissingBreakInLoop", + "id": "ThrowableSupplierOnlyThrowException", "shortDescription": { - "text": "Early loop exit in 'if' condition" + "text": "Throwable supplier never returns a value" }, "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" + "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, @@ -15465,8 +15465,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Error handling", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -15478,13 +15478,13 @@ ] }, { - "id": "ThrowableSupplierOnlyThrowException", + "id": "IfStatementMissingBreakInLoop", "shortDescription": { - "text": "Throwable supplier never returns a value" + "text": "Early loop exit in 'if' condition" }, "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" + "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, @@ -15497,8 +15497,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -15894,27 +15894,27 @@ ] }, { - "id": "RedundantCompareToJavaTime", + "id": "UnclearBinaryExpression", "shortDescription": { - "text": "Expression with 'java.time' 'compareTo()' call can be simplified" + "text": "Multiple operators with different precedence" }, "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" + "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": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -15926,27 +15926,27 @@ ] }, { - "id": "UnclearBinaryExpression", + "id": "RedundantCompareToJavaTime", "shortDescription": { - "text": "Multiple operators with different precedence" + "text": "Expression with 'java.time' 'compareTo()' call can be simplified" }, "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" + "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": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -15958,27 +15958,27 @@ ] }, { - "id": "ChainedMethodCall", + "id": "VariableTypeCanBeExplicit", "shortDescription": { - "text": "Chained method calls" + "text": "Variable type can be explicit" }, "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();`." + "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": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Java language level migration aids/Java 10", + "index": 111, "toolComponent": { "name": "QDJVMC" } @@ -15990,27 +15990,27 @@ ] }, { - "id": "VariableTypeCanBeExplicit", + "id": "ChainedMethodCall", "shortDescription": { - "text": "Variable type can be explicit" + "text": "Chained method calls" }, "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." + "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": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 10", - "index": 111, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -16246,27 +16246,27 @@ ] }, { - "id": "AbstractMethodCallInConstructor", + "id": "EqualsReplaceableByObjectsCall", "shortDescription": { - "text": "Abstract method called during object construction" + "text": "'equals()' expression replaceable by 'Objects.equals()' expression" }, "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." + "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": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 28, + "id": "Java/Java language level migration aids/Java 7", + "index": 113, "toolComponent": { "name": "QDJVMC" } @@ -16278,27 +16278,27 @@ ] }, { - "id": "EqualsReplaceableByObjectsCall", + "id": "AbstractMethodCallInConstructor", "shortDescription": { - "text": "'equals()' expression replaceable by 'Objects.equals()' expression" + "text": "Abstract method called during object construction" }, "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." + "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": "note", + "level": "warning", "parameters": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 7", - "index": 113, + "id": "Java/Initialization", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -16694,13 +16694,13 @@ ] }, { - "id": "JDBCPrepareStatementWithNonConstantString", + "id": "BooleanParameter", "shortDescription": { - "text": "Call to 'Connection.prepare*()' with non-constant string" + "text": "'public' method with 'boolean' parameter" }, "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" + "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, @@ -16713,8 +16713,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 30, + "id": "Java/Abstraction issues", + "index": 77, "toolComponent": { "name": "QDJVMC" } @@ -16726,13 +16726,13 @@ ] }, { - "id": "BooleanParameter", + "id": "JDBCPrepareStatementWithNonConstantString", "shortDescription": { - "text": "'public' method with 'boolean' parameter" + "text": "Call to 'Connection.prepare*()' with non-constant string" }, "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." + "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, @@ -16745,8 +16745,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 77, + "id": "Java/Security", + "index": 30, "toolComponent": { "name": "QDJVMC" } @@ -17366,16 +17366,16 @@ ] }, { - "id": "UseOfAWTPeerClass", + "id": "EqualsBetweenInconvertibleTypes", "shortDescription": { - "text": "Use of AWT peer class" + "text": "'equals()' between objects of inconvertible types" }, "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" + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -17385,8 +17385,8 @@ "relationships": [ { "target": { - "id": "Java/Portability", - "index": 7, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -17398,16 +17398,16 @@ ] }, { - "id": "EqualsBetweenInconvertibleTypes", + "id": "UseOfAWTPeerClass", "shortDescription": { - "text": "'equals()' between objects of inconvertible types" + "text": "Use of AWT peer class" }, "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" + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -17417,8 +17417,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Portability", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -17814,27 +17814,27 @@ ] }, { - "id": "TimeToString", + "id": "ObjectEquality", "shortDescription": { - "text": "Call to 'Time.toString()'" + "text": "Object comparison using '==', instead of 'equals()'" }, "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." + "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": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Internationalization", - "index": 9, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -17846,27 +17846,27 @@ ] }, { - "id": "ObjectEquality", + "id": "TimeToString", "shortDescription": { - "text": "Object comparison using '==', instead of 'equals()'" + "text": "Call to 'Time.toString()'" }, "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." + "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": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Internationalization", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -18070,16 +18070,16 @@ ] }, { - "id": "ParameterTypePreventsOverriding", + "id": "ReplaceInefficientStreamCount", "shortDescription": { - "text": "Parameter type prevents overriding" + "text": "Inefficient Stream API call chains ending with count()" }, "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" + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -18089,8 +18089,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 25, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -18102,16 +18102,16 @@ ] }, { - "id": "ReplaceInefficientStreamCount", + "id": "ParameterTypePreventsOverriding", "shortDescription": { - "text": "Inefficient Stream API call chains ending with count()" + "text": "Parameter type prevents overriding" }, "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." + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -18121,8 +18121,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Inheritance issues", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -19222,13 +19222,13 @@ ] }, { - "id": "ConditionalBreakInInfiniteLoop", + "id": "StringConcatenationInFormatCall", "shortDescription": { - "text": "Conditional break inside loop" + "text": "String concatenation as argument to 'format()' call" }, "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" + "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, @@ -19241,8 +19241,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 27, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -19254,13 +19254,13 @@ ] }, { - "id": "StringConcatenationInFormatCall", + "id": "ConditionalBreakInInfiniteLoop", "shortDescription": { - "text": "String concatenation as argument to 'format()' call" + "text": "Conditional break inside loop" }, "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`." + "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, @@ -19273,8 +19273,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -19318,16 +19318,16 @@ ] }, { - "id": "WaitWhileHoldingTwoLocks", + "id": "RedundantClassCall", "shortDescription": { - "text": "'wait()' while holding two locks" + "text": "Redundant 'isInstance()' or 'cast()' call" }, "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" + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -19337,8 +19337,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -19350,16 +19350,16 @@ ] }, { - "id": "RedundantClassCall", + "id": "WaitWhileHoldingTwoLocks", "shortDescription": { - "text": "Redundant 'isInstance()' or 'cast()' call" + "text": "'wait()' while holding two locks" }, "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" + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -19369,8 +19369,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -19574,16 +19574,16 @@ ] }, { - "id": "WhileLoopSpinsOnField", + "id": "DefaultAnnotationParam", "shortDescription": { - "text": "'while' loop spins on field" + "text": "Default annotation parameter value" }, "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." + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -19593,8 +19593,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Declaration redundancy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -19606,16 +19606,16 @@ ] }, { - "id": "DefaultAnnotationParam", + "id": "WhileLoopSpinsOnField", "shortDescription": { - "text": "Default annotation parameter value" + "text": "'while' loop spins on field" }, "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" + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -19625,8 +19625,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -20118,16 +20118,16 @@ ] }, { - "id": "RedundantOperationOnEmptyContainer", + "id": "OptionalIsPresent", "shortDescription": { - "text": "Redundant operation on empty container" + "text": "Non functional style 'Optional.isPresent()' usage" }, "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" + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -20137,8 +20137,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -20150,16 +20150,16 @@ ] }, { - "id": "OptionalIsPresent", + "id": "RedundantOperationOnEmptyContainer", "shortDescription": { - "text": "Non functional style 'Optional.isPresent()' usage" + "text": "Redundant operation on empty container" }, "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." + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -20169,8 +20169,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -20278,16 +20278,16 @@ ] }, { - "id": "ClassNamePrefixedWithPackageName", + "id": "ConstantConditionalExpression", "shortDescription": { - "text": "Class name prefixed with package name" + "text": "Constant conditional expression" }, "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." + "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": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -20297,8 +20297,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions/Class", - "index": 70, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -20310,16 +20310,16 @@ ] }, { - "id": "ConstantConditionalExpression", + "id": "ClassNamePrefixedWithPackageName", "shortDescription": { - "text": "Constant conditional expression" + "text": "Class name prefixed with package name" }, "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" + "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": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -20329,8 +20329,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 27, + "id": "Java/Naming conventions/Class", + "index": 70, "toolComponent": { "name": "QDJVMC" } @@ -20470,27 +20470,27 @@ ] }, { - "id": "WrongPackageStatement", + "id": "ObjectsEqualsCanBeSimplified", "shortDescription": { - "text": "Wrong package statement" + "text": "'Objects.equals()' can be replaced with 'equals()'" }, "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." + "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": true, - "level": "error", + "enabled": false, + "level": "note", "parameters": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -20502,27 +20502,27 @@ ] }, { - "id": "ObjectsEqualsCanBeSimplified", + "id": "WrongPackageStatement", "shortDescription": { - "text": "'Objects.equals()' can be replaced with 'equals()'" + "text": "Wrong package statement" }, "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" + "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": false, - "level": "note", + "enabled": true, + "level": "error", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -20822,13 +20822,13 @@ ] }, { - "id": "ThrowCaughtLocally", + "id": "ClassInheritanceDepth", "shortDescription": { - "text": "'throw' caught by containing 'try' statement" + "text": "Class too deep in inheritance tree" }, "fullDescription": { - "text": "Reports 'throw' statements whose exceptions are always caught by containing 'try' statements. Using 'throw' statements as a \"goto\" to change the local flow of control is confusing and results in poor performance. Example: 'try {\n if (!Files.isDirectory(PROJECTS)) {\n throw new IllegalStateException(\"Directory not found.\"); // warning: 'throw' caught by containing 'try' statement\n }\n ...\n } catch (Exception e) {\n LOG.error(\"run failed\");\n }' Use the Ignore rethrown exceptions option to ignore exceptions that are rethrown.", - "markdown": "Reports `throw` statements whose exceptions are always caught by containing `try` statements.\n\nUsing `throw`\nstatements as a \"goto\" to change the local flow of control is confusing and results in poor performance.\n\n**Example:**\n\n\n try {\n if (!Files.isDirectory(PROJECTS)) {\n throw new IllegalStateException(\"Directory not found.\"); // warning: 'throw' caught by containing 'try' statement\n }\n ...\n } catch (Exception e) {\n LOG.error(\"run failed\");\n }\n\nUse the **Ignore rethrown exceptions** option to ignore exceptions that are rethrown." + "text": "Reports classes that are too deep in the inheritance hierarchy. Classes that are too deeply inherited may be confusing and indicate that a refactoring is necessary. All superclasses from a library are treated as a single superclass, libraries are considered unmodifiable. Use the Inheritance depth limit field to specify the maximum inheritance depth for a class.", + "markdown": "Reports classes that are too deep in the inheritance hierarchy.\n\nClasses that are too deeply inherited may be confusing and indicate that a refactoring is necessary.\n\nAll superclasses from a library are treated as a single superclass, libraries are considered unmodifiable.\n\nUse the **Inheritance depth limit** field to specify the maximum inheritance depth for a class." }, "defaultConfiguration": { "enabled": false, @@ -20841,8 +20841,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Class metrics", + "index": 87, "toolComponent": { "name": "QDJVMC" } @@ -20854,13 +20854,13 @@ ] }, { - "id": "ClassInheritanceDepth", + "id": "ThrowCaughtLocally", "shortDescription": { - "text": "Class too deep in inheritance tree" + "text": "'throw' caught by containing 'try' statement" }, "fullDescription": { - "text": "Reports classes that are too deep in the inheritance hierarchy. Classes that are too deeply inherited may be confusing and indicate that a refactoring is necessary. All superclasses from a library are treated as a single superclass, libraries are considered unmodifiable. Use the Inheritance depth limit field to specify the maximum inheritance depth for a class.", - "markdown": "Reports classes that are too deep in the inheritance hierarchy.\n\nClasses that are too deeply inherited may be confusing and indicate that a refactoring is necessary.\n\nAll superclasses from a library are treated as a single superclass, libraries are considered unmodifiable.\n\nUse the **Inheritance depth limit** field to specify the maximum inheritance depth for a class." + "text": "Reports 'throw' statements whose exceptions are always caught by containing 'try' statements. Using 'throw' statements as a \"goto\" to change the local flow of control is confusing and results in poor performance. Example: 'try {\n if (!Files.isDirectory(PROJECTS)) {\n throw new IllegalStateException(\"Directory not found.\"); // warning: 'throw' caught by containing 'try' statement\n }\n ...\n } catch (Exception e) {\n LOG.error(\"run failed\");\n }' Use the Ignore rethrown exceptions option to ignore exceptions that are rethrown.", + "markdown": "Reports `throw` statements whose exceptions are always caught by containing `try` statements.\n\nUsing `throw`\nstatements as a \"goto\" to change the local flow of control is confusing and results in poor performance.\n\n**Example:**\n\n\n try {\n if (!Files.isDirectory(PROJECTS)) {\n throw new IllegalStateException(\"Directory not found.\"); // warning: 'throw' caught by containing 'try' statement\n }\n ...\n } catch (Exception e) {\n LOG.error(\"run failed\");\n }\n\nUse the **Ignore rethrown exceptions** option to ignore exceptions that are rethrown." }, "defaultConfiguration": { "enabled": false, @@ -20873,8 +20873,8 @@ "relationships": [ { "target": { - "id": "Java/Class metrics", - "index": 87, + "id": "Java/Error handling", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -20918,16 +20918,16 @@ ] }, { - "id": "NonSerializableWithSerialVersionUIDField", + "id": "SynchronizeOnValueBasedClass", "shortDescription": { - "text": "Non-serializable class with 'serialVersionUID'" + "text": "Value-based warnings" }, "fullDescription": { - "text": "Reports non-'Serializable' classes that define a 'serialVersionUID' field. A 'serialVersionUID' field in that context normally indicates an error because the field will be ignored and the class will not be serialized. Example: 'public class IWantToSerializeThis {\n private static final long serialVersionUID = 2669293150219020249L;\n }'", - "markdown": "Reports non-`Serializable` classes that define a `serialVersionUID` field. A `serialVersionUID` field in that context normally indicates an error because the field will be ignored and the class will not be serialized.\n\n**Example:**\n\n\n public class IWantToSerializeThis {\n private static final long serialVersionUID = 2669293150219020249L;\n }\n" + "text": "Reports attempts to synchronize on an instance of a value-based class that produce compile-time warnings and raise run-time exceptions starting from Java 16. For example, 'java.lang.Double' is annotated with 'jdk.internal.ValueBased', so the following code will produce a compile-time warning: 'Double d = 20.0;\nsynchronized (d) { ... } // javac warning' New in 2021.1", + "markdown": "Reports attempts to synchronize on an instance of a value-based class that produce compile-time warnings and raise run-time exceptions starting from Java 16.\n\n\nFor example, `java.lang.Double` is annotated with `jdk.internal.ValueBased`, so the following code will\nproduce a compile-time warning:\n\n\n Double d = 20.0;\n synchronized (d) { ... } // javac warning\n\nNew in 2021.1" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -20937,8 +20937,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 18, + "id": "Java/Compiler issues", + "index": 90, "toolComponent": { "name": "QDJVMC" } @@ -20950,16 +20950,16 @@ ] }, { - "id": "SynchronizeOnValueBasedClass", + "id": "NonSerializableWithSerialVersionUIDField", "shortDescription": { - "text": "Value-based warnings" + "text": "Non-serializable class with 'serialVersionUID'" }, "fullDescription": { - "text": "Reports attempts to synchronize on an instance of a value-based class that produce compile-time warnings and raise run-time exceptions starting from Java 16. For example, 'java.lang.Double' is annotated with 'jdk.internal.ValueBased', so the following code will produce a compile-time warning: 'Double d = 20.0;\nsynchronized (d) { ... } // javac warning' New in 2021.1", - "markdown": "Reports attempts to synchronize on an instance of a value-based class that produce compile-time warnings and raise run-time exceptions starting from Java 16.\n\n\nFor example, `java.lang.Double` is annotated with `jdk.internal.ValueBased`, so the following code will\nproduce a compile-time warning:\n\n\n Double d = 20.0;\n synchronized (d) { ... } // javac warning\n\nNew in 2021.1" + "text": "Reports non-'Serializable' classes that define a 'serialVersionUID' field. A 'serialVersionUID' field in that context normally indicates an error because the field will be ignored and the class will not be serialized. Example: 'public class IWantToSerializeThis {\n private static final long serialVersionUID = 2669293150219020249L;\n }'", + "markdown": "Reports non-`Serializable` classes that define a `serialVersionUID` field. A `serialVersionUID` field in that context normally indicates an error because the field will be ignored and the class will not be serialized.\n\n**Example:**\n\n\n public class IWantToSerializeThis {\n private static final long serialVersionUID = 2669293150219020249L;\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -20969,8 +20969,8 @@ "relationships": [ { "target": { - "id": "Java/Compiler issues", - "index": 90, + "id": "Java/Serialization issues", + "index": 18, "toolComponent": { "name": "QDJVMC" } @@ -21014,13 +21014,13 @@ ] }, { - "id": "BulkFileAttributesRead", + "id": "ImplicitNumericConversion", "shortDescription": { - "text": "Bulk 'Files.readAttributes()' call can be used" + "text": "Implicit numeric conversion" }, "fullDescription": { - "text": "Reports multiple sequential 'java.io.File' attribute checks, such as: 'isDirectory()' 'isFile()' 'lastModified()' 'length()' Such calls can be replaced with a bulk 'Files.readAttributes()' call. This is usually more performant then multiple separate attribute checks. Example: 'boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }' After the quick-fix is applied: 'boolean isNewFile(File file, long lastModified) throws IOException {\n BasicFileAttributes fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }' This inspection does not show a warning if 'IOException' is not handled in the current context, but the quick-fix is still available. Note that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if the file does not exist at all. This inspection only reports if the language level of the project or module is 7 or higher. New in 2022.1", - "markdown": "Reports multiple sequential `java.io.File` attribute checks, such as:\n\n* `isDirectory()`\n* `isFile()`\n* `lastModified()`\n* `length()`\n\nSuch calls can be replaced with a bulk `Files.readAttributes()` call. This is usually more performant then multiple separate attribute checks.\n\nExample:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n BasicFileAttributes fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }\n\nThis inspection does not show a warning if `IOException` is not handled in the current context, but the quick-fix is still available.\n\nNote that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if\nthe file does not exist at all.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nNew in 2022.1" + "text": "Reports implicit conversion between numeric types. Implicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs. Example: 'double m(int i) {\n return i * 10;\n }' After the quick-fix is applied: 'double m(int i) {\n return (double) (i * 10);\n }' Configure the inspection: Use the Ignore widening conversions option to ignore implicit conversion that cannot result in data loss (for example, 'int'->'long'). Use the Ignore conversions from and to 'char' option to ignore conversion from and to 'char'. The inspection will still report conversion from and to floating-point numbers. Use the Ignore conversion from constants and literals to make the inspection ignore conversion from literals and compile-time constants.", + "markdown": "Reports implicit conversion between numeric types.\n\nImplicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs.\n\n**Example:**\n\n\n double m(int i) {\n return i * 10;\n }\n\nAfter the quick-fix is applied:\n\n\n double m(int i) {\n return (double) (i * 10);\n }\n\nConfigure the inspection:\n\n* Use the **Ignore widening conversions** option to ignore implicit conversion that cannot result in data loss (for example, `int`-\\>`long`).\n* Use the **Ignore conversions from and to 'char'** option to ignore conversion from and to `char`. The inspection will still report conversion from and to floating-point numbers.\n* Use the **Ignore conversion from constants and literals** to make the inspection ignore conversion from literals and compile-time constants." }, "defaultConfiguration": { "enabled": false, @@ -21033,8 +21033,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -21046,13 +21046,13 @@ ] }, { - "id": "ImplicitNumericConversion", + "id": "BulkFileAttributesRead", "shortDescription": { - "text": "Implicit numeric conversion" + "text": "Bulk 'Files.readAttributes()' call can be used" }, "fullDescription": { - "text": "Reports implicit conversion between numeric types. Implicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs. Example: 'double m(int i) {\n return i * 10;\n }' After the quick-fix is applied: 'double m(int i) {\n return (double) (i * 10);\n }' Configure the inspection: Use the Ignore widening conversions option to ignore implicit conversion that cannot result in data loss (for example, 'int'->'long'). Use the Ignore conversions from and to 'char' option to ignore conversion from and to 'char'. The inspection will still report conversion from and to floating-point numbers. Use the Ignore conversion from constants and literals to make the inspection ignore conversion from literals and compile-time constants.", - "markdown": "Reports implicit conversion between numeric types.\n\nImplicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs.\n\n**Example:**\n\n\n double m(int i) {\n return i * 10;\n }\n\nAfter the quick-fix is applied:\n\n\n double m(int i) {\n return (double) (i * 10);\n }\n\nConfigure the inspection:\n\n* Use the **Ignore widening conversions** option to ignore implicit conversion that cannot result in data loss (for example, `int`-\\>`long`).\n* Use the **Ignore conversions from and to 'char'** option to ignore conversion from and to `char`. The inspection will still report conversion from and to floating-point numbers.\n* Use the **Ignore conversion from constants and literals** to make the inspection ignore conversion from literals and compile-time constants." + "text": "Reports multiple sequential 'java.io.File' attribute checks, such as: 'isDirectory()' 'isFile()' 'lastModified()' 'length()' Such calls can be replaced with a bulk 'Files.readAttributes()' call. This is usually more performant then multiple separate attribute checks. Example: 'boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }' After the quick-fix is applied: 'boolean isNewFile(File file, long lastModified) throws IOException {\n BasicFileAttributes fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }' This inspection does not show a warning if 'IOException' is not handled in the current context, but the quick-fix is still available. Note that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if the file does not exist at all. This inspection only reports if the language level of the project or module is 7 or higher. New in 2022.1", + "markdown": "Reports multiple sequential `java.io.File` attribute checks, such as:\n\n* `isDirectory()`\n* `isFile()`\n* `lastModified()`\n* `length()`\n\nSuch calls can be replaced with a bulk `Files.readAttributes()` call. This is usually more performant then multiple separate attribute checks.\n\nExample:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n BasicFileAttributes fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }\n\nThis inspection does not show a warning if `IOException` is not handled in the current context, but the quick-fix is still available.\n\nNote that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if\nthe file does not exist at all.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nNew in 2022.1" }, "defaultConfiguration": { "enabled": false, @@ -21065,8 +21065,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 26, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -21334,13 +21334,13 @@ ] }, { - "id": "OverlyStrongTypeCast", + "id": "EqualsCalledOnEnumConstant", "shortDescription": { - "text": "Overly strong type cast" + "text": "'equals()' called on enum value" }, "fullDescription": { - "text": "Reports type casts that are overly strong. For instance, casting an object to 'ArrayList' when casting it to 'List' would do just as well. Note: much like the Redundant type cast inspection, applying the fix for this inspection may change the semantics of your program if you are intentionally using an overly strong cast to cause a 'ClassCastException' to be generated. Example: 'interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }' Use the checkbox below to ignore casts when there's a matching 'instanceof' check in the code.", - "markdown": "Reports type casts that are overly strong. For instance, casting an object to `ArrayList` when casting it to `List` would do just as well.\n\n\n**Note:** much like the *Redundant type cast*\ninspection, applying the fix for this inspection may change the semantics of your program if you are\nintentionally using an overly strong cast to cause a `ClassCastException` to be generated.\n\nExample:\n\n\n interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }\n\n\nUse the checkbox below to ignore casts when there's a matching `instanceof` check in the code." + "text": "Reports 'equals()' calls on enum constants. Such calls can be replaced by an identity comparison ('==') because two enum constants are equal only when they have the same identity. A quick-fix is available to change the call to a comparison. Example: 'boolean foo(MyEnum value) {\n return value.equals(MyEnum.FOO);\n }' After the quick-fix is applied: 'boolean foo(MyEnum value) {\n return value == MyEnum.FOO;\n }'", + "markdown": "Reports `equals()` calls on enum constants.\n\nSuch calls can be replaced by an identity comparison (`==`) because two\nenum constants are equal only when they have the same identity.\n\nA quick-fix is available to change the call to a comparison.\n\n**Example:**\n\n\n boolean foo(MyEnum value) {\n return value.equals(MyEnum.FOO);\n }\n\nAfter the quick-fix is applied:\n\n\n boolean foo(MyEnum value) {\n return value == MyEnum.FOO;\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -21353,8 +21353,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 77, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -21366,13 +21366,13 @@ ] }, { - "id": "EqualsCalledOnEnumConstant", + "id": "OverlyStrongTypeCast", "shortDescription": { - "text": "'equals()' called on enum value" + "text": "Overly strong type cast" }, "fullDescription": { - "text": "Reports 'equals()' calls on enum constants. Such calls can be replaced by an identity comparison ('==') because two enum constants are equal only when they have the same identity. A quick-fix is available to change the call to a comparison. Example: 'boolean foo(MyEnum value) {\n return value.equals(MyEnum.FOO);\n }' After the quick-fix is applied: 'boolean foo(MyEnum value) {\n return value == MyEnum.FOO;\n }'", - "markdown": "Reports `equals()` calls on enum constants.\n\nSuch calls can be replaced by an identity comparison (`==`) because two\nenum constants are equal only when they have the same identity.\n\nA quick-fix is available to change the call to a comparison.\n\n**Example:**\n\n\n boolean foo(MyEnum value) {\n return value.equals(MyEnum.FOO);\n }\n\nAfter the quick-fix is applied:\n\n\n boolean foo(MyEnum value) {\n return value == MyEnum.FOO;\n }\n" + "text": "Reports type casts that are overly strong. For instance, casting an object to 'ArrayList' when casting it to 'List' would do just as well. Note: much like the Redundant type cast inspection, applying the fix for this inspection may change the semantics of your program if you are intentionally using an overly strong cast to cause a 'ClassCastException' to be generated. Example: 'interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }' Use the checkbox below to ignore casts when there's a matching 'instanceof' check in the code.", + "markdown": "Reports type casts that are overly strong. For instance, casting an object to `ArrayList` when casting it to `List` would do just as well.\n\n\n**Note:** much like the *Redundant type cast*\ninspection, applying the fix for this inspection may change the semantics of your program if you are\nintentionally using an overly strong cast to cause a `ClassCastException` to be generated.\n\nExample:\n\n\n interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }\n\n\nUse the checkbox below to ignore casts when there's a matching `instanceof` check in the code." }, "defaultConfiguration": { "enabled": false, @@ -21385,8 +21385,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Abstraction issues", + "index": 77, "toolComponent": { "name": "QDJVMC" } @@ -21494,13 +21494,13 @@ ] }, { - "id": "UnnecessaryConstantArrayCreationExpression", + "id": "HardcodedLineSeparators", "shortDescription": { - "text": "Redundant 'new' expression in constant array creation" + "text": "Hardcoded line separator" }, "fullDescription": { - "text": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment. Example: 'int[] foo = new int[] {42};' After the quick-fix is applied: 'int[] foo = {42};'", - "markdown": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment.\n\n**Example:**\n\n\n int[] foo = new int[] {42};\n\nAfter the quick-fix is applied:\n\n\n int[] foo = {42};\n" + "text": "Reports linefeed ('\\n') and carriage return ('\\r') character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded. Example: 'String count = \"first\\nsecond\\rthird\";'", + "markdown": "Reports linefeed (`\\n`) and carriage return (`\\r`) character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded.\n\n**Example:**\n\n\n String count = \"first\\nsecond\\rthird\";\n" }, "defaultConfiguration": { "enabled": false, @@ -21513,8 +21513,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Portability", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -21526,13 +21526,13 @@ ] }, { - "id": "HardcodedLineSeparators", + "id": "UnnecessaryConstantArrayCreationExpression", "shortDescription": { - "text": "Hardcoded line separator" + "text": "Redundant 'new' expression in constant array creation" }, "fullDescription": { - "text": "Reports linefeed ('\\n') and carriage return ('\\r') character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded. Example: 'String count = \"first\\nsecond\\rthird\";'", - "markdown": "Reports linefeed (`\\n`) and carriage return (`\\r`) character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded.\n\n**Example:**\n\n\n String count = \"first\\nsecond\\rthird\";\n" + "text": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment. Example: 'int[] foo = new int[] {42};' After the quick-fix is applied: 'int[] foo = {42};'", + "markdown": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment.\n\n**Example:**\n\n\n int[] foo = new int[] {42};\n\nAfter the quick-fix is applied:\n\n\n int[] foo = {42};\n" }, "defaultConfiguration": { "enabled": false, @@ -21545,8 +21545,8 @@ "relationships": [ { "target": { - "id": "Java/Portability", - "index": 7, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -21846,13 +21846,13 @@ ] }, { - "id": "InterfaceMethodClashesWithObject", + "id": "SimplifiableAssertion", "shortDescription": { - "text": "Interface method clashes with method in 'Object'" + "text": "Simplifiable assertion" }, "fullDescription": { - "text": "Reports interface methods that clash with the protected methods 'clone()' and 'finalize()' from the 'java.lang.Object' class. In an interface, it is possible to declare these methods with a return type that is incompatible with the 'java.lang.Object' methods. A class that implements such an interface will not be compilable. When the interface is functional, it remains possible to create a lambda from it, but this is not recommended. Example: '// Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }'", - "markdown": "Reports interface methods that clash with the **protected** methods `clone()` and `finalize()` from the `java.lang.Object` class.\n\nIn an interface, it is possible to declare these methods with a return type that is incompatible with the `java.lang.Object` methods.\nA class that implements such an interface will not be compilable.\nWhen the interface is functional, it remains possible to create a lambda from it, but this is not recommended.\n\nExample:\n\n\n // Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }\n" + "text": "Reports any 'assert' calls that can be replaced with simpler and equivalent calls. Example → Replacement 'assertEquals(true, x());' 'assertTrue(x());' 'assertTrue(y() != null);' 'assertNotNull(y());' 'assertTrue(z == z());' 'assertSame(z, z());' 'assertTrue(a.equals(a()));' 'assertEquals(a, a());' 'assertTrue(false);' 'fail();'", + "markdown": "Reports any `assert` calls that can be replaced with simpler and equivalent calls.\n\n| Example | → | Replacement |\n|----------------------------------|---|-------------------------|\n| `assertEquals(`**true**`, x());` | | `assertTrue(x());` |\n| `assertTrue(y() != null);` | | `assertNotNull(y());` |\n| `assertTrue(z == z());` | | `assertSame(z, z());` |\n| `assertTrue(a.equals(a()));` | | `assertEquals(a, a());` |\n| `assertTrue(`**false**`);` | | `fail();` |" }, "defaultConfiguration": { "enabled": true, @@ -21865,8 +21865,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 77, + "id": "Java/Test frameworks", + "index": 97, "toolComponent": { "name": "QDJVMC" } @@ -21878,16 +21878,16 @@ ] }, { - "id": "LoadLibraryWithNonConstantString", + "id": "InterfaceMethodClashesWithObject", "shortDescription": { - "text": "Call to 'System.loadLibrary()' with non-constant string" + "text": "Interface method clashes with method in 'Object'" }, "fullDescription": { - "text": "Reports calls to 'java.lang.System.loadLibrary()', 'java.lang.System.load()', 'java.lang.Runtime.loadLibrary()' and 'java.lang.Runtime.load()' which take a dynamically-constructed string as the name of the library. Constructed library name strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }' Use the inspection settings to consider any 'static final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'private static final String LIBRARY = getUserInput();'", - "markdown": "Reports calls to `java.lang.System.loadLibrary()`, `java.lang.System.load()`, `java.lang.Runtime.loadLibrary()` and `java.lang.Runtime.load()` which take a dynamically-constructed string as the name of the library.\n\n\nConstructed library name strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }\n\n\nUse the inspection settings to consider any `static final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n private static final String LIBRARY = getUserInput();\n" + "text": "Reports interface methods that clash with the protected methods 'clone()' and 'finalize()' from the 'java.lang.Object' class. In an interface, it is possible to declare these methods with a return type that is incompatible with the 'java.lang.Object' methods. A class that implements such an interface will not be compilable. When the interface is functional, it remains possible to create a lambda from it, but this is not recommended. Example: '// Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }'", + "markdown": "Reports interface methods that clash with the **protected** methods `clone()` and `finalize()` from the `java.lang.Object` class.\n\nIn an interface, it is possible to declare these methods with a return type that is incompatible with the `java.lang.Object` methods.\nA class that implements such an interface will not be compilable.\nWhen the interface is functional, it remains possible to create a lambda from it, but this is not recommended.\n\nExample:\n\n\n // Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -21897,8 +21897,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 30, + "id": "Java/Abstraction issues", + "index": 77, "toolComponent": { "name": "QDJVMC" } @@ -21910,16 +21910,16 @@ ] }, { - "id": "SimplifiableAssertion", + "id": "LoadLibraryWithNonConstantString", "shortDescription": { - "text": "Simplifiable assertion" + "text": "Call to 'System.loadLibrary()' with non-constant string" }, "fullDescription": { - "text": "Reports any 'assert' calls that can be replaced with simpler and equivalent calls. Example → Replacement 'assertEquals(true, x());' 'assertTrue(x());' 'assertTrue(y() != null);' 'assertNotNull(y());' 'assertTrue(z == z());' 'assertSame(z, z());' 'assertTrue(a.equals(a()));' 'assertEquals(a, a());' 'assertTrue(false);' 'fail();'", - "markdown": "Reports any `assert` calls that can be replaced with simpler and equivalent calls.\n\n| Example | → | Replacement |\n|----------------------------------|---|-------------------------|\n| `assertEquals(`**true**`, x());` | | `assertTrue(x());` |\n| `assertTrue(y() != null);` | | `assertNotNull(y());` |\n| `assertTrue(z == z());` | | `assertSame(z, z());` |\n| `assertTrue(a.equals(a()));` | | `assertEquals(a, a());` |\n| `assertTrue(`**false**`);` | | `fail();` |" + "text": "Reports calls to 'java.lang.System.loadLibrary()', 'java.lang.System.load()', 'java.lang.Runtime.loadLibrary()' and 'java.lang.Runtime.load()' which take a dynamically-constructed string as the name of the library. Constructed library name strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }' Use the inspection settings to consider any 'static final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'private static final String LIBRARY = getUserInput();'", + "markdown": "Reports calls to `java.lang.System.loadLibrary()`, `java.lang.System.load()`, `java.lang.Runtime.loadLibrary()` and `java.lang.Runtime.load()` which take a dynamically-constructed string as the name of the library.\n\n\nConstructed library name strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }\n\n\nUse the inspection settings to consider any `static final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n private static final String LIBRARY = getUserInput();\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -21929,8 +21929,8 @@ "relationships": [ { "target": { - "id": "Java/Test frameworks", - "index": 97, + "id": "Java/Security", + "index": 30, "toolComponent": { "name": "QDJVMC" } @@ -22198,16 +22198,16 @@ ] }, { - "id": "ComparatorMethodParameterNotUsed", + "id": "UseOfSunClasses", "shortDescription": { - "text": "Suspicious 'Comparator.compare()' implementation" + "text": "Use of 'sun.*' classes" }, "fullDescription": { - "text": "Reports problems in 'Comparator.compare()' and 'Comparable.compareTo()' implementations. The following cases are reported: A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly. It's evident that the method does not return '0' for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data. The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order. The comparison method returns 'Integer.MIN_VALUE'. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of 'Integer.MIN_VALUE' is 'Integer.MIN_VALUE'. Example: 'Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;'", - "markdown": "Reports problems in `Comparator.compare()` and `Comparable.compareTo()` implementations.\n\nThe following cases are reported:\n\n* A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly.\n* It's evident that the method does not return `0` for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data.\n* The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order.\n* The comparison method returns `Integer.MIN_VALUE`. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of `Integer.MIN_VALUE` is `Integer.MIN_VALUE`.\n\n**Example:**\n\n\n Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;\n" + "text": "Reports uses of classes from the 'sun.*' hierarchy. Such classes are non-portable between different JVMs.", + "markdown": "Reports uses of classes from the `sun.*` hierarchy. Such classes are non-portable between different JVMs." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -22217,8 +22217,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Portability", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -22230,16 +22230,16 @@ ] }, { - "id": "UseOfSunClasses", + "id": "ComparatorMethodParameterNotUsed", "shortDescription": { - "text": "Use of 'sun.*' classes" + "text": "Suspicious 'Comparator.compare()' implementation" }, "fullDescription": { - "text": "Reports uses of classes from the 'sun.*' hierarchy. Such classes are non-portable between different JVMs.", - "markdown": "Reports uses of classes from the `sun.*` hierarchy. Such classes are non-portable between different JVMs." + "text": "Reports problems in 'Comparator.compare()' and 'Comparable.compareTo()' implementations. The following cases are reported: A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly. It's evident that the method does not return '0' for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data. The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order. The comparison method returns 'Integer.MIN_VALUE'. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of 'Integer.MIN_VALUE' is 'Integer.MIN_VALUE'. Example: 'Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;'", + "markdown": "Reports problems in `Comparator.compare()` and `Comparable.compareTo()` implementations.\n\nThe following cases are reported:\n\n* A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly.\n* It's evident that the method does not return `0` for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data.\n* The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order.\n* The comparison method returns `Integer.MIN_VALUE`. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of `Integer.MIN_VALUE` is `Integer.MIN_VALUE`.\n\n**Example:**\n\n\n Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -22249,8 +22249,8 @@ "relationships": [ { "target": { - "id": "Java/Portability", - "index": 7, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -22326,13 +22326,13 @@ ] }, { - "id": "Annotation", + "id": "SimplifyCollector", "shortDescription": { - "text": "Annotation" + "text": "Simplifiable collector" }, "fullDescription": { - "text": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM.", - "markdown": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM." + "text": "Reports collectors that can be simplified. In particular, some cascaded 'groupingBy()' collectors can be expressed by using a simpler 'toMap()' collector, which is also likely to be more performant. Example: 'Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));' After the quick-fix is applied: 'Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));' This inspection only reports if the language level of the project or module is 8 or higher. New in 2017.1", + "markdown": "Reports collectors that can be simplified.\n\nIn particular, some cascaded `groupingBy()` collectors can be expressed by using a\nsimpler `toMap()` collector, which is also likely to be more performant.\n\nExample:\n\n\n Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));\n\nAfter the quick-fix is applied:\n\n\n Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nNew in 2017.1" }, "defaultConfiguration": { "enabled": false, @@ -22345,8 +22345,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level issues", - "index": 63, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -22358,13 +22358,13 @@ ] }, { - "id": "SimplifyCollector", + "id": "Annotation", "shortDescription": { - "text": "Simplifiable collector" + "text": "Annotation" }, "fullDescription": { - "text": "Reports collectors that can be simplified. In particular, some cascaded 'groupingBy()' collectors can be expressed by using a simpler 'toMap()' collector, which is also likely to be more performant. Example: 'Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));' After the quick-fix is applied: 'Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));' This inspection only reports if the language level of the project or module is 8 or higher. New in 2017.1", - "markdown": "Reports collectors that can be simplified.\n\nIn particular, some cascaded `groupingBy()` collectors can be expressed by using a\nsimpler `toMap()` collector, which is also likely to be more performant.\n\nExample:\n\n\n Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));\n\nAfter the quick-fix is applied:\n\n\n Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nNew in 2017.1" + "text": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM.", + "markdown": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM." }, "defaultConfiguration": { "enabled": false, @@ -22377,8 +22377,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, + "id": "Java/Java language level issues", + "index": 63, "toolComponent": { "name": "QDJVMC" } @@ -22422,16 +22422,16 @@ ] }, { - "id": "PrimitiveArrayArgumentToVariableArgMethod", + "id": "UnnecessaryUnicodeEscape", "shortDescription": { - "text": "Confusing primitive array argument to varargs method" + "text": "Unnecessary unicode escape sequence" }, "fullDescription": { - "text": "Reports any calls to a variable arity method where the call has a primitive array in the variable arity parameter position (for example, 'System.out.printf(\"%s\", new int[]{1, 2, 3})'). Such a primitive-array argument may be confusing, as it will be wrapped as a single-element array, rather than each individual element being boxed, as might be expected. Example: 'String.format(\"%s\", new int[]{1, 2, 3});' After the quick-fix is applied: 'String.format(\"%s\", (Object) new int[]{1, 2, 3});'", - "markdown": "Reports any calls to a variable arity method where the call has a primitive array in the variable arity parameter position (for example, `System.out.printf(\"%s\", new int[]{1, 2, 3})`). Such a primitive-array argument may be confusing, as it will be wrapped as a single-element array, rather than each individual element being boxed, as might be expected.\n\n**Example:**\n\n\n String.format(\"%s\", new int[]{1, 2, 3});\n\nAfter the quick-fix is applied:\n\n\n String.format(\"%s\", (Object) new int[]{1, 2, 3});\n" + "text": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab). Example: 'String s = \"\\u0062\";'", + "markdown": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab).\n\n**Example:**\n\n String s = \"\\u0062\";\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -22441,8 +22441,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Internationalization", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -22454,13 +22454,13 @@ ] }, { - "id": "UnnecessaryUnicodeEscape", + "id": "StringTokenizer", "shortDescription": { - "text": "Unnecessary unicode escape sequence" + "text": "Use of 'StringTokenizer'" }, "fullDescription": { - "text": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab). Example: 'String s = \"\\u0062\";'", - "markdown": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab).\n\n**Example:**\n\n String s = \"\\u0062\";\n" + "text": "Reports usages of the 'StringTokenizer' class. Excessive use of 'StringTokenizer' is incorrect in an internationalized environment.", + "markdown": "Reports usages of the `StringTokenizer` class. Excessive use of `StringTokenizer` is incorrect in an internationalized environment." }, "defaultConfiguration": { "enabled": false, @@ -22486,16 +22486,16 @@ ] }, { - "id": "StringTokenizer", + "id": "PrimitiveArrayArgumentToVariableArgMethod", "shortDescription": { - "text": "Use of 'StringTokenizer'" + "text": "Confusing primitive array argument to varargs method" }, "fullDescription": { - "text": "Reports usages of the 'StringTokenizer' class. Excessive use of 'StringTokenizer' is incorrect in an internationalized environment.", - "markdown": "Reports usages of the `StringTokenizer` class. Excessive use of `StringTokenizer` is incorrect in an internationalized environment." + "text": "Reports any calls to a variable arity method where the call has a primitive array in the variable arity parameter position (for example, 'System.out.printf(\"%s\", new int[]{1, 2, 3})'). Such a primitive-array argument may be confusing, as it will be wrapped as a single-element array, rather than each individual element being boxed, as might be expected. Example: 'String.format(\"%s\", new int[]{1, 2, 3});' After the quick-fix is applied: 'String.format(\"%s\", (Object) new int[]{1, 2, 3});'", + "markdown": "Reports any calls to a variable arity method where the call has a primitive array in the variable arity parameter position (for example, `System.out.printf(\"%s\", new int[]{1, 2, 3})`). Such a primitive-array argument may be confusing, as it will be wrapped as a single-element array, rather than each individual element being boxed, as might be expected.\n\n**Example:**\n\n\n String.format(\"%s\", new int[]{1, 2, 3});\n\nAfter the quick-fix is applied:\n\n\n String.format(\"%s\", (Object) new int[]{1, 2, 3});\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -22505,8 +22505,8 @@ "relationships": [ { "target": { - "id": "Java/Internationalization", - "index": 9, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -22614,13 +22614,13 @@ ] }, { - "id": "BigDecimalEquals", + "id": "AccessToNonThreadSafeStaticFieldFromInstance", "shortDescription": { - "text": "'equals()' called on 'BigDecimal'" + "text": "Non-thread-safe 'static' field access" }, "fullDescription": { - "text": "Reports 'equals()' calls that compare two 'java.math.BigDecimal' numbers. This is normally a mistake, as two 'java.math.BigDecimal' numbers are only equal if they are equal in both value and scale. Example: 'if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false' After the quick-fix is applied: 'if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true'", - "markdown": "Reports `equals()` calls that compare two `java.math.BigDecimal` numbers. This is normally a mistake, as two `java.math.BigDecimal` numbers are only equal if they are equal in both value and scale.\n\n**Example:**\n\n\n if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false\n\nAfter the quick-fix is applied:\n\n\n if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true\n" + "text": "Reports access to 'static' fields that are of a non-thread-safe type. When a 'static' field is accessed from an instance method or a non-synchronized block, multiple threads can access that field. This can lead to unspecified side effects, like exceptions and incorrect results. Example: 'class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }' You can specify which types should be considered not thread-safe. Only fields with these exact types or initialized with these exact types are reported, because there may exist thread-safe subclasses of these types.", + "markdown": "Reports access to `static` fields that are of a non-thread-safe type.\n\n\nWhen a `static` field is accessed from an instance method or a non-synchronized block,\nmultiple threads can access that field.\nThis can lead to unspecified side effects, like exceptions and incorrect results.\n\n**Example:**\n\n\n class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }\n\n\nYou can specify which types should be considered not thread-safe.\nOnly fields with these exact types or initialized with these exact types are reported,\nbecause there may exist thread-safe subclasses of these types." }, "defaultConfiguration": { "enabled": false, @@ -22633,8 +22633,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 26, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -22646,13 +22646,13 @@ ] }, { - "id": "AccessToNonThreadSafeStaticFieldFromInstance", + "id": "BigDecimalEquals", "shortDescription": { - "text": "Non-thread-safe 'static' field access" + "text": "'equals()' called on 'BigDecimal'" }, "fullDescription": { - "text": "Reports access to 'static' fields that are of a non-thread-safe type. When a 'static' field is accessed from an instance method or a non-synchronized block, multiple threads can access that field. This can lead to unspecified side effects, like exceptions and incorrect results. Example: 'class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }' You can specify which types should be considered not thread-safe. Only fields with these exact types or initialized with these exact types are reported, because there may exist thread-safe subclasses of these types.", - "markdown": "Reports access to `static` fields that are of a non-thread-safe type.\n\n\nWhen a `static` field is accessed from an instance method or a non-synchronized block,\nmultiple threads can access that field.\nThis can lead to unspecified side effects, like exceptions and incorrect results.\n\n**Example:**\n\n\n class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }\n\n\nYou can specify which types should be considered not thread-safe.\nOnly fields with these exact types or initialized with these exact types are reported,\nbecause there may exist thread-safe subclasses of these types." + "text": "Reports 'equals()' calls that compare two 'java.math.BigDecimal' numbers. This is normally a mistake, as two 'java.math.BigDecimal' numbers are only equal if they are equal in both value and scale. Example: 'if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false' After the quick-fix is applied: 'if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true'", + "markdown": "Reports `equals()` calls that compare two `java.math.BigDecimal` numbers. This is normally a mistake, as two `java.math.BigDecimal` numbers are only equal if they are equal in both value and scale.\n\n**Example:**\n\n\n if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false\n\nAfter the quick-fix is applied:\n\n\n if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true\n" }, "defaultConfiguration": { "enabled": false, @@ -22665,8 +22665,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -23606,13 +23606,13 @@ ] }, { - "id": "SuppressionAnnotation", + "id": "UnnecessaryToStringCall", "shortDescription": { - "text": "Inspection suppression annotation" + "text": "Unnecessary call to 'toString()'" }, "fullDescription": { - "text": "Reports comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }'", - "markdown": "Reports comments or annotations suppressing inspections.\n\nThis inspection can be useful when leaving suppressions intentionally for further review.\n\n**Example:**\n\n\n @SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }\n" + "text": "Reports calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null.", + "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods, and the explicit call to `toString()` is not needed.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null." }, "defaultConfiguration": { "enabled": false, @@ -23625,8 +23625,8 @@ "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 49, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -23638,13 +23638,13 @@ ] }, { - "id": "UnnecessaryToStringCall", + "id": "SuppressionAnnotation", "shortDescription": { - "text": "Unnecessary call to 'toString()'" + "text": "Inspection suppression annotation" }, "fullDescription": { - "text": "Reports calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null.", - "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods, and the explicit call to `toString()` is not needed.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null." + "text": "Reports comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }'", + "markdown": "Reports comments or annotations suppressing inspections.\n\nThis inspection can be useful when leaving suppressions intentionally for further review.\n\n**Example:**\n\n\n @SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -23657,8 +23657,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Code maturity", + "index": 49, "toolComponent": { "name": "QDJVMC" } @@ -23734,27 +23734,27 @@ ] }, { - "id": "ReturnSeparatedFromComputation", + "id": "CastThatLosesPrecision", "shortDescription": { - "text": "'return' separated from the result computation" + "text": "Numeric cast that loses precision" }, "fullDescription": { - "text": "Reports 'return' statements that return a local variable where the value of the variable is computed somewhere else within the same method. The quick-fix inlines the returned variable by moving the return statement to the location in which the value of the variable is computed. When the returned value can't be inlined into the 'return' statement, the quick-fix attempts to move the return statement as close to the computation of the returned value as possible. Example: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;' After the quick-fix is applied: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;'", - "markdown": "Reports `return` statements that return a local variable where the value of the variable is computed somewhere else within the same method.\n\nThe quick-fix inlines the returned variable by moving the return statement to the location in which the value\nof the variable is computed.\nWhen the returned value can't be inlined into the `return` statement,\nthe quick-fix attempts to move the return statement as close to the computation of the returned value as possible.\n\nExample:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;\n\nAfter the quick-fix is applied:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;\n" + "text": "Reports cast operations between primitive numeric types that may result in precision loss. Such casts are not necessarily a problem but may result in difficult to trace bugs if the loss of precision is unexpected. Example: 'int a = 420;\n byte b = (byte) a;' Use the Ignore casts from int to char option to ignore casts from 'int' to 'char'. This type of cast is often used when implementing I/O operations because the 'read()' method of the 'java.io.Reader' class returns an 'int'. Use the Ignore casts from int 128-255 to byte option to ignore casts of constant values (128-255) from 'int' to 'byte'. Such values will overflow to negative numbers that still fit inside a byte.", + "markdown": "Reports cast operations between primitive numeric types that may result in precision loss.\n\nSuch casts are not necessarily a problem but may result in difficult to\ntrace bugs if the loss of precision is unexpected.\n\n**Example:**\n\n\n int a = 420;\n byte b = (byte) a;\n\nUse the **Ignore casts from int to char** option to ignore casts from `int` to `char`.\nThis type of cast is often used when implementing I/O operations because the `read()` method of the\n`java.io.Reader` class returns an `int`.\n\nUse the **Ignore casts from int 128-255 to byte** option to ignore casts of constant values (128-255) from `int` to\n`byte`.\nSuch values will overflow to negative numbers that still fit inside a byte." }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Numeric issues/Cast", + "index": 103, "toolComponent": { "name": "QDJVMC" } @@ -23766,27 +23766,27 @@ ] }, { - "id": "SynchronizeOnNonFinalField", + "id": "ReturnSeparatedFromComputation", "shortDescription": { - "text": "Synchronization on a non-final field" + "text": "'return' separated from the result computation" }, "fullDescription": { - "text": "Reports 'synchronized' statement lock expressions that consist of a non-'final' field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object. Example: 'private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }'", - "markdown": "Reports `synchronized` statement lock expressions that consist of a non-`final` field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object.\n\n**Example:**\n\n\n private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }\n" + "text": "Reports 'return' statements that return a local variable where the value of the variable is computed somewhere else within the same method. The quick-fix inlines the returned variable by moving the return statement to the location in which the value of the variable is computed. When the returned value can't be inlined into the 'return' statement, the quick-fix attempts to move the return statement as close to the computation of the returned value as possible. Example: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;' After the quick-fix is applied: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;'", + "markdown": "Reports `return` statements that return a local variable where the value of the variable is computed somewhere else within the same method.\n\nThe quick-fix inlines the returned variable by moving the return statement to the location in which the value\nof the variable is computed.\nWhen the returned value can't be inlined into the `return` statement,\nthe quick-fix attempts to move the return statement as close to the computation of the returned value as possible.\n\nExample:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;\n\nAfter the quick-fix is applied:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;\n" }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -23798,16 +23798,16 @@ ] }, { - "id": "CastThatLosesPrecision", + "id": "SynchronizeOnNonFinalField", "shortDescription": { - "text": "Numeric cast that loses precision" + "text": "Synchronization on a non-final field" }, "fullDescription": { - "text": "Reports cast operations between primitive numeric types that may result in precision loss. Such casts are not necessarily a problem but may result in difficult to trace bugs if the loss of precision is unexpected. Example: 'int a = 420;\n byte b = (byte) a;' Use the Ignore casts from int to char option to ignore casts from 'int' to 'char'. This type of cast is often used when implementing I/O operations because the 'read()' method of the 'java.io.Reader' class returns an 'int'. Use the Ignore casts from int 128-255 to byte option to ignore casts of constant values (128-255) from 'int' to 'byte'. Such values will overflow to negative numbers that still fit inside a byte.", - "markdown": "Reports cast operations between primitive numeric types that may result in precision loss.\n\nSuch casts are not necessarily a problem but may result in difficult to\ntrace bugs if the loss of precision is unexpected.\n\n**Example:**\n\n\n int a = 420;\n byte b = (byte) a;\n\nUse the **Ignore casts from int to char** option to ignore casts from `int` to `char`.\nThis type of cast is often used when implementing I/O operations because the `read()` method of the\n`java.io.Reader` class returns an `int`.\n\nUse the **Ignore casts from int 128-255 to byte** option to ignore casts of constant values (128-255) from `int` to\n`byte`.\nSuch values will overflow to negative numbers that still fit inside a byte." + "text": "Reports 'synchronized' statement lock expressions that consist of a non-'final' field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object. Example: 'private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }'", + "markdown": "Reports `synchronized` statement lock expressions that consist of a non-`final` field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object.\n\n**Example:**\n\n\n private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -23817,8 +23817,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues/Cast", - "index": 103, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -24022,13 +24022,13 @@ ] }, { - "id": "Java8MapApi", + "id": "TestOnlyProblems", "shortDescription": { - "text": "Simplifiable 'Map' operations" + "text": "Test-only usage in production code" }, "fullDescription": { - "text": "Reports common usage patterns of 'java.util.Map' and suggests replacing them with: 'getOrDefault()', 'computeIfAbsent()', 'putIfAbsent()', 'merge()', or 'replaceAll()'. Example: 'map.containsKey(key) ? map.get(key) : \"default\";' After the quick-fix is applied: 'map.getOrDefault(key, \"default\");' Example: 'List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }' After the quick-fix is applied: 'map.computeIfAbsent(key, localKey -> new ArrayList<>());' Example: 'Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);' After the quick-fix is applied: 'map.merge(key, 1, (localKey, localValue) -> localValue + 1);' Example: 'for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }' After the quick-fix is applied: 'map.replaceAll((localKey, localValue) -> transform(localValue));' Note that the replacement with 'computeIfAbsent()' or 'merge()' might work incorrectly for some 'Map' implementations if the code extracted to the lambda expression modifies the same 'Map'. By default, the warning doesn't appear if this code might have side effects. If necessary, enable the Suggest replacement even if lambda may have side effects option to always show the warning. Also, due to different handling of the 'null' value in old methods like 'put()' and newer methods like 'computeIfAbsent()' or 'merge()', semantics might change if storing the 'null' value into given 'Map' is important. The inspection won't suggest the replacement when the value is statically known to be nullable, but for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning and adding an explanatory comment. This inspection reports only if the language level of the project or module is 8 or higher.", - "markdown": "Reports common usage patterns of `java.util.Map` and suggests replacing them with: `getOrDefault()`, `computeIfAbsent()`, `putIfAbsent()`, `merge()`, or `replaceAll()`.\n\nExample:\n\n\n map.containsKey(key) ? map.get(key) : \"default\";\n\nAfter the quick-fix is applied:\n\n\n map.getOrDefault(key, \"default\");\n\nExample:\n\n\n List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }\n\nAfter the quick-fix is applied:\n\n\n map.computeIfAbsent(key, localKey -> new ArrayList<>());\n\nExample:\n\n\n Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);\n\nAfter the quick-fix is applied:\n\n\n map.merge(key, 1, (localKey, localValue) -> localValue + 1);\n\nExample:\n\n\n for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }\n\nAfter the quick-fix is applied:\n\n\n map.replaceAll((localKey, localValue) -> transform(localValue));\n\nNote that the replacement with `computeIfAbsent()` or `merge()` might work incorrectly for some `Map`\nimplementations if the code extracted to the lambda expression modifies the same `Map`. By default,\nthe warning doesn't appear if this code might have side effects. If necessary, enable the\n**Suggest replacement even if lambda may have side effects** option to always show the warning.\n\nAlso, due to different handling of the `null` value in old methods like `put()` and newer methods like\n`computeIfAbsent()` or `merge()`, semantics might change if storing the `null` value into given\n`Map` is important. The inspection won't suggest the replacement when the value is statically known to be nullable,\nbut for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning\nand adding an explanatory comment.\n\nThis inspection reports only if the language level of the project or module is 8 or higher." + "text": "Reports '@TestOnly'- and '@VisibleForTesting'-annotated methods and classes that are used in production code. Also reports usage of applying '@TestOnly' '@VisibleForTesting' to the same element. The problems are not reported if such method or class is referenced from: Code under the Test Sources folder A test class (JUnit/TestNG) Another '@TestOnly'-annotated method Example (in production code): '@TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }'", + "markdown": "Reports `@TestOnly`- and `@VisibleForTesting`-annotated methods and classes that are used in production code. Also reports usage of applying `@TestOnly` `@VisibleForTesting` to the same element.\n\nThe problems are not reported if such method or class is referenced from:\n\n* Code under the **Test Sources** folder\n* A test class (JUnit/TestNG)\n* Another `@TestOnly`-annotated method\n\n**Example (in production code):**\n\n\n @TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -24041,8 +24041,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 8", - "index": 61, + "id": "JVM languages/Test frameworks", + "index": 96, "toolComponent": { "name": "QDJVMC" } @@ -24054,13 +24054,13 @@ ] }, { - "id": "TestOnlyProblems", + "id": "Java8MapApi", "shortDescription": { - "text": "Test-only usage in production code" + "text": "Simplifiable 'Map' operations" }, "fullDescription": { - "text": "Reports '@TestOnly'- and '@VisibleForTesting'-annotated methods and classes that are used in production code. Also reports usage of applying '@TestOnly' '@VisibleForTesting' to the same element. The problems are not reported if such method or class is referenced from: Code under the Test Sources folder A test class (JUnit/TestNG) Another '@TestOnly'-annotated method Example (in production code): '@TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }'", - "markdown": "Reports `@TestOnly`- and `@VisibleForTesting`-annotated methods and classes that are used in production code. Also reports usage of applying `@TestOnly` `@VisibleForTesting` to the same element.\n\nThe problems are not reported if such method or class is referenced from:\n\n* Code under the **Test Sources** folder\n* A test class (JUnit/TestNG)\n* Another `@TestOnly`-annotated method\n\n**Example (in production code):**\n\n\n @TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }\n" + "text": "Reports common usage patterns of 'java.util.Map' and suggests replacing them with: 'getOrDefault()', 'computeIfAbsent()', 'putIfAbsent()', 'merge()', or 'replaceAll()'. Example: 'map.containsKey(key) ? map.get(key) : \"default\";' After the quick-fix is applied: 'map.getOrDefault(key, \"default\");' Example: 'List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }' After the quick-fix is applied: 'map.computeIfAbsent(key, localKey -> new ArrayList<>());' Example: 'Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);' After the quick-fix is applied: 'map.merge(key, 1, (localKey, localValue) -> localValue + 1);' Example: 'for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }' After the quick-fix is applied: 'map.replaceAll((localKey, localValue) -> transform(localValue));' Note that the replacement with 'computeIfAbsent()' or 'merge()' might work incorrectly for some 'Map' implementations if the code extracted to the lambda expression modifies the same 'Map'. By default, the warning doesn't appear if this code might have side effects. If necessary, enable the Suggest replacement even if lambda may have side effects option to always show the warning. Also, due to different handling of the 'null' value in old methods like 'put()' and newer methods like 'computeIfAbsent()' or 'merge()', semantics might change if storing the 'null' value into given 'Map' is important. The inspection won't suggest the replacement when the value is statically known to be nullable, but for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning and adding an explanatory comment. This inspection reports only if the language level of the project or module is 8 or higher.", + "markdown": "Reports common usage patterns of `java.util.Map` and suggests replacing them with: `getOrDefault()`, `computeIfAbsent()`, `putIfAbsent()`, `merge()`, or `replaceAll()`.\n\nExample:\n\n\n map.containsKey(key) ? map.get(key) : \"default\";\n\nAfter the quick-fix is applied:\n\n\n map.getOrDefault(key, \"default\");\n\nExample:\n\n\n List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }\n\nAfter the quick-fix is applied:\n\n\n map.computeIfAbsent(key, localKey -> new ArrayList<>());\n\nExample:\n\n\n Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);\n\nAfter the quick-fix is applied:\n\n\n map.merge(key, 1, (localKey, localValue) -> localValue + 1);\n\nExample:\n\n\n for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }\n\nAfter the quick-fix is applied:\n\n\n map.replaceAll((localKey, localValue) -> transform(localValue));\n\nNote that the replacement with `computeIfAbsent()` or `merge()` might work incorrectly for some `Map`\nimplementations if the code extracted to the lambda expression modifies the same `Map`. By default,\nthe warning doesn't appear if this code might have side effects. If necessary, enable the\n**Suggest replacement even if lambda may have side effects** option to always show the warning.\n\nAlso, due to different handling of the `null` value in old methods like `put()` and newer methods like\n`computeIfAbsent()` or `merge()`, semantics might change if storing the `null` value into given\n`Map` is important. The inspection won't suggest the replacement when the value is statically known to be nullable,\nbut for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning\nand adding an explanatory comment.\n\nThis inspection reports only if the language level of the project or module is 8 or higher." }, "defaultConfiguration": { "enabled": false, @@ -24073,8 +24073,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Test frameworks", - "index": 96, + "id": "Java/Java language level migration aids/Java 8", + "index": 61, "toolComponent": { "name": "QDJVMC" } @@ -24086,16 +24086,16 @@ ] }, { - "id": "JUnit5Converter", + "id": "MeaninglessRecordAnnotationInspection", "shortDescription": { - "text": "JUnit 4 test can be JUnit 5" + "text": "Meaningless record annotation" }, "fullDescription": { - "text": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes. Example: 'import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\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 RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }' This inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project.", - "markdown": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes.\n\n**Example:**\n\n\n import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\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 RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }\n\nThis inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project." + "text": "Reports annotations used on record components that have no effect. This can happen in two cases: The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined. The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined. Example: '@Target(ElementType.METHOD)\n@interface A { }\n \n// The annotation will not appear in bytecode at all,\n// as it should be propagated to the accessor but accessor is explicitly defined \nrecord R(@A int x) {\n public int x() { return x; }\n}' New in 2021.1", + "markdown": "Reports annotations used on record components that have no effect.\n\nThis can happen in two cases:\n\n* The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined.\n* The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined.\n\nExample:\n\n\n @Target(ElementType.METHOD)\n @interface A { }\n \n // The annotation will not appear in bytecode at all,\n // as it should be propagated to the accessor but accessor is explicitly defined \n record R(@A int x) {\n public int x() { return x; }\n }\n\nNew in 2021.1" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -24105,8 +24105,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Test frameworks", - "index": 96, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -24118,16 +24118,16 @@ ] }, { - "id": "MeaninglessRecordAnnotationInspection", + "id": "JUnit5Converter", "shortDescription": { - "text": "Meaningless record annotation" + "text": "JUnit 4 test can be JUnit 5" }, "fullDescription": { - "text": "Reports annotations used on record components that have no effect. This can happen in two cases: The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined. The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined. Example: '@Target(ElementType.METHOD)\n@interface A { }\n \n// The annotation will not appear in bytecode at all,\n// as it should be propagated to the accessor but accessor is explicitly defined \nrecord R(@A int x) {\n public int x() { return x; }\n}' New in 2021.1", - "markdown": "Reports annotations used on record components that have no effect.\n\nThis can happen in two cases:\n\n* The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined.\n* The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined.\n\nExample:\n\n\n @Target(ElementType.METHOD)\n @interface A { }\n \n // The annotation will not appear in bytecode at all,\n // as it should be propagated to the accessor but accessor is explicitly defined \n record R(@A int x) {\n public int x() { return x; }\n }\n\nNew in 2021.1" + "text": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes. Example: 'import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\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 RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }' This inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project.", + "markdown": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes.\n\n**Example:**\n\n\n import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\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 RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }\n\nThis inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -24137,8 +24137,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "JVM languages/Test frameworks", + "index": 96, "toolComponent": { "name": "QDJVMC" } @@ -24182,16 +24182,16 @@ ] }, { - "id": "AssignmentToSuperclassField", + "id": "NumericOverflow", "shortDescription": { - "text": "Constructor assigns value to field defined in superclass" + "text": "Numeric overflow" }, "fullDescription": { - "text": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor. It is considered preferable to initialize the fields of a superclass in its own constructor and delegate to that constructor in a subclass. This will also allow declaring a field 'final' if it isn't changed after the construction. Example: 'class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }' To avoid the problem, declare a superclass constructor: 'class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }'", - "markdown": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor.\n\nIt is considered preferable to initialize the fields of a superclass in its own constructor and\ndelegate to that constructor in a subclass. This will also allow declaring a field `final`\nif it isn't changed after the construction.\n\n**Example:**\n\n\n class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }\n\nTo avoid the problem, declare a superclass constructor:\n\n\n class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }\n" + "text": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction . Examples: 'float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;'", + "markdown": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction .\n\n**Examples:**\n\n\n float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -24201,8 +24201,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 36, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -24214,16 +24214,16 @@ ] }, { - "id": "NumericOverflow", + "id": "AssignmentToSuperclassField", "shortDescription": { - "text": "Numeric overflow" + "text": "Constructor assigns value to field defined in superclass" }, "fullDescription": { - "text": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction . Examples: 'float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;'", - "markdown": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction .\n\n**Examples:**\n\n\n float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;\n" + "text": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor. It is considered preferable to initialize the fields of a superclass in its own constructor and delegate to that constructor in a subclass. This will also allow declaring a field 'final' if it isn't changed after the construction. Example: 'class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }' To avoid the problem, declare a superclass constructor: 'class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }'", + "markdown": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor.\n\nIt is considered preferable to initialize the fields of a superclass in its own constructor and\ndelegate to that constructor in a subclass. This will also allow declaring a field `final`\nif it isn't changed after the construction.\n\n**Example:**\n\n\n class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }\n\nTo avoid the problem, declare a superclass constructor:\n\n\n class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -24233,8 +24233,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 26, + "id": "Java/Assignment issues", + "index": 36, "toolComponent": { "name": "QDJVMC" } @@ -24790,13 +24790,13 @@ ] }, { - "id": "IgnoreResultOfCall", + "id": "BlockingMethodInNonBlockingContext", "shortDescription": { - "text": "Result of method call ignored" + "text": "Possibly blocking call in non-blocking context" }, "fullDescription": { - "text": "Reports method calls whose result is ignored. For many methods, ignoring the result is perfectly legitimate, but for some it is almost certainly an error. Examples of methods where ignoring the result is likely an error include 'java.io.inputStream.read()', which returns the number of bytes actually read, and any method on 'java.lang.String' or 'java.math.BigInteger'. These methods do not produce side-effects and thus pointless if their result is ignored. The calls to the following methods are inspected: Simple getters (which do nothing except return a field) Methods specified in the settings of this inspection Methods annotated with 'org.jetbrains.annotations.Contract(pure=true)' Methods annotated with .*.'CheckReturnValue' Methods in a class or package annotated with 'javax.annotation.CheckReturnValue' Optionally, all non-library methods Calls to methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation are not reported. Use the inspection settings to specify the classes to check. Methods are matched by name or name pattern using Java regular expression syntax. For classes, use fully-qualified names. Each entry applies to both the class and all its inheritors.", - "markdown": "Reports method calls whose result is ignored.\n\nFor many methods, ignoring the result is perfectly\nlegitimate, but for some it is almost certainly an error. Examples of methods where ignoring\nthe result is likely an error include `java.io.inputStream.read()`,\nwhich returns the number of bytes actually read, and any method on\n`java.lang.String` or `java.math.BigInteger`. These methods do not produce side-effects and thus pointless\nif their result is ignored.\n\nThe calls to the following methods are inspected:\n\n* Simple getters (which do nothing except return a field)\n* Methods specified in the settings of this inspection\n* Methods annotated with `org.jetbrains.annotations.Contract(pure=true)`\n* Methods annotated with .\\*.`CheckReturnValue`\n* Methods in a class or package annotated with `javax.annotation.CheckReturnValue`\n* Optionally, all non-library methods\n\nCalls to methods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation are not reported.\n\n\nUse the inspection settings to specify the classes to check.\nMethods are matched by name or name pattern using Java regular expression syntax.\nFor classes, use fully-qualified names. Each entry applies to both the class and all its inheritors." + "text": "Reports thread-blocking method calls in code fragments where threads should not be blocked. Example (Project Reactor): 'Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n);' Consider running blocking code with a proper scheduler, for example 'Schedulers.boundedElastic()', or try to find an alternative non-blocking API. Example (Kotlin Coroutines): 'suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n}' Consider running blocking code with a special dispatcher, for example 'Dispatchers.IO', or try to find an alternative non-blocking API. Configure the inspection: In the Blocking Annotations list, specify annotations that mark thread-blocking methods. In the Non-Blocking Annotations list, specify annotations that mark non-blocking methods. Specified annotations can be used as External Annotations", + "markdown": "Reports thread-blocking method calls in code fragments where threads should not be blocked.\n\n**Example (Project Reactor):**\n\n\n Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n );\n\nConsider running blocking code [with a proper\nscheduler](https://projectreactor.io/docs/core/release/reference/#faq.wrap-blocking), for example `Schedulers.boundedElastic()`, or try to find an alternative non-blocking API.\n\n**Example (Kotlin Coroutines):**\n\n\n suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n }\n\nConsider running blocking code [with a special dispatcher](https://kotlinlang.org/docs/coroutine-context-and-dispatchers.html),\nfor example `Dispatchers.IO`, or try to find an alternative non-blocking API.\n\nConfigure the inspection:\n\n* In the **Blocking Annotations** list, specify annotations that mark thread-blocking methods.\n* In the **Non-Blocking Annotations** list, specify annotations that mark non-blocking methods.\n\nSpecified annotations can be used as [External Annotations](https://www.jetbrains.com/help/idea/external-annotations.html)" }, "defaultConfiguration": { "enabled": true, @@ -24809,8 +24809,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "JVM languages", + "index": 2, "toolComponent": { "name": "QDJVMC" } @@ -24822,13 +24822,13 @@ ] }, { - "id": "BlockingMethodInNonBlockingContext", + "id": "IgnoreResultOfCall", "shortDescription": { - "text": "Possibly blocking call in non-blocking context" + "text": "Result of method call ignored" }, "fullDescription": { - "text": "Reports thread-blocking method calls in code fragments where threads should not be blocked. Example (Project Reactor): 'Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n);' Consider running blocking code with a proper scheduler, for example 'Schedulers.boundedElastic()', or try to find an alternative non-blocking API. Example (Kotlin Coroutines): 'suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n}' Consider running blocking code with a special dispatcher, for example 'Dispatchers.IO', or try to find an alternative non-blocking API. Configure the inspection: In the Blocking Annotations list, specify annotations that mark thread-blocking methods. In the Non-Blocking Annotations list, specify annotations that mark non-blocking methods. Specified annotations can be used as External Annotations", - "markdown": "Reports thread-blocking method calls in code fragments where threads should not be blocked.\n\n**Example (Project Reactor):**\n\n\n Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n );\n\nConsider running blocking code [with a proper\nscheduler](https://projectreactor.io/docs/core/release/reference/#faq.wrap-blocking), for example `Schedulers.boundedElastic()`, or try to find an alternative non-blocking API.\n\n**Example (Kotlin Coroutines):**\n\n\n suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n }\n\nConsider running blocking code [with a special dispatcher](https://kotlinlang.org/docs/coroutine-context-and-dispatchers.html),\nfor example `Dispatchers.IO`, or try to find an alternative non-blocking API.\n\nConfigure the inspection:\n\n* In the **Blocking Annotations** list, specify annotations that mark thread-blocking methods.\n* In the **Non-Blocking Annotations** list, specify annotations that mark non-blocking methods.\n\nSpecified annotations can be used as [External Annotations](https://www.jetbrains.com/help/idea/external-annotations.html)" + "text": "Reports method calls whose result is ignored. For many methods, ignoring the result is perfectly legitimate, but for some it is almost certainly an error. Examples of methods where ignoring the result is likely an error include 'java.io.inputStream.read()', which returns the number of bytes actually read, and any method on 'java.lang.String' or 'java.math.BigInteger'. These methods do not produce side-effects and thus pointless if their result is ignored. The calls to the following methods are inspected: Simple getters (which do nothing except return a field) Methods specified in the settings of this inspection Methods annotated with 'org.jetbrains.annotations.Contract(pure=true)' Methods annotated with .*.'CheckReturnValue' Methods in a class or package annotated with 'javax.annotation.CheckReturnValue' Optionally, all non-library methods Calls to methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation are not reported. Use the inspection settings to specify the classes to check. Methods are matched by name or name pattern using Java regular expression syntax. For classes, use fully-qualified names. Each entry applies to both the class and all its inheritors.", + "markdown": "Reports method calls whose result is ignored.\n\nFor many methods, ignoring the result is perfectly\nlegitimate, but for some it is almost certainly an error. Examples of methods where ignoring\nthe result is likely an error include `java.io.inputStream.read()`,\nwhich returns the number of bytes actually read, and any method on\n`java.lang.String` or `java.math.BigInteger`. These methods do not produce side-effects and thus pointless\nif their result is ignored.\n\nThe calls to the following methods are inspected:\n\n* Simple getters (which do nothing except return a field)\n* Methods specified in the settings of this inspection\n* Methods annotated with `org.jetbrains.annotations.Contract(pure=true)`\n* Methods annotated with .\\*.`CheckReturnValue`\n* Methods in a class or package annotated with `javax.annotation.CheckReturnValue`\n* Optionally, all non-library methods\n\nCalls to methods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation are not reported.\n\n\nUse the inspection settings to specify the classes to check.\nMethods are matched by name or name pattern using Java regular expression syntax.\nFor classes, use fully-qualified names. Each entry applies to both the class and all its inheritors." }, "defaultConfiguration": { "enabled": true, @@ -24841,8 +24841,8 @@ "relationships": [ { "target": { - "id": "JVM languages", - "index": 2, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -25110,27 +25110,27 @@ ] }, { - "id": "ConfusingElse", + "id": "InnerClassReferencedViaSubclass", "shortDescription": { - "text": "Redundant 'else'" + "text": "Inner class referenced via subclass" }, "fullDescription": { - "text": "Reports redundant 'else' keywords in 'if'—'else' statements and statement chains. The 'else' keyword is redundant when all previous branches end with a 'return', 'throw', 'break', or 'continue' statement. In this case, the statements from the 'else' branch can be placed after the 'if' statement, and the 'else' keyword can be removed. Example: 'if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }' After the quick-fix is applied: 'if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);' Disable the Report when there are no more statements after the 'if' statement option to ignore cases where the 'if'—'else' statement is the last statement in a code block.", - "markdown": "Reports redundant `else` keywords in `if`---`else` statements and statement chains.\n\n\nThe `else` keyword is redundant when all previous branches end with a\n`return`, `throw`, `break`, or `continue` statement. In this case,\nthe statements from the `else` branch can be placed after the `if` statement, and the\n`else` keyword can be removed.\n\n**Example:**\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }\n\nAfter the quick-fix is applied:\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);\n\nDisable the **Report when there are no more statements after the 'if' statement** option to ignore cases where the `if`---`else` statement is the last statement in a code block." + "text": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }' After the quick-fix is applied: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }'", + "markdown": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }\n" }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 27, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -25142,27 +25142,27 @@ ] }, { - "id": "InnerClassReferencedViaSubclass", + "id": "ConfusingElse", "shortDescription": { - "text": "Inner class referenced via subclass" + "text": "Redundant 'else'" }, "fullDescription": { - "text": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }' After the quick-fix is applied: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }'", - "markdown": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }\n" + "text": "Reports redundant 'else' keywords in 'if'—'else' statements and statement chains. The 'else' keyword is redundant when all previous branches end with a 'return', 'throw', 'break', or 'continue' statement. In this case, the statements from the 'else' branch can be placed after the 'if' statement, and the 'else' keyword can be removed. Example: 'if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }' After the quick-fix is applied: 'if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);' Disable the Report when there are no more statements after the 'if' statement option to ignore cases where the 'if'—'else' statement is the last statement in a code block.", + "markdown": "Reports redundant `else` keywords in `if`---`else` statements and statement chains.\n\n\nThe `else` keyword is redundant when all previous branches end with a\n`return`, `throw`, `break`, or `continue` statement. In this case,\nthe statements from the `else` branch can be placed after the `if` statement, and the\n`else` keyword can be removed.\n\n**Example:**\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }\n\nAfter the quick-fix is applied:\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);\n\nDisable the **Report when there are no more statements after the 'if' statement** option to ignore cases where the `if`---`else` statement is the last statement in a code block." }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -25878,13 +25878,13 @@ ] }, { - "id": "ThrowsRuntimeException", + "id": "JDBCResource", "shortDescription": { - "text": "Unchecked exception declared in 'throws' clause" + "text": "JDBC resource opened but not safely closed" }, "fullDescription": { - "text": "Reports declaration of an unchecked exception ('java.lang.RuntimeException' or one of its subclasses) in the 'throws' clause of a method. Declarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc '@throws' tag. Example: 'public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }'", - "markdown": "Reports declaration of an unchecked exception (`java.lang.RuntimeException` or one of its subclasses) in the `throws` clause of a method.\n\nDeclarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc `@throws` tag.\n\n**Example:**\n\n\n public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }\n" + "text": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include 'java.sql.Connection', 'java.sql.Statement', 'java.sql.PreparedStatement', 'java.sql.CallableStatement', and 'java.sql.ResultSet'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }' Use the following options to configure the inspection: Whether a JDBC resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.", + "markdown": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include `java.sql.Connection`, `java.sql.Statement`, `java.sql.PreparedStatement`, `java.sql.CallableStatement`, and `java.sql.ResultSet`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a JDBC resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument." }, "defaultConfiguration": { "enabled": false, @@ -25897,8 +25897,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Resource management", + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -25910,13 +25910,13 @@ ] }, { - "id": "JDBCResource", + "id": "ThrowsRuntimeException", "shortDescription": { - "text": "JDBC resource opened but not safely closed" + "text": "Unchecked exception declared in 'throws' clause" }, "fullDescription": { - "text": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include 'java.sql.Connection', 'java.sql.Statement', 'java.sql.PreparedStatement', 'java.sql.CallableStatement', and 'java.sql.ResultSet'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }' Use the following options to configure the inspection: Whether a JDBC resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.", - "markdown": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include `java.sql.Connection`, `java.sql.Statement`, `java.sql.PreparedStatement`, `java.sql.CallableStatement`, and `java.sql.ResultSet`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a JDBC resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument." + "text": "Reports declaration of an unchecked exception ('java.lang.RuntimeException' or one of its subclasses) in the 'throws' clause of a method. Declarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc '@throws' tag. Example: 'public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }'", + "markdown": "Reports declaration of an unchecked exception (`java.lang.RuntimeException` or one of its subclasses) in the `throws` clause of a method.\n\nDeclarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc `@throws` tag.\n\n**Example:**\n\n\n public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -25929,8 +25929,8 @@ "relationships": [ { "target": { - "id": "Java/Resource management", - "index": 46, + "id": "Java/Error handling", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -26038,27 +26038,27 @@ ] }, { - "id": "RedundantCompareCall", + "id": "LambdaCanBeReplacedWithAnonymous", "shortDescription": { - "text": "Redundant 'compare()' method call" + "text": "Lambda can be replaced with anonymous class" }, "fullDescription": { - "text": "Reports comparisons in which the 'compare' method is superfluous. Example: 'boolean result = Integer.compare(a, b) == 0;' After the quick-fix is applied: 'boolean result = a == b;' New in 2018.2", - "markdown": "Reports comparisons in which the `compare` method is superfluous.\n\nExample:\n\n\n boolean result = Integer.compare(a, b) == 0;\n\nAfter the quick-fix is applied:\n\n\n boolean result = a == b;\n\nNew in 2018.2" + "text": "Reports lambda expressions that can be replaced with anonymous classes. Expanding lambda expressions to anonymous classes may be useful if you need to implement other methods inside an anonymous class. Example: 's -> System.out.println(s)' After the quick-fix is applied: 'new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n}' Lambda expression appeared in Java 8. This inspection can help to downgrade for backward compatibility with earlier Java versions.", + "markdown": "Reports lambda expressions that can be replaced with anonymous classes.\n\n\nExpanding lambda expressions to anonymous classes may be useful if you need to implement other\nmethods inside an anonymous class.\n\nExample:\n\n\n s -> System.out.println(s)\n\nAfter the quick-fix is applied:\n\n new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n }\n\n\n*Lambda expression* appeared in Java 8.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions." }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -26070,27 +26070,27 @@ ] }, { - "id": "LambdaCanBeReplacedWithAnonymous", + "id": "RedundantCompareCall", "shortDescription": { - "text": "Lambda can be replaced with anonymous class" + "text": "Redundant 'compare()' method call" }, "fullDescription": { - "text": "Reports lambda expressions that can be replaced with anonymous classes. Expanding lambda expressions to anonymous classes may be useful if you need to implement other methods inside an anonymous class. Example: 's -> System.out.println(s)' After the quick-fix is applied: 'new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n}' Lambda expression appeared in Java 8. This inspection can help to downgrade for backward compatibility with earlier Java versions.", - "markdown": "Reports lambda expressions that can be replaced with anonymous classes.\n\n\nExpanding lambda expressions to anonymous classes may be useful if you need to implement other\nmethods inside an anonymous class.\n\nExample:\n\n\n s -> System.out.println(s)\n\nAfter the quick-fix is applied:\n\n new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n }\n\n\n*Lambda expression* appeared in Java 8.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions." + "text": "Reports comparisons in which the 'compare' method is superfluous. Example: 'boolean result = Integer.compare(a, b) == 0;' After the quick-fix is applied: 'boolean result = a == b;' New in 2018.2", + "markdown": "Reports comparisons in which the `compare` method is superfluous.\n\nExample:\n\n\n boolean result = Integer.compare(a, b) == 0;\n\nAfter the quick-fix is applied:\n\n\n boolean result = a == b;\n\nNew in 2018.2" }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -26134,27 +26134,27 @@ ] }, { - "id": "EmptyClass", + "id": "TextBlockBackwardMigration", "shortDescription": { - "text": "Redundant empty class" + "text": "Text block can be replaced with regular string literal" }, "fullDescription": { - "text": "Reports empty classes and Java files without any defined classes. A class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes often remain after significant changes or refactorings. Configure the inspection: Use the Ignore if annotated by option to specify special annotations. The inspection will ignore the classes marked with these annotations. Use the Ignore class if it is a parametrization of a super type option to ignore classes that parameterize a superclass. For example: 'class MyList extends ArrayList {}' Use the Ignore subclasses of java.lang.Throwable to ignore classes that extend 'java.lang.Throwable'. Use the Comments count as content option to ignore classes that contain comments.", - "markdown": "Reports empty classes and Java files without any defined classes.\n\nA class is empty if it\ndoesn't contain any fields, methods, constructors, or initializers. Empty classes often remain\nafter significant changes or refactorings.\n\nConfigure the inspection:\n\n* Use the **Ignore if annotated by** option to specify special annotations. The inspection will ignore the classes marked with these annotations.\n*\n Use the **Ignore class if it is a parametrization of a super type** option to ignore classes that parameterize a superclass. For example:\n\n class MyList extends ArrayList {}\n\n* Use the **Ignore subclasses of java.lang.Throwable** to ignore classes that extend `java.lang.Throwable`.\n* Use the **Comments count as content** option to ignore classes that contain comments." + "text": "Reports text blocks that can be replaced with regular string literals. Example: 'Object obj = engine.eval(\"\"\"\n function hello() {\n print('\"Hello, world\"');\n }\n\n hello();\n \"\"\");' After the quick fix is applied: 'Object obj = engine.eval(\"function hello() {\\n\" +\n \" print('\\\"Hello, world\\\"');\\n\" +\n \"}\\n\" +\n \"\\n\" +\n \"hello();\\n\");' Text block appeared in Java 15. This inspection can help to downgrade for backward compatibility with earlier Java versions. New in 2019.3", + "markdown": "Reports text blocks that can be replaced with regular string literals.\n\n**Example:**\n\n\n Object obj = engine.eval(\"\"\"\n function hello() {\n print('\"Hello, world\"');\n }\n\n hello();\n \"\"\");\n\nAfter the quick fix is applied:\n\n\n Object obj = engine.eval(\"function hello() {\\n\" +\n \" print('\\\"Hello, world\\\"');\\n\" +\n \"}\\n\" +\n \"\\n\" +\n \"hello();\\n\");\n\n\n*Text block* appeared in Java 15.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2019.3" }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 12, + "id": "Java/Java language level migration aids/Java 15", + "index": 100, "toolComponent": { "name": "QDJVMC" } @@ -26166,27 +26166,27 @@ ] }, { - "id": "TextBlockBackwardMigration", + "id": "EmptyClass", "shortDescription": { - "text": "Text block can be replaced with regular string literal" + "text": "Redundant empty class" }, "fullDescription": { - "text": "Reports text blocks that can be replaced with regular string literals. Example: 'Object obj = engine.eval(\"\"\"\n function hello() {\n print('\"Hello, world\"');\n }\n\n hello();\n \"\"\");' After the quick fix is applied: 'Object obj = engine.eval(\"function hello() {\\n\" +\n \" print('\\\"Hello, world\\\"');\\n\" +\n \"}\\n\" +\n \"\\n\" +\n \"hello();\\n\");' Text block appeared in Java 15. This inspection can help to downgrade for backward compatibility with earlier Java versions. New in 2019.3", - "markdown": "Reports text blocks that can be replaced with regular string literals.\n\n**Example:**\n\n\n Object obj = engine.eval(\"\"\"\n function hello() {\n print('\"Hello, world\"');\n }\n\n hello();\n \"\"\");\n\nAfter the quick fix is applied:\n\n\n Object obj = engine.eval(\"function hello() {\\n\" +\n \" print('\\\"Hello, world\\\"');\\n\" +\n \"}\\n\" +\n \"\\n\" +\n \"hello();\\n\");\n\n\n*Text block* appeared in Java 15.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2019.3" + "text": "Reports empty classes and Java files without any defined classes. A class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes often remain after significant changes or refactorings. Configure the inspection: Use the Ignore if annotated by option to specify special annotations. The inspection will ignore the classes marked with these annotations. Use the Ignore class if it is a parametrization of a super type option to ignore classes that parameterize a superclass. For example: 'class MyList extends ArrayList {}' Use the Ignore subclasses of java.lang.Throwable to ignore classes that extend 'java.lang.Throwable'. Use the Comments count as content option to ignore classes that contain comments.", + "markdown": "Reports empty classes and Java files without any defined classes.\n\nA class is empty if it\ndoesn't contain any fields, methods, constructors, or initializers. Empty classes often remain\nafter significant changes or refactorings.\n\nConfigure the inspection:\n\n* Use the **Ignore if annotated by** option to specify special annotations. The inspection will ignore the classes marked with these annotations.\n*\n Use the **Ignore class if it is a parametrization of a super type** option to ignore classes that parameterize a superclass. For example:\n\n class MyList extends ArrayList {}\n\n* Use the **Ignore subclasses of java.lang.Throwable** to ignore classes that extend `java.lang.Throwable`.\n* Use the **Comments count as content** option to ignore classes that contain comments." }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 15", - "index": 100, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -26294,13 +26294,13 @@ ] }, { - "id": "AssignmentToLambdaParameter", + "id": "LocalVariableHidingMemberVariable", "shortDescription": { - "text": "Assignment to lambda parameter" + "text": "Local variable hides field" }, "fullDescription": { - "text": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable. The quick-fix adds a declaration of a new variable. Example: 'list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });' After the quick-fix is applied: 'list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });' Use the Ignore if assignment is a transformation of the original parameter option to ignore assignments that modify the parameter value based on its previous value.", - "markdown": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });\n\nAfter the quick-fix is applied:\n\n\n list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });\n\nUse the **Ignore if assignment is a transformation of the original parameter** option to ignore assignments that modify the parameter\nvalue based on its previous value." + "text": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }' You can configure the following options for this inspection: Ignore non-accessible fields - ignore local variables named identically to superclass fields that are not visible (for example, because they are private). Ignore local variables in a static context hiding non-static fields - for example when the local variable is inside a static method or inside a method which is inside a static inner class.", + "markdown": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended.\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }\n\n\nYou can configure the following options for this inspection:\n\n1. **Ignore non-accessible fields** - ignore local variables named identically to superclass fields that are not visible (for example, because they are private).\n2. **Ignore local variables in a static context hiding non-static fields** - for example when the local variable is inside a static method or inside a method which is inside a static inner class." }, "defaultConfiguration": { "enabled": false, @@ -26313,8 +26313,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 36, + "id": "Java/Visibility", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -26326,13 +26326,13 @@ ] }, { - "id": "LocalVariableHidingMemberVariable", + "id": "AssignmentToLambdaParameter", "shortDescription": { - "text": "Local variable hides field" + "text": "Assignment to lambda parameter" }, "fullDescription": { - "text": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }' You can configure the following options for this inspection: Ignore non-accessible fields - ignore local variables named identically to superclass fields that are not visible (for example, because they are private). Ignore local variables in a static context hiding non-static fields - for example when the local variable is inside a static method or inside a method which is inside a static inner class.", - "markdown": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended.\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }\n\n\nYou can configure the following options for this inspection:\n\n1. **Ignore non-accessible fields** - ignore local variables named identically to superclass fields that are not visible (for example, because they are private).\n2. **Ignore local variables in a static context hiding non-static fields** - for example when the local variable is inside a static method or inside a method which is inside a static inner class." + "text": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable. The quick-fix adds a declaration of a new variable. Example: 'list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });' After the quick-fix is applied: 'list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });' Use the Ignore if assignment is a transformation of the original parameter option to ignore assignments that modify the parameter value based on its previous value.", + "markdown": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });\n\nAfter the quick-fix is applied:\n\n\n list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });\n\nUse the **Ignore if assignment is a transformation of the original parameter** option to ignore assignments that modify the parameter\nvalue based on its previous value." }, "defaultConfiguration": { "enabled": false, @@ -26345,8 +26345,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 54, + "id": "Java/Assignment issues", + "index": 36, "toolComponent": { "name": "QDJVMC" } @@ -26486,16 +26486,16 @@ ] }, { - "id": "SuspiciousLiteralUnderscore", + "id": "StringEquality", "shortDescription": { - "text": "Suspicious underscore in number literal" + "text": "String comparison using '==', instead of 'equals()'" }, "fullDescription": { - "text": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo. This inspection will not warn on literals containing two consecutive underscores. It is also allowed to omit underscores in the fractional part of 'double' and 'float' literals. Example: 'int oneMillion = 1_000_0000;'", - "markdown": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo.\n\nThis inspection will not warn on literals containing two consecutive underscores.\nIt is also allowed to omit underscores in the fractional part of `double` and `float` literals.\n\n**Example:** `int oneMillion = 1_000_0000;`" + "text": "Reports code that uses of == or != to compare strings. These operators determine referential equality instead of comparing content. In most cases, strings should be compared using 'equals()', which does a character-by-character comparison when the strings are different objects. Example: 'void foo(String s, String t) {\n final boolean b = t == s;\n }' If 't' is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following: 'void foo(String s, String t) {\n final boolean b = t.equals(s);\n }'", + "markdown": "Reports code that uses of **==** or **!=** to compare strings.\n\n\nThese operators determine referential equality instead of comparing content.\nIn most cases, strings should be compared using `equals()`,\nwhich does a character-by-character comparison when the strings are different objects.\n\n**Example:**\n\n\n void foo(String s, String t) {\n final boolean b = t == s;\n }\n\nIf `t` is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following:\n\n\n void foo(String s, String t) {\n final boolean b = t.equals(s);\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -26505,8 +26505,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 26, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -26518,16 +26518,16 @@ ] }, { - "id": "StringEquality", + "id": "SuspiciousLiteralUnderscore", "shortDescription": { - "text": "String comparison using '==', instead of 'equals()'" + "text": "Suspicious underscore in number literal" }, "fullDescription": { - "text": "Reports code that uses of == or != to compare strings. These operators determine referential equality instead of comparing content. In most cases, strings should be compared using 'equals()', which does a character-by-character comparison when the strings are different objects. Example: 'void foo(String s, String t) {\n final boolean b = t == s;\n }' If 't' is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following: 'void foo(String s, String t) {\n final boolean b = t.equals(s);\n }'", - "markdown": "Reports code that uses of **==** or **!=** to compare strings.\n\n\nThese operators determine referential equality instead of comparing content.\nIn most cases, strings should be compared using `equals()`,\nwhich does a character-by-character comparison when the strings are different objects.\n\n**Example:**\n\n\n void foo(String s, String t) {\n final boolean b = t == s;\n }\n\nIf `t` is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following:\n\n\n void foo(String s, String t) {\n final boolean b = t.equals(s);\n }\n" + "text": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo. This inspection will not warn on literals containing two consecutive underscores. It is also allowed to omit underscores in the fractional part of 'double' and 'float' literals. Example: 'int oneMillion = 1_000_0000;'", + "markdown": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo.\n\nThis inspection will not warn on literals containing two consecutive underscores.\nIt is also allowed to omit underscores in the fractional part of `double` and `float` literals.\n\n**Example:** `int oneMillion = 1_000_0000;`" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -26537,8 +26537,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -26646,13 +26646,13 @@ ] }, { - "id": "UnnecessaryLabelOnContinueStatement", + "id": "PackageDotHtmlMayBePackageInfo", "shortDescription": { - "text": "Unnecessary label on 'continue' statement" + "text": "'package.html' may be converted to 'package-info.java'" }, "fullDescription": { - "text": "Reports 'continue' statements with unnecessary labels. Example: 'LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }'", - "markdown": "Reports `continue` statements with unnecessary labels.\n\nExample:\n\n\n LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }\n" + "text": "Reports any 'package.html' files which are used for documenting packages. Since JDK 1.5, it is recommended that you use 'package-info.java' files instead, as such files can also contain package annotations. This way, package-info.java becomes a sole repository for package level annotations and documentation. Example: 'package.html' '\n \n Documentation example.\n \n' After the quick-fix is applied: 'package-info.java' '/**\n * Documentation example.\n */\npackage com.sample;'", + "markdown": "Reports any `package.html` files which are used for documenting packages.\n\nSince JDK 1.5, it is recommended that you use `package-info.java` files instead, as such\nfiles can also contain package annotations. This way, package-info.java becomes a\nsole repository for package level annotations and documentation.\n\nExample: `package.html`\n\n\n \n \n Documentation example.\n \n \n\nAfter the quick-fix is applied: `package-info.java`\n\n\n /**\n * Documentation example.\n */\n package com.sample;\n" }, "defaultConfiguration": { "enabled": false, @@ -26665,8 +26665,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, + "id": "Java/Javadoc", + "index": 45, "toolComponent": { "name": "QDJVMC" } @@ -26678,13 +26678,13 @@ ] }, { - "id": "PackageDotHtmlMayBePackageInfo", + "id": "UnnecessaryLabelOnContinueStatement", "shortDescription": { - "text": "'package.html' may be converted to 'package-info.java'" + "text": "Unnecessary label on 'continue' statement" }, "fullDescription": { - "text": "Reports any 'package.html' files which are used for documenting packages. Since JDK 1.5, it is recommended that you use 'package-info.java' files instead, as such files can also contain package annotations. This way, package-info.java becomes a sole repository for package level annotations and documentation. Example: 'package.html' '\n \n Documentation example.\n \n' After the quick-fix is applied: 'package-info.java' '/**\n * Documentation example.\n */\npackage com.sample;'", - "markdown": "Reports any `package.html` files which are used for documenting packages.\n\nSince JDK 1.5, it is recommended that you use `package-info.java` files instead, as such\nfiles can also contain package annotations. This way, package-info.java becomes a\nsole repository for package level annotations and documentation.\n\nExample: `package.html`\n\n\n \n \n Documentation example.\n \n \n\nAfter the quick-fix is applied: `package-info.java`\n\n\n /**\n * Documentation example.\n */\n package com.sample;\n" + "text": "Reports 'continue' statements with unnecessary labels. Example: 'LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }'", + "markdown": "Reports `continue` statements with unnecessary labels.\n\nExample:\n\n\n LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -26697,8 +26697,8 @@ "relationships": [ { "target": { - "id": "Java/Javadoc", - "index": 45, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -27446,13 +27446,13 @@ ] }, { - "id": "ClassComplexity", + "id": "SystemGC", "shortDescription": { - "text": "Overly complex class" + "text": "Call to 'System.gc()' or 'Runtime.gc()'" }, "fullDescription": { - "text": "Reports classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Too high complexity indicates that the class should be refactored into several smaller classes. Use the Cyclomatic complexity limit field below to specify the maximum allowed complexity for a class.", - "markdown": "Reports classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nToo high complexity indicates that the class should be refactored into several smaller classes.\n\nUse the **Cyclomatic complexity limit** field below to specify the maximum allowed complexity for a class." + "text": "Reports 'System.gc()' or 'Runtime.gc()' calls. While occasionally useful in testing, explicitly triggering garbage collection via 'System.gc()' is almost never recommended in production code and can result in serious performance issues.", + "markdown": "Reports `System.gc()` or `Runtime.gc()` calls. While occasionally useful in testing, explicitly triggering garbage collection via `System.gc()` is almost never recommended in production code and can result in serious performance issues." }, "defaultConfiguration": { "enabled": false, @@ -27465,8 +27465,8 @@ "relationships": [ { "target": { - "id": "Java/Class metrics", - "index": 87, + "id": "Java/Memory", + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -27478,13 +27478,13 @@ ] }, { - "id": "SystemGC", + "id": "ClassComplexity", "shortDescription": { - "text": "Call to 'System.gc()' or 'Runtime.gc()'" + "text": "Overly complex class" }, "fullDescription": { - "text": "Reports 'System.gc()' or 'Runtime.gc()' calls. While occasionally useful in testing, explicitly triggering garbage collection via 'System.gc()' is almost never recommended in production code and can result in serious performance issues.", - "markdown": "Reports `System.gc()` or `Runtime.gc()` calls. While occasionally useful in testing, explicitly triggering garbage collection via `System.gc()` is almost never recommended in production code and can result in serious performance issues." + "text": "Reports classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Too high complexity indicates that the class should be refactored into several smaller classes. Use the Cyclomatic complexity limit field below to specify the maximum allowed complexity for a class.", + "markdown": "Reports classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nToo high complexity indicates that the class should be refactored into several smaller classes.\n\nUse the **Cyclomatic complexity limit** field below to specify the maximum allowed complexity for a class." }, "defaultConfiguration": { "enabled": false, @@ -27497,8 +27497,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 72, + "id": "Java/Class metrics", + "index": 87, "toolComponent": { "name": "QDJVMC" } @@ -27638,16 +27638,16 @@ ] }, { - "id": "InnerClassMayBeStatic", + "id": "SetReplaceableByEnumSet", "shortDescription": { - "text": "Inner class may be 'static'" + "text": "'Set' can be replaced with 'EnumSet'" }, "fullDescription": { - "text": "Reports inner classes that can be made 'static'. A 'static' inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class. Example: 'public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' After the quick-fix is applied: 'public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }'", - "markdown": "Reports inner classes that can be made `static`.\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nThis prevents a common cause of memory leaks and uses less memory per instance of the class.\n\n**Example:**\n\n\n public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n" + "text": "Reports instantiations of 'java.util.Set' objects whose content types are enumerated classes. Such 'Set' objects can be replaced with 'java.util.EnumSet' objects. 'EnumSet' implementations can be much more efficient compared to other sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to 'EnumSet.noneOf()'. This quick-fix is not available when the type of the variable is a sub-class of 'Set'. Example: 'enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();' After the quick-fix is applied: 'enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);'", + "markdown": "Reports instantiations of `java.util.Set` objects whose content types are enumerated classes. Such `Set` objects can be replaced with `java.util.EnumSet` objects.\n\n\n`EnumSet` implementations can be much more efficient compared to\nother sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to\n`EnumSet.noneOf()`. This quick-fix is not available when the type of the variable is a sub-class of `Set`.\n\n**Example:**\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();\n\nAfter the quick-fix is applied:\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -27657,8 +27657,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 72, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -27670,16 +27670,16 @@ ] }, { - "id": "SetReplaceableByEnumSet", + "id": "InnerClassMayBeStatic", "shortDescription": { - "text": "'Set' can be replaced with 'EnumSet'" + "text": "Inner class may be 'static'" }, "fullDescription": { - "text": "Reports instantiations of 'java.util.Set' objects whose content types are enumerated classes. Such 'Set' objects can be replaced with 'java.util.EnumSet' objects. 'EnumSet' implementations can be much more efficient compared to other sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to 'EnumSet.noneOf()'. This quick-fix is not available when the type of the variable is a sub-class of 'Set'. Example: 'enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();' After the quick-fix is applied: 'enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);'", - "markdown": "Reports instantiations of `java.util.Set` objects whose content types are enumerated classes. Such `Set` objects can be replaced with `java.util.EnumSet` objects.\n\n\n`EnumSet` implementations can be much more efficient compared to\nother sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to\n`EnumSet.noneOf()`. This quick-fix is not available when the type of the variable is a sub-class of `Set`.\n\n**Example:**\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();\n\nAfter the quick-fix is applied:\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);\n" + "text": "Reports inner classes that can be made 'static'. A 'static' inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class. Example: 'public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' After the quick-fix is applied: 'public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }'", + "markdown": "Reports inner classes that can be made `static`.\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nThis prevents a common cause of memory leaks and uses less memory per instance of the class.\n\n**Example:**\n\n\n public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -27689,8 +27689,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Memory", + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -27798,13 +27798,13 @@ ] }, { - "id": "CloneReturnsClassType", + "id": "NonSerializableWithSerializationMethods", "shortDescription": { - "text": "'clone()' should have return type equal to the class it contains" + "text": "Non-serializable class with 'readObject()' or 'writeObject()'" }, "fullDescription": { - "text": "Reports 'clone()' methods with return types different from the class they're located in. Often a 'clone()' method will have a return type of 'java.lang.Object', which makes it harder to use by its clients. Effective Java (the second and third editions) recommends making the return type of the 'clone()' method the same as the class type of the object it returns. Example: 'class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' After the quick-fix is applied: 'class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }'", - "markdown": "Reports `clone()` methods with return types different from the class they're located in.\n\nOften a `clone()` method will have a return type of `java.lang.Object`, which makes it harder to use by its clients.\n*Effective Java* (the second and third editions) recommends making the return type of the `clone()` method the same as the\nclass type of the object it returns.\n\n**Example:**\n\n\n class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n" + "text": "Reports non-'Serializable' classes that define 'readObject()' or 'writeObject()' methods. Such methods in that context normally indicate an error. Example: 'public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }'", + "markdown": "Reports non-`Serializable` classes that define `readObject()` or `writeObject()` methods. Such methods in that context normally indicate an error.\n\n**Example:**\n\n\n public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -27817,8 +27817,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 82, + "id": "Java/Serialization issues", + "index": 18, "toolComponent": { "name": "QDJVMC" } @@ -27830,13 +27830,13 @@ ] }, { - "id": "NonSerializableWithSerializationMethods", + "id": "CloneReturnsClassType", "shortDescription": { - "text": "Non-serializable class with 'readObject()' or 'writeObject()'" + "text": "'clone()' should have return type equal to the class it contains" }, "fullDescription": { - "text": "Reports non-'Serializable' classes that define 'readObject()' or 'writeObject()' methods. Such methods in that context normally indicate an error. Example: 'public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }'", - "markdown": "Reports non-`Serializable` classes that define `readObject()` or `writeObject()` methods. Such methods in that context normally indicate an error.\n\n**Example:**\n\n\n public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }\n" + "text": "Reports 'clone()' methods with return types different from the class they're located in. Often a 'clone()' method will have a return type of 'java.lang.Object', which makes it harder to use by its clients. Effective Java (the second and third editions) recommends making the return type of the 'clone()' method the same as the class type of the object it returns. Example: 'class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' After the quick-fix is applied: 'class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }'", + "markdown": "Reports `clone()` methods with return types different from the class they're located in.\n\nOften a `clone()` method will have a return type of `java.lang.Object`, which makes it harder to use by its clients.\n*Effective Java* (the second and third editions) recommends making the return type of the `clone()` method the same as the\nclass type of the object it returns.\n\n**Example:**\n\n\n class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -27849,8 +27849,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 18, + "id": "Java/Cloning issues", + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -28534,13 +28534,13 @@ ] }, { - "id": "AssignmentOrReturnOfFieldWithMutableType", + "id": "UnnecessaryUnboxing", "shortDescription": { - "text": "Assignment or return of field with mutable type" + "text": "Unnecessary unboxing" }, "fullDescription": { - "text": "Reports return of, or assignment from a method parameter to an array or a mutable type like 'Collection', 'Date', 'Map', 'Calendar', etc. Because such types are mutable, this construct may result in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for performance reasons, it is inherently prone to bugs. The following mutable types are reported: 'java.util.Date' 'java.util.Calendar' 'java.util.Collection' 'java.util.Map' 'com.google.common.collect.Multimap' 'com.google.common.collect.Table' The quick-fix adds a call to the field's '.clone()' method. Example: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }' After the quick-fix is applied: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }' Use the Ignore assignments in and returns from private methods option to ignore assignments and returns in 'private' methods.", - "markdown": "Reports return of, or assignment from a method parameter to an array or a mutable type like `Collection`, `Date`, `Map`, `Calendar`, etc.\n\nBecause such types are mutable, this construct may\nresult in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for\nperformance reasons, it is inherently prone to bugs.\n\nThe following mutable types are reported:\n\n* `java.util.Date`\n* `java.util.Calendar`\n* `java.util.Collection`\n* `java.util.Map`\n* `com.google.common.collect.Multimap`\n* `com.google.common.collect.Table`\n\nThe quick-fix adds a call to the field's `.clone()` method.\n\n**Example:**\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }\n\nUse the **Ignore assignments in and returns from private methods** option to ignore assignments and returns in `private` methods." + "text": "Reports unboxing, that is explicit unwrapping of wrapped primitive values. Unboxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = Integer.valueOf(42).intValue();' → 'Integer i = Integer.valueOf(42);' 'int k = Integer.valueOf(42).intValue();' → 'int k = Integer.valueOf(42);' (reports only when the Only report truly superfluously unboxed expressions option is not checked) Use the Only report truly superfluously unboxed expressions option to only report truly superfluous unboxing, where an unboxed value is immediately boxed either implicitly or explicitly. In this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing. This inspection only reports if the language level of the project or module is 5 or higher.", + "markdown": "Reports unboxing, that is explicit unwrapping of wrapped primitive values.\n\nUnboxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = Integer.valueOf(42).intValue();` → `Integer i = Integer.valueOf(42);`\n* `int k = Integer.valueOf(42).intValue();` → `int k = Integer.valueOf(42);`\n\n (reports only when the **Only report truly superfluously unboxed expressions** option is not checked)\n\n\nUse the **Only report truly superfluously unboxed expressions** option to only report truly superfluous unboxing,\nwhere an unboxed value is immediately boxed either implicitly or explicitly.\nIn this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher." }, "defaultConfiguration": { "enabled": false, @@ -28553,8 +28553,8 @@ "relationships": [ { "target": { - "id": "Java/Encapsulation", - "index": 57, + "id": "Java/Java language level migration aids/Java 5", + "index": 51, "toolComponent": { "name": "QDJVMC" } @@ -28566,13 +28566,13 @@ ] }, { - "id": "RuntimeExecWithNonConstantString", + "id": "AssignmentOrReturnOfFieldWithMutableType", "shortDescription": { - "text": "Call to 'Runtime.exec()' with non-constant string" + "text": "Assignment or return of field with mutable type" }, "fullDescription": { - "text": "Reports calls to 'java.lang.Runtime.exec()' which take a dynamically-constructed string as the command to execute. Constructed execution strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning' Use the inspection settings to consider any 'static' 'final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";'", - "markdown": "Reports calls to `java.lang.Runtime.exec()` which take a dynamically-constructed string as the command to execute.\n\n\nConstructed execution strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning\n\n\nUse the inspection settings to consider any `static` `final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";\n" + "text": "Reports return of, or assignment from a method parameter to an array or a mutable type like 'Collection', 'Date', 'Map', 'Calendar', etc. Because such types are mutable, this construct may result in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for performance reasons, it is inherently prone to bugs. The following mutable types are reported: 'java.util.Date' 'java.util.Calendar' 'java.util.Collection' 'java.util.Map' 'com.google.common.collect.Multimap' 'com.google.common.collect.Table' The quick-fix adds a call to the field's '.clone()' method. Example: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }' After the quick-fix is applied: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }' Use the Ignore assignments in and returns from private methods option to ignore assignments and returns in 'private' methods.", + "markdown": "Reports return of, or assignment from a method parameter to an array or a mutable type like `Collection`, `Date`, `Map`, `Calendar`, etc.\n\nBecause such types are mutable, this construct may\nresult in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for\nperformance reasons, it is inherently prone to bugs.\n\nThe following mutable types are reported:\n\n* `java.util.Date`\n* `java.util.Calendar`\n* `java.util.Collection`\n* `java.util.Map`\n* `com.google.common.collect.Multimap`\n* `com.google.common.collect.Table`\n\nThe quick-fix adds a call to the field's `.clone()` method.\n\n**Example:**\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }\n\nUse the **Ignore assignments in and returns from private methods** option to ignore assignments and returns in `private` methods." }, "defaultConfiguration": { "enabled": false, @@ -28585,8 +28585,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 30, + "id": "Java/Encapsulation", + "index": 57, "toolComponent": { "name": "QDJVMC" } @@ -28598,13 +28598,13 @@ ] }, { - "id": "UnnecessaryUnboxing", + "id": "RuntimeExecWithNonConstantString", "shortDescription": { - "text": "Unnecessary unboxing" + "text": "Call to 'Runtime.exec()' with non-constant string" }, "fullDescription": { - "text": "Reports unboxing, that is explicit unwrapping of wrapped primitive values. Unboxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = Integer.valueOf(42).intValue();' → 'Integer i = Integer.valueOf(42);' 'int k = Integer.valueOf(42).intValue();' → 'int k = Integer.valueOf(42);' (reports only when the Only report truly superfluously unboxed expressions option is not checked) Use the Only report truly superfluously unboxed expressions option to only report truly superfluous unboxing, where an unboxed value is immediately boxed either implicitly or explicitly. In this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing. This inspection only reports if the language level of the project or module is 5 or higher.", - "markdown": "Reports unboxing, that is explicit unwrapping of wrapped primitive values.\n\nUnboxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = Integer.valueOf(42).intValue();` → `Integer i = Integer.valueOf(42);`\n* `int k = Integer.valueOf(42).intValue();` → `int k = Integer.valueOf(42);`\n\n (reports only when the **Only report truly superfluously unboxed expressions** option is not checked)\n\n\nUse the **Only report truly superfluously unboxed expressions** option to only report truly superfluous unboxing,\nwhere an unboxed value is immediately boxed either implicitly or explicitly.\nIn this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher." + "text": "Reports calls to 'java.lang.Runtime.exec()' which take a dynamically-constructed string as the command to execute. Constructed execution strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning' Use the inspection settings to consider any 'static' 'final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";'", + "markdown": "Reports calls to `java.lang.Runtime.exec()` which take a dynamically-constructed string as the command to execute.\n\n\nConstructed execution strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning\n\n\nUse the inspection settings to consider any `static` `final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";\n" }, "defaultConfiguration": { "enabled": false, @@ -28617,8 +28617,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 5", - "index": 51, + "id": "Java/Security", + "index": 30, "toolComponent": { "name": "QDJVMC" } @@ -28790,13 +28790,13 @@ ] }, { - "id": "CyclicPackageDependency", + "id": "StringRepeatCanBeUsed", "shortDescription": { - "text": "Cyclic package dependency" + "text": "String.repeat() can be used" }, "fullDescription": { - "text": "Reports packages that are mutually or cyclically dependent on other packages. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports packages that are mutually or cyclically dependent on other packages.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports loops that can be replaced with a single 'String.repeat()' method (available since Java 11). Example: 'void append(StringBuilder sb, int count, Object obj) {\n for (int i = 0; i < count; i++) {\n sb.append(obj);\n }\n }' After the quick-fix is applied: 'void append(StringBuilder sb, int count, Object obj) {\n sb.append(String.valueOf(obj).repeat(Math.max(0, count)));\n }' By default, the inspection may wrap 'count' with 'Math.max(0, count)' if it cannot prove statically that 'count' is not negative. This is done to prevent possible semantics change, as 'String.repeat()' rejects negative numbers. Use the Add Math.max(0,count) to avoid possible semantics change option to disable this behavior if required. Similarly, a string you want to repeat can be wrapped in 'String.valueOf' to prevent possible 'NullPointerException' if it's unknown whether it can be 'null'. This inspection only reports if the language level of the project or module is 11 or higher. New in 2019.1", + "markdown": "Reports loops that can be replaced with a single `String.repeat()` method (available since Java 11).\n\n**Example:**\n\n\n void append(StringBuilder sb, int count, Object obj) {\n for (int i = 0; i < count; i++) {\n sb.append(obj);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void append(StringBuilder sb, int count, Object obj) {\n sb.append(String.valueOf(obj).repeat(Math.max(0, count)));\n }\n\n\nBy default, the inspection may wrap `count` with `Math.max(0, count)` if it cannot prove statically that `count` is\nnot negative. This is done to prevent possible semantics change, as `String.repeat()` rejects negative numbers.\nUse the **Add Math.max(0,count) to avoid possible semantics change** option to disable this behavior if required.\n\nSimilarly, a string you want to repeat can be wrapped in\n`String.valueOf` to prevent possible `NullPointerException` if it's unknown whether it can be `null`.\n\nThis inspection only reports if the language level of the project or module is 11 or higher.\n\nNew in 2019.1" }, "defaultConfiguration": { "enabled": false, @@ -28809,8 +28809,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 89, + "id": "Java/Java language level migration aids/Java 11", + "index": 124, "toolComponent": { "name": "QDJVMC" } @@ -28822,13 +28822,13 @@ ] }, { - "id": "StringRepeatCanBeUsed", + "id": "CyclicPackageDependency", "shortDescription": { - "text": "String.repeat() can be used" + "text": "Cyclic package dependency" }, "fullDescription": { - "text": "Reports loops that can be replaced with a single 'String.repeat()' method (available since Java 11). Example: 'void append(StringBuilder sb, int count, Object obj) {\n for (int i = 0; i < count; i++) {\n sb.append(obj);\n }\n }' After the quick-fix is applied: 'void append(StringBuilder sb, int count, Object obj) {\n sb.append(String.valueOf(obj).repeat(Math.max(0, count)));\n }' By default, the inspection may wrap 'count' with 'Math.max(0, count)' if it cannot prove statically that 'count' is not negative. This is done to prevent possible semantics change, as 'String.repeat()' rejects negative numbers. Use the Add Math.max(0,count) to avoid possible semantics change option to disable this behavior if required. Similarly, a string you want to repeat can be wrapped in 'String.valueOf' to prevent possible 'NullPointerException' if it's unknown whether it can be 'null'. This inspection only reports if the language level of the project or module is 11 or higher. New in 2019.1", - "markdown": "Reports loops that can be replaced with a single `String.repeat()` method (available since Java 11).\n\n**Example:**\n\n\n void append(StringBuilder sb, int count, Object obj) {\n for (int i = 0; i < count; i++) {\n sb.append(obj);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void append(StringBuilder sb, int count, Object obj) {\n sb.append(String.valueOf(obj).repeat(Math.max(0, count)));\n }\n\n\nBy default, the inspection may wrap `count` with `Math.max(0, count)` if it cannot prove statically that `count` is\nnot negative. This is done to prevent possible semantics change, as `String.repeat()` rejects negative numbers.\nUse the **Add Math.max(0,count) to avoid possible semantics change** option to disable this behavior if required.\n\nSimilarly, a string you want to repeat can be wrapped in\n`String.valueOf` to prevent possible `NullPointerException` if it's unknown whether it can be `null`.\n\nThis inspection only reports if the language level of the project or module is 11 or higher.\n\nNew in 2019.1" + "text": "Reports packages that are mutually or cyclically dependent on other packages. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports packages that are mutually or cyclically dependent on other packages.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, @@ -28841,8 +28841,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 11", - "index": 124, + "id": "Java/Dependency issues", + "index": 89, "toolComponent": { "name": "QDJVMC" } @@ -29046,16 +29046,16 @@ ] }, { - "id": "Contract", + "id": "NewExceptionWithoutArguments", "shortDescription": { - "text": "Contract issues" + "text": "Exception constructor called without arguments" }, "fullDescription": { - "text": "Reports issues in method '@Contract' annotations. The types of issues that can be reported are: Errors in contract syntax Contracts that do not conform to the method signature (wrong parameter count) Method implementations that contradict the contract (e.g. return 'true' when the contract says 'false') Example: '// method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }'", - "markdown": "Reports issues in method `@Contract` annotations. The types of issues that can be reported are:\n\n* Errors in contract syntax\n* Contracts that do not conform to the method signature (wrong parameter count)\n* Method implementations that contradict the contract (e.g. return `true` when the contract says `false`)\n\nExample:\n\n\n // method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }\n" + "text": "Reports creation of a exception instance without any arguments specified. When an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes debugging needlessly hard. Example: 'throw new IOException(); // warning: exception without arguments'", + "markdown": "Reports creation of a exception instance without any arguments specified.\n\nWhen an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes\ndebugging needlessly hard.\n\n**Example:**\n\n\n throw new IOException(); // warning: exception without arguments\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -29065,8 +29065,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Error handling", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -29078,16 +29078,16 @@ ] }, { - "id": "NewExceptionWithoutArguments", + "id": "Contract", "shortDescription": { - "text": "Exception constructor called without arguments" + "text": "Contract issues" }, "fullDescription": { - "text": "Reports creation of a exception instance without any arguments specified. When an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes debugging needlessly hard. Example: 'throw new IOException(); // warning: exception without arguments'", - "markdown": "Reports creation of a exception instance without any arguments specified.\n\nWhen an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes\ndebugging needlessly hard.\n\n**Example:**\n\n\n throw new IOException(); // warning: exception without arguments\n" + "text": "Reports issues in method '@Contract' annotations. The types of issues that can be reported are: Errors in contract syntax Contracts that do not conform to the method signature (wrong parameter count) Method implementations that contradict the contract (e.g. return 'true' when the contract says 'false') Example: '// method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }'", + "markdown": "Reports issues in method `@Contract` annotations. The types of issues that can be reported are:\n\n* Errors in contract syntax\n* Contracts that do not conform to the method signature (wrong parameter count)\n* Method implementations that contradict the contract (e.g. return `true` when the contract says `false`)\n\nExample:\n\n\n // method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -29097,8 +29097,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -29462,13 +29462,13 @@ ] }, { - "id": "UnnecessaryLocalVariable", + "id": "Java9RedundantRequiresStatement", "shortDescription": { - "text": "Redundant local variable" + "text": "Redundant 'requires' directive in module-info" }, "fullDescription": { - "text": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including: Local variables that are immediately returned. Local variables that are immediately assigned to another variable and then not used. Local variables that always have the same value as another local variable or parameter. Example: 'boolean yes() {\n boolean b = true;\n return b;\n }' After the quick-fix is applied: 'boolean yes() {\n return true;\n }' Configure the inspection: Use the Ignore immediately returned or thrown variables option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging. Use the Ignore variables which have an annotation option to ignore annotated variables.", - "markdown": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:\n\n* Local variables that are immediately returned.\n* Local variables that are immediately assigned to another variable and then not used.\n* Local variables that always have the same value as another local variable or parameter.\n\n**Example:**\n\n\n boolean yes() {\n boolean b = true;\n return b;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean yes() {\n return true;\n }\n \nConfigure the inspection:\n\n* Use the **Ignore immediately returned or thrown variables** option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging.\n* Use the **Ignore variables which have an annotation** option to ignore annotated variables." + "text": "Reports redundant 'requires' directives in Java Platform Module System 'module-info.java' files. A 'requires' directive is redundant when a module 'A' requires a module 'B', but the code in module 'A' doesn't import any packages or classes from 'B'. Furthermore, all modules have an implicitly declared dependence on the 'java.base' module, therefore a 'requires java.base;' directive is always redundant. The quick-fix deletes the redundant 'requires' directive. If the deleted dependency re-exported modules that are actually used, the fix adds a 'requires' directives for these modules. This inspection only reports if the language level of the project or module is 9 or higher. New in 2017.1", + "markdown": "Reports redundant `requires` directives in Java Platform Module System `module-info.java` files. A `requires` directive is redundant when a module `A` requires a module `B`, but the code in module `A` doesn't import any packages or classes from `B`. Furthermore, all modules have an implicitly declared dependence on the `java.base` module, therefore a `requires java.base;` directive is always redundant.\n\n\nThe quick-fix deletes the redundant `requires` directive.\nIf the deleted dependency re-exported modules that are actually used, the fix adds a `requires` directives for these modules.\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2017.1" }, "defaultConfiguration": { "enabled": false, @@ -29481,8 +29481,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 23, + "id": "Java/Declaration redundancy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -29494,13 +29494,13 @@ ] }, { - "id": "Java9RedundantRequiresStatement", + "id": "UnnecessaryLocalVariable", "shortDescription": { - "text": "Redundant 'requires' directive in module-info" + "text": "Redundant local variable" }, "fullDescription": { - "text": "Reports redundant 'requires' directives in Java Platform Module System 'module-info.java' files. A 'requires' directive is redundant when a module 'A' requires a module 'B', but the code in module 'A' doesn't import any packages or classes from 'B'. Furthermore, all modules have an implicitly declared dependence on the 'java.base' module, therefore a 'requires java.base;' directive is always redundant. The quick-fix deletes the redundant 'requires' directive. If the deleted dependency re-exported modules that are actually used, the fix adds a 'requires' directives for these modules. This inspection only reports if the language level of the project or module is 9 or higher. New in 2017.1", - "markdown": "Reports redundant `requires` directives in Java Platform Module System `module-info.java` files. A `requires` directive is redundant when a module `A` requires a module `B`, but the code in module `A` doesn't import any packages or classes from `B`. Furthermore, all modules have an implicitly declared dependence on the `java.base` module, therefore a `requires java.base;` directive is always redundant.\n\n\nThe quick-fix deletes the redundant `requires` directive.\nIf the deleted dependency re-exported modules that are actually used, the fix adds a `requires` directives for these modules.\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2017.1" + "text": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including: Local variables that are immediately returned. Local variables that are immediately assigned to another variable and then not used. Local variables that always have the same value as another local variable or parameter. Example: 'boolean yes() {\n boolean b = true;\n return b;\n }' After the quick-fix is applied: 'boolean yes() {\n return true;\n }' Configure the inspection: Use the Ignore immediately returned or thrown variables option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging. Use the Ignore variables which have an annotation option to ignore annotated variables.", + "markdown": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:\n\n* Local variables that are immediately returned.\n* Local variables that are immediately assigned to another variable and then not used.\n* Local variables that always have the same value as another local variable or parameter.\n\n**Example:**\n\n\n boolean yes() {\n boolean b = true;\n return b;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean yes() {\n return true;\n }\n \nConfigure the inspection:\n\n* Use the **Ignore immediately returned or thrown variables** option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging.\n* Use the **Ignore variables which have an annotation** option to ignore annotated variables." }, "defaultConfiguration": { "enabled": false, @@ -29513,8 +29513,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "Java/Data flow", + "index": 23, "toolComponent": { "name": "QDJVMC" } @@ -29782,16 +29782,16 @@ ] }, { - "id": "NegativelyNamedBooleanVariable", + "id": "SuspiciousIntegerDivAssignment", "shortDescription": { - "text": "Negatively named boolean variable" + "text": "Suspicious integer division assignment" }, "fullDescription": { - "text": "Reports negatively named variables, for example: 'disabled', 'hidden', or 'isNotChanged'. Usually, inverting the 'boolean' value and removing the negation from the name makes the code easier to understand. Example: 'boolean disabled = false;'", - "markdown": "Reports negatively named variables, for example: `disabled`, `hidden`, or `isNotChanged`.\n\nUsually, inverting the `boolean` value and removing the negation from the name makes the code easier to understand.\n\nExample:\n\n\n boolean disabled = false;\n" + "text": "Reports assignments whose right side is a division that shouldn't be truncated to integer. While occasionally intended, this construction is often buggy. Example: 'int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result' This code should be replaced with: 'int x = 18;\n x *= 3.0/2;' In the inspection options, you can disable warnings for suspicious but possibly correct divisions, for example, when the dividend can't be calculated statically. 'void calc(int d) {\n int x = 18;\n x *= d/2;\n }' New in 2019.2", + "markdown": "Reports assignments whose right side is a division that shouldn't be truncated to integer.\n\nWhile occasionally intended, this construction is often buggy.\n\n**Example:**\n\n\n int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result\n\n\nThis code should be replaced with:\n\n\n int x = 18;\n x *= 3.0/2;\n\n\nIn the inspection options, you can disable warnings for suspicious but possibly correct divisions,\nfor example, when the dividend can't be calculated statically.\n\n\n void calc(int d) {\n int x = 18;\n x *= d/2;\n }\n\n\nNew in 2019.2" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -29801,8 +29801,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 23, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -29814,16 +29814,16 @@ ] }, { - "id": "SuspiciousIntegerDivAssignment", + "id": "MethodWithMultipleLoops", "shortDescription": { - "text": "Suspicious integer division assignment" + "text": "Method with multiple loops" }, "fullDescription": { - "text": "Reports assignments whose right side is a division that shouldn't be truncated to integer. While occasionally intended, this construction is often buggy. Example: 'int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result' This code should be replaced with: 'int x = 18;\n x *= 3.0/2;' In the inspection options, you can disable warnings for suspicious but possibly correct divisions, for example, when the dividend can't be calculated statically. 'void calc(int d) {\n int x = 18;\n x *= d/2;\n }' New in 2019.2", - "markdown": "Reports assignments whose right side is a division that shouldn't be truncated to integer.\n\nWhile occasionally intended, this construction is often buggy.\n\n**Example:**\n\n\n int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result\n\n\nThis code should be replaced with:\n\n\n int x = 18;\n x *= 3.0/2;\n\n\nIn the inspection options, you can disable warnings for suspicious but possibly correct divisions,\nfor example, when the dividend can't be calculated statically.\n\n\n void calc(int d) {\n int x = 18;\n x *= d/2;\n }\n\n\nNew in 2019.2" + "text": "Reports methods that contain more than one loop statement. Example: The method below will be reported because it contains two loops: 'void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }' The following method will also be reported because it contains a nested loop: 'void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }'", + "markdown": "Reports methods that contain more than one loop statement.\n\n**Example:**\n\nThe method below will be reported because it contains two loops:\n\n\n void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }\n\nThe following method will also be reported because it contains a nested loop:\n\n\n void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -29833,8 +29833,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Method metrics", + "index": 95, "toolComponent": { "name": "QDJVMC" } @@ -29846,13 +29846,13 @@ ] }, { - "id": "MethodWithMultipleLoops", + "id": "NegativelyNamedBooleanVariable", "shortDescription": { - "text": "Method with multiple loops" + "text": "Negatively named boolean variable" }, "fullDescription": { - "text": "Reports methods that contain more than one loop statement. Example: The method below will be reported because it contains two loops: 'void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }' The following method will also be reported because it contains a nested loop: 'void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }'", - "markdown": "Reports methods that contain more than one loop statement.\n\n**Example:**\n\nThe method below will be reported because it contains two loops:\n\n\n void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }\n\nThe following method will also be reported because it contains a nested loop:\n\n\n void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }\n" + "text": "Reports negatively named variables, for example: 'disabled', 'hidden', or 'isNotChanged'. Usually, inverting the 'boolean' value and removing the negation from the name makes the code easier to understand. Example: 'boolean disabled = false;'", + "markdown": "Reports negatively named variables, for example: `disabled`, `hidden`, or `isNotChanged`.\n\nUsually, inverting the `boolean` value and removing the negation from the name makes the code easier to understand.\n\nExample:\n\n\n boolean disabled = false;\n" }, "defaultConfiguration": { "enabled": false, @@ -29865,8 +29865,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 95, + "id": "Java/Data flow", + "index": 23, "toolComponent": { "name": "QDJVMC" } @@ -30070,16 +30070,16 @@ ] }, { - "id": "ManualMinMaxCalculation", + "id": "SimplifiableConditionalExpression", "shortDescription": { - "text": "Manual min/max calculation" + "text": "Simplifiable conditional expression" }, "fullDescription": { - "text": "Reports cases where the minimum or the maximum of two numbers can be calculated using a 'Math.max()' or 'Math.min()' call, instead of doing it manually. Example: 'public int min(int a, int b) {\n return b < a ? b : a;\n }' After the quick-fix is applied: 'public int min(int a, int b) {\n return Math.min(a, b);\n }' Use the Disable for float and double option to disable this inspection for 'double' and 'float' types. This is useful because the quick-fix may slightly change the semantics for 'float'/ 'double' types when handling 'NaN'. Nevertheless, in most cases this will actually fix a subtle bug where 'NaN' is not taken into account. New in 2019.2", - "markdown": "Reports cases where the minimum or the maximum of two numbers can be calculated using a `Math.max()` or `Math.min()` call, instead of doing it manually.\n\n**Example:**\n\n\n public int min(int a, int b) {\n return b < a ? b : a;\n }\n\nAfter the quick-fix is applied:\n\n\n public int min(int a, int b) {\n return Math.min(a, b);\n }\n\n\nUse the **Disable for float and double** option to disable this inspection for `double` and `float` types.\nThis is useful because the quick-fix may slightly change the semantics for `float`/\n`double` types when handling `NaN`. Nevertheless, in most cases this will actually fix\na subtle bug where `NaN` is not taken into account.\n\nNew in 2019.2" + "text": "Reports conditional expressions and suggests simplifying them. Examples: 'condition ? true : foo → condition || foo' 'condition ? false : foo → !condition && foo' 'condition ? foo : !foo → condition == foo' 'condition ? true : false → condition' 'a == b ? b : a → a' 'result != null ? result : null → result'", + "markdown": "Reports conditional expressions and suggests simplifying them.\n\nExamples:\n\n condition ? true : foo → condition || foo\n\n condition ? false : foo → !condition && foo\n\n condition ? foo : !foo → condition == foo\n\n condition ? true : false → condition\n\n a == b ? b : a → a\n\n result != null ? result : null → result\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -30089,8 +30089,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 39, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -30102,16 +30102,16 @@ ] }, { - "id": "SimplifiableConditionalExpression", + "id": "ManualMinMaxCalculation", "shortDescription": { - "text": "Simplifiable conditional expression" + "text": "Manual min/max calculation" }, "fullDescription": { - "text": "Reports conditional expressions and suggests simplifying them. Examples: 'condition ? true : foo → condition || foo' 'condition ? false : foo → !condition && foo' 'condition ? foo : !foo → condition == foo' 'condition ? true : false → condition' 'a == b ? b : a → a' 'result != null ? result : null → result'", - "markdown": "Reports conditional expressions and suggests simplifying them.\n\nExamples:\n\n condition ? true : foo → condition || foo\n\n condition ? false : foo → !condition && foo\n\n condition ? foo : !foo → condition == foo\n\n condition ? true : false → condition\n\n a == b ? b : a → a\n\n result != null ? result : null → result\n" + "text": "Reports cases where the minimum or the maximum of two numbers can be calculated using a 'Math.max()' or 'Math.min()' call, instead of doing it manually. Example: 'public int min(int a, int b) {\n return b < a ? b : a;\n }' After the quick-fix is applied: 'public int min(int a, int b) {\n return Math.min(a, b);\n }' Use the Disable for float and double option to disable this inspection for 'double' and 'float' types. This is useful because the quick-fix may slightly change the semantics for 'float'/ 'double' types when handling 'NaN'. Nevertheless, in most cases this will actually fix a subtle bug where 'NaN' is not taken into account. New in 2019.2", + "markdown": "Reports cases where the minimum or the maximum of two numbers can be calculated using a `Math.max()` or `Math.min()` call, instead of doing it manually.\n\n**Example:**\n\n\n public int min(int a, int b) {\n return b < a ? b : a;\n }\n\nAfter the quick-fix is applied:\n\n\n public int min(int a, int b) {\n return Math.min(a, b);\n }\n\n\nUse the **Disable for float and double** option to disable this inspection for `double` and `float` types.\nThis is useful because the quick-fix may slightly change the semantics for `float`/\n`double` types when handling `NaN`. Nevertheless, in most cases this will actually fix\na subtle bug where `NaN` is not taken into account.\n\nNew in 2019.2" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -30121,8 +30121,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 27, + "id": "Java/Verbose or redundant code constructs", + "index": 39, "toolComponent": { "name": "QDJVMC" } @@ -30422,13 +30422,13 @@ ] }, { - "id": "UnnecessarySuperConstructor", + "id": "ThisEscapedInConstructor", "shortDescription": { - "text": "Unnecessary call to 'super()'" + "text": "'this' reference escaped in object construction" }, "fullDescription": { - "text": "Reports calls to no-arg superclass constructors during object construction. Such calls are unnecessary and may be removed. Example: 'class Foo {\n Foo() {\n super();\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n }\n }'", - "markdown": "Reports calls to no-arg superclass constructors during object construction.\n\nSuch calls are unnecessary and may be removed.\n\n**Example:**\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n }\n }\n" + "text": "Reports possible escapes of 'this' during the object initialization. The escapes occur when 'this' is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized. Example: 'class Foo {\n {\n System.out.println(this);\n }\n }'", + "markdown": "Reports possible escapes of `this` during the object initialization. The escapes occur when `this` is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized.\n\n**Example:**\n\n\n class Foo {\n {\n System.out.println(this);\n }\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -30441,8 +30441,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Initialization", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -30454,13 +30454,13 @@ ] }, { - "id": "ThisEscapedInConstructor", + "id": "UnnecessarySuperConstructor", "shortDescription": { - "text": "'this' reference escaped in object construction" + "text": "Unnecessary call to 'super()'" }, "fullDescription": { - "text": "Reports possible escapes of 'this' during the object initialization. The escapes occur when 'this' is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized. Example: 'class Foo {\n {\n System.out.println(this);\n }\n }'", - "markdown": "Reports possible escapes of `this` during the object initialization. The escapes occur when `this` is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized.\n\n**Example:**\n\n\n class Foo {\n {\n System.out.println(this);\n }\n }\n" + "text": "Reports calls to no-arg superclass constructors during object construction. Such calls are unnecessary and may be removed. Example: 'class Foo {\n Foo() {\n super();\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n }\n }'", + "markdown": "Reports calls to no-arg superclass constructors during object construction.\n\nSuch calls are unnecessary and may be removed.\n\n**Example:**\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n }\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -30473,8 +30473,8 @@ "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 28, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -30582,16 +30582,16 @@ ] }, { - "id": "UseOfObsoleteDateTimeApi", + "id": "InfiniteRecursion", "shortDescription": { - "text": "Use of obsolete date-time API" + "text": "Infinite recursion" }, "fullDescription": { - "text": "Reports usages of 'java.util.Date', 'java.util.Calendar', 'java.util.GregorianCalendar', 'java.util.TimeZone', and 'java.util.SimpleTimeZone'. While still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably not be used in new development.", - "markdown": "Reports usages of `java.util.Date`, `java.util.Calendar`, `java.util.GregorianCalendar`, `java.util.TimeZone`, and `java.util.SimpleTimeZone`.\n\nWhile still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably\nnot be used in new development." + "text": "Reports methods that call themselves infinitely unless an exception is thrown. Methods reported by this inspection cannot return normally. While such behavior may be intended, in many cases this is just an oversight. Example: 'int baz() {\n return baz();\n }'", + "markdown": "Reports methods that call themselves infinitely unless an exception is thrown.\n\n\nMethods reported by this inspection cannot return normally.\nWhile such behavior may be intended, in many cases this is just an oversight.\n\n**Example:**\n\n int baz() {\n return baz();\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -30601,8 +30601,40 @@ "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 49, + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NullArgumentToVariableArgMethod", + "shortDescription": { + "text": "Confusing argument to varargs method" + }, + "fullDescription": { + "text": "Reports calls to variable arity methods that have a single argument in the vararg parameter position, which is either a 'null' or an array of a subtype of the vararg parameter. Such an argument may be confusing as it is unclear if a varargs or non-varargs call is desired. Example: 'String[] ss = new String[]{\"foo\", \"bar\"};\n System.out.printf(\"%s\", ss);' In this example only the first element of the array will be printed, not the entire array.", + "markdown": "Reports calls to variable arity methods that have a single argument in the vararg parameter position, which is either a `null` or an array of a subtype of the vararg parameter. Such an argument may be confusing as it is unclear if a varargs or non-varargs call is desired.\n\n**Example:**\n\n\n String[] ss = new String[]{\"foo\", \"bar\"};\n System.out.printf(\"%s\", ss);\n\nIn this example only the first element of the array will be printed, not the entire array." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -30646,48 +30678,16 @@ ] }, { - "id": "InfiniteRecursion", - "shortDescription": { - "text": "Infinite recursion" - }, - "fullDescription": { - "text": "Reports methods that call themselves infinitely unless an exception is thrown. Methods reported by this inspection cannot return normally. While such behavior may be intended, in many cases this is just an oversight. Example: 'int baz() {\n return baz();\n }'", - "markdown": "Reports methods that call themselves infinitely unless an exception is thrown.\n\n\nMethods reported by this inspection cannot return normally.\nWhile such behavior may be intended, in many cases this is just an oversight.\n\n**Example:**\n\n int baz() {\n return baz();\n }\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Probable bugs", - "index": 13, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NullArgumentToVariableArgMethod", + "id": "UseOfObsoleteDateTimeApi", "shortDescription": { - "text": "Confusing argument to varargs method" + "text": "Use of obsolete date-time API" }, "fullDescription": { - "text": "Reports calls to variable arity methods that have a single argument in the vararg parameter position, which is either a 'null' or an array of a subtype of the vararg parameter. Such an argument may be confusing as it is unclear if a varargs or non-varargs call is desired. Example: 'String[] ss = new String[]{\"foo\", \"bar\"};\n System.out.printf(\"%s\", ss);' In this example only the first element of the array will be printed, not the entire array.", - "markdown": "Reports calls to variable arity methods that have a single argument in the vararg parameter position, which is either a `null` or an array of a subtype of the vararg parameter. Such an argument may be confusing as it is unclear if a varargs or non-varargs call is desired.\n\n**Example:**\n\n\n String[] ss = new String[]{\"foo\", \"bar\"};\n System.out.printf(\"%s\", ss);\n\nIn this example only the first element of the array will be printed, not the entire array." + "text": "Reports usages of 'java.util.Date', 'java.util.Calendar', 'java.util.GregorianCalendar', 'java.util.TimeZone', and 'java.util.SimpleTimeZone'. While still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably not be used in new development.", + "markdown": "Reports usages of `java.util.Date`, `java.util.Calendar`, `java.util.GregorianCalendar`, `java.util.TimeZone`, and `java.util.SimpleTimeZone`.\n\nWhile still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably\nnot be used in new development." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -30697,8 +30697,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Code maturity", + "index": 49, "toolComponent": { "name": "QDJVMC" } @@ -31842,27 +31842,27 @@ ] }, { - "id": "PropertyName", + "id": "InlineClassDeprecatedMigration", "shortDescription": { - "text": "Property naming convention" + "text": "Inline classes are deprecated since 1.5" }, "fullDescription": { - "text": "Reports property names that do not follow the recommended naming conventions. Consistent naming allows for easier code reading and understanding. According to the Kotlin official style guide, property names should start with a lowercase letter and use camel case. It is possible to introduce other naming rules by changing the \"Pattern\" regular expression. Example: 'val My_Cool_Property = \"\"' The quick-fix renames the class according to the Kotlin naming conventions: 'val myCoolProperty = \"\"'", - "markdown": "Reports property names that do not follow the recommended naming conventions.\n\n\nConsistent naming allows for easier code reading and understanding.\nAccording to the [Kotlin official style guide](https://kotlinlang.org/docs/coding-conventions.html#naming-rules),\nproperty names should start with a lowercase letter and use camel case.\n\nIt is possible to introduce other naming rules by changing the \"Pattern\" regular expression.\n\n**Example:**\n\n\n val My_Cool_Property = \"\"\n\nThe quick-fix renames the class according to the Kotlin naming conventions:\n\n\n val myCoolProperty = \"\"\n" + "text": "Reports inline classes that are deprecated and cause compilation warnings in Kotlin 1.5 and later. See What's new in Kotlin 1.5.0 Example: 'inline class Password(val s: String)' After the quick-fix is applied: '@JvmInline\n value class Password(val s: String)' Inspection is available for Kotlin language level starting from 1.5.", + "markdown": "Reports inline classes that are deprecated and cause compilation warnings in Kotlin 1.5 and later.\nSee [What's new in Kotlin 1.5.0](https://kotlinlang.org/docs/whatsnew15.html#inline-classes)\n\nExample:\n\n\n inline class Password(val s: String)\n\nAfter the quick-fix is applied:\n\n\n @JvmInline\n value class Password(val s: String)\n\nInspection is available for Kotlin language level starting from 1.5." }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Naming conventions", - "index": 48, + "id": "Kotlin/Migration", + "index": 16, "toolComponent": { "name": "QDJVMC" } @@ -31874,27 +31874,27 @@ ] }, { - "id": "InlineClassDeprecatedMigration", + "id": "PropertyName", "shortDescription": { - "text": "Inline classes are deprecated since 1.5" + "text": "Property naming convention" }, "fullDescription": { - "text": "Reports inline classes that are deprecated and cause compilation warnings in Kotlin 1.5 and later. See What's new in Kotlin 1.5.0 Example: 'inline class Password(val s: String)' After the quick-fix is applied: '@JvmInline\n value class Password(val s: String)' Inspection is available for Kotlin language level starting from 1.5.", - "markdown": "Reports inline classes that are deprecated and cause compilation warnings in Kotlin 1.5 and later.\nSee [What's new in Kotlin 1.5.0](https://kotlinlang.org/docs/whatsnew15.html#inline-classes)\n\nExample:\n\n\n inline class Password(val s: String)\n\nAfter the quick-fix is applied:\n\n\n @JvmInline\n value class Password(val s: String)\n\nInspection is available for Kotlin language level starting from 1.5." + "text": "Reports property names that do not follow the recommended naming conventions. Consistent naming allows for easier code reading and understanding. According to the Kotlin official style guide, property names should start with a lowercase letter and use camel case. It is possible to introduce other naming rules by changing the \"Pattern\" regular expression. Example: 'val My_Cool_Property = \"\"' The quick-fix renames the class according to the Kotlin naming conventions: 'val myCoolProperty = \"\"'", + "markdown": "Reports property names that do not follow the recommended naming conventions.\n\n\nConsistent naming allows for easier code reading and understanding.\nAccording to the [Kotlin official style guide](https://kotlinlang.org/docs/coding-conventions.html#naming-rules),\nproperty names should start with a lowercase letter and use camel case.\n\nIt is possible to introduce other naming rules by changing the \"Pattern\" regular expression.\n\n**Example:**\n\n\n val My_Cool_Property = \"\"\n\nThe quick-fix renames the class according to the Kotlin naming conventions:\n\n\n val myCoolProperty = \"\"\n" }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 16, + "id": "Kotlin/Naming conventions", + "index": 48, "toolComponent": { "name": "QDJVMC" } @@ -31990,7 +31990,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 52, + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -32374,7 +32374,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 52, + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -32418,20 +32418,20 @@ ] }, { - "id": "ReplaceGuardClauseWithFunctionCall", + "id": "ReplaceSizeZeroCheckWithIsEmpty", "shortDescription": { - "text": "Guard clause can be replaced with Kotlin's function call" + "text": "Size zero check can be replaced with 'isEmpty()'" }, "fullDescription": { - "text": "Reports guard clauses that can be replaced with a function call. Example: 'fun test(foo: Int?) {\n if (foo == null) throw IllegalArgumentException(\"foo\") // replaceable clause\n }' After the quick-fix is applied: 'fun test(foo: Int?) {\n checkNotNull(foo)\n }'", - "markdown": "Reports guard clauses that can be replaced with a function call.\n\n**Example:**\n\n fun test(foo: Int?) {\n if (foo == null) throw IllegalArgumentException(\"foo\") // replaceable clause\n }\n\nAfter the quick-fix is applied:\n\n fun test(foo: Int?) {\n checkNotNull(foo)\n }\n" + "text": "Reports 'size == 0' checks on 'Collections/Array/String' that should be replaced with 'isEmpty()'. Using 'isEmpty()' makes your code simpler. The quick-fix replaces the size check with 'isEmpty()'. Example: 'fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.size == 0\n }' After the quick-fix is applied: 'fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.isEmpty()\n }'", + "markdown": "Reports `size == 0` checks on `Collections/Array/String` that should be replaced with `isEmpty()`.\n\nUsing `isEmpty()` makes your code simpler.\n\nThe quick-fix replaces the size check with `isEmpty()`.\n\n**Example:**\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.size == 0\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.isEmpty()\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ @@ -32450,20 +32450,20 @@ ] }, { - "id": "ReplaceSizeZeroCheckWithIsEmpty", + "id": "ReplaceGuardClauseWithFunctionCall", "shortDescription": { - "text": "Size zero check can be replaced with 'isEmpty()'" + "text": "Guard clause can be replaced with Kotlin's function call" }, "fullDescription": { - "text": "Reports 'size == 0' checks on 'Collections/Array/String' that should be replaced with 'isEmpty()'. Using 'isEmpty()' makes your code simpler. The quick-fix replaces the size check with 'isEmpty()'. Example: 'fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.size == 0\n }' After the quick-fix is applied: 'fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.isEmpty()\n }'", - "markdown": "Reports `size == 0` checks on `Collections/Array/String` that should be replaced with `isEmpty()`.\n\nUsing `isEmpty()` makes your code simpler.\n\nThe quick-fix replaces the size check with `isEmpty()`.\n\n**Example:**\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.size == 0\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.isEmpty()\n }\n" + "text": "Reports guard clauses that can be replaced with a function call. Example: 'fun test(foo: Int?) {\n if (foo == null) throw IllegalArgumentException(\"foo\") // replaceable clause\n }' After the quick-fix is applied: 'fun test(foo: Int?) {\n checkNotNull(foo)\n }'", + "markdown": "Reports guard clauses that can be replaced with a function call.\n\n**Example:**\n\n fun test(foo: Int?) {\n if (foo == null) throw IllegalArgumentException(\"foo\") // replaceable clause\n }\n\nAfter the quick-fix is applied:\n\n fun test(foo: Int?) {\n checkNotNull(foo)\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ @@ -32578,27 +32578,27 @@ ] }, { - "id": "FakeJvmFieldConstant", + "id": "ProtectedInFinal", "shortDescription": { - "text": "Kotlin non-const property used as Java constant" + "text": "'protected' visibility is effectively 'private' in a final class" }, "fullDescription": { - "text": "Reports Kotlin properties that are not 'const' and used as Java annotation arguments. For example, a property with the '@JvmField' annotation has an initializer that can be evaluated at compile-time, and it has a primitive or 'String' type. Such properties have a 'ConstantValue' attribute in bytecode in Kotlin 1.1-1.2. This attribute allows javac to fold usages of the corresponding field and use that field in annotations. This can lead to incorrect behavior in the case of separate or incremental compilation in mixed Java/Kotlin code. This behavior is subject to change in Kotlin 1.3 (no 'ConstantValue' attribute any more). Example: Kotlin code in foo.kt file: 'annotation class Ann(val s: String)\n @JvmField val importantString = \"important\"' Java code: 'public class JavaUser {\n // This is dangerous\n @Ann(s = FooKt.importantString)\n public void foo() {}\n }' To fix the problem replace the '@JvmField' annotation with the 'const' modifier on a relevant Kotlin property or inline it.", - "markdown": "Reports Kotlin properties that are not `const` and used as Java annotation arguments.\n\n\nFor example, a property with the `@JvmField` annotation has an initializer that can be evaluated at compile-time,\nand it has a primitive or `String` type.\n\n\nSuch properties have a `ConstantValue` attribute in bytecode in Kotlin 1.1-1.2.\nThis attribute allows javac to fold usages of the corresponding field and use that field in annotations.\nThis can lead to incorrect behavior in the case of separate or incremental compilation in mixed Java/Kotlin code.\nThis behavior is subject to change in Kotlin 1.3 (no `ConstantValue` attribute any more).\n\n**Example:**\n\nKotlin code in foo.kt file:\n\n\n annotation class Ann(val s: String)\n @JvmField val importantString = \"important\"\n\nJava code:\n\n\n public class JavaUser {\n // This is dangerous\n @Ann(s = FooKt.importantString)\n public void foo() {}\n }\n\nTo fix the problem replace the `@JvmField` annotation with the `const` modifier on a relevant Kotlin property or inline it." + "text": "Reports 'protected' visibility used inside of a 'final' class. In such cases 'protected' members are accessible only in the class itself, so they are effectively 'private'. Example: 'class FinalClass {\n protected fun foo() {}\n }' After the quick-fix is applied: 'class FinalClass {\n private fun foo() {}\n }'", + "markdown": "Reports `protected` visibility used inside of a `final` class. In such cases `protected` members are accessible only in the class itself, so they are effectively `private`.\n\n**Example:**\n\n\n class FinalClass {\n protected fun foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class FinalClass {\n private fun foo() {}\n }\n" }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin/Java interop issues", - "index": 69, + "id": "Kotlin/Style issues", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -32610,27 +32610,27 @@ ] }, { - "id": "ProtectedInFinal", + "id": "FakeJvmFieldConstant", "shortDescription": { - "text": "'protected' visibility is effectively 'private' in a final class" + "text": "Kotlin non-const property used as Java constant" }, "fullDescription": { - "text": "Reports 'protected' visibility used inside of a 'final' class. In such cases 'protected' members are accessible only in the class itself, so they are effectively 'private'. Example: 'class FinalClass {\n protected fun foo() {}\n }' After the quick-fix is applied: 'class FinalClass {\n private fun foo() {}\n }'", - "markdown": "Reports `protected` visibility used inside of a `final` class. In such cases `protected` members are accessible only in the class itself, so they are effectively `private`.\n\n**Example:**\n\n\n class FinalClass {\n protected fun foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class FinalClass {\n private fun foo() {}\n }\n" + "text": "Reports Kotlin properties that are not 'const' and used as Java annotation arguments. For example, a property with the '@JvmField' annotation has an initializer that can be evaluated at compile-time, and it has a primitive or 'String' type. Such properties have a 'ConstantValue' attribute in bytecode in Kotlin 1.1-1.2. This attribute allows javac to fold usages of the corresponding field and use that field in annotations. This can lead to incorrect behavior in the case of separate or incremental compilation in mixed Java/Kotlin code. This behavior is subject to change in Kotlin 1.3 (no 'ConstantValue' attribute any more). Example: Kotlin code in foo.kt file: 'annotation class Ann(val s: String)\n @JvmField val importantString = \"important\"' Java code: 'public class JavaUser {\n // This is dangerous\n @Ann(s = FooKt.importantString)\n public void foo() {}\n }' To fix the problem replace the '@JvmField' annotation with the 'const' modifier on a relevant Kotlin property or inline it.", + "markdown": "Reports Kotlin properties that are not `const` and used as Java annotation arguments.\n\n\nFor example, a property with the `@JvmField` annotation has an initializer that can be evaluated at compile-time,\nand it has a primitive or `String` type.\n\n\nSuch properties have a `ConstantValue` attribute in bytecode in Kotlin 1.1-1.2.\nThis attribute allows javac to fold usages of the corresponding field and use that field in annotations.\nThis can lead to incorrect behavior in the case of separate or incremental compilation in mixed Java/Kotlin code.\nThis behavior is subject to change in Kotlin 1.3 (no `ConstantValue` attribute any more).\n\n**Example:**\n\nKotlin code in foo.kt file:\n\n\n annotation class Ann(val s: String)\n @JvmField val importantString = \"important\"\n\nJava code:\n\n\n public class JavaUser {\n // This is dangerous\n @Ann(s = FooKt.importantString)\n public void foo() {}\n }\n\nTo fix the problem replace the `@JvmField` annotation with the `const` modifier on a relevant Kotlin property or inline it." }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 4, + "id": "Kotlin/Java interop issues", + "index": 69, "toolComponent": { "name": "QDJVMC" } @@ -32866,16 +32866,16 @@ ] }, { - "id": "ReplaceAssertBooleanWithAssertEquality", + "id": "DeprecatedCallableAddReplaceWith", "shortDescription": { - "text": "Assert boolean could be replaced with assert equality" + "text": "@Deprecated annotation without 'replaceWith' argument" }, "fullDescription": { - "text": "Reports calls to 'assertTrue()' and 'assertFalse()' that can be replaced with assert equality functions. 'assertEquals()', 'assertSame()', and their negating counterparts (-Not-) provide more informative messages on failure. Example: 'assertTrue(a == b)' After the quick-fix is applied: 'assertEquals(a, b)'", - "markdown": "Reports calls to `assertTrue()` and `assertFalse()` that can be replaced with assert equality functions.\n\n\n`assertEquals()`, `assertSame()`, and their negating counterparts (-Not-) provide more informative messages on\nfailure.\n\n**Example:**\n\n assertTrue(a == b)\n\nAfter the quick-fix is applied:\n\n assertEquals(a, b)\n" + "text": "Reports deprecated functions and properties that do not have the 'kotlin.ReplaceWith' argument in its 'kotlin.deprecated' annotation and suggests to add one based on their body. Kotlin provides the 'ReplaceWith' argument to replace deprecated declarations automatically. It is recommended to use the argument to fix deprecation issues in code. Example: '@Deprecated(\"Use refined() instead.\")\n fun deprecated() = refined()\n\n fun refined() = 42' The quick-fix adds the 'ReplaceWith()' argument: '@Deprecated(\"Use refined() instead.\", ReplaceWith(\"refined()\"))\n fun deprecated() = refined()\n\n fun refined() = 42'", + "markdown": "Reports deprecated functions and properties that do not have the `kotlin.ReplaceWith` argument in its `kotlin.deprecated` annotation and suggests to add one based on their body.\n\n\nKotlin provides the `ReplaceWith` argument to replace deprecated declarations automatically.\nIt is recommended to use the argument to fix deprecation issues in code.\n\n**Example:**\n\n\n @Deprecated(\"Use refined() instead.\")\n fun deprecated() = refined()\n\n fun refined() = 42\n\nThe quick-fix adds the `ReplaceWith()` argument:\n\n\n @Deprecated(\"Use refined() instead.\", ReplaceWith(\"refined()\"))\n fun deprecated() = refined()\n\n fun refined() = 42\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "note", "parameters": { "ideaSeverity": "WEAK WARNING", @@ -32885,8 +32885,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 4, + "id": "Kotlin/Other problems", + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -32898,16 +32898,16 @@ ] }, { - "id": "DeprecatedCallableAddReplaceWith", + "id": "ReplaceAssertBooleanWithAssertEquality", "shortDescription": { - "text": "@Deprecated annotation without 'replaceWith' argument" + "text": "Assert boolean could be replaced with assert equality" }, "fullDescription": { - "text": "Reports deprecated functions and properties that do not have the 'kotlin.ReplaceWith' argument in its 'kotlin.deprecated' annotation and suggests to add one based on their body. Kotlin provides the 'ReplaceWith' argument to replace deprecated declarations automatically. It is recommended to use the argument to fix deprecation issues in code. Example: '@Deprecated(\"Use refined() instead.\")\n fun deprecated() = refined()\n\n fun refined() = 42' The quick-fix adds the 'ReplaceWith()' argument: '@Deprecated(\"Use refined() instead.\", ReplaceWith(\"refined()\"))\n fun deprecated() = refined()\n\n fun refined() = 42'", - "markdown": "Reports deprecated functions and properties that do not have the `kotlin.ReplaceWith` argument in its `kotlin.deprecated` annotation and suggests to add one based on their body.\n\n\nKotlin provides the `ReplaceWith` argument to replace deprecated declarations automatically.\nIt is recommended to use the argument to fix deprecation issues in code.\n\n**Example:**\n\n\n @Deprecated(\"Use refined() instead.\")\n fun deprecated() = refined()\n\n fun refined() = 42\n\nThe quick-fix adds the `ReplaceWith()` argument:\n\n\n @Deprecated(\"Use refined() instead.\", ReplaceWith(\"refined()\"))\n fun deprecated() = refined()\n\n fun refined() = 42\n" + "text": "Reports calls to 'assertTrue()' and 'assertFalse()' that can be replaced with assert equality functions. 'assertEquals()', 'assertSame()', and their negating counterparts (-Not-) provide more informative messages on failure. Example: 'assertTrue(a == b)' After the quick-fix is applied: 'assertEquals(a, b)'", + "markdown": "Reports calls to `assertTrue()` and `assertFalse()` that can be replaced with assert equality functions.\n\n\n`assertEquals()`, `assertSame()`, and their negating counterparts (-Not-) provide more informative messages on\nfailure.\n\n**Example:**\n\n assertTrue(a == b)\n\nAfter the quick-fix is applied:\n\n assertEquals(a, b)\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "note", "parameters": { "ideaSeverity": "WEAK WARNING", @@ -32917,8 +32917,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Other problems", - "index": 52, + "id": "Kotlin/Style issues", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -33122,13 +33122,13 @@ ] }, { - "id": "IfThenToElvis", + "id": "ObjectPrivatePropertyName", "shortDescription": { - "text": "If-Then foldable to '?:'" + "text": "Object private property naming convention" }, "fullDescription": { - "text": "Reports 'if-then' expressions that can be folded into elvis ('?:') expressions. Example: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo' The quick fix converts the 'if-then' expression into an elvis ('?:') expression: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"'", - "markdown": "Reports `if-then` expressions that can be folded into elvis (`?:`) expressions.\n\n**Example:**\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo\n\nThe quick fix converts the `if-then` expression into an elvis (`?:`) expression:\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"\n" + "text": "Reports properties that do not follow the naming conventions. The following properties are reported: Private properties in objects and companion objects You can specify the required pattern in the inspection options. Recommended naming conventions: it has to start with an underscore or an uppercase letter, use camel case. Example: 'class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }'", + "markdown": "Reports properties that do not follow the naming conventions.\n\nThe following properties are reported:\n\n* Private properties in objects and companion objects\n\nYou can specify the required pattern in the inspection options.\n\n[Recommended naming conventions](https://kotlinlang.org/docs/coding-conventions.html#naming-rules): it has to start with an underscore or an uppercase letter, use camel case.\n\n**Example:**\n\n\n class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -33141,8 +33141,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 4, + "id": "Kotlin/Naming conventions", + "index": 48, "toolComponent": { "name": "QDJVMC" } @@ -33154,13 +33154,13 @@ ] }, { - "id": "ObjectPrivatePropertyName", + "id": "IfThenToElvis", "shortDescription": { - "text": "Object private property naming convention" + "text": "If-Then foldable to '?:'" }, "fullDescription": { - "text": "Reports properties that do not follow the naming conventions. The following properties are reported: Private properties in objects and companion objects You can specify the required pattern in the inspection options. Recommended naming conventions: it has to start with an underscore or an uppercase letter, use camel case. Example: 'class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }'", - "markdown": "Reports properties that do not follow the naming conventions.\n\nThe following properties are reported:\n\n* Private properties in objects and companion objects\n\nYou can specify the required pattern in the inspection options.\n\n[Recommended naming conventions](https://kotlinlang.org/docs/coding-conventions.html#naming-rules): it has to start with an underscore or an uppercase letter, use camel case.\n\n**Example:**\n\n\n class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }\n" + "text": "Reports 'if-then' expressions that can be folded into elvis ('?:') expressions. Example: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo' The quick fix converts the 'if-then' expression into an elvis ('?:') expression: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"'", + "markdown": "Reports `if-then` expressions that can be folded into elvis (`?:`) expressions.\n\n**Example:**\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo\n\nThe quick fix converts the `if-then` expression into an elvis (`?:`) expression:\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"\n" }, "defaultConfiguration": { "enabled": false, @@ -33173,8 +33173,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Naming conventions", - "index": 48, + "id": "Kotlin/Style issues", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -33250,20 +33250,20 @@ ] }, { - "id": "ReplaceStringFormatWithLiteral", + "id": "ReplaceNotNullAssertionWithElvisReturn", "shortDescription": { - "text": "'String.format' call can be replaced with string templates" + "text": "Not-null assertion can be replaced with 'return'" }, "fullDescription": { - "text": "Reports 'String.format' calls that can be replaced with string templates. Using string templates makes your code simpler. The quick-fix replaces the call with a string template. Example: 'fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }' After the quick-fix is applied: 'fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }'", - "markdown": "Reports `String.format` calls that can be replaced with string templates.\n\nUsing string templates makes your code simpler.\n\nThe quick-fix replaces the call with a string template.\n\n**Example:**\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }\n" + "text": "Reports not-null assertion ('!!') calls that can be replaced with the elvis operator and return ('?: return'). A not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of '!!' is good practice. The quick-fix replaces the not-null assertion with 'return' or 'return null'. Example: 'fun test(number: Int?) {\n val x = number!!\n }' After the quick-fix is applied: 'fun test(number: Int?) {\n val x = number ?: return\n }'", + "markdown": "Reports not-null assertion (`!!`) calls that can be replaced with the elvis operator and return (`?: return`).\n\nA not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of `!!` is good practice.\n\nThe quick-fix replaces the not-null assertion with `return` or `return null`.\n\n**Example:**\n\n\n fun test(number: Int?) {\n val x = number!!\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(number: Int?) {\n val x = number ?: return\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ @@ -33282,20 +33282,20 @@ ] }, { - "id": "ReplaceNotNullAssertionWithElvisReturn", + "id": "ReplaceStringFormatWithLiteral", "shortDescription": { - "text": "Not-null assertion can be replaced with 'return'" + "text": "'String.format' call can be replaced with string templates" }, "fullDescription": { - "text": "Reports not-null assertion ('!!') calls that can be replaced with the elvis operator and return ('?: return'). A not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of '!!' is good practice. The quick-fix replaces the not-null assertion with 'return' or 'return null'. Example: 'fun test(number: Int?) {\n val x = number!!\n }' After the quick-fix is applied: 'fun test(number: Int?) {\n val x = number ?: return\n }'", - "markdown": "Reports not-null assertion (`!!`) calls that can be replaced with the elvis operator and return (`?: return`).\n\nA not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of `!!` is good practice.\n\nThe quick-fix replaces the not-null assertion with `return` or `return null`.\n\n**Example:**\n\n\n fun test(number: Int?) {\n val x = number!!\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(number: Int?) {\n val x = number ?: return\n }\n" + "text": "Reports 'String.format' calls that can be replaced with string templates. Using string templates makes your code simpler. The quick-fix replaces the call with a string template. Example: 'fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }' After the quick-fix is applied: 'fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }'", + "markdown": "Reports `String.format` calls that can be replaced with string templates.\n\nUsing string templates makes your code simpler.\n\nThe quick-fix replaces the call with a string template.\n\n**Example:**\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ @@ -34166,7 +34166,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 52, + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -34326,7 +34326,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 52, + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -34518,7 +34518,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 52, + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -34817,38 +34817,6 @@ } ] }, - { - "id": "DeprecatedMavenDependency", - "shortDescription": { - "text": "Deprecated library is used in Maven" - }, - "fullDescription": { - "text": "Reports deprecated maven dependency. Example: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n ' The quick fix changes the deprecated dependency to a maintained one: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n '", - "markdown": "Reports deprecated maven dependency.\n\n**Example:**\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n \n\nThe quick fix changes the deprecated dependency to a maintained one:\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n \n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Kotlin", - "index": 3, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "EnumEntryName", "shortDescription": { @@ -34913,6 +34881,38 @@ } ] }, + { + "id": "DeprecatedMavenDependency", + "shortDescription": { + "text": "Deprecated library is used in Maven" + }, + "fullDescription": { + "text": "Reports deprecated maven dependency. Example: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n ' The quick fix changes the deprecated dependency to a maintained one: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n '", + "markdown": "Reports deprecated maven dependency.\n\n**Example:**\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n \n\nThe quick fix changes the deprecated dependency to a maintained one:\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n \n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "ReplaceSubstringWithDropLast", "shortDescription": { @@ -35094,7 +35094,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 52, + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -35298,13 +35298,13 @@ ] }, { - "id": "WarningOnMainUnusedParameterMigration", + "id": "RedundantWith", "shortDescription": { - "text": "Unused 'args' on 'main' since 1.4" + "text": "Redundant 'with' call" }, "fullDescription": { - "text": "Reports 'main' function with an unused single parameter. Since Kotlin 1.4, it is possible to use the 'main' function without parameter as the entry point to the Kotlin program. The compiler reports a warning for the 'main' function with an unused parameter.", - "markdown": "Reports `main` function with an unused single parameter.\n\nSince Kotlin 1.4, it is possible to use the `main` function without parameter as the entry point to the Kotlin program.\nThe compiler reports a warning for the `main` function with an unused parameter." + "text": "Reports redundant 'with' function calls that don't access anything from the receiver. Examples: 'class MyClass {\n fun f(): String = \"\"\n }\n\n fun testRedundant() {\n with(c) { // <== 'with' is redundant since 'c' isn't used\n println(\"1\")\n }\n }\n\n fun testOk() {\n val c = MyClass()\n with(c) { // <== OK because 'f()' is effectively 'c.f()'\n println(f())\n }\n }'", + "markdown": "Reports redundant `with` function calls that don't access anything from the receiver.\n\n**Examples:**\n\n\n class MyClass {\n fun f(): String = \"\"\n }\n\n fun testRedundant() {\n with(c) { // <== 'with' is redundant since 'c' isn't used\n println(\"1\")\n }\n }\n\n fun testOk() {\n val c = MyClass()\n with(c) { // <== OK because 'f()' is effectively 'c.f()'\n println(f())\n }\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -35317,8 +35317,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 16, + "id": "Kotlin/Redundant constructs", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -35330,13 +35330,13 @@ ] }, { - "id": "RedundantWith", + "id": "WarningOnMainUnusedParameterMigration", "shortDescription": { - "text": "Redundant 'with' call" + "text": "Unused 'args' on 'main' since 1.4" }, "fullDescription": { - "text": "Reports redundant 'with' function calls that don't access anything from the receiver. Examples: 'class MyClass {\n fun f(): String = \"\"\n }\n\n fun testRedundant() {\n with(c) { // <== 'with' is redundant since 'c' isn't used\n println(\"1\")\n }\n }\n\n fun testOk() {\n val c = MyClass()\n with(c) { // <== OK because 'f()' is effectively 'c.f()'\n println(f())\n }\n }'", - "markdown": "Reports redundant `with` function calls that don't access anything from the receiver.\n\n**Examples:**\n\n\n class MyClass {\n fun f(): String = \"\"\n }\n\n fun testRedundant() {\n with(c) { // <== 'with' is redundant since 'c' isn't used\n println(\"1\")\n }\n }\n\n fun testOk() {\n val c = MyClass()\n with(c) { // <== OK because 'f()' is effectively 'c.f()'\n println(f())\n }\n }\n" + "text": "Reports 'main' function with an unused single parameter. Since Kotlin 1.4, it is possible to use the 'main' function without parameter as the entry point to the Kotlin program. The compiler reports a warning for the 'main' function with an unused parameter.", + "markdown": "Reports `main` function with an unused single parameter.\n\nSince Kotlin 1.4, it is possible to use the `main` function without parameter as the entry point to the Kotlin program.\nThe compiler reports a warning for the `main` function with an unused parameter." }, "defaultConfiguration": { "enabled": false, @@ -35349,8 +35349,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 5, + "id": "Kotlin/Migration", + "index": 16, "toolComponent": { "name": "QDJVMC" } @@ -37398,7 +37398,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 52, + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -37826,27 +37826,27 @@ ] }, { - "id": "ConvertTwoComparisonsToRangeCheck", + "id": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", "shortDescription": { - "text": "Two comparisons should be converted to a range check" + "text": "Meaningless annotations targets on superclass" }, "fullDescription": { - "text": "Reports two consecutive comparisons that can be converted to a range check. Checking against a range makes code simpler by removing test subject duplication. Example: 'fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }' The quick-fix replaces the comparison-based check with a range one: 'fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }'", - "markdown": "Reports two consecutive comparisons that can be converted to a range check.\n\nChecking against a range makes code simpler by removing test subject duplication.\n\n**Example:**\n\n\n fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }\n\nThe quick-fix replaces the comparison-based check with a range one:\n\n\n fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }\n" + "text": "Reports meaningless annotation targets on superclasses since Kotlin 1.4. Annotation targets such as '@get:' are meaningless on superclasses and are prohibited. Example: 'interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo' After the quick-fix is applied: 'interface Foo\n\n annotation class Ann\n\n class E : Foo' This inspection only reports if the Kotlin language level of the project or module is 1.4 or higher.", + "markdown": "Reports meaningless annotation targets on superclasses since Kotlin 1.4.\n\nAnnotation targets such as `@get:` are meaningless on superclasses and are prohibited.\n\n**Example:**\n\n\n interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo\n\nAfter the quick-fix is applied:\n\n\n interface Foo\n\n annotation class Ann\n\n class E : Foo\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "error", "parameters": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 4, + "id": "Kotlin/Migration", + "index": 16, "toolComponent": { "name": "QDJVMC" } @@ -37858,27 +37858,27 @@ ] }, { - "id": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", + "id": "ConvertTwoComparisonsToRangeCheck", "shortDescription": { - "text": "Meaningless annotations targets on superclass" + "text": "Two comparisons should be converted to a range check" }, "fullDescription": { - "text": "Reports meaningless annotation targets on superclasses since Kotlin 1.4. Annotation targets such as '@get:' are meaningless on superclasses and are prohibited. Example: 'interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo' After the quick-fix is applied: 'interface Foo\n\n annotation class Ann\n\n class E : Foo' This inspection only reports if the Kotlin language level of the project or module is 1.4 or higher.", - "markdown": "Reports meaningless annotation targets on superclasses since Kotlin 1.4.\n\nAnnotation targets such as `@get:` are meaningless on superclasses and are prohibited.\n\n**Example:**\n\n\n interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo\n\nAfter the quick-fix is applied:\n\n\n interface Foo\n\n annotation class Ann\n\n class E : Foo\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." + "text": "Reports two consecutive comparisons that can be converted to a range check. Checking against a range makes code simpler by removing test subject duplication. Example: 'fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }' The quick-fix replaces the comparison-based check with a range one: 'fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }'", + "markdown": "Reports two consecutive comparisons that can be converted to a range check.\n\nChecking against a range makes code simpler by removing test subject duplication.\n\n**Example:**\n\n\n fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }\n\nThe quick-fix replaces the comparison-based check with a range one:\n\n\n fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }\n" }, "defaultConfiguration": { "enabled": false, - "level": "error", + "level": "note", "parameters": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 16, + "id": "Kotlin/Style issues", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -37910,7 +37910,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 52, + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -37986,16 +37986,16 @@ ] }, { - "id": "EnumValuesSoftDeprecate", + "id": "RemoveRedundantQualifierName", "shortDescription": { - "text": "'Enum.values()' is recommended to be replaced by 'Enum.entries' since 1.9" + "text": "Redundant qualifier name" }, "fullDescription": { - "text": "Reports calls to 'values()' method in enum classes from Kotlin that can be replaced with 'entries' property read. Use of 'Enum.entries' may improve performance of your code. The quick-fix replaces 'values()' with 'entries'. More details: KT-48872 Provide modern and performant replacement for Enum.values() Note: 'entries' property type is different from the return type of 'values()' method ('EnumEntries' which inherits from 'List' instead of 'Array'). Due to this in some cases quick fix inserts extra '.toTypedArray()' conversion to not break the code, but for most common cases replacement will be done without it (e.g. in 'for' loop). Example: 'enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())' After the quick-fix is applied: 'enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())'", - "markdown": "Reports calls to `values()` method in enum classes from Kotlin that can be replaced with `entries` property read.\n\n\nUse of `Enum.entries` may improve performance of your code.\n\n\nThe quick-fix replaces `values()` with `entries`.\n\n\n**More details:** [KT-48872 Provide modern and performant replacement for Enum.values()](https://youtrack.jetbrains.com/issue/KT-48872)\n\n\n**Note:** `entries` property type is different from the return type of `values()` method\n(`EnumEntries` which inherits from `List` instead of `Array`).\nDue to this in some cases quick fix inserts extra `.toTypedArray()` conversion to not break the code, but\nfor most common cases replacement will be done without it (e.g. in `for` loop).\n\n**Example:**\n\n\n enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())\n\nAfter the quick-fix is applied:\n\n\n enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())\n" + "text": "Reports redundant qualifiers (or their parts) on class names, functions, and properties. A fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to. In the contexts where the name can be shortened, the inspection informs on the opportunity and the associated 'Remove redundant qualifier name' quick-fix allows amending the code. Examples: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }' After the quick-fix is applied: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }'", + "markdown": "Reports redundant qualifiers (or their parts) on class names, functions, and properties.\n\n\nA fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to.\nIn the contexts where the name can be shortened, the inspection informs on the opportunity and the associated\n'Remove redundant qualifier name' quick-fix allows amending the code.\n\n**Examples:**\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }\n\nAfter the quick-fix is applied:\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -38005,8 +38005,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Other problems", - "index": 52, + "id": "Kotlin/Redundant constructs", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -38018,16 +38018,16 @@ ] }, { - "id": "RemoveRedundantQualifierName", + "id": "EnumValuesSoftDeprecate", "shortDescription": { - "text": "Redundant qualifier name" + "text": "'Enum.values()' is recommended to be replaced by 'Enum.entries' since 1.9" }, "fullDescription": { - "text": "Reports redundant qualifiers (or their parts) on class names, functions, and properties. A fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to. In the contexts where the name can be shortened, the inspection informs on the opportunity and the associated 'Remove redundant qualifier name' quick-fix allows amending the code. Examples: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }' After the quick-fix is applied: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }'", - "markdown": "Reports redundant qualifiers (or their parts) on class names, functions, and properties.\n\n\nA fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to.\nIn the contexts where the name can be shortened, the inspection informs on the opportunity and the associated\n'Remove redundant qualifier name' quick-fix allows amending the code.\n\n**Examples:**\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }\n\nAfter the quick-fix is applied:\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }\n" + "text": "Reports calls to 'values()' method in enum classes from Kotlin that can be replaced with 'entries' property read. Use of 'Enum.entries' may improve performance of your code. The quick-fix replaces 'values()' with 'entries'. More details: KT-48872 Provide modern and performant replacement for Enum.values() Note: 'entries' property type is different from the return type of 'values()' method ('EnumEntries' which inherits from 'List' instead of 'Array'). Due to this in some cases quick fix inserts extra '.toTypedArray()' conversion to not break the code, but for most common cases replacement will be done without it (e.g. in 'for' loop). Example: 'enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())' After the quick-fix is applied: 'enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())'", + "markdown": "Reports calls to `values()` method in enum classes from Kotlin that can be replaced with `entries` property read.\n\n\nUse of `Enum.entries` may improve performance of your code.\n\n\nThe quick-fix replaces `values()` with `entries`.\n\n\n**More details:** [KT-48872 Provide modern and performant replacement for Enum.values()](https://youtrack.jetbrains.com/issue/KT-48872)\n\n\n**Note:** `entries` property type is different from the return type of `values()` method\n(`EnumEntries` which inherits from `List` instead of `Array`).\nDue to this in some cases quick fix inserts extra `.toTypedArray()` conversion to not break the code, but\nfor most common cases replacement will be done without it (e.g. in `for` loop).\n\n**Example:**\n\n\n enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())\n\nAfter the quick-fix is applied:\n\n\n enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -38037,8 +38037,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 5, + "id": "Kotlin/Other problems", + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -38306,27 +38306,27 @@ ] }, { - "id": "KotlinJvmAnnotationInJava", + "id": "ObsoleteKotlinJsPackages", "shortDescription": { - "text": "Kotlin JVM annotation in Java" + "text": "'kotlin.browser' and 'kotlin.dom' packages are deprecated since 1.4" }, "fullDescription": { - "text": "Reports useless Kotlin JVM annotations in Java code. Example: 'import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }'", - "markdown": "Reports useless Kotlin JVM annotations in Java code.\n\n**Example:**\n\n\n import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }\n" + "text": "Reports usages of 'kotlin.dom' and 'kotlin.browser' packages. These packages were moved to 'kotlinx.dom' and 'kotlinx.browser' respectively in Kotlin 1.4+.", + "markdown": "Reports usages of `kotlin.dom` and `kotlin.browser` packages.\n\nThese packages were moved to `kotlinx.dom` and `kotlinx.browser`\nrespectively in Kotlin 1.4+." }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "error", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Kotlin/Java interop issues", - "index": 69, + "id": "Kotlin/Migration", + "index": 16, "toolComponent": { "name": "QDJVMC" } @@ -38338,27 +38338,27 @@ ] }, { - "id": "ObsoleteKotlinJsPackages", + "id": "KotlinJvmAnnotationInJava", "shortDescription": { - "text": "'kotlin.browser' and 'kotlin.dom' packages are deprecated since 1.4" + "text": "Kotlin JVM annotation in Java" }, "fullDescription": { - "text": "Reports usages of 'kotlin.dom' and 'kotlin.browser' packages. These packages were moved to 'kotlinx.dom' and 'kotlinx.browser' respectively in Kotlin 1.4+.", - "markdown": "Reports usages of `kotlin.dom` and `kotlin.browser` packages.\n\nThese packages were moved to `kotlinx.dom` and `kotlinx.browser`\nrespectively in Kotlin 1.4+." + "text": "Reports useless Kotlin JVM annotations in Java code. Example: 'import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }'", + "markdown": "Reports useless Kotlin JVM annotations in Java code.\n\n**Example:**\n\n\n import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }\n" }, "defaultConfiguration": { - "enabled": false, - "level": "error", + "enabled": true, + "level": "warning", "parameters": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 16, + "id": "Kotlin/Java interop issues", + "index": 69, "toolComponent": { "name": "QDJVMC" } @@ -38626,27 +38626,27 @@ ] }, { - "id": "RedundantUnitExpression", + "id": "RestrictReturnStatementTargetMigration", "shortDescription": { - "text": "Redundant 'Unit'" + "text": "Target label does not denote a function since 1.4" }, "fullDescription": { - "text": "Reports redundant 'Unit' expressions. 'Unit' in Kotlin can be used as the return type of functions that do not return anything meaningful. The 'Unit' type has only one possible value, which is the 'Unit' object. Examples: 'fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }'", - "markdown": "Reports redundant `Unit` expressions.\n\n\n`Unit` in Kotlin can be used as the return type of functions that do not return anything meaningful.\nThe `Unit` type has only one possible value, which is the `Unit` object.\n\n**Examples:**\n\n\n fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }\n" + "text": "Reports labels that don't points to a functions. It's forbidden to declare a target label that does not denote a function. The quick-fix removes the label. Example: 'fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }' After the quick-fix is applied: 'fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }' This inspection only reports if the language level of the project or module is 1.4 or higher.", + "markdown": "Reports labels that don't points to a functions.\n\nIt's forbidden to declare a target label that does not denote a function.\n\nThe quick-fix removes the label.\n\n**Example:**\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }\n\nAfter the quick-fix is applied:\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }\n\nThis inspection only reports if the language level of the project or module is 1.4 or higher." }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "error", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 5, + "id": "Kotlin/Migration", + "index": 16, "toolComponent": { "name": "QDJVMC" } @@ -38658,27 +38658,27 @@ ] }, { - "id": "RestrictReturnStatementTargetMigration", + "id": "RedundantUnitExpression", "shortDescription": { - "text": "Target label does not denote a function since 1.4" + "text": "Redundant 'Unit'" }, "fullDescription": { - "text": "Reports labels that don't points to a functions. It's forbidden to declare a target label that does not denote a function. The quick-fix removes the label. Example: 'fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }' After the quick-fix is applied: 'fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }' This inspection only reports if the language level of the project or module is 1.4 or higher.", - "markdown": "Reports labels that don't points to a functions.\n\nIt's forbidden to declare a target label that does not denote a function.\n\nThe quick-fix removes the label.\n\n**Example:**\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }\n\nAfter the quick-fix is applied:\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }\n\nThis inspection only reports if the language level of the project or module is 1.4 or higher." + "text": "Reports redundant 'Unit' expressions. 'Unit' in Kotlin can be used as the return type of functions that do not return anything meaningful. The 'Unit' type has only one possible value, which is the 'Unit' object. Examples: 'fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }'", + "markdown": "Reports redundant `Unit` expressions.\n\n\n`Unit` in Kotlin can be used as the return type of functions that do not return anything meaningful.\nThe `Unit` type has only one possible value, which is the `Unit` object.\n\n**Examples:**\n\n\n fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }\n" }, "defaultConfiguration": { "enabled": false, - "level": "error", + "level": "warning", "parameters": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 16, + "id": "Kotlin/Redundant constructs", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -38774,7 +38774,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 52, + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -39874,7 +39874,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -40066,7 +40066,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -40258,7 +40258,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -40322,7 +40322,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -40674,7 +40674,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -40866,7 +40866,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -40898,7 +40898,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -40962,7 +40962,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -41582,13 +41582,13 @@ ] }, { - "id": "GrReassignedInClosureLocalVar", + "id": "GroovyMethodParameterCount", "shortDescription": { - "text": "Local variable is reassigned in closure or anonymous class" + "text": "Method with too many parameters" }, "fullDescription": { - "text": "Reports local variables assigned to expression with different type inside of closure or anonymous class. Example: 'int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)' As a result, the 'integer' variable sum is reassigned to a 'String' expression.", - "markdown": "Reports local variables assigned to expression with different type inside of closure or anonymous class.\n\n**Example:**\n\n\n int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)\n\nAs a result, the `integer` variable **sum** is reassigned to a `String` expression." + "text": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection. Use the Maximum number of parameters: field to specify the maximum acceptable number of parameters a method might have.", + "markdown": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection.\n\n\nUse the **Maximum number of parameters:** field to specify the maximum acceptable number of parameters a method might have." }, "defaultConfiguration": { "enabled": false, @@ -41601,8 +41601,8 @@ "relationships": [ { "target": { - "id": "Groovy/Potentially confusing code constructs", - "index": 73, + "id": "Groovy/Method metrics", + "index": 107, "toolComponent": { "name": "QDJVMC" } @@ -41614,13 +41614,13 @@ ] }, { - "id": "GroovyMethodParameterCount", + "id": "GrReassignedInClosureLocalVar", "shortDescription": { - "text": "Method with too many parameters" + "text": "Local variable is reassigned in closure or anonymous class" }, "fullDescription": { - "text": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection. Use the Maximum number of parameters: field to specify the maximum acceptable number of parameters a method might have.", - "markdown": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection.\n\n\nUse the **Maximum number of parameters:** field to specify the maximum acceptable number of parameters a method might have." + "text": "Reports local variables assigned to expression with different type inside of closure or anonymous class. Example: 'int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)' As a result, the 'integer' variable sum is reassigned to a 'String' expression.", + "markdown": "Reports local variables assigned to expression with different type inside of closure or anonymous class.\n\n**Example:**\n\n\n int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)\n\nAs a result, the `integer` variable **sum** is reassigned to a `String` expression." }, "defaultConfiguration": { "enabled": false, @@ -41633,8 +41633,8 @@ "relationships": [ { "target": { - "id": "Groovy/Method metrics", - "index": 107, + "id": "Groovy/Potentially confusing code constructs", + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -41794,7 +41794,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -41986,7 +41986,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -42146,7 +42146,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -42370,7 +42370,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -42786,7 +42786,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -42850,7 +42850,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -43298,7 +43298,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -43426,7 +43426,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -43490,7 +43490,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 53, + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -43950,13 +43950,13 @@ ] }, { - "id": "GroovySynchronizationOnNonFinalField", + "id": "GroovyReturnFromClosureCanBeImplicit", "shortDescription": { - "text": "Synchronization on non-final field" + "text": "'return' statement can be implicit" }, "fullDescription": { - "text": "Reports 'synchronized' statements where the lock expression is a non-'final' field. Such statements are unlikely to have useful semantics, as different threads may be locking on different objects even when operating on the same object.", - "markdown": "Reports `synchronized` statements where the lock expression is a non-`final` field.\n\n\nSuch statements are unlikely to have useful semantics, as different\nthreads may be locking on different objects even when operating on the same object." + "text": "Reports return statements at the end of closures which can be made implicit. Groovy closures implicitly return the value of the last statement in them. Example: 'def foo = {\n return 1\n }' After the quick-fix is applied: 'def foo = {\n 1\n }'", + "markdown": "Reports return statements at the end of closures which can be made implicit.\n\n\nGroovy closures implicitly return the value of the last statement in them.\n\n**Example:**\n\n\n def foo = {\n return 1\n }\n\nAfter the quick-fix is applied:\n\n\n def foo = {\n 1\n }\n" }, "defaultConfiguration": { "enabled": false, @@ -43969,8 +43969,8 @@ "relationships": [ { "target": { - "id": "Groovy/Threading issues", - "index": 40, + "id": "Groovy/Control flow issues", + "index": 71, "toolComponent": { "name": "QDJVMC" } @@ -43982,13 +43982,13 @@ ] }, { - "id": "GroovyReturnFromClosureCanBeImplicit", + "id": "GroovySynchronizationOnNonFinalField", "shortDescription": { - "text": "'return' statement can be implicit" + "text": "Synchronization on non-final field" }, "fullDescription": { - "text": "Reports return statements at the end of closures which can be made implicit. Groovy closures implicitly return the value of the last statement in them. Example: 'def foo = {\n return 1\n }' After the quick-fix is applied: 'def foo = {\n 1\n }'", - "markdown": "Reports return statements at the end of closures which can be made implicit.\n\n\nGroovy closures implicitly return the value of the last statement in them.\n\n**Example:**\n\n\n def foo = {\n return 1\n }\n\nAfter the quick-fix is applied:\n\n\n def foo = {\n 1\n }\n" + "text": "Reports 'synchronized' statements where the lock expression is a non-'final' field. Such statements are unlikely to have useful semantics, as different threads may be locking on different objects even when operating on the same object.", + "markdown": "Reports `synchronized` statements where the lock expression is a non-`final` field.\n\n\nSuch statements are unlikely to have useful semantics, as different\nthreads may be locking on different objects even when operating on the same object." }, "defaultConfiguration": { "enabled": false, @@ -44001,8 +44001,8 @@ "relationships": [ { "target": { - "id": "Groovy/Control flow issues", - "index": 71, + "id": "Groovy/Threading issues", + "index": 40, "toolComponent": { "name": "QDJVMC" } @@ -45786,16 +45786,16 @@ ] }, { - "id": "RegExpRedundantNestedCharacterClass", + "id": "XmlDeprecatedElement", "shortDescription": { - "text": "Redundant nested character class" + "text": "Deprecated symbol" }, "fullDescription": { - "text": "Reports unnecessary nested character classes. Example: '[a-c[x-z]]' After the quick-fix is applied: '[a-cx-z]' New in 2020.2", - "markdown": "Reports unnecessary nested character classes.\n\n**Example:**\n\n\n [a-c[x-z]]\n\nAfter the quick-fix is applied:\n\n\n [a-cx-z]\n\nNew in 2020.2" + "text": "Reports a deprecated XML element or attribute. Symbols can be marked by XML comment or documentation tag with text 'deprecated'.", + "markdown": "Reports a deprecated XML element or attribute.\n\nSymbols can be marked by XML comment or documentation tag with text 'deprecated'." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -45805,8 +45805,8 @@ "relationships": [ { "target": { - "id": "RegExp", - "index": 83, + "id": "XML", + "index": 64, "toolComponent": { "name": "QDJVMC" } @@ -45818,16 +45818,16 @@ ] }, { - "id": "XmlDeprecatedElement", + "id": "RegExpRedundantNestedCharacterClass", "shortDescription": { - "text": "Deprecated symbol" + "text": "Redundant nested character class" }, "fullDescription": { - "text": "Reports a deprecated XML element or attribute. Symbols can be marked by XML comment or documentation tag with text 'deprecated'.", - "markdown": "Reports a deprecated XML element or attribute.\n\nSymbols can be marked by XML comment or documentation tag with text 'deprecated'." + "text": "Reports unnecessary nested character classes. Example: '[a-c[x-z]]' After the quick-fix is applied: '[a-cx-z]' New in 2020.2", + "markdown": "Reports unnecessary nested character classes.\n\n**Example:**\n\n\n [a-c[x-z]]\n\nAfter the quick-fix is applied:\n\n\n [a-cx-z]\n\nNew in 2020.2" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { "ideaSeverity": "WARNING", @@ -45837,8 +45837,8 @@ "relationships": [ { "target": { - "id": "XML", - "index": 64, + "id": "RegExp", + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -45946,13 +45946,13 @@ ] }, { - "id": "RegExpDuplicateAlternationBranch", + "id": "RegExpRepeatedSpace", "shortDescription": { - "text": "Duplicate branch in alternation" + "text": "Consecutive spaces" }, "fullDescription": { - "text": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression. Example: '(alpha|bravo|charlie|alpha)' After the quick-fix is applied: '(alpha|bravo|charlie)' New in 2017.1", - "markdown": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression.\n\n**Example:**\n\n\n (alpha|bravo|charlie|alpha)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo|charlie)\n\nNew in 2017.1" + "text": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier. Example: '( )' After the quick-fix is applied: '( {5})' New in 2017.1", + "markdown": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier.\n\n**Example:**\n\n\n ( )\n\nAfter the quick-fix is applied:\n\n\n ( {5})\n\n\nNew in 2017.1" }, "defaultConfiguration": { "enabled": true, @@ -45978,13 +45978,13 @@ ] }, { - "id": "RegExpRepeatedSpace", + "id": "RegExpDuplicateAlternationBranch", "shortDescription": { - "text": "Consecutive spaces" + "text": "Duplicate branch in alternation" }, "fullDescription": { - "text": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier. Example: '( )' After the quick-fix is applied: '( {5})' New in 2017.1", - "markdown": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier.\n\n**Example:**\n\n\n ( )\n\nAfter the quick-fix is applied:\n\n\n ( {5})\n\n\nNew in 2017.1" + "text": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression. Example: '(alpha|bravo|charlie|alpha)' After the quick-fix is applied: '(alpha|bravo|charlie)' New in 2017.1", + "markdown": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression.\n\n**Example:**\n\n\n (alpha|bravo|charlie|alpha)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo|charlie)\n\nNew in 2017.1" }, "defaultConfiguration": { "enabled": true, @@ -46081,274 +46081,6 @@ ], "isComprehensive": false }, - { - "name": "com.intellij.java-i18n", - "version": "231.9378", - "rules": [ - { - "id": "UnusedMessageFormatParameter", - "shortDescription": { - "text": "Missing message format parameter" - }, - "fullDescription": { - "text": "Reports properties values that look like 'java.text.MessageFormat' format strings but do not use some the parameters of the '{xx}' kind. Example: '# parameter {0} is not used\nerror.message=Something happened in line {1}'", - "markdown": "Reports properties values that look like `java.text.MessageFormat` format strings but do not use some the parameters of the `{xx}` kind.\n\nExample:\n\n\n # parameter {0} is not used\n error.message=Something happened in line {1}\n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 31, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConvertToBasicLatin", - "shortDescription": { - "text": "Non-Basic Latin character" - }, - "fullDescription": { - "text": "Reports non-Basic Latin characters in literals and suggests replacing them with unicode entities. Example: '// © 2021\n char c = '©';\n String s = \"Áî\";'\n After the quick-fix is applied: '// © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";'", - "markdown": "Reports non-Basic Latin characters in literals and suggests replacing them with unicode entities.\n\nExample:\n\n\n // © 2021\n char c = '©';\n String s = \"Áî\";\n\nAfter the quick-fix is applied:\n\n\n // © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Internationalization", - "index": 9, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "InconsistentResourceBundle", - "shortDescription": { - "text": "Inconsistent resource bundle" - }, - "fullDescription": { - "text": "Reports problems in the properties files contained in the resource bundle. Report missing translation option controls search for an untranslated properties. It reports properties contained in parent properties file that are missing in inherited (unless it's a language dialect). E.g. having this resource bundle: messages.properties : abc=xxx messages_fr.properties : empty Property abc will be reported as untranslated. Report inconsistent properties option controls invalid resource bundle structure inspection. It reports properties contained in inherited properties file that are missing in parent (or in sibling if there is no parent). E.g. having this resource bundle: messages.properties : empty messages_fr.properties : abc=xxx Property abc translation here is not available for any language except French, and, thus, will be reported as missing in the (default) properties file messages.properties . Report properties overridden with the same value option checks for properties which are copy-pasted into several properties files verbatim. E.g. in this resource bundle: messages.properties : abc=xxx messages_fr.properties : abc=xxx Property abc will be reported as unnecessarily inherited in the file messages_fr.properties . Report properties overridden with different placeholders option checks for properties which are overridden for placeholder consistency. E.g. in this resource bundle: messages.properties : qwe={0}xxx{1} abc={0}yyy{1} messages_fr.properties : qwe={0}xxx{0}xxx{1} abc={0}yyy Property abc will be reported as property contains message format placeholders with value not corresponding to messages.properties . Report properties overridden with different values endings option checks for properties which are overridden for ending consistency. E.g. in this resource bundle: messages.properties : abc=xxxzzz messages_fr.properties : abc=xxx; Property abc will be reported as property contains special signs ( '!' , '?' , '.' , ':' or ';' ) at the end of value but value in messages.properties doesn't.", - "markdown": "Reports problems in the properties files contained in the resource bundle.\n\n* **Report missing translation**\n\noption controls search for an untranslated properties. \nIt reports properties contained in parent properties file that are missing in inherited (unless it's a language dialect). \nE.g. having this resource bundle: \n**messages.properties** : **abc=xxx** \n**messages_fr.properties** : empty \nProperty **abc** will be reported as untranslated.\n\n* **Report inconsistent properties**\n\noption controls invalid resource bundle structure inspection. \nIt reports properties contained in inherited properties file that are missing in parent (or in sibling if there is no parent). \nE.g. having this resource bundle: \n**messages.properties** : empty \n**messages_fr.properties** : **abc=xxx** \nProperty **abc** translation here is not available for any language except French, and, thus, will be reported as missing in the (default) properties file **messages.properties** .\n\n* **Report properties overridden with the same value**\n\noption checks for properties which are copy-pasted into several properties files verbatim. \nE.g. in this resource bundle: \n**messages.properties** : **abc=xxx** \n**messages_fr.properties** : **abc=xxx** \nProperty **abc** will be reported as unnecessarily inherited in the file **messages_fr.properties** . \n\n* **Report properties overridden with different placeholders**\n\noption checks for properties which are overridden for placeholder consistency. \nE.g. in this resource bundle: \n**messages.properties** : \n**qwe={0}xxx{1}** \n**abc={0}yyy{1}** \n**messages_fr.properties** : \n**qwe={0}xxx{0}xxx{1}** \n**abc={0}yyy** \nProperty **abc** will be reported as property contains message format placeholders with value not corresponding to **messages.properties** . \n\n* **Report properties overridden with different values endings**\n\noption checks for properties which are overridden for ending consistency. \nE.g. in this resource bundle: \n**messages.properties** : \n**abc=xxxzzz** \n**messages_fr.properties** : \n**abc=xxx;** \nProperty **abc** will be reported as property contains special signs ( **'!'** , **'?'** , **'.'** , **':'** or **';'** ) at the end of value but value in **messages.properties** doesn't. " - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 31, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HardCodedStringLiteral", - "shortDescription": { - "text": "Hardcoded strings" - }, - "fullDescription": { - "text": "Reports any instances of hardcoded 'String' literals. Hardcoded 'String' literals are probably errors in an internationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available to transform a string literal into a 'java.util.ResourceBundle.getString()' method call. Use inspection's options to further specialize whether this inspection should report strings in: Assert statements like in 'assert str.equals(\"message\")' Exception constructor calls like in 'new Exception(\"message\")' JUnit assert calls like in 'assertEquals(str, \"message\")' The only argument to a method returning String like in 'getStringByKey(\"key\")' Literals with value of legal and existing class name like 'Class.forName(\"java.lang.Object\")' Literals with value of legal and existing property key 'bundle.getString(\"authentication.failed\")'", - "markdown": "Reports any instances of hardcoded `String` literals.\n\nHardcoded `String` literals are probably errors in an\ninternationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available\nto transform a string literal into a `java.util.ResourceBundle.getString()` method call.\n\nUse inspection's options to further specialize whether this inspection should report strings in:\n\n* Assert statements like in `assert str.equals(\"message\")`\n* Exception constructor calls like in `new Exception(\"message\")`\n* JUnit assert calls like in `assertEquals(str, \"message\")`\n* The only argument to a method returning String like in `getStringByKey(\"key\")`\n* Literals with value of legal and existing class name like `Class.forName(\"java.lang.Object\")`\n* Literals with value of legal and existing property key `bundle.getString(\"authentication.failed\")`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Internationalization", - "index": 9, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DialogTitleCapitalization", - "shortDescription": { - "text": "Incorrect string capitalization" - }, - "fullDescription": { - "text": "Reports strings in method parameters and return values annotated with '@Nls' and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines. Example: 'void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\");' After the quick-fix is applied: 'setTitle(\"This Is Sentence Capitalization but Should Be Title\");'", - "markdown": "Reports strings in method parameters and return values annotated with `@Nls` and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines.\n\n**Example:**\n\n\n void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\"); \n\nAfter the quick-fix is applied:\n\n\n setTitle(\"This Is Sentence Capitalization but Should Be Title\"); \n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Internationalization", - "index": 9, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnresolvedPropertyKey", - "shortDescription": { - "text": "Invalid property key" - }, - "fullDescription": { - "text": "Reports invalid arguments that are passed to methods with parameters annotated as '@PropertyKey'. These arguments should be valid property keys in corresponding properties files. Also, the inspection verifies that the 'resourceBundle' argument of the '@PropertyKey' annotation is an existing resource bundle. Use the quick-fix to create a new property or to select an existing one. Example: '@PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";'", - "markdown": "Reports invalid arguments that are passed to methods with parameters annotated as `@PropertyKey`.\n\nThese arguments should be valid property keys in corresponding properties files.\nAlso, the inspection verifies that the `resourceBundle`\nargument of the `@PropertyKey` annotation is an existing resource bundle.\n\n\nUse the quick-fix to create a new property or to select an existing one.\n\nExample:\n\n\n @PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "error", - "parameters": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Properties files", - "index": 123, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SuspiciousLocalesLanguages", - "shortDescription": { - "text": "Suspicious resource bundle locale languages" - }, - "fullDescription": { - "text": "Reports locales with language codes that are not supported by Java.", - "markdown": "Reports locales with language codes that are not supported by Java." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 31, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DuplicateStringLiteralInspection", - "shortDescription": { - "text": "Duplicate string literal" - }, - "fullDescription": { - "text": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal. Example: 'class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }' Configure the inspection: Use the Min string length field to set the minimal string length required to detect duplicates. Use the Ignore @PropertyKey expressions option to ignore strings passed as arguments to methods annotated with 'org.jetbrains.annotations.PropertyKey'.", - "markdown": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal.\n\nExample:\n\n\n class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }\n\nConfigure the inspection:\n\n* Use the **Min string length** field to set the minimal string length required to detect duplicates.\n* Use the **Ignore @PropertyKey expressions** option to ignore strings passed as arguments to methods annotated with `org.jetbrains.annotations.PropertyKey`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Internationalization", - "index": 9, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, { "name": "org.editorconfig.editorconfigjetbrains", "version": "231.9378", @@ -46374,7 +46106,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46406,7 +46138,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46438,7 +46170,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46470,7 +46202,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46502,7 +46234,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46534,7 +46266,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46566,7 +46298,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46598,7 +46330,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46630,7 +46362,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46662,7 +46394,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46694,7 +46426,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46726,7 +46458,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46758,7 +46490,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46790,7 +46522,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46822,7 +46554,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46854,7 +46586,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46886,7 +46618,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46918,7 +46650,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46950,7 +46682,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -46982,7 +46714,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -47014,7 +46746,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -47046,7 +46778,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -47078,7 +46810,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -47110,7 +46842,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -47142,7 +46874,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -47174,7 +46906,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -47206,7 +46938,7 @@ { "target": { "id": "EditorConfig", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -47238,6 +46970,242 @@ { "target": { "id": "EditorConfig", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.java-i18n", + "version": "231.9378", + "rules": [ + { + "id": "UnusedMessageFormatParameter", + "shortDescription": { + "text": "Missing message format parameter" + }, + "fullDescription": { + "text": "Reports properties values that look like 'java.text.MessageFormat' format strings but do not use some the parameters of the '{xx}' kind. Example: '# parameter {0} is not used\nerror.message=Something happened in line {1}'", + "markdown": "Reports properties values that look like `java.text.MessageFormat` format strings but do not use some the parameters of the `{xx}` kind.\n\nExample:\n\n\n # parameter {0} is not used\n error.message=Something happened in line {1}\n \n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToBasicLatin", + "shortDescription": { + "text": "Non-Basic Latin character" + }, + "fullDescription": { + "text": "Reports non-Basic Latin characters in literals and suggests replacing them with unicode entities. Example: '// © 2021\n char c = '©';\n String s = \"Áî\";'\n After the quick-fix is applied: '// © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";'", + "markdown": "Reports non-Basic Latin characters in literals and suggests replacing them with unicode entities.\n\nExample:\n\n\n // © 2021\n char c = '©';\n String s = \"Áî\";\n\nAfter the quick-fix is applied:\n\n\n // © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InconsistentResourceBundle", + "shortDescription": { + "text": "Inconsistent resource bundle" + }, + "fullDescription": { + "text": "Reports problems in the properties files contained in the resource bundle. Report missing translation option controls search for an untranslated properties. It reports properties contained in parent properties file that are missing in inherited (unless it's a language dialect). E.g. having this resource bundle: messages.properties : abc=xxx messages_fr.properties : empty Property abc will be reported as untranslated. Report inconsistent properties option controls invalid resource bundle structure inspection. It reports properties contained in inherited properties file that are missing in parent (or in sibling if there is no parent). E.g. having this resource bundle: messages.properties : empty messages_fr.properties : abc=xxx Property abc translation here is not available for any language except French, and, thus, will be reported as missing in the (default) properties file messages.properties . Report properties overridden with the same value option checks for properties which are copy-pasted into several properties files verbatim. E.g. in this resource bundle: messages.properties : abc=xxx messages_fr.properties : abc=xxx Property abc will be reported as unnecessarily inherited in the file messages_fr.properties . Report properties overridden with different placeholders option checks for properties which are overridden for placeholder consistency. E.g. in this resource bundle: messages.properties : qwe={0}xxx{1} abc={0}yyy{1} messages_fr.properties : qwe={0}xxx{0}xxx{1} abc={0}yyy Property abc will be reported as property contains message format placeholders with value not corresponding to messages.properties . Report properties overridden with different values endings option checks for properties which are overridden for ending consistency. E.g. in this resource bundle: messages.properties : abc=xxxzzz messages_fr.properties : abc=xxx; Property abc will be reported as property contains special signs ( '!' , '?' , '.' , ':' or ';' ) at the end of value but value in messages.properties doesn't.", + "markdown": "Reports problems in the properties files contained in the resource bundle.\n\n* **Report missing translation**\n\noption controls search for an untranslated properties. \nIt reports properties contained in parent properties file that are missing in inherited (unless it's a language dialect). \nE.g. having this resource bundle: \n**messages.properties** : **abc=xxx** \n**messages_fr.properties** : empty \nProperty **abc** will be reported as untranslated.\n\n* **Report inconsistent properties**\n\noption controls invalid resource bundle structure inspection. \nIt reports properties contained in inherited properties file that are missing in parent (or in sibling if there is no parent). \nE.g. having this resource bundle: \n**messages.properties** : empty \n**messages_fr.properties** : **abc=xxx** \nProperty **abc** translation here is not available for any language except French, and, thus, will be reported as missing in the (default) properties file **messages.properties** .\n\n* **Report properties overridden with the same value**\n\noption checks for properties which are copy-pasted into several properties files verbatim. \nE.g. in this resource bundle: \n**messages.properties** : **abc=xxx** \n**messages_fr.properties** : **abc=xxx** \nProperty **abc** will be reported as unnecessarily inherited in the file **messages_fr.properties** . \n\n* **Report properties overridden with different placeholders**\n\noption checks for properties which are overridden for placeholder consistency. \nE.g. in this resource bundle: \n**messages.properties** : \n**qwe={0}xxx{1}** \n**abc={0}yyy{1}** \n**messages_fr.properties** : \n**qwe={0}xxx{0}xxx{1}** \n**abc={0}yyy** \nProperty **abc** will be reported as property contains message format placeholders with value not corresponding to **messages.properties** . \n\n* **Report properties overridden with different values endings**\n\noption checks for properties which are overridden for ending consistency. \nE.g. in this resource bundle: \n**messages.properties** : \n**abc=xxxzzz** \n**messages_fr.properties** : \n**abc=xxx;** \nProperty **abc** will be reported as property contains special signs ( **'!'** , **'?'** , **'.'** , **':'** or **';'** ) at the end of value but value in **messages.properties** doesn't. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HardCodedStringLiteral", + "shortDescription": { + "text": "Hardcoded strings" + }, + "fullDescription": { + "text": "Reports any instances of hardcoded 'String' literals. Hardcoded 'String' literals are probably errors in an internationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available to transform a string literal into a 'java.util.ResourceBundle.getString()' method call. Use inspection's options to further specialize whether this inspection should report strings in: Assert statements like in 'assert str.equals(\"message\")' Exception constructor calls like in 'new Exception(\"message\")' JUnit assert calls like in 'assertEquals(str, \"message\")' The only argument to a method returning String like in 'getStringByKey(\"key\")' Literals with value of legal and existing class name like 'Class.forName(\"java.lang.Object\")' Literals with value of legal and existing property key 'bundle.getString(\"authentication.failed\")'", + "markdown": "Reports any instances of hardcoded `String` literals.\n\nHardcoded `String` literals are probably errors in an\ninternationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available\nto transform a string literal into a `java.util.ResourceBundle.getString()` method call.\n\nUse inspection's options to further specialize whether this inspection should report strings in:\n\n* Assert statements like in `assert str.equals(\"message\")`\n* Exception constructor calls like in `new Exception(\"message\")`\n* JUnit assert calls like in `assertEquals(str, \"message\")`\n* The only argument to a method returning String like in `getStringByKey(\"key\")`\n* Literals with value of legal and existing class name like `Class.forName(\"java.lang.Object\")`\n* Literals with value of legal and existing property key `bundle.getString(\"authentication.failed\")`" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DialogTitleCapitalization", + "shortDescription": { + "text": "Incorrect string capitalization" + }, + "fullDescription": { + "text": "Reports strings in method parameters and return values annotated with '@Nls' and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines. Example: 'void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\");' After the quick-fix is applied: 'setTitle(\"This Is Sentence Capitalization but Should Be Title\");'", + "markdown": "Reports strings in method parameters and return values annotated with `@Nls` and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines.\n\n**Example:**\n\n\n void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\"); \n\nAfter the quick-fix is applied:\n\n\n setTitle(\"This Is Sentence Capitalization but Should Be Title\"); \n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnresolvedPropertyKey", + "shortDescription": { + "text": "Invalid property key" + }, + "fullDescription": { + "text": "Reports invalid arguments that are passed to methods with parameters annotated as '@PropertyKey'. These arguments should be valid property keys in corresponding properties files. Also, the inspection verifies that the 'resourceBundle' argument of the '@PropertyKey' annotation is an existing resource bundle. Use the quick-fix to create a new property or to select an existing one. Example: '@PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";'", + "markdown": "Reports invalid arguments that are passed to methods with parameters annotated as `@PropertyKey`.\n\nThese arguments should be valid property keys in corresponding properties files.\nAlso, the inspection verifies that the `resourceBundle`\nargument of the `@PropertyKey` annotation is an existing resource bundle.\n\n\nUse the quick-fix to create a new property or to select an existing one.\n\nExample:\n\n\n @PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";\n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Properties files", + "index": 123, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousLocalesLanguages", + "shortDescription": { + "text": "Suspicious resource bundle locale languages" + }, + "fullDescription": { + "text": "Reports locales with language codes that are not supported by Java.", + "markdown": "Reports locales with language codes that are not supported by Java." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", "index": 32, "toolComponent": { "name": "QDJVMC" @@ -47248,6 +47216,38 @@ ] } ] + }, + { + "id": "DuplicateStringLiteralInspection", + "shortDescription": { + "text": "Duplicate string literal" + }, + "fullDescription": { + "text": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal. Example: 'class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }' Configure the inspection: Use the Min string length field to set the minimal string length required to detect duplicates. Use the Ignore @PropertyKey expressions option to ignore strings passed as arguments to methods annotated with 'org.jetbrains.annotations.PropertyKey'.", + "markdown": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal.\n\nExample:\n\n\n class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }\n\nConfigure the inspection:\n\n* Use the **Min string length** field to set the minimal string length required to detect duplicates.\n* Use the **Ignore @PropertyKey expressions** option to ignore strings passed as arguments to methods annotated with `org.jetbrains.annotations.PropertyKey`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] } ], "language": "en-US", @@ -48886,27 +48886,27 @@ ] }, { - "id": "PluginXmlValidity", + "id": "InspectionDescriptionNotFoundInspection", "shortDescription": { - "text": "Plugin.xml validity" + "text": "Inspection description checker" }, "fullDescription": { - "text": "Reports problems in 'plugin.xml'. Invalid configuration can lead to problems at runtime.", - "markdown": "Reports problems in `plugin.xml`.\n\n\nInvalid configuration can lead to problems at runtime." + "text": "Reports inspections that are missing an HTML description file, i.e. a file containing a text like this. The Create description file quick-fix creates a template HTML description file.", + "markdown": "Reports inspections that are missing an HTML description file, i.e. a file containing a text like this.\n\n\nThe **Create description file** quick-fix creates a template HTML description file." }, "defaultConfiguration": { "enabled": false, - "level": "error", + "level": "warning", "parameters": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Plugin DevKit/Plugin descriptor", - "index": 75, + "id": "Plugin DevKit/Description file", + "index": 104, "toolComponent": { "name": "QDJVMC" } @@ -48918,27 +48918,27 @@ ] }, { - "id": "InspectionDescriptionNotFoundInspection", + "id": "PluginXmlValidity", "shortDescription": { - "text": "Inspection description checker" + "text": "Plugin.xml validity" }, "fullDescription": { - "text": "Reports inspections that are missing an HTML description file, i.e. a file containing a text like this. The Create description file quick-fix creates a template HTML description file.", - "markdown": "Reports inspections that are missing an HTML description file, i.e. a file containing a text like this.\n\n\nThe **Create description file** quick-fix creates a template HTML description file." + "text": "Reports problems in 'plugin.xml'. Invalid configuration can lead to problems at runtime.", + "markdown": "Reports problems in `plugin.xml`.\n\n\nInvalid configuration can lead to problems at runtime." }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "error", "parameters": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Plugin DevKit/Description file", - "index": 104, + "id": "Plugin DevKit/Plugin descriptor", + "index": 75, "toolComponent": { "name": "QDJVMC" } @@ -49538,7 +49538,7 @@ { "target": { "id": "Properties files", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -49570,7 +49570,7 @@ { "target": { "id": "Properties files", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -49602,7 +49602,7 @@ { "target": { "id": "Properties files", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -49634,7 +49634,7 @@ { "target": { "id": "Properties files", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -49666,7 +49666,7 @@ { "target": { "id": "Properties files", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -49698,7 +49698,7 @@ { "target": { "id": "Properties files", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -50585,7 +50585,7 @@ "versionControlProvenance": [ { "repositoryUri": "https://github.com/1c-syntax/bsl-language-server.git", - "revisionId": "c423b9563cedb0a1777a66ec0e933b0a972276a8", + "revisionId": "d9b2b5e962febeabefdd4541384a9e305f5230dc", "branch": "refs/heads/develop", "properties": { "repoUrl": "https://github.com/1c-syntax/bsl-language-server.git", @@ -50936,9 +50936,9 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 263, + "startLine": 372, "startColumn": 9, - "charOffset": 9712, + "charOffset": 13383, "charLength": 4, "snippet": { "text": "else" @@ -50946,12 +50946,12 @@ "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 261, + "startLine": 370, "startColumn": 1, - "charOffset": 9556, - "charLength": 212, + "charOffset": 13246, + "charLength": 167, "snippet": { - "text": " } else if (string.subParameter() != null) { // это строка с вложенным параметром типа\n current.addSubParameter(string.subParameter());\n } else { // прочее - пустая строка\n // noop\n }" + "text": " } else if (paramType.complexType() != null) {\n addType(paramDescription, paramType.complexType().getText(), false);\n } else {\n // noop\n }" } } }, @@ -50964,7 +50964,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "cfe77286b84db65fe7eb570f50a05fbf1a83934a6d87ca90808073f679fbcb1f" + "equalIndicator/v1": "afac6956d55abd8bcd728a92b79ed0b4280a00b2107ba85419780ba3380edfb7" }, "properties": { "ideaSeverity": "WARNING", @@ -50990,9 +50990,9 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 372, + "startLine": 124, "startColumn": 9, - "charOffset": 13383, + "charOffset": 4593, "charLength": 4, "snippet": { "text": "else" @@ -51000,12 +51000,12 @@ "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 370, + "startLine": 122, "startColumn": 1, - "charOffset": 13246, - "charLength": 167, + "charOffset": 4435, + "charLength": 214, "snippet": { - "text": " } else if (paramType.complexType() != null) {\n addType(paramDescription, paramType.complexType().getText(), false);\n } else {\n // noop\n }" + "text": " } else if (string.subParameter() != null) { // это строка с вложенным параметром типа\n fakeParam.addSubParameter(string.subParameter());\n } else { // прочее - пустая строка\n // noop\n }" } } }, @@ -51018,7 +51018,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "afac6956d55abd8bcd728a92b79ed0b4280a00b2107ba85419780ba3380edfb7" + "equalIndicator/v1": "ca7195dc12bd26b031fb8cc9f47e4748b3a43dac1633be1683282470e7c638a0" }, "properties": { "ideaSeverity": "WARNING", @@ -51044,9 +51044,9 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 124, + "startLine": 263, "startColumn": 9, - "charOffset": 4593, + "charOffset": 9712, "charLength": 4, "snippet": { "text": "else" @@ -51054,12 +51054,12 @@ "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 122, + "startLine": 261, "startColumn": 1, - "charOffset": 4435, - "charLength": 214, + "charOffset": 9556, + "charLength": 212, "snippet": { - "text": " } else if (string.subParameter() != null) { // это строка с вложенным параметром типа\n fakeParam.addSubParameter(string.subParameter());\n } else { // прочее - пустая строка\n // noop\n }" + "text": " } else if (string.subParameter() != null) { // это строка с вложенным параметром типа\n current.addSubParameter(string.subParameter());\n } else { // прочее - пустая строка\n // noop\n }" } } }, @@ -51072,7 +51072,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "ca7195dc12bd26b031fb8cc9f47e4748b3a43dac1633be1683282470e7c638a0" + "equalIndicator/v1": "cfe77286b84db65fe7eb570f50a05fbf1a83934a6d87ca90808073f679fbcb1f" }, "properties": { "ideaSeverity": "WARNING", @@ -51354,10 +51354,10 @@ } ], "automationDetails": { - "id": "project/qodana/2023-08-07", - "guid": "5a42cd45-e30a-4b36-be9e-f98cd8ab83d0", + "id": "project/qodana/2023-09-04", + "guid": "29023024-f10f-4a93-9fd7-a502140b52aa", "properties": { - "jobUrl": "https://github.com/1c-syntax/bsl-language-server/actions/runs/5788698550" + "jobUrl": "https://github.com/1c-syntax/bsl-language-server/actions/runs/6078022192" } }, "newlineSequences": [ @@ -51367,37 +51367,37 @@ "properties": { "qodana.promo.results": [ { - "ruleId": "FieldMayBeFinal", + "ruleId": "DefaultAnnotationParam", "kind": "fail", "level": "warning", "message": { - "text": "Field 'reportersOptions' may be 'final'", - "markdown": "Field `reportersOptions` may be 'final'" + "text": "Redundant default parameter value assignment", + "markdown": "Redundant default parameter value assignment" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/cli/AnalyzeCommand.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/BadWordsDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 135, + "startLine": 50, "startColumn": 20, - "charOffset": 5453, - "charLength": 16, + "charOffset": 1895, + "charLength": 17, "snippet": { - "text": "reportersOptions" + "text": "BAD_WORDS_DEFAULT" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 133, + "startLine": 48, "startColumn": 1, - "charOffset": 5325, - "charLength": 162, + "charOffset": 1827, + "charLength": 169, "snippet": { - "text": " completionCandidates = ReportersKeys.class,\n description = \"Reporter key (${COMPLETION-CANDIDATES})\")\n private String[] reportersOptions = {};\n\n @Option(" + "text": " @DiagnosticParameter(\n type = String.class,\n defaultValue = BAD_WORDS_DEFAULT\n )\n private Pattern badWords = CaseInsensitivePattern.compile(BAD_WORDS_DEFAULT);" } } }, @@ -51410,7 +51410,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "efb2a2355a44d1d58603fab18d8ed664e7bb8001fe05e4f4aa299a158ded983b" + "equalIndicator/v1": "0075b5ac0f587a18b42ec66d5835585bd8dd59fe5399780ae701a882e27920e2" }, "properties": { "ideaSeverity": "WARNING", @@ -51418,37 +51418,37 @@ } }, { - "ruleId": "FieldMayBeFinal", + "ruleId": "RegExpSimplifiable", "kind": "fail", - "level": "warning", + "level": "note", "message": { - "text": "Field 'maxParamsCount' may be 'final'", - "markdown": "Field `maxParamsCount` may be 'final'" + "text": "'[\\\\*]' can be simplified to '\\*'", + "markdown": "`[\\\\*]` can be simplified to '\\\\\\*'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/NumberOfParamsDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UsingHardcodeSecretInformationDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 49, - "startColumn": 15, - "charOffset": 1899, - "charLength": 14, + "startLine": 67, + "startColumn": 75, + "charOffset": 2811, + "charLength": 5, "snippet": { - "text": "maxParamsCount" + "text": "[\\\\*]" }, - "sourceLanguage": "JAVA" + "sourceLanguage": "RegExp" }, "contextRegion": { - "startLine": 47, + "startLine": 65, "startColumn": 1, - "charOffset": 1840, - "charLength": 106, + "charOffset": 2731, + "charLength": 137, "snippet": { - "text": " defaultValue = \"\" + MAX_PARAMS_COUNT\n )\n private int maxParamsCount = MAX_PARAMS_COUNT;\n\n @Override" + "text": " );\n\n private static final Pattern PATTERN_CHECK_PASSWORD = Pattern.compile(\"^[\\\\*]+$\", Pattern.UNICODE_CASE);\n\n @DiagnosticParameter(" } } }, @@ -51461,45 +51461,45 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "e0fb20e2a737fc73e36a33c3f9cd5bb91e8a9bd5ace0181a8580c09034ac11bb" + "equalIndicator/v1": "71340859aaa634a7436637ac31b215a4ec2cb5ab9376bb6a2eba5a45dfff2c41" }, "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, { - "ruleId": "FieldMayBeFinal", + "ruleId": "TrivialStringConcatenation", "kind": "fail", "level": "warning", "message": { - "text": "Field 'maxOptionalParamsCount' may be 'final'", - "markdown": "Field `maxOptionalParamsCount` may be 'final'" + "text": "Empty string used in concatenation", + "markdown": "Empty string used in concatenation" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/NumberOfOptionalParamsDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SetPermissionsForNewObjectsDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 49, - "startColumn": 15, - "charOffset": 1925, - "charLength": 22, + "startLine": 58, + "startColumn": 20, + "charOffset": 2252, + "charLength": 2, "snippet": { - "text": "maxOptionalParamsCount" + "text": "\"\"" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 47, + "startLine": 56, "startColumn": 1, - "charOffset": 1857, - "charLength": 132, + "charOffset": 2184, + "charLength": 100, "snippet": { - "text": " defaultValue = \"\" + MAX_OPTIONAL_PARAMS_COUNT\n )\n private int maxOptionalParamsCount = MAX_OPTIONAL_PARAMS_COUNT;\n\n @Override" + "text": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + NAMES_FULL_ACCESS_ROLE\n )\n" } } }, @@ -51512,7 +51512,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "3b353e4e0f223ad88815c18e5087e917fc5bb58f422cd5b74c16bed5cdf94dae" + "equalIndicator/v1": "96e7e12a31a961f033b2af97c00150c7474a8fcb3adfdc8938bc5b9b506da507" }, "properties": { "ideaSeverity": "WARNING", @@ -51520,37 +51520,37 @@ } }, { - "ruleId": "FieldMayBeFinal", + "ruleId": "TrivialStringConcatenation", "kind": "fail", "level": "warning", "message": { - "text": "Field 'useStrictValidation' may be 'final'", - "markdown": "Field `useStrictValidation` may be 'final'" + "text": "Empty string used in concatenation", + "markdown": "Empty string used in concatenation" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SpaceAtStartCommentDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 83, - "startColumn": 19, - "charOffset": 3281, - "charLength": 19, + "startLine": 88, + "startColumn": 20, + "charOffset": 3575, + "charLength": 2, "snippet": { - "text": "useStrictValidation" + "text": "\"\"" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 81, + "startLine": 86, "startColumn": 1, - "charOffset": 3213, - "charLength": 156, + "charOffset": 3507, + "charLength": 169, "snippet": { - "text": " defaultValue = \"\" + USE_STRICT_VALIDATION\n )\n private boolean useStrictValidation = USE_STRICT_VALIDATION;\n\n public SpaceAtStartCommentDiagnostic() {" + "text": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_LEFT\n )\n private String listForCheckLeft = DEFAULT_LIST_FOR_CHECK_LEFT;" } } }, @@ -51563,7 +51563,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "f9cecdea954ae772066b1228214c05cede7e9f6ec9c50dcf221eb8c663ab79c4" + "equalIndicator/v1": "fb15fb0d148d2601477d8fdf6280f4ebb4d472be87d1557eb2218490c821131d" }, "properties": { "ideaSeverity": "WARNING", @@ -51571,37 +51571,37 @@ } }, { - "ruleId": "FieldMayBeFinal", + "ruleId": "TrivialStringConcatenation", "kind": "fail", "level": "warning", "message": { - "text": "Field 'maxValuesCount' may be 'final'", - "markdown": "Field `maxValuesCount` may be 'final'" + "text": "Empty string used in concatenation", + "markdown": "Empty string used in concatenation" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/NumberOfValuesInStructureConstructorDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 55, - "startColumn": 15, - "charOffset": 2181, - "charLength": 14, + "startLine": 94, + "startColumn": 20, + "charOffset": 3746, + "charLength": 2, "snippet": { - "text": "maxValuesCount" + "text": "\"\"" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 53, + "startLine": 92, "startColumn": 1, - "charOffset": 2122, - "charLength": 106, + "charOffset": 3678, + "charLength": 172, "snippet": { - "text": " defaultValue = \"\" + MAX_VALUES_COUNT\n )\n private int maxValuesCount = MAX_VALUES_COUNT;\n\n @Override" + "text": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_RIGHT\n )\n private String listForCheckRight = DEFAULT_LIST_FOR_CHECK_RIGHT;" } } }, @@ -51614,7 +51614,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "87c47d6aaf310152a66939cf27acab191df9f07b6046ae8912a8ede5f21fe64b" + "equalIndicator/v1": "7eb40371ef86e50013987dd6bac35549e3b62bdfa1c65762e1b2bd3a3ac1ea2b" }, "properties": { "ideaSeverity": "WARNING", @@ -51622,12 +51622,12 @@ } }, { - "ruleId": "FieldMayBeFinal", + "ruleId": "TrivialStringConcatenation", "kind": "fail", "level": "warning", "message": { - "text": "Field 'checkSpaceToRightOfUnary' may be 'final'", - "markdown": "Field `checkSpaceToRightOfUnary` may be 'final'" + "text": "Empty string used in concatenation", + "markdown": "Empty string used in concatenation" }, "locations": [ { @@ -51637,22 +51637,22 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 108, - "startColumn": 19, - "charOffset": 4185, - "charLength": 24, + "startLine": 100, + "startColumn": 20, + "charOffset": 3920, + "charLength": 2, "snippet": { - "text": "checkSpaceToRightOfUnary" + "text": "\"\"" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 106, + "startLine": 98, "startColumn": 1, - "charOffset": 4101, - "charLength": 174, + "charOffset": 3852, + "charLength": 197, "snippet": { - "text": " defaultValue = \"\" + DEFAULT_CHECK_SPACE_TO_RIGHT_OF_UNARY\n )\n private boolean checkSpaceToRightOfUnary = DEFAULT_CHECK_SPACE_TO_RIGHT_OF_UNARY;\n\n @DiagnosticParameter(" + "text": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_LEFT_AND_RIGHT\n )\n private String listForCheckLeftAndRight = DEFAULT_LIST_FOR_CHECK_LEFT_AND_RIGHT;" } } }, @@ -51665,7 +51665,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "7e21fcefd988ea8d9ce95a971c1e7044f6a0b350f8ce7919e237c50f23e484a5" + "equalIndicator/v1": "acc1fddfdcfd240ef1a1973491f5c9a7a1a234e9fe816fa19231d8a187d483af" }, "properties": { "ideaSeverity": "WARNING", @@ -51673,37 +51673,37 @@ } }, { - "ruleId": "FieldMayBeFinal", + "ruleId": "SimplifyStreamApiCallChains", "kind": "fail", "level": "warning", "message": { - "text": "Field 'listForCheckRight' may be 'final'", - "markdown": "Field `listForCheckRight` may be 'final'" + "text": "'collect(toList())' can be replaced with 'toList()'", + "markdown": "'collect(toList())' can be replaced with 'toList()'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RefOveruseDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 96, - "startColumn": 18, - "charOffset": 3801, - "charLength": 17, + "startLine": 189, + "startColumn": 8, + "charOffset": 7746, + "charLength": 28, "snippet": { - "text": "listForCheckRight" + "text": "collect(Collectors.toList())" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 94, + "startLine": 187, "startColumn": 1, - "charOffset": 3727, - "charLength": 148, + "charOffset": 7656, + "charLength": 156, "snippet": { - "text": " defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_RIGHT\n )\n private String listForCheckRight = DEFAULT_LIST_FOR_CHECK_RIGHT;\n\n @DiagnosticParameter(" + "text": " .map(SDBLParser.JoinPartContext::dataSource)\n .filter(Objects::nonNull)\n .collect(Collectors.toList());\n result.addAll(joinDataSources);\n" } } }, @@ -51716,7 +51716,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "abb038d57f734ce95201682f39a1b20cf60a23fc47c98ca095d545da1e701899" + "equalIndicator/v1": "17d74d3e6d2050db19b35a82988c414d5df2b42f699edb07c1a6694ccbae1853" }, "properties": { "ideaSeverity": "WARNING", @@ -51724,37 +51724,37 @@ } }, { - "ruleId": "FieldMayBeFinal", + "ruleId": "SimplifyStreamApiCallChains", "kind": "fail", "level": "warning", "message": { - "text": "Field 'allowMultipleCommas' may be 'final'", - "markdown": "Field `allowMultipleCommas` may be 'final'" + "text": "'collect(toList())' can be replaced with 'toList()'", + "markdown": "'collect(toList())' can be replaced with 'toList()'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RefOveruseDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 114, - "startColumn": 19, - "charOffset": 4378, - "charLength": 19, + "startLine": 194, + "startColumn": 8, + "charOffset": 7962, + "charLength": 28, "snippet": { - "text": "allowMultipleCommas" + "text": "collect(Collectors.toList())" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 112, + "startLine": 192, "startColumn": 1, - "charOffset": 4302, - "charLength": 159, + "charOffset": 7813, + "charLength": 220, "snippet": { - "text": " defaultValue = \"\" + DEFAULT_ALLOW_MULTIPLE_COMMAS\n )\n private boolean allowMultipleCommas = DEFAULT_ALLOW_MULTIPLE_COMMAS;\n\n private String mainMessage;" + "text": " var dataSourcesFromJoins = joinDataSources.stream()\n .flatMap(dataSourceContext1 -> getInnerDataSource(dataSourceContext1).stream())\n .collect(Collectors.toList());\n\n result.addAll(dataSourcesFromJoins);" } } }, @@ -51767,7 +51767,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "5e3f88f81e6609dbc0f651ceb14e725fcf9d8d2c89f8f89ff5e6e2eb4bfb4991" + "equalIndicator/v1": "fe1cff73a4d212eda0419e55c9fb3511150ec7ced976a89aaaf44849d559b4db" }, "properties": { "ideaSeverity": "WARNING", @@ -51779,33 +51779,33 @@ "kind": "fail", "level": "warning", "message": { - "text": "Field 'listForCheckLeft' may be 'final'", - "markdown": "Field `listForCheckLeft` may be 'final'" + "text": "Field 'exitPoint' may be 'final'", + "markdown": "Field `exitPoint` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/cfg/ControlFlowGraph.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 90, - "startColumn": 18, - "charOffset": 3629, - "charLength": 16, + "startLine": 35, + "startColumn": 22, + "charOffset": 1188, + "charLength": 9, "snippet": { - "text": "listForCheckLeft" + "text": "exitPoint" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 88, + "startLine": 33, "startColumn": 1, - "charOffset": 3556, - "charLength": 145, + "charOffset": 1156, + "charLength": 66, "snippet": { - "text": " defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_LEFT\n )\n private String listForCheckLeft = DEFAULT_LIST_FOR_CHECK_LEFT;\n\n @DiagnosticParameter(" + "text": "\n @Getter\n private ExitVertex exitPoint;\n\n ControlFlowGraph() {" } } }, @@ -51818,7 +51818,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "d457d8c541163b726a3f23a0fbdfc2ae02e50c282649e0f2685243917f6b4271" + "equalIndicator/v1": "5fde6b97e131c264200fad1f6b6437d403538b270f5ba0c9c3e97658c2d8badb" }, "properties": { "ideaSeverity": "WARNING", @@ -51830,33 +51830,33 @@ "kind": "fail", "level": "warning", "message": { - "text": "Field 'listForCheckLeftAndRight' may be 'final'", - "markdown": "Field `listForCheckLeftAndRight` may be 'final'" + "text": "Field 'maxReturnsCount' may be 'final'", + "markdown": "Field `maxReturnsCount` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingSpaceDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TooManyReturnsDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 102, - "startColumn": 18, - "charOffset": 3984, - "charLength": 24, + "startLine": 60, + "startColumn": 15, + "charOffset": 2433, + "charLength": 15, "snippet": { - "text": "listForCheckLeftAndRight" + "text": "maxReturnsCount" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 100, + "startLine": 58, "startColumn": 1, - "charOffset": 3901, - "charLength": 173, + "charOffset": 2373, + "charLength": 154, "snippet": { - "text": " defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_LEFT_AND_RIGHT\n )\n private String listForCheckLeftAndRight = DEFAULT_LIST_FOR_CHECK_LEFT_AND_RIGHT;\n\n @DiagnosticParameter(" + "text": " defaultValue = \"\" + MAX_RETURNS_COUNT\n )\n private int maxReturnsCount = MAX_RETURNS_COUNT;\n\n private static String leftSubStr(String inputString) {" } } }, @@ -51869,7 +51869,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "82b5ba611a4eb1fca6545e5cc822b4535e373a717e6d858ceefbe483689e4de7" + "equalIndicator/v1": "5f3e2c52b8ad320491b1a66cd0092fb9227d929d589f841a66fca89c318682a4" }, "properties": { "ideaSeverity": "WARNING", @@ -51881,33 +51881,33 @@ "kind": "fail", "level": "warning", "message": { - "text": "Field 'isAllowedMethodADD' may be 'final'", - "markdown": "Field `isAllowedMethodADD` may be 'final'" + "text": "Field 'maxLineLength' may be 'final'", + "markdown": "Field `maxLineLength` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DuplicatedInsertionIntoCollectionDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 83, - "startColumn": 19, - "charOffset": 3751, - "charLength": 18, + "startLine": 62, + "startColumn": 15, + "charOffset": 2396, + "charLength": 13, "snippet": { - "text": "isAllowedMethodADD" + "text": "maxLineLength" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 81, + "startLine": 60, "startColumn": 1, - "charOffset": 3683, - "charLength": 173, + "charOffset": 2338, + "charLength": 115, "snippet": { - "text": " defaultValue = \"\" + IS_ALLOWED_METHOD_ADD\n )\n private boolean isAllowedMethodADD = IS_ALLOWED_METHOD_ADD;\n private Pattern methodPattern = INSERT_ADD_METHOD_PATTERN;\n" + "text": " defaultValue = \"\" + MAX_LINE_LENGTH\n )\n private int maxLineLength = MAX_LINE_LENGTH;\n\n @DiagnosticParameter(" } } }, @@ -51920,7 +51920,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "a49c8aa361cb73d969fce7c0decd4f9f2063722846f78165b656adb53beb615f" + "equalIndicator/v1": "85c58414dc44e34b845db47c2404b666bf3c68f99772ca6f70ec5b0de663d67c" }, "properties": { "ideaSeverity": "WARNING", @@ -51928,37 +51928,37 @@ } }, { - "ruleId": "CommentedOutCode", + "ruleId": "FieldMayBeFinal", "kind": "fail", - "level": "note", + "level": "warning", "message": { - "text": "Commented out code (6 lines)", - "markdown": "Commented out code (6 lines)" + "text": "Field 'checkMethodDescription' may be 'final'", + "markdown": "Field `checkMethodDescription` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 72, - "startColumn": 1, - "charOffset": 3029, - "charLength": 2, + "startLine": 68, + "startColumn": 19, + "charOffset": 2551, + "charLength": 22, "snippet": { - "text": "//" + "text": "checkMethodDescription" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 70, + "startLine": 66, "startColumn": 1, - "charOffset": 2993, - "charLength": 120, + "charOffset": 2480, + "charLength": 201, "snippet": { - "text": " var range = params.getRange();\n\n// var ast = documentContext.getAst();\n// Trees.findAllRuleNodes(\n// ast," + "text": " defaultValue = \"\" + CHECK_METHOD_DESCRIPTION\n )\n private boolean checkMethodDescription = CHECK_METHOD_DESCRIPTION;\n\n private final Map> tokensInOneLine = new HashMap<>();" } } }, @@ -51971,11 +51971,11 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "140fdd15ad1c0ab3d2ff0a809804359b9793a40bb71dca1f139d768129204d80" + "equalIndicator/v1": "86a5f98338add7295ae35668b22c99b5d74a47cced2cc01e20e15f71306f6eac" }, "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } } ], diff --git a/qodana/results/result-allProblems.json b/qodana/results/result-allProblems.json index c86725dfd70..efdc9639187 100644 --- a/qodana/results/result-allProblems.json +++ b/qodana/results/result-allProblems.json @@ -199,14 +199,14 @@ "type": "file", "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/DescriptionReader.java", "language": "JAVA", - "line": 263, + "line": 372, "offset": 9, "length": 4, "code": { - "startLine": 261, + "startLine": 370, "length": 4, - "offset": 156, - "surroundingCode": " } else if (string.subParameter() != null) { // это строка с вложенным параметром типа\n current.addSubParameter(string.subParameter());\n } else { // прочее - пустая строка\n // noop\n }" + "offset": 137, + "surroundingCode": " } else if (paramType.complexType() != null) {\n addType(paramDescription, paramType.complexType().getText(), false);\n } else {\n // noop\n }" } } ], @@ -214,7 +214,7 @@ "module": "bsl-language-server.main", "inspectionName": "EmptyStatementBody" }, - "hash": "cfe77286b84db65fe7eb570f50a05fbf1a83934a6d87ca90808073f679fbcb1f" + "hash": "afac6956d55abd8bcd728a92b79ed0b4280a00b2107ba85419780ba3380edfb7" },{ "tool": "Code Inspection", "category": "Probable bugs", @@ -230,14 +230,14 @@ "type": "file", "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/DescriptionReader.java", "language": "JAVA", - "line": 372, + "line": 124, "offset": 9, "length": 4, "code": { - "startLine": 370, + "startLine": 122, "length": 4, - "offset": 137, - "surroundingCode": " } else if (paramType.complexType() != null) {\n addType(paramDescription, paramType.complexType().getText(), false);\n } else {\n // noop\n }" + "offset": 158, + "surroundingCode": " } else if (string.subParameter() != null) { // это строка с вложенным параметром типа\n fakeParam.addSubParameter(string.subParameter());\n } else { // прочее - пустая строка\n // noop\n }" } } ], @@ -245,7 +245,7 @@ "module": "bsl-language-server.main", "inspectionName": "EmptyStatementBody" }, - "hash": "afac6956d55abd8bcd728a92b79ed0b4280a00b2107ba85419780ba3380edfb7" + "hash": "ca7195dc12bd26b031fb8cc9f47e4748b3a43dac1633be1683282470e7c638a0" },{ "tool": "Code Inspection", "category": "Probable bugs", @@ -261,14 +261,14 @@ "type": "file", "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/DescriptionReader.java", "language": "JAVA", - "line": 124, + "line": 263, "offset": 9, "length": 4, "code": { - "startLine": 122, + "startLine": 261, "length": 4, - "offset": 158, - "surroundingCode": " } else if (string.subParameter() != null) { // это строка с вложенным параметром типа\n fakeParam.addSubParameter(string.subParameter());\n } else { // прочее - пустая строка\n // noop\n }" + "offset": 156, + "surroundingCode": " } else if (string.subParameter() != null) { // это строка с вложенным параметром типа\n current.addSubParameter(string.subParameter());\n } else { // прочее - пустая строка\n // noop\n }" } } ], @@ -276,7 +276,7 @@ "module": "bsl-language-server.main", "inspectionName": "EmptyStatementBody" }, - "hash": "ca7195dc12bd26b031fb8cc9f47e4748b3a43dac1633be1683282470e7c638a0" + "hash": "cfe77286b84db65fe7eb570f50a05fbf1a83934a6d87ca90808073f679fbcb1f" },{ "tool": "Code Inspection", "category": "Probable bugs",