diff --git a/qodana/results/descriptions/Code_Inspection.json b/qodana/results/descriptions/Code_Inspection.json index 24b5776509d..537de945d7d 100644 --- a/qodana/results/descriptions/Code_Inspection.json +++ b/qodana/results/descriptions/Code_Inspection.json @@ -187,18 +187,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": "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": "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": "ReplaceToStringWithStringTemplate", "displayName": "Call of 'toString' could be replaced with string template", @@ -421,18 +421,18 @@ "enabled": false, "description": "Reports `isEmpty`, `isBlank`, `isNotEmpty`, or `isNotBlank` calls in an `if` statement to assign a default value.\n\nThe quick-fix replaces the `if` condition with `ifEmpty` or `ifBlank` calls.\n\n**Example:**\n\n\n fun test(list: List): List {\n return if (list.isEmpty()) {\n println()\n foo()\n } else {\n list\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(list: List): List {\n return list.ifEmpty {\n println()\n foo()\n }\n }\n\nThis inspection only reports if the Kotlin language version of the project or module is 1.3 or higher." }, - { - "shortName": "ReplaceNegatedIsEmptyWithIsNotEmpty", - "displayName": "Negated call can be simplified", - "enabled": false, - "description": "Reports negation `isEmpty()` and `isNotEmpty()` for collections and `String`, or `isBlank()` and `isNotBlank()` for `String`.\n\nUsing corresponding functions makes your code simpler.\n\nThe quick-fix replaces the negation call with the corresponding call from the Standard Library.\n\n**Example:**\n\n\n fun main() {\n val list = listOf(1,2,3)\n if (!list.isEmpty()) {\n // do smth\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val list = listOf(1,2,3)\n if (list.isNotEmpty()) {\n // do smth\n }\n }\n" - }, { "shortName": "ReplaceWithImportAlias", "displayName": "Fully qualified name can be replaced with existing import alias", "enabled": false, "description": "Reports fully qualified names that can be replaced with an existing import alias.\n\n**Example:**\n\n\n import foo.Foo as Bar\n fun main() {\n foo.Foo()\n }\n\nAfter the quick-fix is applied:\n\n\n import foo.Foo as Bar\n fun main() {\n Bar()\n }\n" }, + { + "shortName": "ReplaceNegatedIsEmptyWithIsNotEmpty", + "displayName": "Negated call can be simplified", + "enabled": false, + "description": "Reports negation `isEmpty()` and `isNotEmpty()` for collections and `String`, or `isBlank()` and `isNotBlank()` for `String`.\n\nUsing corresponding functions makes your code simpler.\n\nThe quick-fix replaces the negation call with the corresponding call from the Standard Library.\n\n**Example:**\n\n\n fun main() {\n val list = listOf(1,2,3)\n if (!list.isEmpty()) {\n // do smth\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val list = listOf(1,2,3)\n if (list.isNotEmpty()) {\n // do smth\n }\n }\n" + }, { "shortName": "SimplifyBooleanWithConstants", "displayName": "Boolean expression can be simplified", @@ -1646,18 +1646,18 @@ "enabled": false, "description": "Reports method and constructor calls that implicitly use the platform default charset. Such calls can produce different results on systems that use a different default charset and may result in unexpected behaviour.\n\n**Example:**\n\n void foo(byte[] bytes) {\n String s = new String(bytes);\n }\n\nYou can use a quick-fix that specifies the explicit UTF-8 charset if the corresponding overloaded method is available.\nAfter the quick-fix is applied:\n\n void foo(byte[] bytes) {\n String s = new String(bytes, StandardCharsets.UTF_8);\n }\n" }, - { - "shortName": "StringTokenizer", - "displayName": "Use of 'StringTokenizer'", - "enabled": false, - "description": "Reports usages of the `StringTokenizer` class. Excessive use of `StringTokenizer` is incorrect in an internationalized environment." - }, { "shortName": "UnnecessaryUnicodeEscape", "displayName": "Unnecessary unicode escape sequence", "enabled": false, "description": "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" }, + { + "shortName": "StringTokenizer", + "displayName": "Use of 'StringTokenizer'", + "enabled": false, + "description": "Reports usages of the `StringTokenizer` class. Excessive use of `StringTokenizer` is incorrect in an internationalized environment." + }, { "shortName": "NumericToString", "displayName": "Call to 'Number.toString()'", @@ -3094,12 +3094,6 @@ "enabled": true, "description": "Reports suspicious indentation of statements after a control statement without braces.\n\n\nSuch indentation can make it look like the statement is inside the control statement,\nwhen in fact it will be executed unconditionally after the control statement.\n\n**Example:**\n\n\n class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }\n" }, - { - "shortName": "SuspiciousDateFormat", - "displayName": "Suspicious date format pattern", - "enabled": true, - "description": "Reports date format patterns that are likely used by mistake.\n\nThe following patterns are reported:\n\n* Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December.\n* Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended.\n* Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended.\n* Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended.\n* Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended.\n\n\nExamples: \n\n`new SimpleDateFormat(\"YYYY-MM-dd\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"yyyy-MM-DD\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"HH:MM\")`: likely `\"HH:mm\"` was intended.\n\nNew in 2020.1" - }, { "shortName": "ClassNewInstance", "displayName": "Unsafe call to 'Class.newInstance()'", @@ -3112,6 +3106,12 @@ "enabled": true, "description": "Reports expressions that can be replaced with \"magic\" constants.\n\nExample 1:\n\n\n // Bare literal \"2\" is used, warning:\n Font font = new Font(\"Arial\", 2)\n\nExample 2:\n\n\n // Predefined constant is used, good:\n Font font = new Font(\"Arial\", Font.ITALIC)\n\n\nWhen possible, the quick-fix inserts an appropriate predefined constant.\n\n\nThe behavior of this inspection is controlled by `org.intellij.lang.annotations.MagicConstant` annotation.\nSome standard Java library methods are pre-annotated, but you can use this annotation in your code as well." }, + { + "shortName": "SuspiciousDateFormat", + "displayName": "Suspicious date format pattern", + "enabled": true, + "description": "Reports date format patterns that are likely used by mistake.\n\nThe following patterns are reported:\n\n* Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December.\n* Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended.\n* Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended.\n* Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended.\n* Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended.\n\n\nExamples: \n\n`new SimpleDateFormat(\"YYYY-MM-dd\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"yyyy-MM-DD\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"HH:MM\")`: likely `\"HH:mm\"` was intended.\n\nNew in 2020.1" + }, { "shortName": "StaticFieldReferenceOnSubclass", "displayName": "Static field referenced via subclass", @@ -3720,161 +3720,6 @@ } ] }, - { - "name": "Declaration redundancy", - "inspections": [ - { - "shortName": "UnusedReturnValue", - "displayName": "Method can be made 'void'", - "enabled": false, - "description": "Reports methods whose return values are never used when called. The return type of such methods can be made `void`.\n\nMethods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\nThe quick-fix updates the method signature and removes `return` statements from inside the method.\n\n**Example:**\n\n\n // reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }\n\nAfter the quick-fix is applied to both methods:\n\n\n protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...\n\n\n**NOTE:** Some methods might not be reported during in-editor highlighting due to performance reasons.\nTo see all results, run the inspection using **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**\\>\n\nUse the **Ignore chainable methods** option to ignore unused return values from chainable calls.\n\nUse the **Maximal reported method visibility** option to control the maximum visibility of methods to be reported." - }, - { - "shortName": "unused", - "displayName": "Unused declaration", - "enabled": false, - "description": "Reports classes, methods, or fields that are not used or unreachable from the entry points.\n\nAn entry point can be a main method, tests, classes from outside the specified scope, classes accessible from\n`module-info.java`, and so on. It is possible to configure custom entry points by using name patterns or annotations.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nIn this example, `Department` explicitly references `Organization` but if `Department` class itself is unused, then inspection will report both classes.\n\n\nThe inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local\nvariables that are declared but not used.\n\n\n**Note:** Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is\nchecked only when its name rarely occurs in the project.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the visibility settings below to configure members to be reported. For example, configuring report `private` methods only means\nthat `public` methods of `private` inner class will be reported but `protected` methods of top level class\nwill be ignored.\n\n\nUse the **entry points** tab to configure entry points to be considered during the inspection run.\n\nYou can add entry points manually when inspection results are ready.\n\nIf your code uses unsupported frameworks, there are several options:\n\n* If the framework relies on annotations, use the **Annotations...** button to configure the framework's annotations.\n* If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.\n\nThis way the annotated code accessible by the framework internals will be treated as used." - }, - { - "shortName": "ProtectedMemberInFinalClass", - "displayName": "'protected' member in 'final' class", - "enabled": false, - "description": "Reports `protected` members in `final`classes.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." - }, - { - "shortName": "EmptyInitializer", - "displayName": "Empty class initializer", - "enabled": false, - "description": "Reports empty class initializer blocks." - }, - { - "shortName": "UnusedLibrary", - "displayName": "Unused library", - "enabled": false, - "description": "Reports libraries attached to the specified inspection scope that are not used directly in code." - }, - { - "shortName": "TrivialFunctionalExpressionUsage", - "displayName": "Trivial usage of functional expression", - "enabled": false, - "description": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n" - }, - { - "shortName": "RedundantLambdaParameterType", - "displayName": "Redundant lambda parameter types", - "enabled": false, - "description": "Reports lambda formal parameter types that are redundant because they can be inferred from the context.\n\n**Example:**\n\n\n Map map = ...\n map.forEach((String s, Integer i) -> log.info(s + \"=\" + i));\n\nThe quick-fix removes the parameter types from the lambda.\n\n\n Map map = ...\n map.forEach((s, i) -> log.info(s + \"=\" + i));\n" - }, - { - "shortName": "AccessStaticViaInstance", - "displayName": "Access static member via instance reference", - "enabled": false, - "description": "Reports references to `static` methods and fields via a class instance rather than the class itself.\n\nEven though referring to static members via instance variables is allowed by The Java Language Specification,\nthis makes the code confusing as the reader may think that the result of the method depends on the instance.\n\nThe quick-fix replaces the instance variable with the class name.\n\nExample:\n\n\n String s1 = s.valueOf(0);\n\nAfter the quick-fix is applied:\n\n\n String s = String.valueOf(0);\n" - }, - { - "shortName": "UnnecessaryModuleDependencyInspection", - "displayName": "Unnecessary module dependency", - "enabled": false, - "description": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies." - }, - { - "shortName": "CanBeFinal", - "displayName": "Declaration can have 'final' modifier", - "enabled": false, - "description": "Reports fields, methods, or classes that may have the `final` modifier added to their declarations.\n\nFinal classes can't be extended, final methods can't be overridden, and final fields can't be reassigned.\n\n**Example:**\n\n\n public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }\n\nUse the **Report classes** and **Report methods** options to define which declarations are to be reported." - }, - { - "shortName": "EmptyMethod", - "displayName": "Empty method", - "enabled": false, - "description": "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." - }, - { - "shortName": "RedundantExplicitClose", - "displayName": "Redundant 'close()'", - "enabled": false, - "description": "Reports unnecessary calls to `close()` at the end of a try-with-resources block and suggests removing them.\n\n**Example**:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n ac.close();\n }\n\nAfter the quick-fix is applied:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n }\n\nNew in 2018.1" - }, - { - "shortName": "RedundantThrows", - "displayName": "Redundant 'throws' clause", - "enabled": false, - "description": "Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and overriding methods.\n\nThe inspection ignores methods related to serialization, for example the methods `readObject()` and `writeObject()`.\n\n**Example:**\n\n\n void method() throws InterruptedException {\n System.out.println();\n }\n\nThe quick-fix removes unnecessary exceptions from the declaration and normalizes redundant `try`-`catch` statements:\n\n\n void method() {\n System.out.println();\n }\n\n\n**Note:** Some exceptions may not be reported during in-editor highlighting for performance reasons.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the **Ignore exceptions thrown by entry point methods** option to not report exceptions thrown by\nfor example `main()` methods.\nEntry point methods can be configured in the settings of the\n[Java \\| Declaration redundancy \\| Unused declaration](settings://Errors?Unused%20Declaration%20entry%20point) inspection.\n\n
" - }, - { - "shortName": "DuplicateThrows", - "displayName": "Duplicate throws", - "enabled": false, - "description": "Reports duplicate exceptions in a method `throws` list.\n\nExample:\n\n\n void f() throws Exception, Exception {}\n\nAfter the quick-fix is applied:\n\n\n void f() throws Exception {}\n\n\nUse the **Ignore exceptions subclassing others** option to ignore exceptions subclassing other exceptions." - }, - { - "shortName": "UnusedLabel", - "displayName": "Unused label", - "enabled": false, - "description": "Reports labels that are not targets of any `break` or `continue` statements.\n\n**Example:**\n\n\n label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nAfter the quick-fix is applied, the label is removed:\n\n\n for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n" - }, - { - "shortName": "DefaultAnnotationParam", - "displayName": "Default annotation parameter value", - "enabled": false, - "description": "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" - }, - { - "shortName": "SameParameterValue", - "displayName": "Method parameter always has the same value", - "enabled": false, - "description": "Reports method parameters that always have the same constant value.\n\nExample:\n\n\n static void printPoint(int x, int y) { // x is always 0\n System.out.println(x + \", \" + y);\n }\n\n public static void main(String[] args) {\n printPoint(0, 1);\n printPoint(0, 2);\n }\n\nThe quick-fix inlines the constant value. This may simplify the method implementation.\n\n\nUse the **Ignore when a quick-fix can not be provided** option to suppress the inspections when:\n\n* the parameter is modified inside the method\n* the parameter value that is being passed is a reference to an inaccessible field (Java ony)\n* the parameter is a vararg (Java only)\n\n\nUse the **Maximal method visibility** option to control the maximum visibility of methods to be reported.\n\n\nUse the **Minimal method usage count to report parameter** field to specify the minimal number of method usages with the same parameter value." - }, - { - "shortName": "SameReturnValue", - "displayName": "Method always returns the same value", - "enabled": false, - "description": "Reports methods and method hierarchies that always return the same constant.\n\n\nThe inspection works differently in batch-mode\n(from **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**)\nand on-the-fly in the editor:\n\n* In batch-mode, the inspection reports methods and method hierarchies that always return the same constant.\n* In the editor, the inspection only reports methods that have more than one `return` statement, do not have super methods, and cannot be overridden. If a method overrides or implements a method, a contract may require it to return a specific constant, but at the same time, we may want to have several exit points. If a method can be overridden, it is possible that a different value will be returned in subclasses.\n\n**Example:**\n\n\n class X {\n // Warn only in batch-mode:\n int xxx() { // Method 'xxx()' and all its overriding methods always return '0'\n return 0;\n }\n }\n\n class Y extends X {\n @Override\n int xxx() {\n return 0;\n }\n\n // Warn only in batch-mode:\n int yyy() { // Method 'yyy()' always returns '0'\n return 0;\n }\n\n // Warn both in batch-mode and on-the-fly:\n final int zzz(boolean flag) { // Method 'zzz()' always returns '0'\n if (Math.random() > 0.5) {\n return 0;\n }\n return 0;\n }\n }\n" - }, - { - "shortName": "RedundantRecordConstructor", - "displayName": "Redundant record constructor", - "enabled": false, - "description": "Reports redundant constructors declared inside Java records.\n\n**Example 1:**\n\n\n record Point(int x, int y) {\n public Point {} // could be removed\n }\n \n record Point(int x, int y) {\n public Point(int x, int y) { // could be removed\n this.x = x;\n this.y = y;\n }\n }\n\nThe quick-fix removes the redundant constructors.\n\n**Example 2:**\n\n\n // could be converted to compact constructor\n record Range(int from, int to) {\n public Range(int from, int to) {\n if (from > to) throw new IllegalArgumentException();\n this.from = from;\n this.to = to;\n }\n }\n\nThe quick-fix converts this code into a compact constructor.\n\nThis inspection only reports if the language level of the project or module is 16 or higher.\n\nNew in 2020.1" - }, - { - "shortName": "WeakerAccess", - "displayName": "Declaration access can be weaker", - "enabled": false, - "description": "Reports fields, methods or classes that may have their access modifier narrowed down.\n\nExample:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }\n\nAfter the quick-fix is applied:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }\n\nUse the inspection's options to define the rules for the modifier change suggestions." - }, - { - "shortName": "FinalMethodInFinalClass", - "displayName": "'final' method in 'final' class", - "enabled": false, - "description": "Reports `final` methods in `final` classes.\n\nSince `final` classes cannot be inherited, marking a method as `final`\nmay be unnecessary and confusing.\n\n**Example:**\n\n record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." - }, - { - "shortName": "Java9RedundantRequiresStatement", - "displayName": "Redundant 'requires' directive in module-info", - "enabled": false, - "description": "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" - }, - { - "shortName": "SillyAssignment", - "displayName": "Variable is assigned to itself", - "enabled": false, - "description": "Reports assignments of a variable to itself.\n\n**Example:**\n\n\n a = a;\n\nThe quick-fix removes the assigment." - }, - { - "shortName": "FunctionalExpressionCanBeFolded", - "displayName": "Functional expression can be folded", - "enabled": false, - "description": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation.\n\nExample:\n\n\n SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());\n\nAfter the quick-fix is applied:\n\n\n SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);\n\nThis inspection reports only if the language level of the project or module is 8 or higher." - }, - { - "shortName": "GroovyUnusedDeclaration", - "displayName": "Unused declaration", - "enabled": false, - "description": "Reports unused classes, methods and fields.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nHere `Department` explicitly references `Organization` but if `Department` class itself is unused,\nthen inspection would report both classes.\n\n\nThe inspection also reports parameters, which are not used by their methods and all method implementations/overriders, as well as local\nvariables, which are declared but not used.\n\nFor more information, see the same inspection in Java." - } - ] - }, { "name": "Error handling", "inspections": [ @@ -4091,60 +3936,215 @@ ] }, { - "name": "Migration", + "name": "Declaration redundancy", "inspections": [ { - "shortName": "NonExhaustiveWhenStatementMigration", - "displayName": "Non-exhaustive 'when' statements will be prohibited since 1.7", + "shortName": "UnusedReturnValue", + "displayName": "Method can be made 'void'", "enabled": false, - "description": "Reports a non-exhaustive `when` statements that will lead to compilation error since 1.7.\n\nMotivation types:\n\n* Problematic/meaningless usage patterns need to be discouraged/blocked (e.g. counterintuitive behaviors)\n * Code is error-prone\n* Inconsistency in the design (things are done differently in different contexts)\n\nImpact types:\n\n* Compilation. Some code that used to compile won't compile any more\n * There were cases when such code worked with no exceptions\n * Some such code could compile without any warnings\n\n**More details:** [KT-47709: Make when statements with enum, sealed, and Boolean subjects exhaustive by default](https://youtrack.jetbrains.com/issue/KT-47709)\n\nThe quick-fix adds the missing `else -> {}` branch.\n\n**Example:**\n\n\n sealed class Base {\n class A : Base()\n class B : Base()\n }\n\n fun test(base: Base) {\n when (base) {\n is Base.A -> \"\"\n }\n }\n\nAfter the quick-fix is applied:\n\n\n sealed class Base {\n class A : Base()\n class B : Base()\n }\n\n fun test(base: Base) {\n when (base) {\n is Base.A -> \"\"\n else -> {}\n }\n }\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.6 or higher." + "description": "Reports methods whose return values are never used when called. The return type of such methods can be made `void`.\n\nMethods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\nThe quick-fix updates the method signature and removes `return` statements from inside the method.\n\n**Example:**\n\n\n // reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }\n\nAfter the quick-fix is applied to both methods:\n\n\n protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...\n\n\n**NOTE:** Some methods might not be reported during in-editor highlighting due to performance reasons.\nTo see all results, run the inspection using **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**\\>\n\nUse the **Ignore chainable methods** option to ignore unused return values from chainable calls.\n\nUse the **Maximal reported method visibility** option to control the maximum visibility of methods to be reported." }, { - "shortName": "InlineClassDeprecatedMigration", - "displayName": "Inline classes are deprecated since 1.5", + "shortName": "unused", + "displayName": "Unused declaration", "enabled": false, - "description": "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." + "description": "Reports classes, methods, or fields that are not used or unreachable from the entry points.\n\nAn entry point can be a main method, tests, classes from outside the specified scope, classes accessible from\n`module-info.java`, and so on. It is possible to configure custom entry points by using name patterns or annotations.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nIn this example, `Department` explicitly references `Organization` but if `Department` class itself is unused, then inspection will report both classes.\n\n\nThe inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local\nvariables that are declared but not used.\n\n\n**Note:** Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is\nchecked only when its name rarely occurs in the project.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the visibility settings below to configure members to be reported. For example, configuring report `private` methods only means\nthat `public` methods of `private` inner class will be reported but `protected` methods of top level class\nwill be ignored.\n\n\nUse the **entry points** tab to configure entry points to be considered during the inspection run.\n\nYou can add entry points manually when inspection results are ready.\n\nIf your code uses unsupported frameworks, there are several options:\n\n* If the framework relies on annotations, use the **Annotations...** button to configure the framework's annotations.\n* If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.\n\nThis way the annotated code accessible by the framework internals will be treated as used." }, { - "shortName": "AmbiguousExpressionInWhenBranchMigration", - "displayName": "Ambiguous logical expressions in 'when' branches since 1.7", + "shortName": "ProtectedMemberInFinalClass", + "displayName": "'protected' member in 'final' class", "enabled": false, - "description": "Reports ambiguous logical expressions in `when` branches which cause compilation errors in Kotlin 1.8 and later.\n\n\n fun Int.matches(strict: Boolean): Boolean = when (strict) {\n true -> this == 6\n this in (4..7) -> true // is ambiguous\n else -> false\n }\n\nAfter the quick-fix is applied:\n\n\n fun Int.matches(strict: Boolean): Boolean = when (strict) {\n true -> this == 6\n (this in (4..7)) -> true // wrapped in parentheses\n else -> false\n }\n\nInspection is available for Kotlin language level starting from 1.7." + "description": "Reports `protected` members in `final`classes.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." }, { - "shortName": "ProhibitJvmOverloadsOnConstructorsOfAnnotationClassesMigration", - "displayName": "'@JvmOverloads' annotation cannot be used on constructors of annotation classes since 1.4", + "shortName": "EmptyInitializer", + "displayName": "Empty class initializer", "enabled": false, - "description": "Reports `@JvmOverloads` on constructors of annotation classes because it's meaningless.\n\n\nThere is no footprint of `@JvmOverloads` in the generated bytecode and Kotlin metadata,\nso `@JvmOverloads` doesn't affect the generated bytecode and the code behavior.\n\n`@JvmOverloads` on constructors of annotation classes causes a compilation error since Kotlin 1.4.\n\n**Example:**\n\n\n annotation class A @JvmOverloads constructor(val x: Int = 1)\n\nAfter the quick-fix is applied:\n\n\n annotation class A constructor(val x: Int = 1)\n" + "description": "Reports empty class initializer blocks." }, { - "shortName": "CastDueToProgressionResolutionChangeMigration", - "displayName": "Progression resolution change since 1.9", + "shortName": "UnusedLibrary", + "displayName": "Unused library", "enabled": false, - "description": "Reports overloaded function calls where an argument requires an explicit cast to resolve to a proper declaration.\nThe current compiler warning (available since Kotlin 1.6.20) will become an error in Kotlin 1.8.\n\n\nProgressions and ranges types (`kotlin.ranges`) will start implementing the `Collection` interface in Kotlin\n1.9 and later. This update will cause a change in resolution for overloaded functions. For instance, in the example below, the\n`test(1..5)` call will be resolved to `test(t: Any)` in Kotlin 1.8 and earlier and to\n`test(t: Collection<*>)` in Kotlin 1.9 and later.\n\n\n fun test(t: Any) { }\n fun test(t: Collection<*>) { }\n fun invoke() {\n test(1..5) // IntRange becomes Collection in 1.9\n }\n\nThe provided quick-fix captures the behaviour specific to the compiler of version 1.8 and earlier:\n\n\n fun test(t: Any) { }\n fun test(t: Collection<*>) { }\n\n fun invoke() {\n test(1..5) // resolved to 'test(t: T)' before Kotlin 1.9\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(t: Any) { }\n fun test(t: Collection<*>) { }\n\n fun invoke() {\n test((1..5) as Iterable) // resolved to 'test(t: T)' in Kotlin 1.9\n }\n\nInspection is available for the Kotlin language level starting from 1.6." + "description": "Reports libraries attached to the specified inspection scope that are not used directly in code." }, { - "shortName": "AddConversionCallMigration", - "displayName": "Explicit conversion from `Int` needed since 1.9", + "shortName": "TrivialFunctionalExpressionUsage", + "displayName": "Trivial usage of functional expression", "enabled": false, - "description": "Reports expressions that will be of type `Int`, thus causing compilation errors in Kotlin 1.9 and later.\n\nExample:\n\n\n fun takeByte(x: Byte) {}\n\n fun foo() {\n takeByte(1 + 1) // will be resolved to Int in 1.9\n }\n\nAfter the quick-fix is applied:\n\n\n fun takeByte(x: Byte) {}\n\n fun foo() {\n takeByte((1 + 1).toByte()) // will be resolved to Int in 1.9\n }\n\nInspection is available for Kotlin language level starting from 1.7." + "description": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n" }, { - "shortName": "KotlinDeprecation", - "displayName": "Usage of redundant or deprecated syntax or deprecated symbols", + "shortName": "RedundantLambdaParameterType", + "displayName": "Redundant lambda parameter types", "enabled": false, - "description": "Reports obsolete language features and unnecessarily verbose code constructs during the code cleanup operation (**Code \\| Code Cleanup** ).\n\n\nThe quick-fix automatically replaces usages of obsolete language features or unnecessarily verbose code constructs with compact and up-to-date syntax.\n\n\nIt also replaces deprecated symbols with their proposed substitutions." + "description": "Reports lambda formal parameter types that are redundant because they can be inferred from the context.\n\n**Example:**\n\n\n Map map = ...\n map.forEach((String s, Integer i) -> log.info(s + \"=\" + i));\n\nThe quick-fix removes the parameter types from the lambda.\n\n\n Map map = ...\n map.forEach((s, i) -> log.info(s + \"=\" + i));\n" }, { - "shortName": "WarningOnMainUnusedParameterMigration", - "displayName": "Unused 'args' on 'main' since 1.4", + "shortName": "AccessStaticViaInstance", + "displayName": "Access static member via instance reference", "enabled": false, - "description": "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." + "description": "Reports references to `static` methods and fields via a class instance rather than the class itself.\n\nEven though referring to static members via instance variables is allowed by The Java Language Specification,\nthis makes the code confusing as the reader may think that the result of the method depends on the instance.\n\nThe quick-fix replaces the instance variable with the class name.\n\nExample:\n\n\n String s1 = s.valueOf(0);\n\nAfter the quick-fix is applied:\n\n\n String s = String.valueOf(0);\n" }, { - "shortName": "RedundantLabelMigration", - "displayName": "Redundant label", - "enabled": false, + "shortName": "UnnecessaryModuleDependencyInspection", + "displayName": "Unnecessary module dependency", + "enabled": false, + "description": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies." + }, + { + "shortName": "CanBeFinal", + "displayName": "Declaration can have 'final' modifier", + "enabled": false, + "description": "Reports fields, methods, or classes that may have the `final` modifier added to their declarations.\n\nFinal classes can't be extended, final methods can't be overridden, and final fields can't be reassigned.\n\n**Example:**\n\n\n public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }\n\nUse the **Report classes** and **Report methods** options to define which declarations are to be reported." + }, + { + "shortName": "EmptyMethod", + "displayName": "Empty method", + "enabled": false, + "description": "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." + }, + { + "shortName": "RedundantExplicitClose", + "displayName": "Redundant 'close()'", + "enabled": false, + "description": "Reports unnecessary calls to `close()` at the end of a try-with-resources block and suggests removing them.\n\n**Example**:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n ac.close();\n }\n\nAfter the quick-fix is applied:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n }\n\nNew in 2018.1" + }, + { + "shortName": "RedundantThrows", + "displayName": "Redundant 'throws' clause", + "enabled": false, + "description": "Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and overriding methods.\n\nThe inspection ignores methods related to serialization, for example the methods `readObject()` and `writeObject()`.\n\n**Example:**\n\n\n void method() throws InterruptedException {\n System.out.println();\n }\n\nThe quick-fix removes unnecessary exceptions from the declaration and normalizes redundant `try`-`catch` statements:\n\n\n void method() {\n System.out.println();\n }\n\n\n**Note:** Some exceptions may not be reported during in-editor highlighting for performance reasons.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the **Ignore exceptions thrown by entry point methods** option to not report exceptions thrown by\nfor example `main()` methods.\nEntry point methods can be configured in the settings of the\n[Java \\| Declaration redundancy \\| Unused declaration](settings://Errors?Unused%20Declaration%20entry%20point) inspection.\n\n
" + }, + { + "shortName": "DuplicateThrows", + "displayName": "Duplicate throws", + "enabled": false, + "description": "Reports duplicate exceptions in a method `throws` list.\n\nExample:\n\n\n void f() throws Exception, Exception {}\n\nAfter the quick-fix is applied:\n\n\n void f() throws Exception {}\n\n\nUse the **Ignore exceptions subclassing others** option to ignore exceptions subclassing other exceptions." + }, + { + "shortName": "UnusedLabel", + "displayName": "Unused label", + "enabled": false, + "description": "Reports labels that are not targets of any `break` or `continue` statements.\n\n**Example:**\n\n\n label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nAfter the quick-fix is applied, the label is removed:\n\n\n for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n" + }, + { + "shortName": "DefaultAnnotationParam", + "displayName": "Default annotation parameter value", + "enabled": false, + "description": "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" + }, + { + "shortName": "SameParameterValue", + "displayName": "Method parameter always has the same value", + "enabled": false, + "description": "Reports method parameters that always have the same constant value.\n\nExample:\n\n\n static void printPoint(int x, int y) { // x is always 0\n System.out.println(x + \", \" + y);\n }\n\n public static void main(String[] args) {\n printPoint(0, 1);\n printPoint(0, 2);\n }\n\nThe quick-fix inlines the constant value. This may simplify the method implementation.\n\n\nUse the **Ignore when a quick-fix can not be provided** option to suppress the inspections when:\n\n* the parameter is modified inside the method\n* the parameter value that is being passed is a reference to an inaccessible field (Java ony)\n* the parameter is a vararg (Java only)\n\n\nUse the **Maximal method visibility** option to control the maximum visibility of methods to be reported.\n\n\nUse the **Minimal method usage count to report parameter** field to specify the minimal number of method usages with the same parameter value." + }, + { + "shortName": "SameReturnValue", + "displayName": "Method always returns the same value", + "enabled": false, + "description": "Reports methods and method hierarchies that always return the same constant.\n\n\nThe inspection works differently in batch-mode\n(from **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**)\nand on-the-fly in the editor:\n\n* In batch-mode, the inspection reports methods and method hierarchies that always return the same constant.\n* In the editor, the inspection only reports methods that have more than one `return` statement, do not have super methods, and cannot be overridden. If a method overrides or implements a method, a contract may require it to return a specific constant, but at the same time, we may want to have several exit points. If a method can be overridden, it is possible that a different value will be returned in subclasses.\n\n**Example:**\n\n\n class X {\n // Warn only in batch-mode:\n int xxx() { // Method 'xxx()' and all its overriding methods always return '0'\n return 0;\n }\n }\n\n class Y extends X {\n @Override\n int xxx() {\n return 0;\n }\n\n // Warn only in batch-mode:\n int yyy() { // Method 'yyy()' always returns '0'\n return 0;\n }\n\n // Warn both in batch-mode and on-the-fly:\n final int zzz(boolean flag) { // Method 'zzz()' always returns '0'\n if (Math.random() > 0.5) {\n return 0;\n }\n return 0;\n }\n }\n" + }, + { + "shortName": "RedundantRecordConstructor", + "displayName": "Redundant record constructor", + "enabled": false, + "description": "Reports redundant constructors declared inside Java records.\n\n**Example 1:**\n\n\n record Point(int x, int y) {\n public Point {} // could be removed\n }\n \n record Point(int x, int y) {\n public Point(int x, int y) { // could be removed\n this.x = x;\n this.y = y;\n }\n }\n\nThe quick-fix removes the redundant constructors.\n\n**Example 2:**\n\n\n // could be converted to compact constructor\n record Range(int from, int to) {\n public Range(int from, int to) {\n if (from > to) throw new IllegalArgumentException();\n this.from = from;\n this.to = to;\n }\n }\n\nThe quick-fix converts this code into a compact constructor.\n\nThis inspection only reports if the language level of the project or module is 16 or higher.\n\nNew in 2020.1" + }, + { + "shortName": "WeakerAccess", + "displayName": "Declaration access can be weaker", + "enabled": false, + "description": "Reports fields, methods or classes that may have their access modifier narrowed down.\n\nExample:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }\n\nAfter the quick-fix is applied:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }\n\nUse the inspection's options to define the rules for the modifier change suggestions." + }, + { + "shortName": "FinalMethodInFinalClass", + "displayName": "'final' method in 'final' class", + "enabled": false, + "description": "Reports `final` methods in `final` classes.\n\nSince `final` classes cannot be inherited, marking a method as `final`\nmay be unnecessary and confusing.\n\n**Example:**\n\n record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." + }, + { + "shortName": "Java9RedundantRequiresStatement", + "displayName": "Redundant 'requires' directive in module-info", + "enabled": false, + "description": "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" + }, + { + "shortName": "SillyAssignment", + "displayName": "Variable is assigned to itself", + "enabled": false, + "description": "Reports assignments of a variable to itself.\n\n**Example:**\n\n\n a = a;\n\nThe quick-fix removes the assigment." + }, + { + "shortName": "FunctionalExpressionCanBeFolded", + "displayName": "Functional expression can be folded", + "enabled": false, + "description": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation.\n\nExample:\n\n\n SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());\n\nAfter the quick-fix is applied:\n\n\n SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);\n\nThis inspection reports only if the language level of the project or module is 8 or higher." + }, + { + "shortName": "GroovyUnusedDeclaration", + "displayName": "Unused declaration", + "enabled": false, + "description": "Reports unused classes, methods and fields.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nHere `Department` explicitly references `Organization` but if `Department` class itself is unused,\nthen inspection would report both classes.\n\n\nThe inspection also reports parameters, which are not used by their methods and all method implementations/overriders, as well as local\nvariables, which are declared but not used.\n\nFor more information, see the same inspection in Java." + } + ] + }, + { + "name": "Migration", + "inspections": [ + { + "shortName": "NonExhaustiveWhenStatementMigration", + "displayName": "Non-exhaustive 'when' statements will be prohibited since 1.7", + "enabled": false, + "description": "Reports a non-exhaustive `when` statements that will lead to compilation error since 1.7.\n\nMotivation types:\n\n* Problematic/meaningless usage patterns need to be discouraged/blocked (e.g. counterintuitive behaviors)\n * Code is error-prone\n* Inconsistency in the design (things are done differently in different contexts)\n\nImpact types:\n\n* Compilation. Some code that used to compile won't compile any more\n * There were cases when such code worked with no exceptions\n * Some such code could compile without any warnings\n\n**More details:** [KT-47709: Make when statements with enum, sealed, and Boolean subjects exhaustive by default](https://youtrack.jetbrains.com/issue/KT-47709)\n\nThe quick-fix adds the missing `else -> {}` branch.\n\n**Example:**\n\n\n sealed class Base {\n class A : Base()\n class B : Base()\n }\n\n fun test(base: Base) {\n when (base) {\n is Base.A -> \"\"\n }\n }\n\nAfter the quick-fix is applied:\n\n\n sealed class Base {\n class A : Base()\n class B : Base()\n }\n\n fun test(base: Base) {\n when (base) {\n is Base.A -> \"\"\n else -> {}\n }\n }\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.6 or higher." + }, + { + "shortName": "InlineClassDeprecatedMigration", + "displayName": "Inline classes are deprecated since 1.5", + "enabled": false, + "description": "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." + }, + { + "shortName": "AmbiguousExpressionInWhenBranchMigration", + "displayName": "Ambiguous logical expressions in 'when' branches since 1.7", + "enabled": false, + "description": "Reports ambiguous logical expressions in `when` branches which cause compilation errors in Kotlin 1.8 and later.\n\n\n fun Int.matches(strict: Boolean): Boolean = when (strict) {\n true -> this == 6\n this in (4..7) -> true // is ambiguous\n else -> false\n }\n\nAfter the quick-fix is applied:\n\n\n fun Int.matches(strict: Boolean): Boolean = when (strict) {\n true -> this == 6\n (this in (4..7)) -> true // wrapped in parentheses\n else -> false\n }\n\nInspection is available for Kotlin language level starting from 1.7." + }, + { + "shortName": "ProhibitJvmOverloadsOnConstructorsOfAnnotationClassesMigration", + "displayName": "'@JvmOverloads' annotation cannot be used on constructors of annotation classes since 1.4", + "enabled": false, + "description": "Reports `@JvmOverloads` on constructors of annotation classes because it's meaningless.\n\n\nThere is no footprint of `@JvmOverloads` in the generated bytecode and Kotlin metadata,\nso `@JvmOverloads` doesn't affect the generated bytecode and the code behavior.\n\n`@JvmOverloads` on constructors of annotation classes causes a compilation error since Kotlin 1.4.\n\n**Example:**\n\n\n annotation class A @JvmOverloads constructor(val x: Int = 1)\n\nAfter the quick-fix is applied:\n\n\n annotation class A constructor(val x: Int = 1)\n" + }, + { + "shortName": "CastDueToProgressionResolutionChangeMigration", + "displayName": "Progression resolution change since 1.9", + "enabled": false, + "description": "Reports overloaded function calls where an argument requires an explicit cast to resolve to a proper declaration.\nThe current compiler warning (available since Kotlin 1.6.20) will become an error in Kotlin 1.8.\n\n\nProgressions and ranges types (`kotlin.ranges`) will start implementing the `Collection` interface in Kotlin\n1.9 and later. This update will cause a change in resolution for overloaded functions. For instance, in the example below, the\n`test(1..5)` call will be resolved to `test(t: Any)` in Kotlin 1.8 and earlier and to\n`test(t: Collection<*>)` in Kotlin 1.9 and later.\n\n\n fun test(t: Any) { }\n fun test(t: Collection<*>) { }\n fun invoke() {\n test(1..5) // IntRange becomes Collection in 1.9\n }\n\nThe provided quick-fix captures the behaviour specific to the compiler of version 1.8 and earlier:\n\n\n fun test(t: Any) { }\n fun test(t: Collection<*>) { }\n\n fun invoke() {\n test(1..5) // resolved to 'test(t: T)' before Kotlin 1.9\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(t: Any) { }\n fun test(t: Collection<*>) { }\n\n fun invoke() {\n test((1..5) as Iterable) // resolved to 'test(t: T)' in Kotlin 1.9\n }\n\nInspection is available for the Kotlin language level starting from 1.6." + }, + { + "shortName": "AddConversionCallMigration", + "displayName": "Explicit conversion from `Int` needed since 1.9", + "enabled": false, + "description": "Reports expressions that will be of type `Int`, thus causing compilation errors in Kotlin 1.9 and later.\n\nExample:\n\n\n fun takeByte(x: Byte) {}\n\n fun foo() {\n takeByte(1 + 1) // will be resolved to Int in 1.9\n }\n\nAfter the quick-fix is applied:\n\n\n fun takeByte(x: Byte) {}\n\n fun foo() {\n takeByte((1 + 1).toByte()) // will be resolved to Int in 1.9\n }\n\nInspection is available for Kotlin language level starting from 1.7." + }, + { + "shortName": "KotlinDeprecation", + "displayName": "Usage of redundant or deprecated syntax or deprecated symbols", + "enabled": false, + "description": "Reports obsolete language features and unnecessarily verbose code constructs during the code cleanup operation (**Code \\| Code Cleanup** ).\n\n\nThe quick-fix automatically replaces usages of obsolete language features or unnecessarily verbose code constructs with compact and up-to-date syntax.\n\n\nIt also replaces deprecated symbols with their proposed substitutions." + }, + { + "shortName": "WarningOnMainUnusedParameterMigration", + "displayName": "Unused 'args' on 'main' since 1.4", + "enabled": false, + "description": "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." + }, + { + "shortName": "RedundantLabelMigration", + "displayName": "Redundant label", + "enabled": false, "description": "Reports redundant labels which cause compilation errors since Kotlin 1.4.\n\nSince Kotlin 1.0, one can mark any statement with a label:\n\n\n fun foo() {\n L1@ val x = L2@bar()\n }\n\nHowever, these labels can be referenced only in a limited number of ways:\n\n* break / continue from a loop\n* non-local return from an inline lambda or inline anonymous function\nsssss\n\nSuch labels are prohibited since Kotlin 1.4.\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." }, { @@ -4375,6 +4375,35 @@ } ] }, + { + "name": "GPath", + "inspections": [ + { + "shortName": "GroovyListSetCanBeKeyedAccess", + "displayName": "Call to List.set can be keyed access", + "enabled": false, + "description": "Reports calls to `java.util.List.set()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def list = [\"foo\"]\n list.set(0, \"bar\") // list.set(0, \"bar\") could be replaced with list[0] = \"bar\"\n\nAfter the quick-fix is applied:\n\n\n def list = [\"foo\"]\n list[0] = \"bar\"\n\n" + }, + { + "shortName": "GroovyMapPutCanBeKeyedAccess", + "displayName": "Call to Map.put can be keyed access", + "enabled": false, + "description": "Reports calls to `java.util.Map.put()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def map = [\"foo\": \"bar\"]\n map.put(\"foo\", \"baz\") // map.put(\"foo\", \"baz\") could be replaced with map[\"foo\"] = \"baz\"\n\nAfter the quick-fix is applied:\n\n\n def map = [\"foo\": \"bar\"]\n map[\"foo\"] = \"baz\"\n\n" + }, + { + "shortName": "GroovyMapGetCanBeKeyedAccess", + "displayName": "Call to Map.get can be keyed access", + "enabled": false, + "description": "Reports calls to `java.util.Map.get()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def map = [\"foo\": \"bar\"]\n def str = map.get(\"foo\") // map.get(\"foo\") could be replaced with map[\"foo\"]\n\nAfter the quick-fix is applied:\n\n\n def map = [\"foo\": \"bar\"]\n def str = map[\"foo\"]\n\n" + }, + { + "shortName": "GroovyListGetCanBeKeyedAccess", + "displayName": "Call to List.get can be keyed access", + "enabled": false, + "description": "Reports calls to `java.util.List.get()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def list = [\"foo\"]\n def str = list.get(0) // list.get(0) could be replaced with list[0]\n\nAfter the quick-fix is applied:\n\n\n def list = [\"foo\"]\n def str = list[0]\n\n" + } + ] + }, { "name": "Embedded", "inspections": [ @@ -4446,35 +4475,6 @@ } ] }, - { - "name": "GPath", - "inspections": [ - { - "shortName": "GroovyListSetCanBeKeyedAccess", - "displayName": "Call to List.set can be keyed access", - "enabled": false, - "description": "Reports calls to `java.util.List.set()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def list = [\"foo\"]\n list.set(0, \"bar\") // list.set(0, \"bar\") could be replaced with list[0] = \"bar\"\n\nAfter the quick-fix is applied:\n\n\n def list = [\"foo\"]\n list[0] = \"bar\"\n\n" - }, - { - "shortName": "GroovyMapPutCanBeKeyedAccess", - "displayName": "Call to Map.put can be keyed access", - "enabled": false, - "description": "Reports calls to `java.util.Map.put()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def map = [\"foo\": \"bar\"]\n map.put(\"foo\", \"baz\") // map.put(\"foo\", \"baz\") could be replaced with map[\"foo\"] = \"baz\"\n\nAfter the quick-fix is applied:\n\n\n def map = [\"foo\": \"bar\"]\n map[\"foo\"] = \"baz\"\n\n" - }, - { - "shortName": "GroovyMapGetCanBeKeyedAccess", - "displayName": "Call to Map.get can be keyed access", - "enabled": false, - "description": "Reports calls to `java.util.Map.get()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def map = [\"foo\": \"bar\"]\n def str = map.get(\"foo\") // map.get(\"foo\") could be replaced with map[\"foo\"]\n\nAfter the quick-fix is applied:\n\n\n def map = [\"foo\": \"bar\"]\n def str = map[\"foo\"]\n\n" - }, - { - "shortName": "GroovyListGetCanBeKeyedAccess", - "displayName": "Call to List.get can be keyed access", - "enabled": false, - "description": "Reports calls to `java.util.List.get()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def list = [\"foo\"]\n def str = list.get(0) // list.get(0) could be replaced with list[0]\n\nAfter the quick-fix is applied:\n\n\n def list = [\"foo\"]\n def str = list[0]\n\n" - } - ] - }, { "name": "Imports", "inspections": [ @@ -4731,43 +4731,216 @@ ] }, { - "name": "Control flow issues", + "name": "Numeric issues", "inspections": [ { - "shortName": "NegatedEqualityExpression", - "displayName": "Negated equality expression", + "shortName": "RemoveLiteralUnderscores", + "displayName": "Underscores in numeric literal", "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" + "description": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level.\n\nThe quick-fix removes underscores from numeric literals. For example `1_000_000` will be converted to `1000000`.\n\n\n*Numeric literals with underscores* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2020.2" }, { - "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": "BadOddness", + "displayName": "Suspicious oddness check", + "enabled": false, + "description": "Reports odd-even checks of the following form: `x % 2 == 1`. Such checks fail when used with negative odd values. Consider using `x % 2 != 0` or `(x & 1) == 1` instead." }, { - "shortName": "AssertionCanBeIf", - "displayName": "Assertion can be replaced with 'if' statement", + "shortName": "ComparisonOfShortAndChar", + "displayName": "Comparison of 'short' and 'char' values", "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" + "description": "Reports equality comparisons between `short` and `char` values.\n\nSuch comparisons may cause subtle bugs because while both values are 2-byte long, `short` values are\nsigned, and `char` values are unsigned.\n\n**Example:**\n\n\n if (Character.MAX_VALUE == shortValue()) {} //never can be true\n" }, { - "shortName": "BreakStatement", - "displayName": "'break' statement", + "shortName": "InsertLiteralUnderscores", + "displayName": "Unreadable numeric literal", "enabled": false, - "description": "Reports `break` statements that are used in places other than at the end of a `switch` statement branch.\n\n`break` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void foo(List strs) {\n for (String str : strs) {\n if (str.contains(\"stop\")) break;\n handleStr(str);\n }\n }\n" + "description": "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" }, { - "shortName": "InfiniteLoopStatement", - "displayName": "Infinite loop statement", + "shortName": "DivideByZero", + "displayName": "Division by zero", "enabled": true, - "description": "Reports `for`, `while`, or `do` statements that can only exit by throwing an exception. While such statements may be correct, they often happen due to coding errors.\n\nExample:\n\n\n for (;;) {\n }\n\n\nUse the **Ignore when placed in Thread.run** option to ignore the\ninfinite loop statements inside `Thread.run`.\nIt may be useful for the daemon threads.\n\nExample:\n\n\n new Thread(() -> {\n while (true) {\n }\n }).start();\n" - }, - { - "shortName": "ConditionalCanBePushedInsideExpression", - "displayName": "Conditional can be pushed inside branch expression", - "enabled": false, - "description": "Reports conditional expressions with `then` and else branches that are similar enough so that the expression can be moved inside. This action shortens the code.\n\nExample:\n\n\n double g(int a, int b) {\n return a == b ? Math.cos(0) : Math.cos(1);\n }\n\nAfter the quick-fix is applied:\n\n\n double g(int a, int b) {\n return Math.cos(a == b ? 0 : 1);\n }\n\nNew in 2017.2" + "description": "Reports division by zero or remainder by zero. Such expressions will produce an `Infinity`, `-Infinity` or `NaN` result for doubles or floats, and will throw an `ArithmeticException` for integers.\n\nWhen the expression has a `NaN` result, the fix suggests replacing the division expression with the `NaN` constant." + }, + { + "shortName": "ComparisonToNaN", + "displayName": "Comparison to 'Double.NaN' or 'Float.NaN'", + "enabled": true, + "description": "Reports any comparisons to `Double.NaN` or `Float.NaN`. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the `Double.isNaN()` or `Float.isNaN()` methods instead.\n\n**Example:**\n\n\n if (x == Double.NaN) {...}\n\nAfter the quick-fix is applied:\n\n\n if (Double.isNaN(x)) {...}\n" + }, + { + "shortName": "ConfusingFloatingPointLiteral", + "displayName": "Confusing floating-point literal", + "enabled": false, + "description": "Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point.\n\nSuch literals may be confusing, and violate several coding standards.\n\n**Example:**\n\n double d = .03;\n\nAfter the quick-fix is applied:\n\n double d = 0.03;\n\n\nUse the **Ignore floating point literals in scientific notation** option to ignore floating point numbers in scientific notation." + }, + { + "shortName": "UnaryPlus", + "displayName": "Unary plus", + "enabled": true, + "description": "Reports usages of the `+` unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in `+++`) or with the equal operator (like in `=+`).\n\n**Example:**\n\n\n void unaryPlus(int i) {\n int x = + +i;\n }\n\nThe following quick fixes are suggested:\n\n* Remove `+` operators before the `i` variable:\n\n\n void unaryPlus(int i) {\n int x = i;\n }\n\n* Replace `+` operators with the prefix increment operator:\n\n\n void unaryPlus(int i) {\n int x = ++i;\n }\n\n\nUse the checkbox below to report unary pluses that are used together with a binary or another unary expression.\nIt means the inspection will not report situations when a unary plus expression is used in array\ninitializer expressions or as a method argument." + }, + { + "shortName": "OctalAndDecimalIntegersMixed", + "displayName": "Octal and decimal integers in same array", + "enabled": false, + "description": "Reports mixed octal and decimal integer literals in a single array initializer. This situation might happen when you copy a list of numbers into an array initializer. Some numbers in the array might be zero-padded and the compiler will interpret them as octal.\n\n**Example:**\n\n int[] elapsed = {1, 13, 052};\n\nAfter the quick-fix that removes a leading zero is applied:\n\n int[] elapsed = {1, 13, 52};\n\nIf it is an octal number (for example, after a variable inline), then you can use another quick-fix that converts octal to decimal:\n`int[] elapsed = {1, 13, 42};`" + }, + { + "shortName": "UnnecessaryUnaryMinus", + "displayName": "Unnecessary unary minus", + "enabled": true, + "description": "Reports unnecessary unary minuses. Such expressions might be hard to understand and might contain errors.\n\n**For example:**\n\n void unaryMinus(int i) {\n int x = - -i;\n }\n\nThe following quick fixes are suggested here:\n\n* Remove `-` operators before the `i` variable:\n\n void unaryMinus(int i) {\n int x = i;\n }\n\n* Replace `-` operators with the prefix decrement operator:\n\n void unaryMinus(int i) {\n int x = --i;\n }\n\n**Another example:**\n\n void unaryMinus(int i) {\n i += - 8;\n }\n\nAfter the quick-fix is applied:\n\n void unaryMinus(int i) {\n i -= 8;\n }\n" + }, + { + "shortName": "LossyConversionCompoundAssignment", + "displayName": "Possibly lossy implicit cast in compound assignment", + "enabled": true, + "description": "Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable.\n\n\nDuring such compound assignments, an implicit cast occurs, potentially resulting in lossy conversions.\n\nExample:\n\n\n long c = 1;\n c += 1.2;\n\nAfter the quick-fix is applied:\n\n\n long c = 1;\n c += (long) 1.2;\n\nNew in 2023.2" + }, + { + "shortName": "CachedNumberConstructorCall", + "displayName": "Number constructor call with primitive argument", + "enabled": true, + "description": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9." + }, + { + "shortName": "PointlessArithmeticExpression", + "displayName": "Pointless arithmetic expression", + "enabled": true, + "description": "Reports pointless arithmetic expressions. Such expressions include adding or subtracting zero, multiplying by zero or one, and division by one.\n\nSuch expressions may be the result of automated refactorings and they are unlikely to be what the developer intended to do.\n\nThe quick-fix simplifies such expressions.\n\n**Example:**\n\n\n void f(int a) {\n int x = a - a;\n int y = a + 0;\n int res = x / x;\n }\n\nAfter the quick-fix is applied:\n\n\n void f(int a) {\n int x = 0;\n int y = a;\n int res = 1;\n }\n\n\nNote that in rare cases, the suggested replacement might not be completely equivalent to the original code\nfor all possible inputs. For example, the inspection suggests replacing `x / x` with `1`.\nHowever, if `x` is zero, the original code throws `ArithmeticException` or results in `NaN`.\nAlso, if `x` is `NaN`, then the result is also `NaN`. It's very unlikely that such behavior is intended." + }, + { + "shortName": "CharUsedInArithmeticContext", + "displayName": "'char' expression used in arithmetic context", + "enabled": false, + "description": "Reports expressions of the `char` type used in addition or subtraction expressions.\n\nSuch code is not necessarily an issue but may result in bugs (for example,\nif a string is expected).\n\n**Example:** `int a = 'a' + 42;`\n\nAfter the quick-fix is applied: `int a = (int) 'a' + 42;`\n\nFor the `String` context:\n\n int i1 = 1;\n int i2 = 2;\n System.out.println(i2 + '-' + i1 + \" = \" + (i2 - i1));\n\nAfter the quick-fix is applied:\n`System.out.println(i2 + \"-\" + i1 + \" = \" + (i2 - i1));`" + }, + { + "shortName": "UnpredictableBigDecimalConstructorCall", + "displayName": "Unpredictable 'BigDecimal' constructor call", + "enabled": true, + "description": "Reports calls to `BigDecimal` constructors that accept a `double` value. These constructors produce `BigDecimal` that is exactly equal to the supplied `double` value. However, because doubles are encoded in the IEEE 754 64-bit double-precision binary floating-point format, the exact value can be unexpected.\n\nFor example, `new BigDecimal(0.1)` yields a `BigDecimal` object. Its value is\n`0.1000000000000000055511151231257827021181583404541015625`\nwhich is the nearest number to 0.1 representable as a double.\nTo get `BigDecimal` that stores the same value as written in the source code,\nuse either `new BigDecimal(\"0.1\")` or `BigDecimal.valueOf(0.1)`.\n\n**Example:**\n\n\n class Constructor {\n void foo() {\n new BigDecimal(0.1);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Constructor {\n void foo() {\n new BigDecimal(\"0.1\");\n }\n }\n" + }, + { + "shortName": "IntegerDivisionInFloatingPointContext", + "displayName": "Integer division in floating-point context", + "enabled": true, + "description": "Reports integer divisions where the result is used as a floating-point number. Such division is often an error and may have unexpected results due to the truncation that happens in integer division.\n\n**Example:**\n\n\n float x = 3.0F + 3 * 2 / 5;\n\nAfter the quick-fix is applied:\n\n\n float x = 3.0F + ((float) (3 * 2)) /5;\n" + }, + { + "shortName": "NegativeIntConstantInLongContext", + "displayName": "Negative int hexadecimal constant in long context", + "enabled": true, + "description": "Reports negative int hexadecimal constants in long context. Such constants are implicitly widened to long, which means their higher bits will become 1 rather than 0 (e.g., 0xFFFF_FFFF will become 0xFFFF_FFFF_FFFF_FFFFL). Unlikely this is intended, and even if it is, using an explicit long constant would be less confusing.\n\n**Example:**\n\n\n // Warning: this is int constant -1 which is widened to long\n // becoming 0xFFFF_FFFF_FFFF_FFFFL.\n long mask = 0xFFFF_FFFF;\n\nNew in 2022.3" + }, + { + "shortName": "ImplicitNumericConversion", + "displayName": "Implicit numeric conversion", + "enabled": false, + "description": "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." + }, + { + "shortName": "BigDecimalEquals", + "displayName": "'equals()' called on 'BigDecimal'", + "enabled": false, + "description": "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" + }, + { + "shortName": "OctalLiteral", + "displayName": "Octal integer", + "enabled": true, + "description": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals.\n\nExample:\n\n\n int i = 015;\n int j = 0_777;\n\nThis inspection has two different quick-fixes.\nAfter the **Convert octal literal to decimal literal** quick-fix is applied, the code changes to:\n\n\n int i = 13;\n int j = 511;\n\nAfter the **Remove leading zero to make decimal** quick-fix is applied, the code changes to:\n\n\n int i = 15;\n int j = 777;\n" + }, + { + "shortName": "ConstantMathCall", + "displayName": "Constant call to 'Math'", + "enabled": false, + "description": "Reports calls to `java.lang.Math` or `java.lang.StrictMath` methods that can be replaced with simple compile-time constants.\n\n**Example:**\n\n double v = Math.sin(0.0);\n\nAfter the quick-fix is applied:\n\n double v = 0.0;\n" + }, + { + "shortName": "NumericOverflow", + "displayName": "Numeric overflow", + "enabled": true, + "description": "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" + }, + { + "shortName": "NonReproducibleMathCall", + "displayName": "Non-reproducible call to 'Math'", + "enabled": false, + "description": "Reports calls to `java.lang.Math` methods, which results are not guaranteed to be reproduced precisely.\n\nIn environments where reproducibility of results is required, `java.lang.StrictMath`\nshould be used instead." + }, + { + "shortName": "FloatingPointEquality", + "displayName": "Floating-point equality comparison", + "enabled": false, + "description": "Reports floating-point values that are being compared using the `==` or `!=` operator.\n\nFloating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics.\n\nThis inspection ignores comparisons with zero and infinity literals.\n\n**Example:**\n\n\n void m(double d1, double d2) {\n if (d1 == d2) {}\n }\n" + }, + { + "shortName": "SuspiciousLiteralUnderscore", + "displayName": "Suspicious underscore in number literal", + "enabled": false, + "description": "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;`" + }, + { + "shortName": "LongLiteralsEndingWithLowercaseL", + "displayName": "'long' literal ending with 'l' instead of 'L'", + "enabled": true, + "description": "Reports `long` literals ending with lowercase 'l'. These literals may be confusing, as the lowercase 'l' looks very similar to a literal '1' (one).\n\n**Example:**\n\n\n long nights = 100l;\n\nAfter the quick-fix is applied:\n\n\n long nights = 100L;\n" + }, + { + "shortName": "BigDecimalMethodWithoutRoundingCalled", + "displayName": "Call to 'BigDecimal' method without a rounding mode argument", + "enabled": true, + "description": "Reports calls to `divide()` or `setScale()` without a rounding mode argument.\n\nSuch calls can lead to an `ArithmeticException` when the exact value cannot be represented in the result\n(for example, because it has a non-terminating decimal expansion).\n\nSpecifying a rounding mode prevents the `ArithmeticException`.\n\n**Example:**\n\n\n BigDecimal.valueOf(1).divide(BigDecimal.valueOf(3));\n" + }, + { + "shortName": "OverlyComplexArithmeticExpression", + "displayName": "Overly complex arithmetic expression", + "enabled": false, + "description": "Reports arithmetic expressions with the excessive number of terms. Such expressions might be hard to understand and might contain errors.\n\nParameters, field references, and other primary expressions are counted as a term.\n\n**Example:**\n\n int calc(int a, int b) {\n return a + a + a + b + b + b + b; // The line contains 7 terms and will be reported.\n }\n\nUse the field below to specify a number of terms allowed in arithmetic expressions." + } + ] + }, + { + "name": "Control flow issues", + "inspections": [ + { + "shortName": "NegatedEqualityExpression", + "displayName": "Negated equality expression", + "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": "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", + "enabled": false, + "description": "Reports `break` statements that are used in places other than at the end of a `switch` statement branch.\n\n`break` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void foo(List strs) {\n for (String str : strs) {\n if (str.contains(\"stop\")) break;\n handleStr(str);\n }\n }\n" + }, + { + "shortName": "InfiniteLoopStatement", + "displayName": "Infinite loop statement", + "enabled": true, + "description": "Reports `for`, `while`, or `do` statements that can only exit by throwing an exception. While such statements may be correct, they often happen due to coding errors.\n\nExample:\n\n\n for (;;) {\n }\n\n\nUse the **Ignore when placed in Thread.run** option to ignore the\ninfinite loop statements inside `Thread.run`.\nIt may be useful for the daemon threads.\n\nExample:\n\n\n new Thread(() -> {\n while (true) {\n }\n }).start();\n" + }, + { + "shortName": "ConditionalCanBePushedInsideExpression", + "displayName": "Conditional can be pushed inside branch expression", + "enabled": false, + "description": "Reports conditional expressions with `then` and else branches that are similar enough so that the expression can be moved inside. This action shortens the code.\n\nExample:\n\n\n double g(int a, int b) {\n return a == b ? Math.cos(0) : Math.cos(1);\n }\n\nAfter the quick-fix is applied:\n\n\n double g(int a, int b) {\n return Math.cos(a == b ? 0 : 1);\n }\n\nNew in 2017.2" }, { "shortName": "ContinueStatementWithLabel", @@ -5058,255 +5231,82 @@ "description": "Reports uninitialized final fields, invalid assignments to final variables, and parameters and fields." }, { - "shortName": "GroovyBreak", - "displayName": "'break' statement", - "enabled": false, - "description": "Reports `break` statements outside of `switch` statements." - }, - { - "shortName": "GroovyConstantConditional", - "displayName": "Constant conditional expression", - "enabled": false, - "description": "Reports conditional expressions with boolean constant as a condition.\n\n**Example:**\n\n\n true ? result1 : result2\n false ? result1 : result2\n" - }, - { - "shortName": "GroovyContinue", - "displayName": "'continue' statement", - "enabled": false, - "description": "Reports `continue` statements." - }, - { - "shortName": "GroovySwitchStatementWithNoDefault", - "displayName": "Switch statement with no default case", - "enabled": false, - "description": "Reports `switch` statements that do not contain `default` labels.\n\n\nSome coding practices may insist on adding this label to all `switch` statements." - }, - { - "shortName": "GroovyUnnecessaryReturn", - "displayName": "Unnecessary 'return' statement", - "enabled": false, - "description": "Reports `return` statements at the end of constructors and methods returning\n`void`. These are unnecessary and may be safely removed.\n\n**Example:**\n\n\n void foo (String s){\n print(s)\n return\n }\n\nAfter the quick-fix is applied:\n\n\n void foo (String s){\n print(s)\n }\n\nFor more information, see the same inspection in Java." - }, - { - "shortName": "GroovyConditionalWithIdenticalBranches", - "displayName": "Ternary expression with identical branches", - "enabled": false, - "description": "Reports ternary expressions with identical \"then\" and \"else\" branches. Such expressions are almost certainly a programmer error.\n\nThe quick-fix replaces the expression with its \"then\" branch.\n\n**Example:**\n\n\n condition ? a.foo() : a.foo()\n\nAfter the quick-fix is applied:\n\n\n a.foo()\n" - }, - { - "shortName": "GroovyConditionalCanBeElvis", - "displayName": "Ternary expression can be replaced with elvis expression", - "enabled": false, - "description": "Reports ternary expressions which can be replaced by an elvis expression.\n\n**Example:**\n\n\n def notNull(o, defaultValue) {\n o != null ? o : defaultValue\n }\n\nAfter the quick-fix is applied:\n\n\n def notNull(o, defaultValue) {\n o ?: defaultValue\n }\n" - }, - { - "shortName": "GroovyConstantIfStatement", - "displayName": "Constant if statement", - "enabled": false, - "description": "Reports `if` statements with boolean constant as a condition.\n\n**Example:**\n\n\n if (true) {\n // ...\n }\n if (false) {\n // ...\n }\n" - }, - { - "shortName": "GroovyIfStatementWithTooManyBranches", - "displayName": "If statement with too many branches", - "enabled": false, - "description": "Reports `if` statements with too many branches. Such statements may be confusing, and are often the sign of inadequate levels of design abstraction.\n\n**Example:**\n\n\n if (a) {\n print \"foo\"\n } else if (b) {\n print \"bar\"\n } else if (c) {\n print \"baz\"\n } else if (d) {\n print \"Too many branches\"\n }\n\n\nUse the **Maximum number of branches** field to specify the maximum number of branches expected." - }, - { - "shortName": "GroovyConditionalCanBeConditionalCall", - "displayName": "Ternary expression can be replaced with safe call", - "enabled": false, - "description": "Reports ternary expressions which can be replaced by a safe call.\n\n**Example:**\n\n\n def charArray(String s) {\n s == null ? null : s.toCharArray()\n }\n\nAfter the quick-fix is applied:\n\n\n def charArray(String s) {\n s?.toCharArray()\n }\n" - }, - { - "shortName": "GroovyUnnecessaryContinue", - "displayName": "Unnecessary 'continue' statement", - "enabled": false, - "description": "Reports `continue` statements if they are last reachable statements in the loop.\nThese `continue` statements are unnecessary and can be safely removed.\n\n**Example:**\n\n\n for(int i in array) {\n println(i)\n continue\n }\n\nAfter the quick-fix is applied:\n\n\n for(int i in array) {\n println(i)\n }\n\nFor more information, see the same inspection in Java." - }, - { - "shortName": "GroovyLoopStatementThatDoesntLoop", - "displayName": "Loop statement that doesn't loop", - "enabled": false, - "description": "Reports `for` or `while` statements whose bodies are guaranteed to execute at most once. While such statements could be written intentionally, they are usually a symptom of error.\n\n**Example:**\n\n\n for (int i in 0..<10) {\n return\n }\n\n" - }, - { - "shortName": "GroovyReturnFromClosureCanBeImplicit", - "displayName": "'return' statement can be implicit", - "enabled": false, - "description": "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" - } - ] - }, - { - "name": "Numeric issues", - "inspections": [ - { - "shortName": "RemoveLiteralUnderscores", - "displayName": "Underscores in numeric literal", - "enabled": false, - "description": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level.\n\nThe quick-fix removes underscores from numeric literals. For example `1_000_000` will be converted to `1000000`.\n\n\n*Numeric literals with underscores* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2020.2" - }, - { - "shortName": "BadOddness", - "displayName": "Suspicious oddness check", - "enabled": false, - "description": "Reports odd-even checks of the following form: `x % 2 == 1`. Such checks fail when used with negative odd values. Consider using `x % 2 != 0` or `(x & 1) == 1` instead." - }, - { - "shortName": "ComparisonOfShortAndChar", - "displayName": "Comparison of 'short' and 'char' values", - "enabled": false, - "description": "Reports equality comparisons between `short` and `char` values.\n\nSuch comparisons may cause subtle bugs because while both values are 2-byte long, `short` values are\nsigned, and `char` values are unsigned.\n\n**Example:**\n\n\n if (Character.MAX_VALUE == shortValue()) {} //never can be true\n" - }, - { - "shortName": "InsertLiteralUnderscores", - "displayName": "Unreadable numeric literal", - "enabled": false, - "description": "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" - }, - { - "shortName": "DivideByZero", - "displayName": "Division by zero", - "enabled": true, - "description": "Reports division by zero or remainder by zero. Such expressions will produce an `Infinity`, `-Infinity` or `NaN` result for doubles or floats, and will throw an `ArithmeticException` for integers.\n\nWhen the expression has a `NaN` result, the fix suggests replacing the division expression with the `NaN` constant." - }, - { - "shortName": "ComparisonToNaN", - "displayName": "Comparison to 'Double.NaN' or 'Float.NaN'", - "enabled": true, - "description": "Reports any comparisons to `Double.NaN` or `Float.NaN`. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the `Double.isNaN()` or `Float.isNaN()` methods instead.\n\n**Example:**\n\n\n if (x == Double.NaN) {...}\n\nAfter the quick-fix is applied:\n\n\n if (Double.isNaN(x)) {...}\n" - }, - { - "shortName": "ConfusingFloatingPointLiteral", - "displayName": "Confusing floating-point literal", - "enabled": false, - "description": "Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point.\n\nSuch literals may be confusing, and violate several coding standards.\n\n**Example:**\n\n double d = .03;\n\nAfter the quick-fix is applied:\n\n double d = 0.03;\n\n\nUse the **Ignore floating point literals in scientific notation** option to ignore floating point numbers in scientific notation." - }, - { - "shortName": "UnaryPlus", - "displayName": "Unary plus", - "enabled": true, - "description": "Reports usages of the `+` unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in `+++`) or with the equal operator (like in `=+`).\n\n**Example:**\n\n\n void unaryPlus(int i) {\n int x = + +i;\n }\n\nThe following quick fixes are suggested:\n\n* Remove `+` operators before the `i` variable:\n\n\n void unaryPlus(int i) {\n int x = i;\n }\n\n* Replace `+` operators with the prefix increment operator:\n\n\n void unaryPlus(int i) {\n int x = ++i;\n }\n\n\nUse the checkbox below to report unary pluses that are used together with a binary or another unary expression.\nIt means the inspection will not report situations when a unary plus expression is used in array\ninitializer expressions or as a method argument." - }, - { - "shortName": "OctalAndDecimalIntegersMixed", - "displayName": "Octal and decimal integers in same array", - "enabled": false, - "description": "Reports mixed octal and decimal integer literals in a single array initializer. This situation might happen when you copy a list of numbers into an array initializer. Some numbers in the array might be zero-padded and the compiler will interpret them as octal.\n\n**Example:**\n\n int[] elapsed = {1, 13, 052};\n\nAfter the quick-fix that removes a leading zero is applied:\n\n int[] elapsed = {1, 13, 52};\n\nIf it is an octal number (for example, after a variable inline), then you can use another quick-fix that converts octal to decimal:\n`int[] elapsed = {1, 13, 42};`" - }, - { - "shortName": "UnnecessaryUnaryMinus", - "displayName": "Unnecessary unary minus", - "enabled": true, - "description": "Reports unnecessary unary minuses. Such expressions might be hard to understand and might contain errors.\n\n**For example:**\n\n void unaryMinus(int i) {\n int x = - -i;\n }\n\nThe following quick fixes are suggested here:\n\n* Remove `-` operators before the `i` variable:\n\n void unaryMinus(int i) {\n int x = i;\n }\n\n* Replace `-` operators with the prefix decrement operator:\n\n void unaryMinus(int i) {\n int x = --i;\n }\n\n**Another example:**\n\n void unaryMinus(int i) {\n i += - 8;\n }\n\nAfter the quick-fix is applied:\n\n void unaryMinus(int i) {\n i -= 8;\n }\n" - }, - { - "shortName": "LossyConversionCompoundAssignment", - "displayName": "Possibly lossy implicit cast in compound assignment", - "enabled": true, - "description": "Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable.\n\n\nDuring such compound assignments, an implicit cast occurs, potentially resulting in lossy conversions.\n\nExample:\n\n\n long c = 1;\n c += 1.2;\n\nAfter the quick-fix is applied:\n\n\n long c = 1;\n c += (long) 1.2;\n\nNew in 2023.2" - }, - { - "shortName": "CachedNumberConstructorCall", - "displayName": "Number constructor call with primitive argument", - "enabled": true, - "description": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9." - }, - { - "shortName": "PointlessArithmeticExpression", - "displayName": "Pointless arithmetic expression", - "enabled": true, - "description": "Reports pointless arithmetic expressions. Such expressions include adding or subtracting zero, multiplying by zero or one, and division by one.\n\nSuch expressions may be the result of automated refactorings and they are unlikely to be what the developer intended to do.\n\nThe quick-fix simplifies such expressions.\n\n**Example:**\n\n\n void f(int a) {\n int x = a - a;\n int y = a + 0;\n int res = x / x;\n }\n\nAfter the quick-fix is applied:\n\n\n void f(int a) {\n int x = 0;\n int y = a;\n int res = 1;\n }\n\n\nNote that in rare cases, the suggested replacement might not be completely equivalent to the original code\nfor all possible inputs. For example, the inspection suggests replacing `x / x` with `1`.\nHowever, if `x` is zero, the original code throws `ArithmeticException` or results in `NaN`.\nAlso, if `x` is `NaN`, then the result is also `NaN`. It's very unlikely that such behavior is intended." - }, - { - "shortName": "CharUsedInArithmeticContext", - "displayName": "'char' expression used in arithmetic context", - "enabled": false, - "description": "Reports expressions of the `char` type used in addition or subtraction expressions.\n\nSuch code is not necessarily an issue but may result in bugs (for example,\nif a string is expected).\n\n**Example:** `int a = 'a' + 42;`\n\nAfter the quick-fix is applied: `int a = (int) 'a' + 42;`\n\nFor the `String` context:\n\n int i1 = 1;\n int i2 = 2;\n System.out.println(i2 + '-' + i1 + \" = \" + (i2 - i1));\n\nAfter the quick-fix is applied:\n`System.out.println(i2 + \"-\" + i1 + \" = \" + (i2 - i1));`" - }, - { - "shortName": "UnpredictableBigDecimalConstructorCall", - "displayName": "Unpredictable 'BigDecimal' constructor call", - "enabled": true, - "description": "Reports calls to `BigDecimal` constructors that accept a `double` value. These constructors produce `BigDecimal` that is exactly equal to the supplied `double` value. However, because doubles are encoded in the IEEE 754 64-bit double-precision binary floating-point format, the exact value can be unexpected.\n\nFor example, `new BigDecimal(0.1)` yields a `BigDecimal` object. Its value is\n`0.1000000000000000055511151231257827021181583404541015625`\nwhich is the nearest number to 0.1 representable as a double.\nTo get `BigDecimal` that stores the same value as written in the source code,\nuse either `new BigDecimal(\"0.1\")` or `BigDecimal.valueOf(0.1)`.\n\n**Example:**\n\n\n class Constructor {\n void foo() {\n new BigDecimal(0.1);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Constructor {\n void foo() {\n new BigDecimal(\"0.1\");\n }\n }\n" - }, - { - "shortName": "IntegerDivisionInFloatingPointContext", - "displayName": "Integer division in floating-point context", - "enabled": true, - "description": "Reports integer divisions where the result is used as a floating-point number. Such division is often an error and may have unexpected results due to the truncation that happens in integer division.\n\n**Example:**\n\n\n float x = 3.0F + 3 * 2 / 5;\n\nAfter the quick-fix is applied:\n\n\n float x = 3.0F + ((float) (3 * 2)) /5;\n" + "shortName": "GroovyBreak", + "displayName": "'break' statement", + "enabled": false, + "description": "Reports `break` statements outside of `switch` statements." }, { - "shortName": "NegativeIntConstantInLongContext", - "displayName": "Negative int hexadecimal constant in long context", - "enabled": true, - "description": "Reports negative int hexadecimal constants in long context. Such constants are implicitly widened to long, which means their higher bits will become 1 rather than 0 (e.g., 0xFFFF_FFFF will become 0xFFFF_FFFF_FFFF_FFFFL). Unlikely this is intended, and even if it is, using an explicit long constant would be less confusing.\n\n**Example:**\n\n\n // Warning: this is int constant -1 which is widened to long\n // becoming 0xFFFF_FFFF_FFFF_FFFFL.\n long mask = 0xFFFF_FFFF;\n\nNew in 2022.3" + "shortName": "GroovyConstantConditional", + "displayName": "Constant conditional expression", + "enabled": false, + "description": "Reports conditional expressions with boolean constant as a condition.\n\n**Example:**\n\n\n true ? result1 : result2\n false ? result1 : result2\n" }, { - "shortName": "ImplicitNumericConversion", - "displayName": "Implicit numeric conversion", + "shortName": "GroovyContinue", + "displayName": "'continue' statement", "enabled": false, - "description": "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." + "description": "Reports `continue` statements." }, { - "shortName": "BigDecimalEquals", - "displayName": "'equals()' called on 'BigDecimal'", + "shortName": "GroovySwitchStatementWithNoDefault", + "displayName": "Switch statement with no default case", "enabled": false, - "description": "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" + "description": "Reports `switch` statements that do not contain `default` labels.\n\n\nSome coding practices may insist on adding this label to all `switch` statements." }, { - "shortName": "OctalLiteral", - "displayName": "Octal integer", - "enabled": true, - "description": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals.\n\nExample:\n\n\n int i = 015;\n int j = 0_777;\n\nThis inspection has two different quick-fixes.\nAfter the **Convert octal literal to decimal literal** quick-fix is applied, the code changes to:\n\n\n int i = 13;\n int j = 511;\n\nAfter the **Remove leading zero to make decimal** quick-fix is applied, the code changes to:\n\n\n int i = 15;\n int j = 777;\n" + "shortName": "GroovyUnnecessaryReturn", + "displayName": "Unnecessary 'return' statement", + "enabled": false, + "description": "Reports `return` statements at the end of constructors and methods returning\n`void`. These are unnecessary and may be safely removed.\n\n**Example:**\n\n\n void foo (String s){\n print(s)\n return\n }\n\nAfter the quick-fix is applied:\n\n\n void foo (String s){\n print(s)\n }\n\nFor more information, see the same inspection in Java." }, { - "shortName": "ConstantMathCall", - "displayName": "Constant call to 'Math'", + "shortName": "GroovyConditionalWithIdenticalBranches", + "displayName": "Ternary expression with identical branches", "enabled": false, - "description": "Reports calls to `java.lang.Math` or `java.lang.StrictMath` methods that can be replaced with simple compile-time constants.\n\n**Example:**\n\n double v = Math.sin(0.0);\n\nAfter the quick-fix is applied:\n\n double v = 0.0;\n" + "description": "Reports ternary expressions with identical \"then\" and \"else\" branches. Such expressions are almost certainly a programmer error.\n\nThe quick-fix replaces the expression with its \"then\" branch.\n\n**Example:**\n\n\n condition ? a.foo() : a.foo()\n\nAfter the quick-fix is applied:\n\n\n a.foo()\n" }, { - "shortName": "NumericOverflow", - "displayName": "Numeric overflow", - "enabled": true, - "description": "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" + "shortName": "GroovyConditionalCanBeElvis", + "displayName": "Ternary expression can be replaced with elvis expression", + "enabled": false, + "description": "Reports ternary expressions which can be replaced by an elvis expression.\n\n**Example:**\n\n\n def notNull(o, defaultValue) {\n o != null ? o : defaultValue\n }\n\nAfter the quick-fix is applied:\n\n\n def notNull(o, defaultValue) {\n o ?: defaultValue\n }\n" }, { - "shortName": "NonReproducibleMathCall", - "displayName": "Non-reproducible call to 'Math'", + "shortName": "GroovyConstantIfStatement", + "displayName": "Constant if statement", "enabled": false, - "description": "Reports calls to `java.lang.Math` methods, which results are not guaranteed to be reproduced precisely.\n\nIn environments where reproducibility of results is required, `java.lang.StrictMath`\nshould be used instead." + "description": "Reports `if` statements with boolean constant as a condition.\n\n**Example:**\n\n\n if (true) {\n // ...\n }\n if (false) {\n // ...\n }\n" }, { - "shortName": "FloatingPointEquality", - "displayName": "Floating-point equality comparison", + "shortName": "GroovyIfStatementWithTooManyBranches", + "displayName": "If statement with too many branches", "enabled": false, - "description": "Reports floating-point values that are being compared using the `==` or `!=` operator.\n\nFloating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics.\n\nThis inspection ignores comparisons with zero and infinity literals.\n\n**Example:**\n\n\n void m(double d1, double d2) {\n if (d1 == d2) {}\n }\n" + "description": "Reports `if` statements with too many branches. Such statements may be confusing, and are often the sign of inadequate levels of design abstraction.\n\n**Example:**\n\n\n if (a) {\n print \"foo\"\n } else if (b) {\n print \"bar\"\n } else if (c) {\n print \"baz\"\n } else if (d) {\n print \"Too many branches\"\n }\n\n\nUse the **Maximum number of branches** field to specify the maximum number of branches expected." }, { - "shortName": "SuspiciousLiteralUnderscore", - "displayName": "Suspicious underscore in number literal", + "shortName": "GroovyConditionalCanBeConditionalCall", + "displayName": "Ternary expression can be replaced with safe call", "enabled": false, - "description": "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;`" + "description": "Reports ternary expressions which can be replaced by a safe call.\n\n**Example:**\n\n\n def charArray(String s) {\n s == null ? null : s.toCharArray()\n }\n\nAfter the quick-fix is applied:\n\n\n def charArray(String s) {\n s?.toCharArray()\n }\n" }, { - "shortName": "LongLiteralsEndingWithLowercaseL", - "displayName": "'long' literal ending with 'l' instead of 'L'", - "enabled": true, - "description": "Reports `long` literals ending with lowercase 'l'. These literals may be confusing, as the lowercase 'l' looks very similar to a literal '1' (one).\n\n**Example:**\n\n\n long nights = 100l;\n\nAfter the quick-fix is applied:\n\n\n long nights = 100L;\n" + "shortName": "GroovyUnnecessaryContinue", + "displayName": "Unnecessary 'continue' statement", + "enabled": false, + "description": "Reports `continue` statements if they are last reachable statements in the loop.\nThese `continue` statements are unnecessary and can be safely removed.\n\n**Example:**\n\n\n for(int i in array) {\n println(i)\n continue\n }\n\nAfter the quick-fix is applied:\n\n\n for(int i in array) {\n println(i)\n }\n\nFor more information, see the same inspection in Java." }, { - "shortName": "BigDecimalMethodWithoutRoundingCalled", - "displayName": "Call to 'BigDecimal' method without a rounding mode argument", - "enabled": true, - "description": "Reports calls to `divide()` or `setScale()` without a rounding mode argument.\n\nSuch calls can lead to an `ArithmeticException` when the exact value cannot be represented in the result\n(for example, because it has a non-terminating decimal expansion).\n\nSpecifying a rounding mode prevents the `ArithmeticException`.\n\n**Example:**\n\n\n BigDecimal.valueOf(1).divide(BigDecimal.valueOf(3));\n" + "shortName": "GroovyLoopStatementThatDoesntLoop", + "displayName": "Loop statement that doesn't loop", + "enabled": false, + "description": "Reports `for` or `while` statements whose bodies are guaranteed to execute at most once. While such statements could be written intentionally, they are usually a symptom of error.\n\n**Example:**\n\n\n for (int i in 0..<10) {\n return\n }\n\n" }, { - "shortName": "OverlyComplexArithmeticExpression", - "displayName": "Overly complex arithmetic expression", + "shortName": "GroovyReturnFromClosureCanBeImplicit", + "displayName": "'return' statement can be implicit", "enabled": false, - "description": "Reports arithmetic expressions with the excessive number of terms. Such expressions might be hard to understand and might contain errors.\n\nParameters, field references, and other primary expressions are counted as a term.\n\n**Example:**\n\n int calc(int a, int b) {\n return a + a + a + b + b + b + b; // The line contains 7 terms and will be reported.\n }\n\nUse the field below to specify a number of terms allowed in arithmetic expressions." + "description": "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" } ] }, @@ -8500,6 +8500,83 @@ } ] }, + { + "name": "Style", + "inspections": [ + { + "shortName": "JavaStylePropertiesInvocation", + "displayName": "Java-style property access", + "enabled": false, + "description": "Reports properties accessed via method calls.\n\n**Example:**\n\n\n class Foo {\n int foo\n }\n\n def bar = new Foo()\n print(bar.getFoo())\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int foo\n }\n\n def bar = new Foo()\n print(bar.foo)\n" + }, + { + "shortName": "GrUnnecessarySemicolon", + "displayName": "Unnecessary semicolon", + "enabled": false, + "description": "Reports unnecessary semicolons.\n\n**Example:**\n\n\n print 2; print 3 // semicolon is required\n print 2; // semicolon is unnecessary\n" + }, + { + "shortName": "ChangeToMethod", + "displayName": "Operator invocation can be replaced with method call", + "enabled": false, + "description": "Reports operator invocations that can be replaced with method calls.\n\n**Example:**\n\n\n a + b\n\nAfter the quick-fix is applied:\n\n\n a.plus(b)\n" + }, + { + "shortName": "ChangeToOperator", + "displayName": "Method call can be replaced with operator invocation", + "enabled": false, + "description": "Reports method calls that can be replaced with operator invocations.\n\n**Example:**\n\n\n a.plus(b)\n\nAfter the quick-fix is applied:\n\n\n a + b\n" + }, + { + "shortName": "GroovyConditional", + "displayName": "Ternary expression", + "enabled": false, + "description": "Reports ternary expressions.\n\nSome coding standards prohibit the use of the condition operator in favor of `if` statements." + }, + { + "shortName": "GrUnnecessaryAlias", + "displayName": "Unnecessary import alias", + "enabled": false, + "description": "Reports unnecessary import aliases.\n\n**Example:**\n\n\n import com.foo.Bar as Bar\n\nAfter the quick-fix is applied:\n\n\n import com.foo.Bar\n" + }, + { + "shortName": "GrUnnecessaryNonSealedModifier", + "displayName": "Unnecessary 'non-sealed' modifier", + "enabled": false, + "description": "Reports unnecessary `non-sealed` modifiers which used on methods, fields, or variables.\n\nThis modifier has effect only on classes, interfaces and traits.\n\n**Example:**\n\n\n non-sealed boolean foo() {} // modifier is unnecessary\n non-sealed Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n non-sealed class A {}\n" + }, + { + "shortName": "GrUnnecessaryDefModifier", + "displayName": "Unnecessary 'def'", + "enabled": false, + "description": "Reports unnecessary `def` modifiers when used with explicit type declaration.\n\n**Example:**\n\n\n def boolean foo() {} // modifier is unnecessary\n def Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n def (int a, String b) = []\n" + }, + { + "shortName": "GrUnnecessaryFinalModifier", + "displayName": "Unnecessary 'final'", + "enabled": false, + "description": "Reports unnecessary `final` modifiers when used with the record definition.\n\n**Example:**\n\n\n final record R(int a) {} // modifier is unnecessary\n" + }, + { + "shortName": "GrUnnecessaryPublicModifier", + "displayName": "Unnecessary 'public'", + "enabled": false, + "description": "Reports unnecessary `public` modifiers as Groovy classes and methods are `public` by default.\n\n**Example:**\n\n\n public class Foo{\n public void bar(){\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo{\n void bar(){\n }\n }\n" + }, + { + "shortName": "GrStringStyleViolation", + "displayName": "String style violation", + "enabled": false, + "description": "Reports strings with quotation that doesn't match code style.\n\n**Example:**\n\n\n def hw = \"Hello, world!\"\n\nAfter the quick-fix is applied:\n\n\n def hw = 'Hello, world!'\n\nUse the fields provided below to specify code style for different kinds of strings." + }, + { + "shortName": "GrUnnecessarySealedModifier", + "displayName": "Unnecessary 'sealed' modifier", + "enabled": false, + "description": "Reports unnecessary `sealed` modifiers which used on methods, fields, or variables.\n\nThis modifier has effect only on classes, interfaces and traits.\n\n**Example:**\n\n\n sealed boolean foo() {} // modifier is unnecessary\n sealed Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n sealed class A {}\n" + } + ] + }, { "name": "RegExp", "inspections": [ @@ -8601,83 +8678,6 @@ } ] }, - { - "name": "Style", - "inspections": [ - { - "shortName": "JavaStylePropertiesInvocation", - "displayName": "Java-style property access", - "enabled": false, - "description": "Reports properties accessed via method calls.\n\n**Example:**\n\n\n class Foo {\n int foo\n }\n\n def bar = new Foo()\n print(bar.getFoo())\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int foo\n }\n\n def bar = new Foo()\n print(bar.foo)\n" - }, - { - "shortName": "GrUnnecessarySemicolon", - "displayName": "Unnecessary semicolon", - "enabled": false, - "description": "Reports unnecessary semicolons.\n\n**Example:**\n\n\n print 2; print 3 // semicolon is required\n print 2; // semicolon is unnecessary\n" - }, - { - "shortName": "ChangeToMethod", - "displayName": "Operator invocation can be replaced with method call", - "enabled": false, - "description": "Reports operator invocations that can be replaced with method calls.\n\n**Example:**\n\n\n a + b\n\nAfter the quick-fix is applied:\n\n\n a.plus(b)\n" - }, - { - "shortName": "ChangeToOperator", - "displayName": "Method call can be replaced with operator invocation", - "enabled": false, - "description": "Reports method calls that can be replaced with operator invocations.\n\n**Example:**\n\n\n a.plus(b)\n\nAfter the quick-fix is applied:\n\n\n a + b\n" - }, - { - "shortName": "GroovyConditional", - "displayName": "Ternary expression", - "enabled": false, - "description": "Reports ternary expressions.\n\nSome coding standards prohibit the use of the condition operator in favor of `if` statements." - }, - { - "shortName": "GrUnnecessaryAlias", - "displayName": "Unnecessary import alias", - "enabled": false, - "description": "Reports unnecessary import aliases.\n\n**Example:**\n\n\n import com.foo.Bar as Bar\n\nAfter the quick-fix is applied:\n\n\n import com.foo.Bar\n" - }, - { - "shortName": "GrUnnecessaryNonSealedModifier", - "displayName": "Unnecessary 'non-sealed' modifier", - "enabled": false, - "description": "Reports unnecessary `non-sealed` modifiers which used on methods, fields, or variables.\n\nThis modifier has effect only on classes, interfaces and traits.\n\n**Example:**\n\n\n non-sealed boolean foo() {} // modifier is unnecessary\n non-sealed Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n non-sealed class A {}\n" - }, - { - "shortName": "GrUnnecessaryDefModifier", - "displayName": "Unnecessary 'def'", - "enabled": false, - "description": "Reports unnecessary `def` modifiers when used with explicit type declaration.\n\n**Example:**\n\n\n def boolean foo() {} // modifier is unnecessary\n def Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n def (int a, String b) = []\n" - }, - { - "shortName": "GrUnnecessaryFinalModifier", - "displayName": "Unnecessary 'final'", - "enabled": false, - "description": "Reports unnecessary `final` modifiers when used with the record definition.\n\n**Example:**\n\n\n final record R(int a) {} // modifier is unnecessary\n" - }, - { - "shortName": "GrUnnecessaryPublicModifier", - "displayName": "Unnecessary 'public'", - "enabled": false, - "description": "Reports unnecessary `public` modifiers as Groovy classes and methods are `public` by default.\n\n**Example:**\n\n\n public class Foo{\n public void bar(){\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo{\n void bar(){\n }\n }\n" - }, - { - "shortName": "GrStringStyleViolation", - "displayName": "String style violation", - "enabled": false, - "description": "Reports strings with quotation that doesn't match code style.\n\n**Example:**\n\n\n def hw = \"Hello, world!\"\n\nAfter the quick-fix is applied:\n\n\n def hw = 'Hello, world!'\n\nUse the fields provided below to specify code style for different kinds of strings." - }, - { - "shortName": "GrUnnecessarySealedModifier", - "displayName": "Unnecessary 'sealed' modifier", - "enabled": false, - "description": "Reports unnecessary `sealed` modifiers which used on methods, fields, or variables.\n\nThis modifier has effect only on classes, interfaces and traits.\n\n**Example:**\n\n\n sealed boolean foo() {} // modifier is unnecessary\n sealed Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n sealed class A {}\n" - } - ] - }, { "name": "UI form", "inspections": [ @@ -9127,18 +9127,18 @@ { "name": "Test frameworks", "inspections": [ - { - "shortName": "JUnitMixedFramework", - "displayName": "JUnit API usage from multiple versions in a single TestCase", - "enabled": true, - "description": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case.\n\nExample (JUnit 4 annotation in JUnit 3 test case):\n\n\n public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }\n\nExample (JUnit 5 annotation in JUnit 4 test case):\n\n\n public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n" - }, { "shortName": "TestMethodWithoutAssertion", "displayName": "Test method without assertions", "enabled": false, "description": "Reports test methods that do not contain any assertions. Such methods may indicate either incomplete or weak test cases.\n\n**Example:**\n\n\n public class ExtensiveTest {\n\n @Test\n public void testAlive() {\n System.out.println(\"nothing\");\n }\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the combinations of fully qualified class name and method name regular expression that should qualify as assertions. Class names also match subclasses.\n* Use the **'assert' keyword is considered an assertion** option to specify if the Java `assert` statements using the `assert` keyword should be considered an assertion.\n* Use the **Ignore test methods which declare exceptions** option to ignore the test methods that declare exceptions. This can be useful when you have tests that will throw an exception on failure and thus don't need any assertions." }, + { + "shortName": "JUnitMixedFramework", + "displayName": "JUnit API usage from multiple versions in a single TestCase", + "enabled": true, + "description": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case.\n\nExample (JUnit 4 annotation in JUnit 3 test case):\n\n\n public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }\n\nExample (JUnit 5 annotation in JUnit 4 test case):\n\n\n public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n" + }, { "shortName": "TestFailedLine", "displayName": "Failed line in test", diff --git a/qodana/results/metaInformation.json b/qodana/results/metaInformation.json index c69bf9746a4..b1d84ec7d4e 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": "5cbfe33de7608a078ea24ed183be8d8bf6297b98", + "revisionId": "e2eccdcd7af3f5a35799ed75330bca3e7d0e0d20", "branch": "refs/heads/develop" } }, "deviceId": "200820300000000-b1a5-d275-f8e7-faf9fd093ee8", - "jobUrl": "https://github.com/1c-syntax/bsl-language-server/actions/runs/6465421045", + "jobUrl": "https://github.com/1c-syntax/bsl-language-server/actions/runs/6475178224", "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 98f029baa37..7bf2e83dbe9 100644 --- a/qodana/results/promo.json +++ b/qodana/results/promo.json @@ -3,21 +3,21 @@ "category": "Code style issues", "type": "Field may be 'final'", "severity": "High", - "comment": "Field 'skipAttachable' may be 'final'", + "comment": "Field 'formattingOptions' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FunctionReturnsSamePrimitiveDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", "language": "JAVA", - "line": 71, - "offset": 19, - "length": 14, + "line": 101, + "offset": 29, + "length": 17, "code": { - "startLine": 69, - "length": 14, - "offset": 62, - "surroundingCode": " defaultValue = \"\" + SKIP_ATTACHABLE\n )\n private boolean skipAttachable = SKIP_ATTACHABLE;\n\n @DiagnosticParameter(" + "startLine": 99, + "length": 17, + "offset": 94, + "surroundingCode": " @JsonProperty(\"formatting\")\n @Setter(value = AccessLevel.NONE)\n private FormattingOptions formattingOptions = new FormattingOptions();\n\n private String siteRoot = \"https://1c-syntax.github.io/bsl-language-server\";" } } ], @@ -25,27 +25,27 @@ "module": "bsl-language-server.main", "inspectionName": "FieldMayBeFinal" }, - "hash": "0977057f9611196f9c65dd437e0e0e01a96cc4eb063a531df8af48abdd1da1cb" + "hash": "0a5f1271e31db2a4e5b86f0a8f1bddad77ae6956449089c6c6384b8fa3145d75" },{ "tool": "Code Inspection", "category": "Code style issues", "type": "Field may be 'final'", "severity": "High", - "comment": "Field 'caseSensitiveForString' may be 'final'", + "comment": "Field 'analyzeInternetMailProfileZeroTimeout' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FunctionReturnsSamePrimitiveDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TimeoutsInExternalResourcesDiagnostic.java", "language": "JAVA", "line": 77, "offset": 19, - "length": 22, + "length": 37, "code": { "startLine": 75, - "length": 22, - "offset": 72, - "surroundingCode": " defaultValue = \"\" + CASE_SENSITIVE_FOR_STRING\n )\n private boolean caseSensitiveForString = CASE_SENSITIVE_FOR_STRING;\n\n @Override" + "length": 37, + "offset": 61, + "surroundingCode": " defaultValue = \"\" + ANALYZING_MAIL\n )\n private boolean analyzeInternetMailProfileZeroTimeout = ANALYZING_MAIL;\n\n private Pattern getPatternNewExpression() {" } } ], @@ -53,27 +53,55 @@ "module": "bsl-language-server.main", "inspectionName": "FieldMayBeFinal" }, - "hash": "253bd105bbf46b7c76a6a9c7a4007332c22cb3701445cb613bc48b93a231afda" + "hash": "0be5f72405a4662d8fd4e4f44b5da630f710e47b0e4cdf501ec86836d1ce5518" },{ "tool": "Code Inspection", "category": "Code style issues", "type": "Field may be 'final'", "severity": "High", - "comment": "Field 'endpointPath' may be 'final'", + "comment": "Field 'skipSupport' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/websocket/WebSocketConfiguration.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", + "language": "JAVA", + "line": 46, + "offset": 23, + "length": 11, + "code": { + "startLine": 44, + "length": 11, + "offset": 121, + "surroundingCode": " private ComputeTrigger computeTrigger = ComputeTrigger.ONSAVE;\n private boolean analyzeOnStart;\n private SkipSupport skipSupport = SkipSupport.NEVER;\n private Mode mode = Mode.ON;\n private boolean ordinaryAppSupport = true;" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "0c17bb656c01a33fa0fe800dbbe8b63f7e73500ca91b5cb23a73fcc3ea7b33c7" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'computeTrigger' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", "language": "JAVA", "line": 44, - "offset": 18, - "length": 12, + "offset": 26, + "length": 14, "code": { "startLine": 42, - "length": 12, - "offset": 56, - "surroundingCode": "\n @Value(\"${app.websocket.lsp-path}\")\n private String endpointPath = \"\";\n\n @Bean" + "length": 14, + "offset": 103, + "surroundingCode": "@JsonIgnoreProperties(ignoreUnknown = true)\npublic class DiagnosticsOptions {\n private ComputeTrigger computeTrigger = ComputeTrigger.ONSAVE;\n private boolean analyzeOnStart;\n private SkipSupport skipSupport = SkipSupport.NEVER;" } } ], @@ -81,27 +109,27 @@ "module": "bsl-language-server.main", "inspectionName": "FieldMayBeFinal" }, - "hash": "9e90f205d2530bb6c80c1b7e110aea51c6c9579943223925e6c150d8c8c6b449" + "hash": "19b70620e5c3232e198998d10dfd30a037696e6d912974b6fe2b401c248dd2bc" },{ "tool": "Code Inspection", "category": "Code style issues", "type": "Field may be 'final'", "severity": "High", - "comment": "Field 'findFirst' may be 'final'", + "comment": "Field 'inlayHintOptions' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DataExchangeLoadingDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", "language": "JAVA", - "line": 75, - "offset": 19, - "length": 9, + "line": 97, + "offset": 28, + "length": 16, "code": { - "startLine": 73, - "length": 9, - "offset": 57, - "surroundingCode": " defaultValue = \"\" + FIND_FIRST\n )\n private boolean findFirst = FIND_FIRST;\n\n @Override" + "startLine": 95, + "length": 16, + "offset": 92, + "surroundingCode": " @JsonProperty(\"inlayHint\")\n @Setter(value = AccessLevel.NONE)\n private InlayHintOptions inlayHintOptions = new InlayHintOptions();\n\n @JsonProperty(\"formatting\")" } } ], @@ -109,145 +137,453 @@ "module": "bsl-language-server.main", "inspectionName": "FieldMayBeFinal" }, - "hash": "c1195324e7d45d5200f240c26d107aedddb2d18dde2a71625c53d4f4cb5b8b59" + "hash": "1cc7b494cb8b120d856ce3e0fe6377293144c943c36b912fa4465932526616d9" },{ "tool": "Code Inspection", - "category": "Javadoc", - "type": "Declaration has problems in Javadoc references", + "category": "Code style issues", + "type": "Field may be 'final'", "severity": "High", - "comment": "Cannot resolve symbol 'getUri()'", - "detailsInfo": "Reports unresolved references inside Javadoc comments.\n\nIn the following example, the `someParam` parameter is missing, so it will be highlighted:\n\n\n class A {\n /**\n * @param someParam description\n **/\n void foo() {\n }\n }\n\n\nDisable the **Report inaccessible symbols** option to ignore the tags that reference missing method parameters,\nclasses, fields and methods.", + "comment": "Field 'mode' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ModuleSymbol.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", "language": "JAVA", - "line": 52, - "offset": 87, - "length": 6, + "line": 47, + "offset": 16, + "length": 4, "code": { - "startLine": 50, - "length": 6, - "offset": 259, - "surroundingCode": " * Если у документа есть валидный mdoRef, то содержит его и (при необходимости) квалификатор в виде типа модуля\n * ({@link com.github._1c_syntax.bsl.types.ModuleType}).\n * В остальных случаях содержит строковое представление uri ({@link DocumentContext#getUri()}.\n */\n String name;" + "startLine": 45, + "length": 4, + "offset": 104, + "surroundingCode": " private boolean analyzeOnStart;\n private SkipSupport skipSupport = SkipSupport.NEVER;\n private Mode mode = Mode.ON;\n private boolean ordinaryAppSupport = true;\n private SubsystemFilter subsystemsFilter = new SubsystemFilter();" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "4c28ea190dd62d3f3d454eb16431e07c7b95a3a44b93503d3206d4129b213245" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'codeLensOptions' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "language": "JAVA", + "line": 89, + "offset": 27, + "length": 15, + "code": { + "startLine": 87, + "length": 15, + "offset": 90, + "surroundingCode": " @JsonProperty(\"codeLens\")\n @Setter(value = AccessLevel.NONE)\n private CodeLensOptions codeLensOptions = new CodeLensOptions();\n\n @JsonProperty(\"documentLink\")" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "6f1c2914327e246d2436a994e48d6aa4a3328eb216424c054a6894ce96fe7822" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'documentLinkOptions' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "language": "JAVA", + "line": 93, + "offset": 31, + "length": 19, + "code": { + "startLine": 91, + "length": 19, + "offset": 98, + "surroundingCode": " @JsonProperty(\"documentLink\")\n @Setter(value = AccessLevel.NONE)\n private DocumentLinkOptions documentLinkOptions = new DocumentLinkOptions();\n\n @JsonProperty(\"inlayHint\")" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "JavadocReference" + "inspectionName": "FieldMayBeFinal" }, - "hash": "979e8fda5f2de470a0b8ccb0ca592c9b6ccb0520b686f48523bc062485023e23" + "hash": "6fbdf1d56db17fdf825cb093bbdd33bf3a7b6f079f5b2c62678b6b90651f1bfa" },{ "tool": "Code Inspection", - "category": "Nullability problems", - "type": "@NotNull/@Nullable problems", + "category": "Code style issues", + "type": "Field may be 'final'", "severity": "High", - "comment": "Not annotated parameter overrides @NonNullApi parameter", - "detailsInfo": "Reports problems related to nullability annotations.\n\n**Examples:**\n\n* Overriding methods are not annotated:\n\n\n abstract class A {\n @NotNull abstract String m();\n }\n class B extends A {\n String m() { return \"empty string\"; }\n }\n \n* Annotated primitive types: `@NotNull int myFoo;`\n* Both `@Nullable` and `@NotNull` are present on the same member: `@Nullable @NotNull String myFooString;`\n* Collection of nullable elements is assigned into a collection of non-null elements:\n\n\n void testList(List<@Nullable String> nullableList) {\n List<@NotNull String> list2 = nullableList;\n }\n \nUse the **Configure Annotations** button to specify nullability annotations and the checkboxes to fine-tune where the inspection should provide warnings.\n\nThis inspection only reports if the language level of the project or module is 5 or higher,\nand nullability annotations are available on the classpath.", + "comment": "Field 'siteRoot' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/infrastructure/DiagnosticBeanPostProcessor.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", "language": "JAVA", - "line": 56, - "offset": 68, + "line": 103, + "offset": 18, "length": 8, "code": { - "startLine": 54, + "startLine": 101, "length": 8, - "offset": 80, - "surroundingCode": "\n @Override\n public Object postProcessAfterInitialization(Object bean, String beanName) {\n\n if (!BSLDiagnostic.class.isAssignableFrom(bean.getClass())) {" + "offset": 91, + "surroundingCode": " private FormattingOptions formattingOptions = new FormattingOptions();\n\n private String siteRoot = \"https://1c-syntax.github.io/bsl-language-server\";\n private boolean useDevSite;\n" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "83d3e14106ab3feec3d114205df68f37abfebed773b2b5ca3277c80ca632b093" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'sendErrors' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "language": "JAVA", + "line": 106, + "offset": 26, + "length": 10, + "code": { + "startLine": 104, + "length": 10, + "offset": 56, + "surroundingCode": " private boolean useDevSite;\n\n private SendErrorsMode sendErrors = SendErrorsMode.DEFAULT;\n\n @Nullable" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "974649d350abb97382164a7d276af735c8330b013dbfdb4c96be44995ba6c9a9" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'parameters' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", + "language": "JAVA", + "line": 52, + "offset": 61, + "length": 10, + "code": { + "startLine": 50, + "length": 10, + "offset": 118, + "surroundingCode": "\n @JsonDeserialize(using = ParametersDeserializer.class)\n private Map>> parameters = new HashMap<>();\n}\n" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "NullableProblems" + "inspectionName": "FieldMayBeFinal" }, - "hash": "69f40bd1a6b47026f6793b2b4bb0fb8146bcd18b2302b27a5469039bc220f34a" + "hash": "b077b179714a7393d8c94c1b14799e4ec06eb478da1942ecda2dc51e2d7019d5" },{ "tool": "Code Inspection", - "category": "Nullability problems", - "type": "@NotNull/@Nullable problems", + "category": "Code style issues", + "type": "Field may be 'final'", "severity": "High", - "comment": "Not annotated parameter overrides @NonNullApi parameter", - "detailsInfo": "Reports problems related to nullability annotations.\n\n**Examples:**\n\n* Overriding methods are not annotated:\n\n\n abstract class A {\n @NotNull abstract String m();\n }\n class B extends A {\n String m() { return \"empty string\"; }\n }\n \n* Annotated primitive types: `@NotNull int myFoo;`\n* Both `@Nullable` and `@NotNull` are present on the same member: `@Nullable @NotNull String myFooString;`\n* Collection of nullable elements is assigned into a collection of non-null elements:\n\n\n void testList(List<@Nullable String> nullableList) {\n List<@NotNull String> list2 = nullableList;\n }\n \nUse the **Configure Annotations** button to specify nullability annotations and the checkboxes to fine-tune where the inspection should provide warnings.\n\nThis inspection only reports if the language level of the project or module is 5 or higher,\nand nullability annotations are available on the classpath.", + "comment": "Field 'subsystemsFilter' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/infrastructure/DiagnosticBeanPostProcessor.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", "language": "JAVA", - "line": 42, - "offset": 69, + "line": 49, + "offset": 27, + "length": 16, + "code": { + "startLine": 47, + "length": 16, + "offset": 102, + "surroundingCode": " private Mode mode = Mode.ON;\n private boolean ordinaryAppSupport = true;\n private SubsystemFilter subsystemsFilter = new SubsystemFilter();\n\n @JsonDeserialize(using = ParametersDeserializer.class)" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "b24471c1b7a37a3d5a2760883d002e7c5c4898774280c1a49050ab6aa42e75d7" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'parameters' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/inlayhints/InlayHintOptions.java", + "language": "JAVA", + "line": 49, + "offset": 61, + "length": 10, + "code": { + "startLine": 47, + "length": 10, + "offset": 123, + "surroundingCode": " */\n @JsonDeserialize(using = ParametersDeserializer.class)\n private Map>> parameters = new HashMap<>();\n}\n" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "b635c8a07ffa4ed2069d04a214bf30f4d8692f014541d72d051032438d3f1048" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SpaceAtStartCommentDiagnostic.java", + "language": "JAVA", + "line": 83, + "offset": 19, + "length": 19, + "code": { + "startLine": 81, + "length": 19, + "offset": 68, + "surroundingCode": " defaultValue = \"\" + USE_STRICT_VALIDATION\n )\n private boolean useStrictValidation = USE_STRICT_VALIDATION;\n\n public SpaceAtStartCommentDiagnostic() {" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "bb2f36ce9a481cf7dc1b3836482e687eb4d37f95e8734b4c8b2eb9fedfccb288" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'language' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "language": "JAVA", + "line": 81, + "offset": 20, "length": 8, "code": { - "startLine": 40, + "startLine": 79, "length": 8, - "offset": 81, - "surroundingCode": "\n @Override\n public Object postProcessBeforeInitialization(Object bean, String beanName) {\n if (!BSLDiagnostic.class.isAssignableFrom(bean.getClass())) {\n return bean;" + "offset": 120, + "surroundingCode": " private static final Pattern searchConfiguration = Pattern.compile(\"Configuration\\\\.(xml|mdo)$\");\n\n private Language language = Language.DEFAULT_LANGUAGE;\n\n @JsonProperty(\"diagnostics\")" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "NullableProblems" + "inspectionName": "FieldMayBeFinal" }, - "hash": "a453ac241fce07460259ceabd7266c48b96099d7888b60c6d3487f798d9d6874" + "hash": "cc805b1f031c7a98fa2c14667fe1dadc3ddb24e27cf4fd1095fa0ef02a6600fb" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'methodPattern' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/AbstractFindMethodDiagnostic.java", + "language": "JAVA", + "line": 45, + "offset": 19, + "length": 13, + "code": { + "startLine": 43, + "length": 13, + "offset": 38, + "surroundingCode": " @Getter\n @Setter\n private Pattern methodPattern;\n\n /**" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "cf84819f339902603b36a0444f5a874ab84d01b78a229b3969c6a59b45e62af7" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'diagnosticsOptions' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "language": "JAVA", + "line": 85, + "offset": 30, + "length": 18, + "code": { + "startLine": 83, + "length": 18, + "offset": 96, + "surroundingCode": " @JsonProperty(\"diagnostics\")\n @Setter(value = AccessLevel.NONE)\n private DiagnosticsOptions diagnosticsOptions = new DiagnosticsOptions();\n\n @JsonProperty(\"codeLens\")" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "e4a8747518e7359166822947a228e7e821d89bd7bbd862631556fc40b0af2b5e" +},{ + "tool": "Code Inspection", + "category": "Code style issues", + "type": "Field may be 'final'", + "severity": "High", + "comment": "Field 'ordinaryAppSupport' 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\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", + "language": "JAVA", + "line": 48, + "offset": 19, + "length": 18, + "code": { + "startLine": 46, + "length": 18, + "offset": 104, + "surroundingCode": " private SkipSupport skipSupport = SkipSupport.NEVER;\n private Mode mode = Mode.ON;\n private boolean ordinaryAppSupport = true;\n private SubsystemFilter subsystemsFilter = new SubsystemFilter();\n" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "FieldMayBeFinal" + }, + "hash": "e595d4c2ddc63ac5783e7ebb56eed6d7b295e25c0bacf86b80a95e921b7df563" },{ "tool": "Code Inspection", "category": "Verbose or redundant code constructs", - "type": "Concatenation with empty string", + "type": "Redundant type cast", "severity": "High", - "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\n\nUse the **Report only cases when empty string can be deleted without other changes**\noption to only report cases when empty string can be deleted\nwithout conversion other operands with `String.valueOf`.", + "comment": "Casting 'expression.getParent()' to 'BSLParser.ElsifBranchContext' is redundant", + "detailsInfo": "Reports unnecessary cast expressions.\n\nExample:\n\n\n static Object toObject(String s) {\n return (Object) s;\n }\n\n\nUse the checkbox below to ignore clarifying casts e.g., casts in collection calls where `Object` is expected:\n\n\n static void removeFromList(List l, Object o) {\n l.remove((String)o);\n } \n", "sources": [ { "type": "file", - "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/IncorrectLineBreakDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/AllFunctionPathMustHaveReturnDiagnostic.java", "language": "JAVA", - "line": 74, - "offset": 20, - "length": 2, + "line": 162, + "offset": 27, + "length": 28, "code": { - "startLine": 72, - "length": 2, - "offset": 68, - "surroundingCode": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_START\n )\n private Pattern listOfIncorrectFirstSymbol = createPatternIncorrectStartLine(DEFAULT_LIST_FOR_CHECK_START);" + "startLine": 160, + "length": 28, + "offset": 168, + "surroundingCode": " var expression = v.getExpression();\n if (expression.getParent() instanceof BSLParser.ElsifBranchContext && !ignoreMissingElseOnExit) {\n return Optional.of((BSLParser.ElsifBranchContext) expression.getParent());\n }\n" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "TrivialStringConcatenation" + "inspectionName": "RedundantCast" }, - "hash": "5355e6263896b63b853194d62435b8e7866ea257b8d1180f53381031fa7f157d" + "hash": "cf16fab86b340461a763ad3df7290cbbae7fb2dfc659c327c423912ebc40f68b" },{ "tool": "Code Inspection", "category": "Verbose or redundant code constructs", - "type": "Concatenation with empty string", + "type": "Stream API call chain can be simplified", "severity": "High", - "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\n\nUse the **Report only cases when empty string can be deleted without other changes**\noption to only report cases when empty string can be deleted\nwithout conversion other operands with `String.valueOf`.", + "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/IncorrectLineBreakDiagnostic.java", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RewriteMethodParameterDiagnostic.java", "language": "JAVA", - "line": 86, - "offset": 20, - "length": 2, + "line": 184, + "offset": 10, + "length": 28, "code": { - "startLine": 84, - "length": 2, - "offset": 68, - "surroundingCode": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_END\n )\n private Pattern listOfIncorrectLastSymbol = createPatternIncorrectEndLine(DEFAULT_LIST_FOR_CHECK_END);" + "startLine": 182, + "length": 28, + "offset": 61, + "surroundingCode": " reference.getSelectionRange(),\n \"+1\"\n )).collect(Collectors.toList());\n var resultRefs = new ArrayList();\n resultRefs.add(RelatedInformation.create(" + } + } + ], + "attributes": { + "module": "bsl-language-server.main", + "inspectionName": "SimplifyStreamApiCallChains" + }, + "hash": "54974f45d0575f20f8528cc62150ef6f99612f9e6f3eaa48bbece33fe40e35eb" +},{ + "tool": "Code Inspection", + "category": "Imports", + "type": "Unused import", + "severity": "High", + "comment": "Unused import 'import org.antlr.v4.runtime.RuleContext;'", + "detailsInfo": "Reports redundant `import` statements.\n\nRegular `import` statements are unnecessary when not using imported classes and packages in the source file.\nThe same applies to imported `static` fields and methods that aren't used in the source file.\n\n**Example:**\n\n\n import java.util.ArrayList;\n public class Example {\n public static void main(String[] args) {\n System.out.println(\"Hello World!\");\n }\n }\n\nAfter the quick fix is applied:\n\n\n public class Example {\n public static void main(String[] args) {\n System.out.println(\"Hello World!\");\n }\n }\n", + "sources": [ + { + "type": "file", + "path": "src/main/java/com/github/_1c_syntax/bsl/languageserver/codeactions/ExtractStructureConstructorSupplier.java", + "language": "JAVA", + "line": 35, + "offset": 1, + "length": 40, + "code": { + "startLine": 33, + "length": 40, + "offset": 101, + "surroundingCode": "import com.github._1c_syntax.bsl.parser.BSLParserRuleContext;\nimport lombok.RequiredArgsConstructor;\nimport org.antlr.v4.runtime.RuleContext;\nimport org.antlr.v4.runtime.tree.TerminalNode;\nimport org.eclipse.lsp4j.CodeAction;" } } ], "attributes": { "module": "bsl-language-server.main", - "inspectionName": "TrivialStringConcatenation" + "inspectionName": "UNUSED_IMPORT" }, - "hash": "71fad01f46f068479c1dec20f8a590a32612f69d6f8ca4af831065bf49393b42" + "hash": "d6d2b7e443732e19ee62238a2dead2c4681ee40bdc2e748a9be2e70ac5045a33" }]} \ No newline at end of file diff --git a/qodana/results/qodana.sarif.json b/qodana/results/qodana.sarif.json index 70b4ed7a912..e061540a7ca 100644 --- a/qodana/results/qodana.sarif.json +++ b/qodana/results/qodana.sarif.json @@ -193,8 +193,8 @@ ] }, { - "id": "Java/Declaration redundancy", - "name": "Declaration redundancy", + "id": "Java/Error handling", + "name": "Error handling", "relationships": [ { "target": { @@ -211,8 +211,8 @@ ] }, { - "id": "Java/Error handling", - "name": "Error handling", + "id": "Java/Declaration redundancy", + "name": "Declaration redundancy", "relationships": [ { "target": { @@ -269,13 +269,17 @@ ] }, { - "id": "Java/Performance/Embedded", - "name": "Embedded", + "id": "Groovy", + "name": "Groovy" + }, + { + "id": "Groovy/GPath", + "name": "GPath", "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Groovy", + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -287,17 +291,13 @@ ] }, { - "id": "Groovy", - "name": "Groovy" - }, - { - "id": "Groovy/GPath", - "name": "GPath", + "id": "Java/Performance/Embedded", + "name": "Embedded", "relationships": [ { "target": { - "id": "Groovy", - "index": 20, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -381,8 +381,8 @@ ] }, { - "id": "Java/Control flow issues", - "name": "Control flow issues", + "id": "Java/Numeric issues", + "name": "Numeric issues", "relationships": [ { "target": { @@ -399,8 +399,8 @@ ] }, { - "id": "Java/Numeric issues", - "name": "Numeric issues", + "id": "Java/Control flow issues", + "name": "Control flow issues", "relationships": [ { "target": { @@ -507,7 +507,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -561,7 +561,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -623,7 +623,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -825,7 +825,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -991,7 +991,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1081,7 +1081,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1117,7 +1117,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1247,7 +1247,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1276,10 +1276,6 @@ } ] }, - { - "id": "RegExp", - "name": "RegExp" - }, { "id": "Groovy/Style", "name": "Style", @@ -1287,7 +1283,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1298,6 +1294,10 @@ } ] }, + { + "id": "RegExp", + "name": "RegExp" + }, { "id": "UI form", "name": "UI form" @@ -1381,7 +1381,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1537,7 +1537,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1555,7 +1555,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -1595,7 +1595,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1613,7 +1613,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1889,7 +1889,7 @@ { "target": { "id": "Groovy", - "index": 20, + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -3324,21 +3324,21 @@ ] }, { - "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": { - "suppressToolId": "ReplaceSizeZeroCheckWithIsEmpty", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "ReplaceGuardClauseWithFunctionCall", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ @@ -3357,21 +3357,21 @@ ] }, { - "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": { - "suppressToolId": "ReplaceGuardClauseWithFunctionCall", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "ReplaceSizeZeroCheckWithIsEmpty", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ @@ -3489,28 +3489,28 @@ ] }, { - "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": { - "suppressToolId": "FakeJvmFieldConstant", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ProtectedInFinal", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin/Java interop issues", - "index": 68, + "id": "Kotlin/Style issues", + "index": 3, "toolComponent": { "name": "QDJVMC" } @@ -3522,28 +3522,28 @@ ] }, { - "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": { - "suppressToolId": "ProtectedInFinal", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "FakeJvmFieldConstant", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 3, + "id": "Kotlin/Java interop issues", + "index": 68, "toolComponent": { "name": "QDJVMC" } @@ -3786,19 +3786,19 @@ ] }, { - "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": { - "suppressToolId": "ReplaceAssertBooleanWithAssertEquality", + "suppressToolId": "DeprecatedCallableAddReplaceWith", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -3806,8 +3806,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 3, + "id": "Kotlin/Other problems", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -3819,19 +3819,19 @@ ] }, { - "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": { - "suppressToolId": "DeprecatedCallableAddReplaceWith", + "suppressToolId": "ReplaceAssertBooleanWithAssertEquality", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -3839,8 +3839,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Other problems", - "index": 54, + "id": "Kotlin/Style issues", + "index": 3, "toolComponent": { "name": "QDJVMC" } @@ -4050,19 +4050,19 @@ ] }, { - "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, "level": "note", "parameters": { - "suppressToolId": "IfThenToElvis", + "suppressToolId": "ObjectPrivatePropertyName", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -4070,8 +4070,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 3, + "id": "Kotlin/Naming conventions", + "index": 49, "toolComponent": { "name": "QDJVMC" } @@ -4083,19 +4083,19 @@ ] }, { - "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, "level": "note", "parameters": { - "suppressToolId": "ObjectPrivatePropertyName", + "suppressToolId": "IfThenToElvis", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -4103,8 +4103,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Naming conventions", - "index": 49, + "id": "Kotlin/Style issues", + "index": 3, "toolComponent": { "name": "QDJVMC" } @@ -5799,28 +5799,28 @@ ] }, { - "id": "UnnecessaryVariable", + "id": "DeprecatedMavenDependency", "shortDescription": { - "text": "Unnecessary local variable" + "text": "Deprecated library is used in Maven" }, "fullDescription": { - "text": "Reports local variables that are used only in the very next 'return' statement or are exact copies of other variables. Such variables can be safely inlined to make the code more clear.", - "markdown": "Reports local variables that are used only in the very next `return` statement or are exact copies of other variables.\n\nSuch variables can be safely inlined to make the code more clear." + "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": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryVariable", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "DeprecatedMavenDependency", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 5, + "id": "Kotlin", + "index": 2, "toolComponent": { "name": "QDJVMC" } @@ -5832,28 +5832,28 @@ ] }, { - "id": "DeprecatedMavenDependency", + "id": "EnumEntryName", "shortDescription": { - "text": "Deprecated library is used in Maven" + "text": "Enum entry naming convention" }, "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" + "text": "Reports enum entry names that do not follow the recommended naming conventions. Example: 'enum class Foo {\n _Foo,\n foo\n }' To fix the problem rename enum entries to match the recommended naming conventions.", + "markdown": "Reports enum entry names that do not follow the recommended naming conventions.\n\n**Example:**\n\n\n enum class Foo {\n _Foo,\n foo\n }\n\nTo fix the problem rename enum entries to match the recommended naming conventions." }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "DeprecatedMavenDependency", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "EnumEntryName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin", - "index": 2, + "id": "Kotlin/Naming conventions", + "index": 49, "toolComponent": { "name": "QDJVMC" } @@ -5865,19 +5865,19 @@ ] }, { - "id": "EnumEntryName", + "id": "UnnecessaryVariable", "shortDescription": { - "text": "Enum entry naming convention" + "text": "Unnecessary local variable" }, "fullDescription": { - "text": "Reports enum entry names that do not follow the recommended naming conventions. Example: 'enum class Foo {\n _Foo,\n foo\n }' To fix the problem rename enum entries to match the recommended naming conventions.", - "markdown": "Reports enum entry names that do not follow the recommended naming conventions.\n\n**Example:**\n\n\n enum class Foo {\n _Foo,\n foo\n }\n\nTo fix the problem rename enum entries to match the recommended naming conventions." + "text": "Reports local variables that are used only in the very next 'return' statement or are exact copies of other variables. Such variables can be safely inlined to make the code more clear.", + "markdown": "Reports local variables that are used only in the very next `return` statement or are exact copies of other variables.\n\nSuch variables can be safely inlined to make the code more clear." }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "suppressToolId": "EnumEntryName", + "suppressToolId": "UnnecessaryVariable", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -5885,8 +5885,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Naming conventions", - "index": 49, + "id": "Kotlin/Redundant constructs", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -6294,19 +6294,19 @@ ] }, { - "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, "level": "note", "parameters": { - "suppressToolId": "RedundantWith", + "suppressToolId": "WarningOnMainUnusedParameterMigration", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -6314,8 +6314,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 5, + "id": "Kotlin/Migration", + "index": 16, "toolComponent": { "name": "QDJVMC" } @@ -6327,19 +6327,19 @@ ] }, { - "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, "level": "note", "parameters": { - "suppressToolId": "WarningOnMainUnusedParameterMigration", + "suppressToolId": "RedundantWith", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -6347,8 +6347,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 16, + "id": "Kotlin/Redundant constructs", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -6459,21 +6459,21 @@ ] }, { - "id": "ReplaceNegatedIsEmptyWithIsNotEmpty", + "id": "ReplaceWithImportAlias", "shortDescription": { - "text": "Negated call can be simplified" + "text": "Fully qualified name can be replaced with existing import alias" }, "fullDescription": { - "text": "Reports negation 'isEmpty()' and 'isNotEmpty()' for collections and 'String', or 'isBlank()' and 'isNotBlank()' for 'String'. Using corresponding functions makes your code simpler. The quick-fix replaces the negation call with the corresponding call from the Standard Library. Example: 'fun main() {\n val list = listOf(1,2,3)\n if (!list.isEmpty()) {\n // do smth\n }\n }' After the quick-fix is applied: 'fun main() {\n val list = listOf(1,2,3)\n if (list.isNotEmpty()) {\n // do smth\n }\n }'", - "markdown": "Reports negation `isEmpty()` and `isNotEmpty()` for collections and `String`, or `isBlank()` and `isNotBlank()` for `String`.\n\nUsing corresponding functions makes your code simpler.\n\nThe quick-fix replaces the negation call with the corresponding call from the Standard Library.\n\n**Example:**\n\n\n fun main() {\n val list = listOf(1,2,3)\n if (!list.isEmpty()) {\n // do smth\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val list = listOf(1,2,3)\n if (list.isNotEmpty()) {\n // do smth\n }\n }\n" + "text": "Reports fully qualified names that can be replaced with an existing import alias. Example: 'import foo.Foo as Bar\nfun main() {\n foo.Foo()\n}' After the quick-fix is applied: 'import foo.Foo as Bar\nfun main() {\n Bar()\n}'", + "markdown": "Reports fully qualified names that can be replaced with an existing import alias.\n\n**Example:**\n\n\n import foo.Foo as Bar\n fun main() {\n foo.Foo()\n }\n\nAfter the quick-fix is applied:\n\n\n import foo.Foo as Bar\n fun main() {\n Bar()\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "suppressToolId": "ReplaceNegatedIsEmptyWithIsNotEmpty", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "ReplaceWithImportAlias", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ @@ -6492,21 +6492,21 @@ ] }, { - "id": "ReplaceWithImportAlias", + "id": "ReplaceNegatedIsEmptyWithIsNotEmpty", "shortDescription": { - "text": "Fully qualified name can be replaced with existing import alias" + "text": "Negated call can be simplified" }, "fullDescription": { - "text": "Reports fully qualified names that can be replaced with an existing import alias. Example: 'import foo.Foo as Bar\nfun main() {\n foo.Foo()\n}' After the quick-fix is applied: 'import foo.Foo as Bar\nfun main() {\n Bar()\n}'", - "markdown": "Reports fully qualified names that can be replaced with an existing import alias.\n\n**Example:**\n\n\n import foo.Foo as Bar\n fun main() {\n foo.Foo()\n }\n\nAfter the quick-fix is applied:\n\n\n import foo.Foo as Bar\n fun main() {\n Bar()\n }\n" + "text": "Reports negation 'isEmpty()' and 'isNotEmpty()' for collections and 'String', or 'isBlank()' and 'isNotBlank()' for 'String'. Using corresponding functions makes your code simpler. The quick-fix replaces the negation call with the corresponding call from the Standard Library. Example: 'fun main() {\n val list = listOf(1,2,3)\n if (!list.isEmpty()) {\n // do smth\n }\n }' After the quick-fix is applied: 'fun main() {\n val list = listOf(1,2,3)\n if (list.isNotEmpty()) {\n // do smth\n }\n }'", + "markdown": "Reports negation `isEmpty()` and `isNotEmpty()` for collections and `String`, or `isBlank()` and `isNotBlank()` for `String`.\n\nUsing corresponding functions makes your code simpler.\n\nThe quick-fix replaces the negation call with the corresponding call from the Standard Library.\n\n**Example:**\n\n\n fun main() {\n val list = listOf(1,2,3)\n if (!list.isEmpty()) {\n // do smth\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val list = listOf(1,2,3)\n if (list.isNotEmpty()) {\n // do smth\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "suppressToolId": "ReplaceWithImportAlias", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "ReplaceNegatedIsEmptyWithIsNotEmpty", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ @@ -11157,19 +11157,19 @@ ] }, { - "id": "UnusedReturnValue", + "id": "UncheckedExceptionClass", "shortDescription": { - "text": "Method can be made 'void'" + "text": "Unchecked 'Exception' class" }, "fullDescription": { - "text": "Reports methods whose return values are never used when called. The return type of such methods can be made 'void'. Methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation will not be reported. The quick-fix updates the method signature and removes 'return' statements from inside the method. Example: '// reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }' After the quick-fix is applied to both methods: 'protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...' NOTE: Some methods might not be reported during in-editor highlighting due to performance reasons. To see all results, run the inspection using Code | Inspect Code or Code | Analyze Code | Run Inspection by Name> Use the Ignore chainable methods option to ignore unused return values from chainable calls. Use the Maximal reported method visibility option to control the maximum visibility of methods to be reported.", - "markdown": "Reports methods whose return values are never used when called. The return type of such methods can be made `void`.\n\nMethods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\nThe quick-fix updates the method signature and removes `return` statements from inside the method.\n\n**Example:**\n\n\n // reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }\n\nAfter the quick-fix is applied to both methods:\n\n\n protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...\n\n\n**NOTE:** Some methods might not be reported during in-editor highlighting due to performance reasons.\nTo see all results, run the inspection using **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**\\>\n\nUse the **Ignore chainable methods** option to ignore unused return values from chainable calls.\n\nUse the **Maximal reported method visibility** option to control the maximum visibility of methods to be reported." + "text": "Reports subclasses of 'java.lang.RuntimeException'. Some coding standards require that all user-defined exception classes are checked. Example: 'class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException''", + "markdown": "Reports subclasses of `java.lang.RuntimeException`.\n\nSome coding standards require that all user-defined exception classes are checked.\n\n**Example:**\n\n\n class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException'\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnusedReturnValue", + "suppressToolId": "UncheckedExceptionClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11177,7 +11177,7 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", + "id": "Java/Error handling", "index": 14, "toolComponent": { "name": "QDJVMC" @@ -11190,19 +11190,19 @@ ] }, { - "id": "UncheckedExceptionClass", + "id": "UnusedReturnValue", "shortDescription": { - "text": "Unchecked 'Exception' class" + "text": "Method can be made 'void'" }, "fullDescription": { - "text": "Reports subclasses of 'java.lang.RuntimeException'. Some coding standards require that all user-defined exception classes are checked. Example: 'class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException''", - "markdown": "Reports subclasses of `java.lang.RuntimeException`.\n\nSome coding standards require that all user-defined exception classes are checked.\n\n**Example:**\n\n\n class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException'\n" + "text": "Reports methods whose return values are never used when called. The return type of such methods can be made 'void'. Methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation will not be reported. The quick-fix updates the method signature and removes 'return' statements from inside the method. Example: '// reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }' After the quick-fix is applied to both methods: 'protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...' NOTE: Some methods might not be reported during in-editor highlighting due to performance reasons. To see all results, run the inspection using Code | Inspect Code or Code | Analyze Code | Run Inspection by Name> Use the Ignore chainable methods option to ignore unused return values from chainable calls. Use the Maximal reported method visibility option to control the maximum visibility of methods to be reported.", + "markdown": "Reports methods whose return values are never used when called. The return type of such methods can be made `void`.\n\nMethods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\nThe quick-fix updates the method signature and removes `return` statements from inside the method.\n\n**Example:**\n\n\n // reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }\n\nAfter the quick-fix is applied to both methods:\n\n\n protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...\n\n\n**NOTE:** Some methods might not be reported during in-editor highlighting due to performance reasons.\nTo see all results, run the inspection using **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**\\>\n\nUse the **Ignore chainable methods** option to ignore unused return values from chainable calls.\n\nUse the **Maximal reported method visibility** option to control the maximum visibility of methods to be reported." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UncheckedExceptionClass", + "suppressToolId": "UnusedReturnValue", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11210,7 +11210,7 @@ "relationships": [ { "target": { - "id": "Java/Error handling", + "id": "Java/Declaration redundancy", "index": 15, "toolComponent": { "name": "QDJVMC" @@ -11322,19 +11322,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "ClassWithOnlyPrivateConstructors", + "suppressToolId": "ComparatorNotSerializable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11342,8 +11342,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 12, + "id": "Java/Serialization issues", + "index": 18, "toolComponent": { "name": "QDJVMC" } @@ -11355,19 +11355,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "ComparatorNotSerializable", + "suppressToolId": "ClassWithOnlyPrivateConstructors", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11375,8 +11375,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 18, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -11409,7 +11409,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -11553,27 +11553,27 @@ ] }, { - "id": "NegatedEqualityExpression", + "id": "RemoveLiteralUnderscores", "shortDescription": { - "text": "Negated equality expression" + "text": "Underscores in numeric literal" }, "fullDescription": { - "text": "Reports equality expressions which are negated by a prefix expression. Such expressions can be simplified using the '!=' operator. Example: '!(i == 1)' After the quick-fix is applied: 'i != 1'", - "markdown": "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" + "text": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level. The quick-fix removes underscores from numeric literals. For example '1_000_000' will be converted to '1000000'. Numeric literals with underscores appeared in Java 7. This inspection can help to downgrade for backward compatibility with earlier Java versions. New in 2020.2", + "markdown": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level.\n\nThe quick-fix removes underscores from numeric literals. For example `1_000_000` will be converted to `1000000`.\n\n\n*Numeric literals with underscores* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2020.2" }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "NegatedEqualityExpression", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "RemoveLiteralUnderscores", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Control flow issues", + "id": "Java/Numeric issues", "index": 26, "toolComponent": { "name": "QDJVMC" @@ -11586,27 +11586,27 @@ ] }, { - "id": "RemoveLiteralUnderscores", + "id": "NegatedEqualityExpression", "shortDescription": { - "text": "Underscores in numeric literal" + "text": "Negated equality expression" }, "fullDescription": { - "text": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level. The quick-fix removes underscores from numeric literals. For example '1_000_000' will be converted to '1000000'. Numeric literals with underscores appeared in Java 7. This inspection can help to downgrade for backward compatibility with earlier Java versions. New in 2020.2", - "markdown": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level.\n\nThe quick-fix removes underscores from numeric literals. For example `1_000_000` will be converted to `1000000`.\n\n\n*Numeric literals with underscores* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2020.2" + "text": "Reports equality expressions which are negated by a prefix expression. Such expressions can be simplified using the '!=' operator. Example: '!(i == 1)' After the quick-fix is applied: 'i != 1'", + "markdown": "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" }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "RemoveLiteralUnderscores", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "NegatedEqualityExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Numeric issues", + "id": "Java/Control flow issues", "index": 27, "toolComponent": { "name": "QDJVMC" @@ -11706,7 +11706,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -11883,28 +11883,28 @@ ] }, { - "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": { - "suppressToolId": "DoubleNegation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "AssertionCanBeIf", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -11916,28 +11916,28 @@ ] }, { - "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": { - "suppressToolId": "AssertionCanBeIf", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "DoubleNegation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -12147,19 +12147,19 @@ ] }, { - "id": "ProtectedMemberInFinalClass", + "id": "TooBroadCatch", "shortDescription": { - "text": "'protected' member in 'final' class" + "text": "Overly broad 'catch' block" }, "fullDescription": { - "text": "Reports 'protected' members in 'final'classes. Since 'final' classes cannot be inherited, marking the method as 'protected' may be confusing. It is better to declare such members as 'private' or package-visible instead. Example: 'record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly.", - "markdown": "Reports `protected` members in `final`classes.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." + "text": "Reports 'catch' blocks with parameters that are more generic than the exception thrown by the corresponding 'try' block. Example: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }' After the quick-fix is applied: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }' Configure the inspection: Use the Only warn on RuntimeException, Exception, Error or Throwable option to have this inspection warn only on the most generic exceptions. Use the Ignore exceptions which hide others but are themselves thrown option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad.", + "markdown": "Reports `catch` blocks with parameters that are more generic than the exception thrown by the corresponding `try` block.\n\n**Example:**\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }\n\nConfigure the inspection:\n\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ProtectedMemberInFinalClass", + "suppressToolId": "OverlyBroadCatchBlock", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -12167,7 +12167,7 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", + "id": "Java/Error handling", "index": 14, "toolComponent": { "name": "QDJVMC" @@ -12180,19 +12180,19 @@ ] }, { - "id": "TooBroadCatch", + "id": "ProtectedMemberInFinalClass", "shortDescription": { - "text": "Overly broad 'catch' block" + "text": "'protected' member in 'final' class" }, "fullDescription": { - "text": "Reports 'catch' blocks with parameters that are more generic than the exception thrown by the corresponding 'try' block. Example: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }' After the quick-fix is applied: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }' Configure the inspection: Use the Only warn on RuntimeException, Exception, Error or Throwable option to have this inspection warn only on the most generic exceptions. Use the Ignore exceptions which hide others but are themselves thrown option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad.", - "markdown": "Reports `catch` blocks with parameters that are more generic than the exception thrown by the corresponding `try` block.\n\n**Example:**\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }\n\nConfigure the inspection:\n\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad." + "text": "Reports 'protected' members in 'final'classes. Since 'final' classes cannot be inherited, marking the method as 'protected' may be confusing. It is better to declare such members as 'private' or package-visible instead. Example: 'record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly.", + "markdown": "Reports `protected` members in `final`classes.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "OverlyBroadCatchBlock", + "suppressToolId": "ProtectedMemberInFinalClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -12200,7 +12200,7 @@ "relationships": [ { "target": { - "id": "Java/Error handling", + "id": "Java/Declaration redundancy", "index": 15, "toolComponent": { "name": "QDJVMC" @@ -12246,19 +12246,19 @@ ] }, { - "id": "BadOddness", + "id": "LoggingConditionDisagreesWithLogLevelStatement", "shortDescription": { - "text": "Suspicious oddness check" + "text": "Log condition does not match logging call" }, "fullDescription": { - "text": "Reports odd-even checks of the following form: 'x % 2 == 1'. Such checks fail when used with negative odd values. Consider using 'x % 2 != 0' or '(x & 1) == 1' instead.", - "markdown": "Reports odd-even checks of the following form: `x % 2 == 1`. Such checks fail when used with negative odd values. Consider using `x % 2 != 0` or `(x & 1) == 1` instead." + "text": "Reports is log enabled for conditions of 'if' statements that do not match the log level of the contained logging call. For example: 'if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }' This inspection understands the java.util.logging, Log4j, Log4j2, Apache Commons Logging and the SLF4J logging frameworks.", + "markdown": "Reports *is log enabled for* conditions of `if` statements that do not match the log level of the contained logging call.\n\n\nFor example:\n\n\n if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }\n\nThis inspection understands the *java.util.logging* , *Log4j* , *Log4j2* , *Apache Commons Logging*\nand the *SLF4J* logging frameworks." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "BadOddness", + "suppressToolId": "LoggingConditionDisagreesWithLogLevelStatement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -12266,8 +12266,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 27, + "id": "JVM languages/Logging", + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -12279,19 +12279,19 @@ ] }, { - "id": "LoggingConditionDisagreesWithLogLevelStatement", + "id": "BadOddness", "shortDescription": { - "text": "Log condition does not match logging call" + "text": "Suspicious oddness check" }, "fullDescription": { - "text": "Reports is log enabled for conditions of 'if' statements that do not match the log level of the contained logging call. For example: 'if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }' This inspection understands the java.util.logging, Log4j, Log4j2, Apache Commons Logging and the SLF4J logging frameworks.", - "markdown": "Reports *is log enabled for* conditions of `if` statements that do not match the log level of the contained logging call.\n\n\nFor example:\n\n\n if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }\n\nThis inspection understands the *java.util.logging* , *Log4j* , *Log4j2* , *Apache Commons Logging*\nand the *SLF4J* logging frameworks." + "text": "Reports odd-even checks of the following form: 'x % 2 == 1'. Such checks fail when used with negative odd values. Consider using 'x % 2 != 0' or '(x & 1) == 1' instead.", + "markdown": "Reports odd-even checks of the following form: `x % 2 == 1`. Such checks fail when used with negative odd values. Consider using `x % 2 != 0` or `(x & 1) == 1` instead." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "LoggingConditionDisagreesWithLogLevelStatement", + "suppressToolId": "BadOddness", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -12299,8 +12299,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Logging", - "index": 46, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -12366,7 +12366,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -12399,7 +12399,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -12597,7 +12597,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -12630,7 +12630,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -12675,28 +12675,28 @@ ] }, { - "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": { - "suppressToolId": "InsertLiteralUnderscores", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "UnnecessaryBreak", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 27, + "id": "Java/Verbose or redundant code constructs", + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -12708,28 +12708,28 @@ ] }, { - "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": { - "suppressToolId": "UnnecessaryBreak", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "InsertLiteralUnderscores", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 37, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -12762,7 +12762,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -13071,19 +13071,19 @@ ] }, { - "id": "ClassGetClass", + "id": "ExternalizableWithoutPublicNoArgConstructor", "shortDescription": { - "text": "Suspicious 'Class.getClass()' call" + "text": "'Externalizable' class without 'public' no-arg constructor" }, "fullDescription": { - "text": "Reports 'getClass()' methods that are called on a 'java.lang.Class' instance. This is usually a mistake as the result is always equivalent to 'Class.class'. If it's a mistake, then it's better to remove the 'getClass()' call and use the qualifier directly. If the behavior is intended, then it's better to write 'Class.class' explicitly to avoid confusion. Example: 'void test(Class clazz) {\n String name = clazz.getClass().getName();\n }' After one of the possible quick-fixes is applied: 'void test(Class clazz) {\n String name = clazz.getName();\n }' New in 2018.2", - "markdown": "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" + "text": "Reports 'Externalizable' classes without a public no-argument constructor. When an 'Externalizable' object is reconstructed, an instance is created using the public no-arg constructor before the 'readExternal' method called. If a public no-arg constructor is not available, a 'java.io.InvalidClassException' will be thrown at runtime.", + "markdown": "Reports `Externalizable` classes without a public no-argument constructor.\n\nWhen an `Externalizable` object is reconstructed, an instance is created using the public\nno-arg constructor before the `readExternal` method called. If a public\nno-arg constructor is not available, a `java.io.InvalidClassException` will be\nthrown at runtime." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassGetClass", + "suppressToolId": "ExternalizableWithoutPublicNoArgConstructor", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13091,8 +13091,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Serialization issues", + "index": 18, "toolComponent": { "name": "QDJVMC" } @@ -13104,19 +13104,19 @@ ] }, { - "id": "ExternalizableWithoutPublicNoArgConstructor", + "id": "ClassGetClass", "shortDescription": { - "text": "'Externalizable' class without 'public' no-arg constructor" + "text": "Suspicious 'Class.getClass()' call" }, "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 'getClass()' methods that are called on a 'java.lang.Class' instance. This is usually a mistake as the result is always equivalent to 'Class.class'. If it's a mistake, then it's better to remove the 'getClass()' call and use the qualifier directly. If the behavior is intended, then it's better to write 'Class.class' explicitly to avoid confusion. Example: 'void test(Class clazz) {\n String name = clazz.getClass().getName();\n }' After one of the possible quick-fixes is applied: 'void test(Class clazz) {\n String name = clazz.getName();\n }' New in 2018.2", + "markdown": "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" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ExternalizableWithoutPublicNoArgConstructor", + "suppressToolId": "ClassGetClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13124,8 +13124,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 18, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -13158,7 +13158,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -13302,19 +13302,19 @@ ] }, { - "id": "LengthOneStringInIndexOf", + "id": "MisspelledEquals", "shortDescription": { - "text": "Single character string argument in 'String.indexOf()' call" + "text": "'equal()' instead of 'equals()'" }, "fullDescription": { - "text": "Reports single character strings being used as an argument in 'String.indexOf()' and 'String.lastIndexOf()' calls. A quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement. Example: 'return s.indexOf(\"x\");' After the quick-fix is applied: 'return s.indexOf('x');'", - "markdown": "Reports single character strings being used as an argument in `String.indexOf()` and `String.lastIndexOf()` calls.\n\nA quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement.\n\n**Example:**\n\n\n return s.indexOf(\"x\");\n\nAfter the quick-fix is applied:\n\n\n return s.indexOf('x');\n" + "text": "Reports declarations of 'equal()' with a single parameter. Normally, this is a typo and 'equals()' is actually intended. A quick-fix is suggested to rename the method to 'equals'. Example: 'class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }' After the quick-fix is applied: 'class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }'", + "markdown": "Reports declarations of `equal()` with a single parameter. Normally, this is a typo and `equals()` is actually intended.\n\nA quick-fix is suggested to rename the method to `equals`.\n\n**Example:**\n\n\n class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SingleCharacterStringConcatenation", + "suppressToolId": "MisspelledEquals", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13322,8 +13322,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -13335,19 +13335,19 @@ ] }, { - "id": "MisspelledEquals", + "id": "NonFinalFieldInEnum", "shortDescription": { - "text": "'equal()' instead of 'equals()'" + "text": "Non-final field in 'enum'" }, "fullDescription": { - "text": "Reports declarations of 'equal()' with a single parameter. Normally, this is a typo and 'equals()' is actually intended. A quick-fix is suggested to rename the method to 'equals'. Example: 'class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }' After the quick-fix is applied: 'class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }'", - "markdown": "Reports declarations of `equal()` with a single parameter. Normally, this is a typo and `equals()` is actually intended.\n\nA quick-fix is suggested to rename the method to `equals`.\n\n**Example:**\n\n\n class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }\n" + "text": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable. Example: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' After the quick-fix is applied: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' Use the `Ignore fields that cannot be made 'final'` option to only warn on fields that can be made final using the quick-fix.", + "markdown": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable.\n\n**Example:**\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nUse the \\`Ignore fields that cannot be made 'final'\\` option to only warn on fields that can be made final using the quick-fix." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MisspelledEquals", + "suppressToolId": "NonFinalFieldInEnum", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13355,8 +13355,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13368,19 +13368,19 @@ ] }, { - "id": "NonFinalFieldInEnum", + "id": "LengthOneStringInIndexOf", "shortDescription": { - "text": "Non-final field in 'enum'" + "text": "Single character string argument in 'String.indexOf()' call" }, "fullDescription": { - "text": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable. Example: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' After the quick-fix is applied: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' Use the `Ignore fields that cannot be made 'final'` option to only warn on fields that can be made final using the quick-fix.", - "markdown": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable.\n\n**Example:**\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nUse the \\`Ignore fields that cannot be made 'final'\\` option to only warn on fields that can be made final using the quick-fix." + "text": "Reports single character strings being used as an argument in 'String.indexOf()' and 'String.lastIndexOf()' calls. A quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement. Example: 'return s.indexOf(\"x\");' After the quick-fix is applied: 'return s.indexOf('x');'", + "markdown": "Reports single character strings being used as an argument in `String.indexOf()` and `String.lastIndexOf()` calls.\n\nA quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement.\n\n**Example:**\n\n\n return s.indexOf(\"x\");\n\nAfter the quick-fix is applied:\n\n\n return s.indexOf('x');\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalFieldInEnum", + "suppressToolId": "SingleCharacterStringConcatenation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13388,8 +13388,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 12, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -13434,19 +13434,19 @@ ] }, { - "id": "TrivialFunctionalExpressionUsage", + "id": "EnumClass", "shortDescription": { - "text": "Trivial usage of functional expression" + "text": "Enumerated class" }, "fullDescription": { - "text": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation. Example: 'boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }' When the quick-fix is applied, the method call changes to: 'boolean contains(List names, String name) {\n return names.contains(name);\n }'", - "markdown": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n" + "text": "Reports enum classes. Such statements are not supported in Java 1.4 and earlier JVM.", + "markdown": "Reports **enum** classes. Such statements are not supported in Java 1.4 and earlier JVM." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "TrivialFunctionalExpressionUsage", + "suppressToolId": "EnumClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13454,8 +13454,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 14, + "id": "Java/Java language level issues", + "index": 62, "toolComponent": { "name": "QDJVMC" } @@ -13467,19 +13467,19 @@ ] }, { - "id": "EnumClass", + "id": "TrivialFunctionalExpressionUsage", "shortDescription": { - "text": "Enumerated class" + "text": "Trivial usage of functional expression" }, "fullDescription": { - "text": "Reports enum classes. Such statements are not supported in Java 1.4 and earlier JVM.", - "markdown": "Reports **enum** classes. Such statements are not supported in Java 1.4 and earlier JVM." + "text": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation. Example: 'boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }' When the quick-fix is applied, the method call changes to: 'boolean contains(List names, String name) {\n return names.contains(name);\n }'", + "markdown": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "EnumClass", + "suppressToolId": "TrivialFunctionalExpressionUsage", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13487,8 +13487,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level issues", - "index": 62, + "id": "Java/Declaration redundancy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -13752,7 +13752,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -14016,7 +14016,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -14445,7 +14445,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -14511,7 +14511,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -14874,7 +14874,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -14886,19 +14886,19 @@ ] }, { - "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, where the array brackets are placed after a variable name or after a method parameter list. Most code styles prefer Java-style array declarations, where the array brackets are placed after the type name. Example: 'public String process(String value[])[] {\n return value;\n }' After the quick-fix is applied: '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, where the array brackets are placed after a variable name or after a method parameter list. Most code styles prefer Java-style array declarations, where the array brackets are placed after the type name.\n\n**Example:**\n\n\n public String process(String value[])[] {\n return value;\n }\n\nAfter the quick-fix is applied:\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, "level": "warning", "parameters": { - "suppressToolId": "CloneInNonCloneableClass", + "suppressToolId": "CStyleArrayDeclaration", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -14906,8 +14906,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 81, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -14919,19 +14919,19 @@ ] }, { - "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, where the array brackets are placed after a variable name or after a method parameter list. Most code styles prefer Java-style array declarations, where the array brackets are placed after the type name. Example: 'public String process(String value[])[] {\n return value;\n }' After the quick-fix is applied: '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, where the array brackets are placed after a variable name or after a method parameter list. Most code styles prefer Java-style array declarations, where the array brackets are placed after the type name.\n\n**Example:**\n\n\n public String process(String value[])[] {\n return value;\n }\n\nAfter the quick-fix is applied:\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, "level": "warning", "parameters": { - "suppressToolId": "CStyleArrayDeclaration", + "suppressToolId": "CloneInNonCloneableClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -14939,8 +14939,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Cloning issues", + "index": 81, "toolComponent": { "name": "QDJVMC" } @@ -15249,19 +15249,19 @@ ] }, { - "id": "StringBufferField", + "id": "ClassEscapesItsScope", "shortDescription": { - "text": "'StringBuilder' field" + "text": "Class is exposed outside of its visibility scope" }, "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 where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference. Example: 'public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }' Additionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages. However, if a member that is part of the exported API references a non-exported class in its signature, such a member cannot be used outside of the module. Configure the inspection: Use the Report non-exported classes exposed in module API (Java 9+) option to report module API members that expose non-exported classes. Note that the language level of the project or module needs to be 9 or higher for this option. Use the Report non-accessible classes exposed in public API option to report on public members that expose classes with a smaller visibility scope. Use the Report private classes exposed in package-local API option to report on package-local members that expose 'private' classes.", + "markdown": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference.\n\n**Example:**\n\n\n public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }\n\n\nAdditionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages.\nHowever, if a member that is part of the exported API references a non-exported class in its signature,\nsuch a member cannot be used outside of the module.\n\nConfigure the inspection:\n\n* Use the **Report non-exported classes exposed in module API (Java 9+)** option to report module API members that expose non-exported classes. \n Note that the language level of the project or module needs to be 9 or higher for this option.\n* Use the **Report non-accessible classes exposed in public API** option to report on public members that expose classes with a smaller visibility scope.\n* Use the **Report private classes exposed in package-local API** option to report on package-local members that expose `private` classes." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "StringBufferField", + "suppressToolId": "ClassEscapesDefinedScope", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -15269,8 +15269,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 71, + "id": "Java/Visibility", + "index": 57, "toolComponent": { "name": "QDJVMC" } @@ -15282,19 +15282,19 @@ ] }, { - "id": "ClassEscapesItsScope", + "id": "StringBufferField", "shortDescription": { - "text": "Class is exposed outside of its visibility scope" + "text": "'StringBuilder' field" }, "fullDescription": { - "text": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference. Example: 'public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }' Additionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages. However, if a member that is part of the exported API references a non-exported class in its signature, such a member cannot be used outside of the module. Configure the inspection: Use the Report non-exported classes exposed in module API (Java 9+) option to report module API members that expose non-exported classes. Note that the language level of the project or module needs to be 9 or higher for this option. Use the Report non-accessible classes exposed in public API option to report on public members that expose classes with a smaller visibility scope. Use the Report private classes exposed in package-local API option to report on package-local members that expose 'private' classes.", - "markdown": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference.\n\n**Example:**\n\n\n public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }\n\n\nAdditionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages.\nHowever, if a member that is part of the exported API references a non-exported class in its signature,\nsuch a member cannot be used outside of the module.\n\nConfigure the inspection:\n\n* Use the **Report non-exported classes exposed in module API (Java 9+)** option to report module API members that expose non-exported classes. \n Note that the language level of the project or module needs to be 9 or higher for this option.\n* Use the **Report non-accessible classes exposed in public API** option to report on public members that expose classes with a smaller visibility scope.\n* Use the **Report private classes exposed in package-local API** option to report on package-local members that expose `private` classes." + "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": { - "suppressToolId": "ClassEscapesDefinedScope", + "suppressToolId": "StringBufferField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -15302,8 +15302,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 57, + "id": "Java/Memory", + "index": 71, "toolComponent": { "name": "QDJVMC" } @@ -15315,19 +15315,19 @@ ] }, { - "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 first checkbox below to run the inspection for the methods that override library methods. Checking library methods may slow down the inspection. Use the second checkbox below to ignore methods that only delegate calls to their super methods.", - "markdown": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed.\n\n\nUse the first checkbox below to run the inspection for the methods that override library methods.\nChecking library methods may slow down the inspection.\n\n\nUse the second checkbox below to ignore methods that only delegate calls to their super methods." + "text": "Reports implementations of 'equals()' that access non-'final' variables. Such access may result in 'equals()' returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes. Example: 'public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }'", + "markdown": "Reports implementations of `equals()` that access non-`final` variables. Such access may result in `equals()` returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes.\n\n**Example:**\n\n\n public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }\n \n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "RedundantMethodOverride", + "suppressToolId": "NonFinalFieldReferenceInEquals", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -15335,8 +15335,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 25, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -15348,19 +15348,19 @@ ] }, { - "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 first checkbox below to run the inspection for the methods that override library methods. Checking library methods may slow down the inspection. Use the second checkbox below to ignore methods that only delegate calls to their super methods.", + "markdown": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed.\n\n\nUse the first checkbox below to run the inspection for the methods that override library methods.\nChecking library methods may slow down the inspection.\n\n\nUse the second checkbox below to ignore methods that only delegate calls to their super methods." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalFieldReferenceInEquals", + "suppressToolId": "RedundantMethodOverride", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -15368,8 +15368,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Inheritance issues", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -15435,7 +15435,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -15534,7 +15534,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -15546,19 +15546,19 @@ ] }, { - "id": "NonFinalFieldInImmutable", + "id": "StringConcatenationInMessageFormatCall", "shortDescription": { - "text": "Non-final field in '@Immutable' class" + "text": "String concatenation as argument to 'MessageFormat.format()' call" }, "fullDescription": { - "text": "Reports any non-final field in a class with the '@Immutable' annotation. This violates the contract of the '@Immutable' annotation. Example: 'import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", - "markdown": "Reports any non-final field in a class with the `@Immutable` annotation. This violates the contract of the `@Immutable` annotation.\n\nExample:\n\n\n import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" + "text": "Reports non-constant string concatenations used as an argument to a call to 'MessageFormat.format()'. While occasionally intended, this is usually a misuse of the formatting method and may even cause unexpected exceptions if the variables used in the concatenated string contain special characters like '{'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }' Here, the 'userName' will be interpreted as a part of the format string, which may result in 'IllegalArgumentException' (for example, if 'userName' is '\"{\"'). This call should be probably replaced with 'MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)'.", + "markdown": "Reports non-constant string concatenations used as an argument to a call to `MessageFormat.format()`.\n\n\nWhile occasionally intended, this is usually a misuse of the formatting method\nand may even cause unexpected exceptions if the variables used in the concatenated string contain\nspecial characters like `{`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }\n\n\nHere, the `userName` will be interpreted as a part of the format string, which may result\nin `IllegalArgumentException` (for example, if `userName` is `\"{\"`).\nThis call should be probably replaced with `MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)`." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalFieldInImmutable", + "suppressToolId": "StringConcatenationInMessageFormatCall", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -15566,8 +15566,8 @@ "relationships": [ { "target": { - "id": "Java/Concurrency annotation issues", - "index": 59, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -15579,19 +15579,19 @@ ] }, { - "id": "StringConcatenationInMessageFormatCall", + "id": "NonFinalFieldInImmutable", "shortDescription": { - "text": "String concatenation as argument to 'MessageFormat.format()' call" + "text": "Non-final field in '@Immutable' class" }, "fullDescription": { - "text": "Reports non-constant string concatenations used as an argument to a call to 'MessageFormat.format()'. While occasionally intended, this is usually a misuse of the formatting method and may even cause unexpected exceptions if the variables used in the concatenated string contain special characters like '{'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }' Here, the 'userName' will be interpreted as a part of the format string, which may result in 'IllegalArgumentException' (for example, if 'userName' is '\"{\"'). This call should be probably replaced with 'MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)'.", - "markdown": "Reports non-constant string concatenations used as an argument to a call to `MessageFormat.format()`.\n\n\nWhile occasionally intended, this is usually a misuse of the formatting method\nand may even cause unexpected exceptions if the variables used in the concatenated string contain\nspecial characters like `{`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }\n\n\nHere, the `userName` will be interpreted as a part of the format string, which may result\nin `IllegalArgumentException` (for example, if `userName` is `\"{\"`).\nThis call should be probably replaced with `MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)`." + "text": "Reports any non-final field in a class with the '@Immutable' annotation. This violates the contract of the '@Immutable' annotation. Example: 'import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", + "markdown": "Reports any non-final field in a class with the `@Immutable` annotation. This violates the contract of the `@Immutable` annotation.\n\nExample:\n\n\n import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "StringConcatenationInMessageFormatCall", + "suppressToolId": "NonFinalFieldInImmutable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -15599,8 +15599,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Concurrency annotation issues", + "index": 59, "toolComponent": { "name": "QDJVMC" } @@ -15831,7 +15831,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -15930,7 +15930,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -15974,39 +15974,6 @@ } ] }, - { - "id": "MethodOverloadsParentMethod", - "shortDescription": { - "text": "Possibly unintended overload of method from superclass" - }, - "fullDescription": { - "text": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type. In this case, the method in a subclass will be overloading the method from the superclass instead of overriding it. If it is unintended, it may result in latent bugs. Example: 'public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }' Use the option to choose whether the inspection should also report cases where parameter types are not compatible.", - "markdown": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type.\n\n\nIn this case, the method in a subclass will be overloading the method from the superclass\ninstead of overriding it. If it is unintended, it may result in latent bugs.\n\n**Example:**\n\n\n public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }\n\n\nUse the option to choose whether the inspection should also report cases where parameter types are not compatible." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MethodOverloadsMethodOfSuperclass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Visibility", - "index": 57, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "DisjointPackage", "shortDescription": { @@ -16074,19 +16041,19 @@ ] }, { - "id": "MethodMayBeSynchronized", + "id": "MethodOverloadsParentMethod", "shortDescription": { - "text": "Method with single 'synchronized' block can be replaced with 'synchronized' method" + "text": "Possibly unintended overload of method from superclass" }, "fullDescription": { - "text": "Reports methods whose body contains a single 'synchronized' statement. A lock expression for this 'synchronized' statement must be equal to 'this' for instance methods or '[ClassName].class' for static methods. To improve readability of such methods, you can remove the 'synchronized' wrapper and mark the method as 'synchronized'. Example: 'public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }' After the quick-fix is applied: 'public synchronized int generateInt(int x) {\n return 1;\n }'", - "markdown": "Reports methods whose body contains a single `synchronized` statement. A lock expression for this `synchronized` statement must be equal to `this` for instance methods or `[ClassName].class` for static methods.\n\n\nTo improve readability of such methods,\nyou can remove the `synchronized` wrapper and mark the method as `synchronized`.\n\n**Example:**\n\n\n public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public synchronized int generateInt(int x) {\n return 1;\n }\n" + "text": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type. In this case, the method in a subclass will be overloading the method from the superclass instead of overriding it. If it is unintended, it may result in latent bugs. Example: 'public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }' Use the option to choose whether the inspection should also report cases where parameter types are not compatible.", + "markdown": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type.\n\n\nIn this case, the method in a subclass will be overloading the method from the superclass\ninstead of overriding it. If it is unintended, it may result in latent bugs.\n\n**Example:**\n\n\n public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }\n\n\nUse the option to choose whether the inspection should also report cases where parameter types are not compatible." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MethodMayBeSynchronized", + "suppressToolId": "MethodOverloadsMethodOfSuperclass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -16094,8 +16061,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Visibility", + "index": 57, "toolComponent": { "name": "QDJVMC" } @@ -16139,6 +16106,39 @@ } ] }, + { + "id": "MethodMayBeSynchronized", + "shortDescription": { + "text": "Method with single 'synchronized' block can be replaced with 'synchronized' method" + }, + "fullDescription": { + "text": "Reports methods whose body contains a single 'synchronized' statement. A lock expression for this 'synchronized' statement must be equal to 'this' for instance methods or '[ClassName].class' for static methods. To improve readability of such methods, you can remove the 'synchronized' wrapper and mark the method as 'synchronized'. Example: 'public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }' After the quick-fix is applied: 'public synchronized int generateInt(int x) {\n return 1;\n }'", + "markdown": "Reports methods whose body contains a single `synchronized` statement. A lock expression for this `synchronized` statement must be equal to `this` for instance methods or `[ClassName].class` for static methods.\n\n\nTo improve readability of such methods,\nyou can remove the `synchronized` wrapper and mark the method as `synchronized`.\n\n**Example:**\n\n\n public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public synchronized int generateInt(int x) {\n return 1;\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodMayBeSynchronized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "LoggingPlaceholderCountMatchesArgumentCount", "shortDescription": { @@ -16602,19 +16602,19 @@ ] }, { - "id": "FinalMethod", + "id": "NegatedConditionalExpression", "shortDescription": { - "text": "Method can't be overridden" + "text": "Negated conditional expression" }, "fullDescription": { - "text": "Reports methods that are declared 'final'. Such methods can't be overridden and may indicate a lack of object-oriented design. Some coding standards discourage 'final' methods.", - "markdown": "Reports methods that are declared `final`. Such methods can't be overridden and may indicate a lack of object-oriented design. Some coding standards discourage `final` methods." + "text": "Reports conditional expressions which are negated with a prefix expression, as such constructions may be confusing. There is a fix that propagates the outer negation to both branches. Example: '!(i == 1 ? a : b)' After the quick-fix is applied: 'i == 1 ? !a : !b'", + "markdown": "Reports conditional expressions which are negated with a prefix expression, as such constructions may be confusing.\n\nThere is a fix that propagates the outer negation to both branches.\n\nExample:\n\n\n !(i == 1 ? a : b)\n\nAfter the quick-fix is applied:\n\n\n i == 1 ? !a : !b\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "FinalMethod", + "suppressToolId": "NegatedConditionalExpression", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -16622,8 +16622,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 12, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -16635,19 +16635,19 @@ ] }, { - "id": "NegatedConditionalExpression", + "id": "FinalMethod", "shortDescription": { - "text": "Negated conditional expression" + "text": "Method can't be overridden" }, "fullDescription": { - "text": "Reports conditional expressions which are negated with a prefix expression, as such constructions may be confusing. There is a fix that propagates the outer negation to both branches. Example: '!(i == 1 ? a : b)' After the quick-fix is applied: 'i == 1 ? !a : !b'", - "markdown": "Reports conditional expressions which are negated with a prefix expression, as such constructions may be confusing.\n\nThere is a fix that propagates the outer negation to both branches.\n\nExample:\n\n\n !(i == 1 ? a : b)\n\nAfter the quick-fix is applied:\n\n\n i == 1 ? !a : !b\n" + "text": "Reports methods that are declared 'final'. Such methods can't be overridden and may indicate a lack of object-oriented design. Some coding standards discourage 'final' methods.", + "markdown": "Reports methods that are declared `final`. Such methods can't be overridden and may indicate a lack of object-oriented design. Some coding standards discourage `final` methods." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NegatedConditionalExpression", + "suppressToolId": "FinalMethod", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -16655,8 +16655,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -16821,7 +16821,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -16986,7 +16986,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -17031,28 +17031,28 @@ ] }, { - "id": "SuspiciousReturnByteInputStream", + "id": "ConditionalExpression", "shortDescription": { - "text": "Suspicious byte value returned from 'InputStream.read()'" + "text": "Conditional expression" }, "fullDescription": { - "text": "Reports expressions of 'byte' type returned from a method implementing the 'InputStream.read()' method. This is suspicious because 'InputStream.read()' should return a value in the range from '0' to '255', while an expression of byte type contains a value from '-128' to '127'. The quick-fix converts the expression into an unsigned 'byte' by applying the bitmask '0xFF'. Example: 'class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++]; // problem\n }\n}' After applying the quick-fix: 'class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++] & 0xFF;\n }\n}' New in 2023.2", - "markdown": "Reports expressions of `byte` type returned from a method implementing the `InputStream.read()` method.\n\n\nThis is suspicious because `InputStream.read()` should return a value in the range from `0` to `255`,\nwhile an expression of byte type contains a value from `-128` to `127`.\nThe quick-fix converts the expression into an unsigned `byte` by applying the bitmask `0xFF`.\n\n**Example:**\n\n\n class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++]; // problem\n }\n }\n\nAfter applying the quick-fix:\n\n\n class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++] & 0xFF;\n }\n }\n\nNew in 2023.2" + "text": "Reports usages of the ternary condition operator and suggests converting them to 'if'/'else' statements. Some code standards prohibit the use of the condition operator. Example: 'Object result = (condition) ? foo() : bar();' After the quick-fix is applied: 'Object result;\n if (condition) {\n comp = foo();\n }\n else {\n comp = bar();\n }' Configure the inspection: Use the Ignore for simple assignments and returns option to ignore simple assignments and returns and allow the following constructs: 'String s = (foo == null) ? \"\" : foo.toString();' Use the Ignore places where an if statement is not possible option to ignore conditional expressions in contexts in which automatic replacement with an if statement is not possible (for example, when the conditional expression is used as an argument to a 'super()' constructor call).", + "markdown": "Reports usages of the ternary condition operator and suggests converting them to `if`/`else` statements.\n\nSome code standards prohibit the use of the condition operator.\n\nExample:\n\n\n Object result = (condition) ? foo() : bar();\n\nAfter the quick-fix is applied:\n\n\n Object result;\n if (condition) {\n comp = foo();\n }\n else {\n comp = bar();\n }\n\nConfigure the inspection:\n\nUse the **Ignore for simple assignments and returns** option to ignore simple assignments and returns and allow the following constructs:\n\n\n String s = (foo == null) ? \"\" : foo.toString();\n\n\nUse the **Ignore places where an if statement is not possible** option to ignore conditional expressions in contexts in which automatic\nreplacement with an if statement is not possible (for example, when the conditional expression is used as an argument to a\n`super()` constructor call)." }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "SuspiciousReturnByteInputStream", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ConditionalExpression", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -17064,28 +17064,28 @@ ] }, { - "id": "ConditionalExpression", + "id": "SuspiciousReturnByteInputStream", "shortDescription": { - "text": "Conditional expression" + "text": "Suspicious byte value returned from 'InputStream.read()'" }, "fullDescription": { - "text": "Reports usages of the ternary condition operator and suggests converting them to 'if'/'else' statements. Some code standards prohibit the use of the condition operator. Example: 'Object result = (condition) ? foo() : bar();' After the quick-fix is applied: 'Object result;\n if (condition) {\n comp = foo();\n }\n else {\n comp = bar();\n }' Configure the inspection: Use the Ignore for simple assignments and returns option to ignore simple assignments and returns and allow the following constructs: 'String s = (foo == null) ? \"\" : foo.toString();' Use the Ignore places where an if statement is not possible option to ignore conditional expressions in contexts in which automatic replacement with an if statement is not possible (for example, when the conditional expression is used as an argument to a 'super()' constructor call).", - "markdown": "Reports usages of the ternary condition operator and suggests converting them to `if`/`else` statements.\n\nSome code standards prohibit the use of the condition operator.\n\nExample:\n\n\n Object result = (condition) ? foo() : bar();\n\nAfter the quick-fix is applied:\n\n\n Object result;\n if (condition) {\n comp = foo();\n }\n else {\n comp = bar();\n }\n\nConfigure the inspection:\n\nUse the **Ignore for simple assignments and returns** option to ignore simple assignments and returns and allow the following constructs:\n\n\n String s = (foo == null) ? \"\" : foo.toString();\n\n\nUse the **Ignore places where an if statement is not possible** option to ignore conditional expressions in contexts in which automatic\nreplacement with an if statement is not possible (for example, when the conditional expression is used as an argument to a\n`super()` constructor call)." + "text": "Reports expressions of 'byte' type returned from a method implementing the 'InputStream.read()' method. This is suspicious because 'InputStream.read()' should return a value in the range from '0' to '255', while an expression of byte type contains a value from '-128' to '127'. The quick-fix converts the expression into an unsigned 'byte' by applying the bitmask '0xFF'. Example: 'class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++]; // problem\n }\n}' After applying the quick-fix: 'class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++] & 0xFF;\n }\n}' New in 2023.2", + "markdown": "Reports expressions of `byte` type returned from a method implementing the `InputStream.read()` method.\n\n\nThis is suspicious because `InputStream.read()` should return a value in the range from `0` to `255`,\nwhile an expression of byte type contains a value from `-128` to `127`.\nThe quick-fix converts the expression into an unsigned `byte` by applying the bitmask `0xFF`.\n\n**Example:**\n\n\n class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++]; // problem\n }\n }\n\nAfter applying the quick-fix:\n\n\n class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++] & 0xFF;\n }\n }\n\nNew in 2023.2" }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "ConditionalExpression", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "SuspiciousReturnByteInputStream", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -17217,7 +17217,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -17448,7 +17448,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -17481,7 +17481,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -17514,7 +17514,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -17811,7 +17811,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -18108,7 +18108,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -18207,7 +18207,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -18351,19 +18351,19 @@ ] }, { - "id": "CloneableImplementsClone", + "id": "TypeMayBeWeakened", "shortDescription": { - "text": "Cloneable class without 'clone()' method" + "text": "Type may be weakened" }, "fullDescription": { - "text": "Reports classes implementing the 'Cloneable' interface that don't override the 'clone()' method. Such classes use the default implementation of 'clone()', which isn't 'public' but 'protected', and which does not copy the mutable state of the class. A quick-fix is available to generate a basic 'clone()' method, which can be used as a basis for a properly functioning 'clone()' method expected from a 'Cloneable' class. Example: 'public class Data implements Cloneable {\n private String[] names;\n }' After the quick-fix is applied: 'public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' Use the Ignore classes cloneable due to inheritance option to ignore classes that are 'Cloneable' because they inherit from the 'Cloneable' class. Use the Ignore when Cloneable is necessary to call clone() method of super class option to ignore classes that require implementing 'Cloneable' because they call the 'clone()' method from a superclass.", - "markdown": "Reports classes implementing the `Cloneable` interface that don't override the `clone()` method.\n\nSuch classes use the default implementation of `clone()`,\nwhich isn't `public` but `protected`, and which does not copy the mutable state of the class.\n\nA quick-fix is available to generate a basic `clone()` method,\nwhich can be used as a basis for a properly functioning `clone()` method\nexpected from a `Cloneable` class.\n\n**Example:**\n\n\n public class Data implements Cloneable {\n private String[] names;\n }\n\nAfter the quick-fix is applied:\n\n\n public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nUse the **Ignore classes cloneable due to inheritance** option to ignore classes that are\n`Cloneable` because they inherit from the `Cloneable` class.\n\nUse the **Ignore when Cloneable is necessary to call clone() method of super class**\noption to ignore classes that require implementing `Cloneable` because they call the `clone()` method from a superclass." + "text": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable. Example: '// Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }' Enable the Use righthand type checkbox below to prevent weakening the left side of assignments when the right side is not a type cast or a new expression. When storing the result of a method call in a variable, it is useful to retain the type of the method call result instead of unnecessarily weakening it. Enable the Use parameterized type checkbox below to use the parameterized type of the collection as the weakest type when the object evaluated is used as an argument to a collection method with a parameter type of 'java.lang.Object'. Use this option to prevent weakening to 'Object' when passing an object to the following collection methods: 'get()', 'remove()', 'contains()', 'indexOf()', 'lastIndexOf()', 'containsKey()' and 'containsValue()'. Enable the Do not weaken to Object checkbox below to specify whether a type should be weakened to 'java.lang.Object'. Weakening to 'java.lang.Object' is rarely very useful. Enable the Only weaken to an interface checkbox below to only report a problem when the type can be weakened to an interface type. Enable the Do not weaken return type checkbox below to prevent reporting a problem when the return type may be weakened. Only variables will be analyzed. Enable the Do not suggest weakening variable declared as 'var' checkbox below to prevent reporting on local variables declared using the 'var' keyword (Java 10+) Stop classes are intended to prevent weakening to classes lower than stop classes, even if it is possible. In some cases, this may improve readability.", + "markdown": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable.\n\nExample:\n\n\n // Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }\n\n\nEnable the **Use righthand type** checkbox below\nto prevent weakening the left side of assignments when the right side is not\na type cast or a new expression. When storing the result of a method call in a variable, it is\nuseful to retain the type of the method call result instead of unnecessarily weakening it.\n\n\nEnable the **Use parameterized type** checkbox below\nto use the parameterized type of the collection as the weakest type when\nthe object evaluated is used as an argument to a collection method with a parameter type of\n`java.lang.Object`.\nUse this option to prevent weakening to `Object` when passing an object to the following collection methods:\n`get()`, `remove()`,\n`contains()`, `indexOf()`,\n`lastIndexOf()`, `containsKey()` and `containsValue()`.\n\n\nEnable the **Do not weaken to Object** checkbox below\nto specify whether a type should be weakened to `java.lang.Object`.\nWeakening to `java.lang.Object` is rarely very useful.\n\n\nEnable the **Only weaken to an interface** checkbox below\nto only report a problem when the type can be weakened to an interface type.\n\n\nEnable the **Do not weaken return type** checkbox below\nto prevent reporting a problem when the return type may be weakened.\nOnly variables will be analyzed.\n\n\nEnable the **Do not suggest weakening variable declared as 'var'** checkbox below\nto prevent reporting on local variables declared using the 'var' keyword (Java 10+)\n\n\n**Stop classes** are intended to prevent weakening to classes\nlower than stop classes, even if it is possible.\nIn some cases, this may improve readability." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CloneableClassWithoutClone", + "suppressToolId": "TypeMayBeWeakened", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -18371,8 +18371,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 81, + "id": "Java/Abstraction issues", + "index": 76, "toolComponent": { "name": "QDJVMC" } @@ -18384,19 +18384,19 @@ ] }, { - "id": "TypeMayBeWeakened", + "id": "CloneableImplementsClone", "shortDescription": { - "text": "Type may be weakened" + "text": "Cloneable class without 'clone()' method" }, "fullDescription": { - "text": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable. Example: '// Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }' Enable the Use righthand type checkbox below to prevent weakening the left side of assignments when the right side is not a type cast or a new expression. When storing the result of a method call in a variable, it is useful to retain the type of the method call result instead of unnecessarily weakening it. Enable the Use parameterized type checkbox below to use the parameterized type of the collection as the weakest type when the object evaluated is used as an argument to a collection method with a parameter type of 'java.lang.Object'. Use this option to prevent weakening to 'Object' when passing an object to the following collection methods: 'get()', 'remove()', 'contains()', 'indexOf()', 'lastIndexOf()', 'containsKey()' and 'containsValue()'. Enable the Do not weaken to Object checkbox below to specify whether a type should be weakened to 'java.lang.Object'. Weakening to 'java.lang.Object' is rarely very useful. Enable the Only weaken to an interface checkbox below to only report a problem when the type can be weakened to an interface type. Enable the Do not weaken return type checkbox below to prevent reporting a problem when the return type may be weakened. Only variables will be analyzed. Enable the Do not suggest weakening variable declared as 'var' checkbox below to prevent reporting on local variables declared using the 'var' keyword (Java 10+) Stop classes are intended to prevent weakening to classes lower than stop classes, even if it is possible. In some cases, this may improve readability.", - "markdown": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable.\n\nExample:\n\n\n // Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }\n\n\nEnable the **Use righthand type** checkbox below\nto prevent weakening the left side of assignments when the right side is not\na type cast or a new expression. When storing the result of a method call in a variable, it is\nuseful to retain the type of the method call result instead of unnecessarily weakening it.\n\n\nEnable the **Use parameterized type** checkbox below\nto use the parameterized type of the collection as the weakest type when\nthe object evaluated is used as an argument to a collection method with a parameter type of\n`java.lang.Object`.\nUse this option to prevent weakening to `Object` when passing an object to the following collection methods:\n`get()`, `remove()`,\n`contains()`, `indexOf()`,\n`lastIndexOf()`, `containsKey()` and `containsValue()`.\n\n\nEnable the **Do not weaken to Object** checkbox below\nto specify whether a type should be weakened to `java.lang.Object`.\nWeakening to `java.lang.Object` is rarely very useful.\n\n\nEnable the **Only weaken to an interface** checkbox below\nto only report a problem when the type can be weakened to an interface type.\n\n\nEnable the **Do not weaken return type** checkbox below\nto prevent reporting a problem when the return type may be weakened.\nOnly variables will be analyzed.\n\n\nEnable the **Do not suggest weakening variable declared as 'var'** checkbox below\nto prevent reporting on local variables declared using the 'var' keyword (Java 10+)\n\n\n**Stop classes** are intended to prevent weakening to classes\nlower than stop classes, even if it is possible.\nIn some cases, this may improve readability." + "text": "Reports classes implementing the 'Cloneable' interface that don't override the 'clone()' method. Such classes use the default implementation of 'clone()', which isn't 'public' but 'protected', and which does not copy the mutable state of the class. A quick-fix is available to generate a basic 'clone()' method, which can be used as a basis for a properly functioning 'clone()' method expected from a 'Cloneable' class. Example: 'public class Data implements Cloneable {\n private String[] names;\n }' After the quick-fix is applied: 'public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' Use the Ignore classes cloneable due to inheritance option to ignore classes that are 'Cloneable' because they inherit from the 'Cloneable' class. Use the Ignore when Cloneable is necessary to call clone() method of super class option to ignore classes that require implementing 'Cloneable' because they call the 'clone()' method from a superclass.", + "markdown": "Reports classes implementing the `Cloneable` interface that don't override the `clone()` method.\n\nSuch classes use the default implementation of `clone()`,\nwhich isn't `public` but `protected`, and which does not copy the mutable state of the class.\n\nA quick-fix is available to generate a basic `clone()` method,\nwhich can be used as a basis for a properly functioning `clone()` method\nexpected from a `Cloneable` class.\n\n**Example:**\n\n\n public class Data implements Cloneable {\n private String[] names;\n }\n\nAfter the quick-fix is applied:\n\n\n public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nUse the **Ignore classes cloneable due to inheritance** option to ignore classes that are\n`Cloneable` because they inherit from the `Cloneable` class.\n\nUse the **Ignore when Cloneable is necessary to call clone() method of super class**\noption to ignore classes that require implementing `Cloneable` because they call the `clone()` method from a superclass." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "TypeMayBeWeakened", + "suppressToolId": "CloneableClassWithoutClone", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -18404,8 +18404,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 76, + "id": "Java/Cloning issues", + "index": 81, "toolComponent": { "name": "QDJVMC" } @@ -18438,7 +18438,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -18669,7 +18669,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -18813,28 +18813,28 @@ ] }, { - "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": { - "suppressToolId": "LambdaParameterTypeCanBeSpecified", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "OverlyNestedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Method metrics", + "index": 93, "toolComponent": { "name": "QDJVMC" } @@ -18846,28 +18846,28 @@ ] }, { - "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": { - "suppressToolId": "OverlyNestedMethod", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "LambdaParameterTypeCanBeSpecified", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 93, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -18999,7 +18999,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -19077,19 +19077,19 @@ ] }, { - "id": "JUnitMixedFramework", + "id": "TestMethodWithoutAssertion", "shortDescription": { - "text": "JUnit API usage from multiple versions in a single TestCase" + "text": "Test method without assertions" }, "fullDescription": { - "text": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case. Example (JUnit 4 annotation in JUnit 3 test case): 'public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }' After the quick-fix is applied: 'public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }' Example (JUnit 5 annotation in JUnit 4 test case): 'public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }' After the quick-fix is applied: 'public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }'", - "markdown": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case.\n\nExample (JUnit 4 annotation in JUnit 3 test case):\n\n\n public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }\n\nExample (JUnit 5 annotation in JUnit 4 test case):\n\n\n public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n" + "text": "Reports test methods that do not contain any assertions. Such methods may indicate either incomplete or weak test cases. Example: 'public class ExtensiveTest {\n\n @Test\n public void testAlive() {\n System.out.println(\"nothing\");\n }\n }' Configure the inspection: Use the table to specify the combinations of fully qualified class name and method name regular expression that should qualify as assertions. Class names also match subclasses. Use the 'assert' keyword is considered an assertion option to specify if the Java 'assert' statements using the 'assert' keyword should be considered an assertion. Use the Ignore test methods which declare exceptions option to ignore the test methods that declare exceptions. This can be useful when you have tests that will throw an exception on failure and thus don't need any assertions.", + "markdown": "Reports test methods that do not contain any assertions. Such methods may indicate either incomplete or weak test cases.\n\n**Example:**\n\n\n public class ExtensiveTest {\n\n @Test\n public void testAlive() {\n System.out.println(\"nothing\");\n }\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the combinations of fully qualified class name and method name regular expression that should qualify as assertions. Class names also match subclasses.\n* Use the **'assert' keyword is considered an assertion** option to specify if the Java `assert` statements using the `assert` keyword should be considered an assertion.\n* Use the **Ignore test methods which declare exceptions** option to ignore the test methods that declare exceptions. This can be useful when you have tests that will throw an exception on failure and thus don't need any assertions." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "JUnitMixedFramework", + "suppressToolId": "TestMethodWithoutAssertion", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19110,19 +19110,19 @@ ] }, { - "id": "TestMethodWithoutAssertion", + "id": "JUnitMixedFramework", "shortDescription": { - "text": "Test method without assertions" + "text": "JUnit API usage from multiple versions in a single TestCase" }, "fullDescription": { - "text": "Reports test methods that do not contain any assertions. Such methods may indicate either incomplete or weak test cases. Example: 'public class ExtensiveTest {\n\n @Test\n public void testAlive() {\n System.out.println(\"nothing\");\n }\n }' Configure the inspection: Use the table to specify the combinations of fully qualified class name and method name regular expression that should qualify as assertions. Class names also match subclasses. Use the 'assert' keyword is considered an assertion option to specify if the Java 'assert' statements using the 'assert' keyword should be considered an assertion. Use the Ignore test methods which declare exceptions option to ignore the test methods that declare exceptions. This can be useful when you have tests that will throw an exception on failure and thus don't need any assertions.", - "markdown": "Reports test methods that do not contain any assertions. Such methods may indicate either incomplete or weak test cases.\n\n**Example:**\n\n\n public class ExtensiveTest {\n\n @Test\n public void testAlive() {\n System.out.println(\"nothing\");\n }\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the combinations of fully qualified class name and method name regular expression that should qualify as assertions. Class names also match subclasses.\n* Use the **'assert' keyword is considered an assertion** option to specify if the Java `assert` statements using the `assert` keyword should be considered an assertion.\n* Use the **Ignore test methods which declare exceptions** option to ignore the test methods that declare exceptions. This can be useful when you have tests that will throw an exception on failure and thus don't need any assertions." + "text": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case. Example (JUnit 4 annotation in JUnit 3 test case): 'public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }' After the quick-fix is applied: 'public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }' Example (JUnit 5 annotation in JUnit 4 test case): 'public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }' After the quick-fix is applied: 'public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }'", + "markdown": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case.\n\nExample (JUnit 4 annotation in JUnit 3 test case):\n\n\n public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }\n\nExample (JUnit 5 annotation in JUnit 4 test case):\n\n\n public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "TestMethodWithoutAssertion", + "suppressToolId": "JUnitMixedFramework", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19341,19 +19341,19 @@ ] }, { - "id": "ClassWithMultipleLoggers", + "id": "ShiftOutOfRange", "shortDescription": { - "text": "Class with multiple loggers" + "text": "Shift operation by inappropriate constant" }, "fullDescription": { - "text": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application. For example: 'public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }' Use the table below to specify Logger class names. Classes which declare multiple fields that have the type of one of the specified classes will be reported by this inspection.", - "markdown": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application.\n\nFor example:\n\n\n public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }\n\n\nUse the table below to specify Logger class names.\nClasses which declare multiple fields that have the type of one of the specified classes will be reported by this inspection." + "text": "Reports shift operations where the shift value is a constant outside the reasonable range. Integer shift operations outside the range '0..31' and long shift operations outside the range '0..63' are reported. Shifting by negative or overly large values is almost certainly a coding error. Example: 'int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;'", + "markdown": "Reports shift operations where the shift value is a constant outside the reasonable range.\n\nInteger shift operations outside the range `0..31` and long shift operations outside the\nrange `0..63` are reported. Shifting by negative or overly large values is almost certainly\na coding error.\n\n**Example:**\n\n\n int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassWithMultipleLoggers", + "suppressToolId": "ShiftOutOfRange", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19361,8 +19361,8 @@ "relationships": [ { "target": { - "id": "Java/Logging", - "index": 66, + "id": "Java/Bitwise operation issues", + "index": 96, "toolComponent": { "name": "QDJVMC" } @@ -19374,19 +19374,19 @@ ] }, { - "id": "ShiftOutOfRange", + "id": "ClassWithMultipleLoggers", "shortDescription": { - "text": "Shift operation by inappropriate constant" + "text": "Class with multiple loggers" }, "fullDescription": { - "text": "Reports shift operations where the shift value is a constant outside the reasonable range. Integer shift operations outside the range '0..31' and long shift operations outside the range '0..63' are reported. Shifting by negative or overly large values is almost certainly a coding error. Example: 'int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;'", - "markdown": "Reports shift operations where the shift value is a constant outside the reasonable range.\n\nInteger shift operations outside the range `0..31` and long shift operations outside the\nrange `0..63` are reported. Shifting by negative or overly large values is almost certainly\na coding error.\n\n**Example:**\n\n\n int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;\n" + "text": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application. For example: 'public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }' Use the table below to specify Logger class names. Classes which declare multiple fields that have the type of one of the specified classes will be reported by this inspection.", + "markdown": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application.\n\nFor example:\n\n\n public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }\n\n\nUse the table below to specify Logger class names.\nClasses which declare multiple fields that have the type of one of the specified classes will be reported by this inspection." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ShiftOutOfRange", + "suppressToolId": "ClassWithMultipleLoggers", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19394,8 +19394,8 @@ "relationships": [ { "target": { - "id": "Java/Bitwise operation issues", - "index": 96, + "id": "Java/Logging", + "index": 66, "toolComponent": { "name": "QDJVMC" } @@ -19473,19 +19473,19 @@ ] }, { - "id": "AutoBoxing", + "id": "ExtendsThrowable", "shortDescription": { - "text": "Auto-boxing" + "text": "Class directly extends 'Throwable'" }, "fullDescription": { - "text": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance. Example: 'Integer x = 42;' The quick-fix makes the conversion explicit: 'Integer x = Integer.valueOf(42);' AutoBoxing appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions.", - "markdown": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance.\n\n**Example:**\n\n Integer x = 42;\n\nThe quick-fix makes the conversion explicit:\n\n Integer x = Integer.valueOf(42);\n\n\n*AutoBoxing* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions." + "text": "Reports classes that directly extend 'java.lang.Throwable'. Extending 'java.lang.Throwable' directly is generally considered bad practice. It is usually enough to extend 'java.lang.RuntimeException', 'java.lang.Exception', or - in special cases - 'java.lang.Error'. Example: 'class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable''", + "markdown": "Reports classes that directly extend `java.lang.Throwable`.\n\nExtending `java.lang.Throwable` directly is generally considered bad practice.\nIt is usually enough to extend `java.lang.RuntimeException`, `java.lang.Exception`, or - in special\ncases - `java.lang.Error`.\n\n**Example:**\n\n\n class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "AutoBoxing", + "suppressToolId": "ExtendsThrowable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19493,8 +19493,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Error handling", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -19506,19 +19506,19 @@ ] }, { - "id": "ExtendsThrowable", + "id": "AutoBoxing", "shortDescription": { - "text": "Class directly extends 'Throwable'" + "text": "Auto-boxing" }, "fullDescription": { - "text": "Reports classes that directly extend 'java.lang.Throwable'. Extending 'java.lang.Throwable' directly is generally considered bad practice. It is usually enough to extend 'java.lang.RuntimeException', 'java.lang.Exception', or - in special cases - 'java.lang.Error'. Example: 'class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable''", - "markdown": "Reports classes that directly extend `java.lang.Throwable`.\n\nExtending `java.lang.Throwable` directly is generally considered bad practice.\nIt is usually enough to extend `java.lang.RuntimeException`, `java.lang.Exception`, or - in special\ncases - `java.lang.Error`.\n\n**Example:**\n\n\n class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'\n" + "text": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance. Example: 'Integer x = 42;' The quick-fix makes the conversion explicit: 'Integer x = Integer.valueOf(42);' AutoBoxing appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions.", + "markdown": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance.\n\n**Example:**\n\n Integer x = 42;\n\nThe quick-fix makes the conversion explicit:\n\n Integer x = Integer.valueOf(42);\n\n\n*AutoBoxing* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ExtendsThrowable", + "suppressToolId": "AutoBoxing", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19526,8 +19526,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 15, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -19593,7 +19593,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -19626,7 +19626,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -19791,7 +19791,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -19803,19 +19803,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "CloneCallsConstructors", + "suppressToolId": "UnnecessaryModuleDependencyInspection", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19823,8 +19823,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 81, + "id": "Java/Declaration redundancy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -19836,19 +19836,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryModuleDependencyInspection", + "suppressToolId": "CloneCallsConstructors", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19856,8 +19856,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 14, + "id": "Java/Cloning issues", + "index": 81, "toolComponent": { "name": "QDJVMC" } @@ -19902,19 +19902,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "ArraysAsListWithZeroOrOneArgument", + "suppressToolId": "WaitNotInLoop", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19922,8 +19922,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -19935,19 +19935,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "WaitNotInLoop", + "suppressToolId": "ArraysAsListWithZeroOrOneArgument", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19955,8 +19955,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -20133,19 +20133,19 @@ ] }, { - "id": "ReturnThis", + "id": "CanBeFinal", "shortDescription": { - "text": "Return of 'this'" + "text": "Declaration can have 'final' modifier" }, "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" + "text": "Reports fields, methods, or classes that may have the 'final' modifier added to their declarations. Final classes can't be extended, final methods can't be overridden, and final fields can't be reassigned. Example: 'public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }' After the quick-fix is applied: 'public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }' Use the Report classes and Report methods options to define which declarations are to be reported.", + "markdown": "Reports fields, methods, or classes that may have the `final` modifier added to their declarations.\n\nFinal classes can't be extended, final methods can't be overridden, and final fields can't be reassigned.\n\n**Example:**\n\n\n public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }\n\nUse the **Report classes** and **Report methods** options to define which declarations are to be reported." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ReturnOfThis", + "suppressToolId": "CanBeFinal", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20153,8 +20153,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Declaration redundancy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -20166,19 +20166,19 @@ ] }, { - "id": "CanBeFinal", + "id": "ReturnThis", "shortDescription": { - "text": "Declaration can have 'final' modifier" + "text": "Return of 'this'" }, "fullDescription": { - "text": "Reports fields, methods, or classes that may have the 'final' modifier added to their declarations. Final classes can't be extended, final methods can't be overridden, and final fields can't be reassigned. Example: 'public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }' After the quick-fix is applied: 'public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }' Use the Report classes and Report methods options to define which declarations are to be reported.", - "markdown": "Reports fields, methods, or classes that may have the `final` modifier added to their declarations.\n\nFinal classes can't be extended, final methods can't be overridden, and final fields can't be reassigned.\n\n**Example:**\n\n\n public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }\n\nUse the **Report classes** and **Report methods** options to define which declarations are to be reported." + "text": "Reports methods returning 'this'. While such a return is valid, it is rarely necessary, and usually indicates that the method is intended to be used as part of a chain of similar method calls (for example, 'buffer.append(\"foo\").append(\"bar\").append(\"baz\")'). Such chains are frowned upon by many coding standards. Example: 'public Builder append(String str) {\n // [...]\n return this;\n }'", + "markdown": "Reports methods returning `this`.\n\n\nWhile such a return is valid, it is rarely necessary, and usually indicates that the method is intended to be used\nas part of a chain of similar method calls (for example, `buffer.append(\"foo\").append(\"bar\").append(\"baz\")`).\nSuch chains are frowned upon by many coding standards.\n\n**Example:**\n\n\n public Builder append(String str) {\n // [...]\n return this;\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CanBeFinal", + "suppressToolId": "ReturnOfThis", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20186,8 +20186,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 14, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -20199,19 +20199,19 @@ ] }, { - "id": "UnnecessaryLabelOnBreakStatement", + "id": "SerializableRecordContainsIgnoredMembers", "shortDescription": { - "text": "Unnecessary label on 'break' statement" + "text": "'record' contains ignored members" }, "fullDescription": { - "text": "Reports 'break' statements with unnecessary labels. Such labels do not change the control flow but make the code difficult to follow. Example: 'label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break label;\n //doSmth\n }' After the quick-fix is applied: 'label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break;\n //doSmth\n }'", - "markdown": "Reports `break` statements with unnecessary labels. Such labels do not change the control flow but make the code difficult to follow.\n\n**Example:**\n\n\n label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break label;\n //doSmth\n }\n\nAfter the quick-fix is applied:\n\n\n label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break;\n //doSmth\n }\n" + "text": "Reports serialization methods or fields defined in a 'record' class. Serialization methods include 'writeObject()', 'readObject()', 'readObjectNoData()', 'writeExternal()', and 'readExternal()' and the field 'serialPersistentFields'. These members are not used for the serialization or deserialization of records and therefore unnecessary. Examples: 'record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }' 'record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }' This inspection only reports if the language level of the project or module is 14 or higher. New in 2020.3", + "markdown": "Reports serialization methods or fields defined in a `record` class. Serialization methods include `writeObject()`, `readObject()`, `readObjectNoData()`, `writeExternal()`, and `readExternal()` and the field `serialPersistentFields`. These members are not used for the serialization or deserialization of records and therefore unnecessary.\n\n**Examples:**\n\n\n record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\n\n record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }\n\nThis inspection only reports if the language level of the project or module is 14 or higher.\n\nNew in 2020.3" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryLabelOnBreakStatement", + "suppressToolId": "SerializableRecordContainsIgnoredMembers", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20219,8 +20219,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 37, + "id": "Java/Serialization issues", + "index": 18, "toolComponent": { "name": "QDJVMC" } @@ -20232,19 +20232,19 @@ ] }, { - "id": "SerializableRecordContainsIgnoredMembers", + "id": "UnnecessaryLabelOnBreakStatement", "shortDescription": { - "text": "'record' contains ignored members" + "text": "Unnecessary label on 'break' statement" }, "fullDescription": { - "text": "Reports serialization methods or fields defined in a 'record' class. Serialization methods include 'writeObject()', 'readObject()', 'readObjectNoData()', 'writeExternal()', and 'readExternal()' and the field 'serialPersistentFields'. These members are not used for the serialization or deserialization of records and therefore unnecessary. Examples: 'record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }' 'record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }' This inspection only reports if the language level of the project or module is 14 or higher. New in 2020.3", - "markdown": "Reports serialization methods or fields defined in a `record` class. Serialization methods include `writeObject()`, `readObject()`, `readObjectNoData()`, `writeExternal()`, and `readExternal()` and the field `serialPersistentFields`. These members are not used for the serialization or deserialization of records and therefore unnecessary.\n\n**Examples:**\n\n\n record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\n\n record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }\n\nThis inspection only reports if the language level of the project or module is 14 or higher.\n\nNew in 2020.3" + "text": "Reports 'break' statements with unnecessary labels. Such labels do not change the control flow but make the code difficult to follow. Example: 'label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break label;\n //doSmth\n }' After the quick-fix is applied: 'label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break;\n //doSmth\n }'", + "markdown": "Reports `break` statements with unnecessary labels. Such labels do not change the control flow but make the code difficult to follow.\n\n**Example:**\n\n\n label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break label;\n //doSmth\n }\n\nAfter the quick-fix is applied:\n\n\n label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break;\n //doSmth\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SerializableRecordContainsIgnoredMembers", + "suppressToolId": "UnnecessaryLabelOnBreakStatement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20252,8 +20252,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 18, + "id": "Java/Verbose or redundant code constructs", + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -20496,19 +20496,19 @@ ] }, { - "id": "SharedThreadLocalRandom", + "id": "NonFinalClone", "shortDescription": { - "text": "'ThreadLocalRandom' instance might be shared" + "text": "Non-final 'clone()' in secure context" }, "fullDescription": { - "text": "Reports 'java.util.concurrent.ThreadLocalRandom' instances which might be shared between threads. A 'ThreadLocalRandom' should not be shared between threads because that is not thread-safe. The inspection reports instances that are assigned to a field used as a method argument, or assigned to a local variable and used in anonymous or nested classes as they might get shared between threads. Usages of 'ThreadLocalRandom' should typically look like 'ThreadLocalRandom.current().nextInt(...)' (or 'nextDouble(...)' etc.). When all usages are in this form, 'ThreadLocalRandom' instances cannot be used accidentally by multiple threads. Example: 'class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }' Use the options to list methods that are safe to be passed to 'ThreadLocalRandom' instances as an argument. It's possible to use regular expressions for method names.", - "markdown": "Reports `java.util.concurrent.ThreadLocalRandom` instances which might be shared between threads.\n\n\nA `ThreadLocalRandom` should not be shared between threads because that is not thread-safe.\nThe inspection reports instances that are assigned to a field used as a method argument,\nor assigned to a local variable and used in anonymous or nested classes as they might get shared between threads.\n\n\nUsages of `ThreadLocalRandom` should typically look like `ThreadLocalRandom.current().nextInt(...)`\n(or `nextDouble(...)` etc.).\nWhen all usages are in this form, `ThreadLocalRandom` instances cannot be used accidentally by multiple threads.\n\n**Example:**\n\n\n class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }\n \n\nUse the options to list methods that are safe to be passed to `ThreadLocalRandom` instances as an argument.\nIt's possible to use regular expressions for method names." + "text": "Reports 'clone()' methods without the 'final' modifier. Since 'clone()' can be used to instantiate objects without using a constructor, allowing the 'clone()' method to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the 'clone()' method or the enclosing class itself 'final'. Example: 'class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }'", + "markdown": "Reports `clone()` methods without the `final` modifier.\n\n\nSince `clone()` can be used to instantiate objects without using a constructor, allowing the `clone()`\nmethod to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the\n`clone()` method or the enclosing class itself `final`.\n\n**Example:**\n\n\n class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SharedThreadLocalRandom", + "suppressToolId": "NonFinalClone", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20516,8 +20516,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Security", + "index": 30, "toolComponent": { "name": "QDJVMC" } @@ -20529,19 +20529,19 @@ ] }, { - "id": "NonFinalClone", + "id": "SharedThreadLocalRandom", "shortDescription": { - "text": "Non-final 'clone()' in secure context" + "text": "'ThreadLocalRandom' instance might be shared" }, "fullDescription": { - "text": "Reports 'clone()' methods without the 'final' modifier. Since 'clone()' can be used to instantiate objects without using a constructor, allowing the 'clone()' method to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the 'clone()' method or the enclosing class itself 'final'. Example: 'class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }'", - "markdown": "Reports `clone()` methods without the `final` modifier.\n\n\nSince `clone()` can be used to instantiate objects without using a constructor, allowing the `clone()`\nmethod to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the\n`clone()` method or the enclosing class itself `final`.\n\n**Example:**\n\n\n class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }\n" + "text": "Reports 'java.util.concurrent.ThreadLocalRandom' instances which might be shared between threads. A 'ThreadLocalRandom' should not be shared between threads because that is not thread-safe. The inspection reports instances that are assigned to a field used as a method argument, or assigned to a local variable and used in anonymous or nested classes as they might get shared between threads. Usages of 'ThreadLocalRandom' should typically look like 'ThreadLocalRandom.current().nextInt(...)' (or 'nextDouble(...)' etc.). When all usages are in this form, 'ThreadLocalRandom' instances cannot be used accidentally by multiple threads. Example: 'class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }' Use the options to list methods that are safe to be passed to 'ThreadLocalRandom' instances as an argument. It's possible to use regular expressions for method names.", + "markdown": "Reports `java.util.concurrent.ThreadLocalRandom` instances which might be shared between threads.\n\n\nA `ThreadLocalRandom` should not be shared between threads because that is not thread-safe.\nThe inspection reports instances that are assigned to a field used as a method argument,\nor assigned to a local variable and used in anonymous or nested classes as they might get shared between threads.\n\n\nUsages of `ThreadLocalRandom` should typically look like `ThreadLocalRandom.current().nextInt(...)`\n(or `nextDouble(...)` etc.).\nWhen all usages are in this form, `ThreadLocalRandom` instances cannot be used accidentally by multiple threads.\n\n**Example:**\n\n\n class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }\n \n\nUse the options to list methods that are safe to be passed to `ThreadLocalRandom` instances as an argument.\nIt's possible to use regular expressions for method names." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalClone", + "suppressToolId": "SharedThreadLocalRandom", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20549,8 +20549,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 30, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -20649,7 +20649,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -20682,7 +20682,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -20793,28 +20793,28 @@ ] }, { - "id": "Since15", + "id": "RedundantFieldInitialization", "shortDescription": { - "text": "Usages of API which isn't available at the configured language level" + "text": "Redundant field initialization" }, "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 fields explicitly initialized to their default values. Example: 'class Foo {\n int foo = 0;\n List bar = null;\n }' After the quick-fix is applied: 'class Foo {\n int foo;\n List bar;\n }' Use the inspection settings to only report explicit 'null' initialization, for example: 'class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }'", + "markdown": "Reports fields explicitly initialized to their default values.\n\n**Example:**\n\n\n class Foo {\n int foo = 0;\n List bar = null;\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int foo;\n List bar;\n }\n\n\nUse the inspection settings to only report explicit `null` initialization, for example:\n\n\n class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }\n" }, "defaultConfiguration": { "enabled": false, - "level": "error", + "level": "warning", "parameters": { - "suppressToolId": "Since15", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "suppressToolId": "RedundantFieldInitialization", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "JVM languages", - "index": 4, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -20826,28 +20826,28 @@ ] }, { - "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": { - "suppressToolId": "EmptyMethod", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "Since15", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 14, + "id": "JVM languages", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -20859,19 +20859,19 @@ ] }, { - "id": "RedundantFieldInitialization", + "id": "EmptyMethod", "shortDescription": { - "text": "Redundant field initialization" + "text": "Empty method" }, "fullDescription": { - "text": "Reports fields explicitly initialized to their default values. Example: 'class Foo {\n int foo = 0;\n List bar = null;\n }' After the quick-fix is applied: 'class Foo {\n int foo;\n List bar;\n }' Use the inspection settings to only report explicit 'null' initialization, for example: 'class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }'", - "markdown": "Reports fields explicitly initialized to their default values.\n\n**Example:**\n\n\n class Foo {\n int foo = 0;\n List bar = null;\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int foo;\n List bar;\n }\n\n\nUse the inspection settings to only report explicit `null` initialization, for example:\n\n\n class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }\n" + "text": "Reports empty methods that can be removed. Methods are considered empty if they are empty themselves and if they are overridden or implemented by empty methods only. Note that methods containing only comments and the 'super()' call with own parameters are also considered empty. The inspection ignores methods with special annotations, for example, the 'javax.ejb.Init' and 'javax.ejb.Remove' EJB annotations . The quick-fix safely removes unnecessary methods. Configure the inspection: Use the Comments and javadoc count as content option to select whether methods with comments should be treated as non-empty. Use the Additional special annotations option to configure additional annotations that should be ignored by this inspection.", + "markdown": "Reports empty methods that can be removed.\n\nMethods are considered empty if they are empty themselves and if they are overridden or\nimplemented by empty methods only. Note that methods containing only comments and the `super()` call with own parameters are\nalso considered empty.\n\nThe inspection ignores methods with special annotations, for example, the `javax.ejb.Init` and `javax.ejb.Remove` EJB annotations .\n\nThe quick-fix safely removes unnecessary methods.\n\nConfigure the inspection:\n\n* Use the **Comments and javadoc count as content** option to select whether methods with comments should be treated as non-empty.\n* Use the **Additional special annotations** option to configure additional annotations that should be ignored by this inspection." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "RedundantFieldInitialization", + "suppressToolId": "EmptyMethod", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20879,8 +20879,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Declaration redundancy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -21056,39 +21056,6 @@ } ] }, - { - "id": "MultipleVariablesInDeclaration", - "shortDescription": { - "text": "Multiple variables in one declaration" - }, - "fullDescription": { - "text": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable. Some coding standards prohibit such declarations. Example: 'int x = 1, y = 2;' After the quick-fix is applied: 'int x = 1;\n int y = 2;' Configure the inspection: Use the Ignore 'for' loop declarations option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example: 'for (int i = 0, max = list.size(); i > max; i++) {}' Use the Only warn on different array dimensions in a single declaration option to only warn when variables with different array dimensions are declared in a single declaration, for example: 'String s = \"\", array[];' New in 2019.2", - "markdown": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable.\n\nSome coding standards prohibit such declarations.\n\nExample:\n\n\n int x = 1, y = 2;\n\nAfter the quick-fix is applied:\n\n\n int x = 1;\n int y = 2;\n\nConfigure the inspection:\n\n* Use the **Ignore 'for' loop declarations** option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example:\n\n\n for (int i = 0, max = list.size(); i > max; i++) {}\n\n* Use the **Only warn on different array dimensions in a single declaration** option to only warn when variables with different array dimensions are declared in a single declaration, for example:\n\n\n String s = \"\", array[];\n\nNew in 2019.2" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "MultipleVariablesInDeclaration", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Code style issues", - "index": 11, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "QuestionableName", "shortDescription": { @@ -21122,6 +21089,39 @@ } ] }, + { + "id": "MultipleVariablesInDeclaration", + "shortDescription": { + "text": "Multiple variables in one declaration" + }, + "fullDescription": { + "text": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable. Some coding standards prohibit such declarations. Example: 'int x = 1, y = 2;' After the quick-fix is applied: 'int x = 1;\n int y = 2;' Configure the inspection: Use the Ignore 'for' loop declarations option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example: 'for (int i = 0, max = list.size(); i > max; i++) {}' Use the Only warn on different array dimensions in a single declaration option to only warn when variables with different array dimensions are declared in a single declaration, for example: 'String s = \"\", array[];' New in 2019.2", + "markdown": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable.\n\nSome coding standards prohibit such declarations.\n\nExample:\n\n\n int x = 1, y = 2;\n\nAfter the quick-fix is applied:\n\n\n int x = 1;\n int y = 2;\n\nConfigure the inspection:\n\n* Use the **Ignore 'for' loop declarations** option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example:\n\n\n for (int i = 0, max = list.size(); i > max; i++) {}\n\n* Use the **Only warn on different array dimensions in a single declaration** option to only warn when variables with different array dimensions are declared in a single declaration, for example:\n\n\n String s = \"\", array[];\n\nNew in 2019.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MultipleVariablesInDeclaration", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "IOResource", "shortDescription": { @@ -21342,7 +21342,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -21584,39 +21584,6 @@ } ] }, - { - "id": "OverloadedMethodsWithSameNumberOfParameters", - "shortDescription": { - "text": "Overloaded methods with same number of parameters" - }, - "fullDescription": { - "text": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called. Example: 'class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }' Use the option to ignore overloaded methods whose parameter types are definitely incompatible.", - "markdown": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called.\n\n**Example:**\n\n\n class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }\n\n\nUse the option to ignore overloaded methods whose parameter types are definitely incompatible." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "OverloadedMethodsWithSameNumberOfParameters", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Naming conventions/Method", - "index": 86, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "OverridableMethodCallDuringObjectConstruction", "shortDescription": { @@ -21651,19 +21618,19 @@ ] }, { - "id": "ParametersPerMethod", + "id": "OverloadedMethodsWithSameNumberOfParameters", "shortDescription": { - "text": "Method with too many parameters" + "text": "Overloaded methods with same number of parameters" }, "fullDescription": { - "text": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary. Methods that have super methods are not reported. Use the Parameter limit field to specify the maximum allowed number of parameters for a method.", - "markdown": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary.\n\nMethods that have super methods are not reported.\n\nUse the **Parameter limit** field to specify the maximum allowed number of parameters for a method." + "text": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called. Example: 'class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }' Use the option to ignore overloaded methods whose parameter types are definitely incompatible.", + "markdown": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called.\n\n**Example:**\n\n\n class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }\n\n\nUse the option to ignore overloaded methods whose parameter types are definitely incompatible." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MethodWithTooManyParameters", + "suppressToolId": "OverloadedMethodsWithSameNumberOfParameters", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21671,8 +21638,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 93, + "id": "Java/Naming conventions/Method", + "index": 86, "toolComponent": { "name": "QDJVMC" } @@ -21684,19 +21651,19 @@ ] }, { - "id": "OverlyLongLambda", + "id": "ParametersPerMethod", "shortDescription": { - "text": "Overly long lambda expression" + "text": "Method with too many parameters" }, "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 methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary. Methods that have super methods are not reported. Use the Parameter limit field to specify the maximum allowed number of parameters for a method.", + "markdown": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary.\n\nMethods that have super methods are not reported.\n\nUse the **Parameter limit** field to specify the maximum allowed number of parameters for a method." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "OverlyLongLambda", + "suppressToolId": "MethodWithTooManyParameters", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21783,19 +21750,19 @@ ] }, { - "id": "CachedNumberConstructorCall", + "id": "OverlyLongLambda", "shortDescription": { - "text": "Number constructor call with primitive argument" + "text": "Overly long lambda expression" }, "fullDescription": { - "text": "Reports instantiations of new 'Long', 'Integer', 'Short', or 'Byte' objects that have a primitive 'long', 'integer', 'short', or 'byte' argument. It is recommended that you use the static method 'valueOf()' introduced in Java 5. By default, this method caches objects for values between -128 and 127 inclusive. Example: 'Integer i = new Integer(1);\n Long l = new Long(1L);' After the quick-fix is applied, the code changes to: 'Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);' This inspection only reports if the language level of the project or module is 5 or higher Use the Ignore new number expressions with a String argument option to ignore calls to number constructors with a 'String' argument. Use the Report only when constructor is @Deprecated option to only report calls to deprecated constructors. 'Long', 'Integer', 'Short' and 'Byte' constructors are deprecated since JDK 9.", - "markdown": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9." + "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": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CachedNumberConstructorCall", + "suppressToolId": "OverlyLongLambda", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21803,8 +21770,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 27, + "id": "Java/Method metrics", + "index": 93, "toolComponent": { "name": "QDJVMC" } @@ -21848,6 +21815,39 @@ } ] }, + { + "id": "CachedNumberConstructorCall", + "shortDescription": { + "text": "Number constructor call with primitive argument" + }, + "fullDescription": { + "text": "Reports instantiations of new 'Long', 'Integer', 'Short', or 'Byte' objects that have a primitive 'long', 'integer', 'short', or 'byte' argument. It is recommended that you use the static method 'valueOf()' introduced in Java 5. By default, this method caches objects for values between -128 and 127 inclusive. Example: 'Integer i = new Integer(1);\n Long l = new Long(1L);' After the quick-fix is applied, the code changes to: 'Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);' This inspection only reports if the language level of the project or module is 5 or higher Use the Ignore new number expressions with a String argument option to ignore calls to number constructors with a 'String' argument. Use the Report only when constructor is @Deprecated option to only report calls to deprecated constructors. 'Long', 'Integer', 'Short' and 'Byte' constructors are deprecated since JDK 9.", + "markdown": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CachedNumberConstructorCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "CloneDeclaresCloneNotSupported", "shortDescription": { @@ -21903,7 +21903,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -21948,19 +21948,19 @@ ] }, { - "id": "SimpleDateFormatWithoutLocale", + "id": "UnnecessaryExplicitNumericCast", "shortDescription": { - "text": "'SimpleDateFormat' without locale" + "text": "Unnecessary explicit numeric cast" }, "fullDescription": { - "text": "Reports instantiations of 'java.util.SimpleDateFormat' or 'java.time.format.DateTimeFormatter' that do not specify a 'java.util.Locale'. These calls will use the platform default locale, which depends on the OS settings. This can lead to surprising behaviour when the code is run on a different platform or the OS settings are changed. 'Example:' 'new SimpleDateFormat(\"yyyy\");\n DateTimeFormatter.ofPattern(\"d/M/y\");'", - "markdown": "Reports instantiations of `java.util.SimpleDateFormat` or `java.time.format.DateTimeFormatter` that do not specify a `java.util.Locale`. These calls will use the platform default locale, which depends on the OS settings. This can lead to surprising behaviour when the code is run on a different platform or the OS settings are changed.\n\n`Example:`\n\n\n new SimpleDateFormat(\"yyyy\");\n DateTimeFormatter.ofPattern(\"d/M/y\");\n" + "text": "Reports primitive numeric casts that would be inserted implicitly by the compiler. Also, reports any primitive numeric casts that the compiler will remove. Example: 'int x = (short)5; // The cast will be removed by the javac tool' After the quick-fix is applied: 'int x = 5;'", + "markdown": "Reports primitive numeric casts that would be inserted implicitly by the compiler. Also, reports any primitive numeric casts that the compiler will remove.\n\n**Example:**\n\n int x = (short)5; // The cast will be removed by the javac tool\n\nAfter the quick-fix is applied:\n`int x = 5;`" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SimpleDateFormatWithoutLocale", + "suppressToolId": "UnnecessaryExplicitNumericCast", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21968,8 +21968,8 @@ "relationships": [ { "target": { - "id": "Java/Internationalization", - "index": 9, + "id": "Java/Numeric issues/Cast", + "index": 101, "toolComponent": { "name": "QDJVMC" } @@ -21981,19 +21981,19 @@ ] }, { - "id": "UnnecessaryExplicitNumericCast", + "id": "SimpleDateFormatWithoutLocale", "shortDescription": { - "text": "Unnecessary explicit numeric cast" + "text": "'SimpleDateFormat' without locale" }, "fullDescription": { - "text": "Reports primitive numeric casts that would be inserted implicitly by the compiler. Also, reports any primitive numeric casts that the compiler will remove. Example: 'int x = (short)5; // The cast will be removed by the javac tool' After the quick-fix is applied: 'int x = 5;'", - "markdown": "Reports primitive numeric casts that would be inserted implicitly by the compiler. Also, reports any primitive numeric casts that the compiler will remove.\n\n**Example:**\n\n int x = (short)5; // The cast will be removed by the javac tool\n\nAfter the quick-fix is applied:\n`int x = 5;`" + "text": "Reports instantiations of 'java.util.SimpleDateFormat' or 'java.time.format.DateTimeFormatter' that do not specify a 'java.util.Locale'. These calls will use the platform default locale, which depends on the OS settings. This can lead to surprising behaviour when the code is run on a different platform or the OS settings are changed. 'Example:' 'new SimpleDateFormat(\"yyyy\");\n DateTimeFormatter.ofPattern(\"d/M/y\");'", + "markdown": "Reports instantiations of `java.util.SimpleDateFormat` or `java.time.format.DateTimeFormatter` that do not specify a `java.util.Locale`. These calls will use the platform default locale, which depends on the OS settings. This can lead to surprising behaviour when the code is run on a different platform or the OS settings are changed.\n\n`Example:`\n\n\n new SimpleDateFormat(\"yyyy\");\n DateTimeFormatter.ofPattern(\"d/M/y\");\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryExplicitNumericCast", + "suppressToolId": "SimpleDateFormatWithoutLocale", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22001,8 +22001,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues/Cast", - "index": 101, + "id": "Java/Internationalization", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -22200,7 +22200,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -22233,7 +22233,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -22332,7 +22332,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -22377,19 +22377,19 @@ ] }, { - "id": "UnnecessaryThis", + "id": "InstanceVariableUninitializedUse", "shortDescription": { - "text": "Unnecessary 'this' qualifier" + "text": "Instance field used before initialization" }, "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 instance variables that are read before initialization. The inspection ignores equality checks with 'null'. Example: 'class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore if annotated by option to specify special annotations. The inspection will ignore fields annotated with one of these annotations. Use the Ignore primitive fields option to ignore uninitialized primitive fields.", + "markdown": "Reports instance variables that are read before initialization.\n\nThe inspection ignores equality checks with `null`.\n\n**Example:**\n\n\n class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection will ignore fields\nannotated with one of these annotations.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryThis", + "suppressToolId": "InstanceVariableUsedBeforeInitialized", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22397,8 +22397,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Initialization", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -22410,19 +22410,19 @@ ] }, { - "id": "InstanceVariableUninitializedUse", + "id": "ClassWithTooManyTransitiveDependencies", "shortDescription": { - "text": "Instance field used before initialization" + "text": "Class with too many transitive dependencies" }, "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 classes that are directly or indirectly dependent on too many other classes. Modifications to any dependency of such a class may require changing the class thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of transitive dependencies field to specify the maximum allowed number of direct or indirect dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that are directly or indirectly dependent on too many other classes.\n\nModifications to any dependency of such a class may require changing the class thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of transitive dependencies** field to specify the maximum allowed number of direct or indirect dependencies\nfor a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InstanceVariableUsedBeforeInitialized", + "suppressToolId": "ClassWithTooManyTransitiveDependencies", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22430,8 +22430,8 @@ "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 28, + "id": "Java/Dependency issues", + "index": 87, "toolComponent": { "name": "QDJVMC" } @@ -22443,19 +22443,19 @@ ] }, { - "id": "ClassWithTooManyTransitiveDependencies", + "id": "UnnecessaryThis", "shortDescription": { - "text": "Class with too many transitive dependencies" + "text": "Unnecessary 'this' qualifier" }, "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 unnecessary 'this' qualifier. Using 'this' to disambiguate a code reference is discouraged by many coding styles and may easily become unnecessary via automatic refactorings. Example: 'class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }' After the quick-fix is applied: 'class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }' Use the inspection settings to ignore assignments to fields. For instance, 'this.x = 2;' won't be reported, but 'int y = this.x;' will be.", + "markdown": "Reports unnecessary `this` qualifier.\n\n\nUsing `this` to disambiguate a code reference is discouraged by many coding styles\nand may easily become unnecessary\nvia automatic refactorings.\n\n**Example:**\n\n\n class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }\n\n\nUse the inspection settings to ignore assignments to fields.\nFor instance, `this.x = 2;` won't be reported, but `int y = this.x;` will be." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassWithTooManyTransitiveDependencies", + "suppressToolId": "UnnecessaryThis", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22463,8 +22463,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 87, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -22497,7 +22497,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -22563,7 +22563,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -22629,7 +22629,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -22728,7 +22728,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -22794,7 +22794,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -22860,7 +22860,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -23136,19 +23136,19 @@ ] }, { - "id": "TypeParameterExtendsFinalClass", + "id": "UtilityClassWithPublicConstructor", "shortDescription": { - "text": "Type parameter extends 'final' class" + "text": "Utility class with 'public' constructor" }, "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" + "text": "Reports utility classes with 'public' constructors. Utility classes have all fields and methods declared as 'static'. Creating a 'public' constructor in such classes is confusing and may cause accidental class instantiation. Example: 'public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }'", + "markdown": "Reports utility classes with `public` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating a `public`\nconstructor in such classes is confusing and may cause accidental class instantiation.\n\n**Example:**\n\n\n public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "TypeParameterExtendsFinalClass", + "suppressToolId": "UtilityClassWithPublicConstructor", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23156,8 +23156,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 25, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -23169,19 +23169,19 @@ ] }, { - "id": "UtilityClassWithPublicConstructor", + "id": "TypeParameterExtendsFinalClass", "shortDescription": { - "text": "Utility class with 'public' constructor" + "text": "Type parameter extends 'final' class" }, "fullDescription": { - "text": "Reports utility classes with 'public' constructors. Utility classes have all fields and methods declared as 'static'. Creating a 'public' constructor in such classes is confusing and may cause accidental class instantiation. Example: 'public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }'", - "markdown": "Reports utility classes with `public` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating a `public`\nconstructor in such classes is confusing and may cause accidental class instantiation.\n\n**Example:**\n\n\n public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }\n" + "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": { - "suppressToolId": "UtilityClassWithPublicConstructor", + "suppressToolId": "TypeParameterExtendsFinalClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23189,8 +23189,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 12, + "id": "Java/Inheritance issues", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -23223,7 +23223,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -23334,19 +23334,19 @@ ] }, { - "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": { - "suppressToolId": "MethodOverridesInaccessibleMethodOfSuper", + "suppressToolId": "resource", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23354,8 +23354,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 57, + "id": "Java/Resource management", + "index": 47, "toolComponent": { "name": "QDJVMC" } @@ -23367,19 +23367,19 @@ ] }, { - "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": { - "suppressToolId": "resource", + "suppressToolId": "MethodOverridesInaccessibleMethodOfSuper", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23387,8 +23387,8 @@ "relationships": [ { "target": { - "id": "Java/Resource management", - "index": 47, + "id": "Java/Visibility", + "index": 57, "toolComponent": { "name": "QDJVMC" } @@ -23520,7 +23520,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -23664,19 +23664,19 @@ ] }, { - "id": "SuperTearDownInFinally", + "id": "PointlessBooleanExpression", "shortDescription": { - "text": "JUnit 3 'super.tearDown()' is not called from 'finally' block" + "text": "Pointless boolean expression" }, "fullDescription": { - "text": "Reports calls of the JUnit 3's 'super.tearDown()' method that are not performed inside a 'finally' block. If an exception is thrown before 'super.tearDown()' is called it could lead to inconsistencies and leaks. Example: 'public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n Files.delete(path);\n super.tearDown();\n }\n }' Improved code: 'public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n try {\n Files.delete(path);\n } finally {\n super.tearDown();\n }\n }\n }'", - "markdown": "Reports calls of the JUnit 3's `super.tearDown()` method that are not performed inside a `finally` block. If an exception is thrown before `super.tearDown()` is called it could lead to inconsistencies and leaks.\n\n**Example:**\n\n\n public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n Files.delete(path);\n super.tearDown();\n }\n }\n\nImproved code:\n\n\n public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n try {\n Files.delete(path);\n } finally {\n super.tearDown();\n }\n }\n }\n" + "text": "Reports unnecessary or overly complicated boolean expressions. Such expressions include '&&'-ing with 'true', '||'-ing with 'false', equality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified. Example: 'boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;' After the quick-fix is applied: 'boolean a = true;\n boolean b = x;\n boolean c = !x;' Configure the inspection: Use the Ignore named constants in determining pointless expressions option to ignore named constants when determining if an expression is pointless.", + "markdown": "Reports unnecessary or overly complicated boolean expressions.\n\nSuch expressions include `&&`-ing with `true`,\n`||`-ing with `false`,\nequality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified.\n\nExample:\n\n\n boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;\n\nAfter the quick-fix is applied:\n\n\n boolean a = true;\n boolean b = x;\n boolean c = !x;\n\n\nConfigure the inspection:\nUse the **Ignore named constants in determining pointless expressions** option to ignore named constants when determining if an expression is pointless." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SuperTearDownInFinally", + "suppressToolId": "PointlessBooleanExpression", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23684,8 +23684,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Test frameworks", - "index": 94, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -23697,19 +23697,19 @@ ] }, { - "id": "PointlessBooleanExpression", + "id": "SuperTearDownInFinally", "shortDescription": { - "text": "Pointless boolean expression" + "text": "JUnit 3 'super.tearDown()' is not called from 'finally' block" }, "fullDescription": { - "text": "Reports unnecessary or overly complicated boolean expressions. Such expressions include '&&'-ing with 'true', '||'-ing with 'false', equality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified. Example: 'boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;' After the quick-fix is applied: 'boolean a = true;\n boolean b = x;\n boolean c = !x;' Configure the inspection: Use the Ignore named constants in determining pointless expressions option to ignore named constants when determining if an expression is pointless.", - "markdown": "Reports unnecessary or overly complicated boolean expressions.\n\nSuch expressions include `&&`-ing with `true`,\n`||`-ing with `false`,\nequality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified.\n\nExample:\n\n\n boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;\n\nAfter the quick-fix is applied:\n\n\n boolean a = true;\n boolean b = x;\n boolean c = !x;\n\n\nConfigure the inspection:\nUse the **Ignore named constants in determining pointless expressions** option to ignore named constants when determining if an expression is pointless." + "text": "Reports calls of the JUnit 3's 'super.tearDown()' method that are not performed inside a 'finally' block. If an exception is thrown before 'super.tearDown()' is called it could lead to inconsistencies and leaks. Example: 'public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n Files.delete(path);\n super.tearDown();\n }\n }' Improved code: 'public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n try {\n Files.delete(path);\n } finally {\n super.tearDown();\n }\n }\n }'", + "markdown": "Reports calls of the JUnit 3's `super.tearDown()` method that are not performed inside a `finally` block. If an exception is thrown before `super.tearDown()` is called it could lead to inconsistencies and leaks.\n\n**Example:**\n\n\n public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n Files.delete(path);\n super.tearDown();\n }\n }\n\nImproved code:\n\n\n public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n try {\n Files.delete(path);\n } finally {\n super.tearDown();\n }\n }\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "PointlessBooleanExpression", + "suppressToolId": "SuperTearDownInFinally", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23717,8 +23717,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "JVM languages/Test frameworks", + "index": 94, "toolComponent": { "name": "QDJVMC" } @@ -23916,7 +23916,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -23949,7 +23949,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -23994,19 +23994,19 @@ ] }, { - "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": { - "suppressToolId": "AssertWithSideEffects", + "suppressToolId": "WaitOrAwaitWithoutTimeout", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24014,8 +24014,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -24027,19 +24027,19 @@ ] }, { - "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": { - "suppressToolId": "WaitOrAwaitWithoutTimeout", + "suppressToolId": "AssertWithSideEffects", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24047,8 +24047,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -24423,19 +24423,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "IfStatementMissingBreakInLoop", + "suppressToolId": "ThrowableSupplierOnlyThrowException", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24443,8 +24443,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Error handling", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -24456,19 +24456,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "ThrowableSupplierOnlyThrowException", + "suppressToolId": "IfStatementMissingBreakInLoop", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24476,8 +24476,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 15, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -24774,7 +24774,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -24807,7 +24807,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -25347,19 +25347,19 @@ ] }, { - "id": "MethodRefCanBeReplacedWithLambda", + "id": "TailRecursion", "shortDescription": { - "text": "Method reference can be replaced with lambda" + "text": "Tail recursion" }, "fullDescription": { - "text": "Reports method references, like 'MyClass::myMethod' and 'myObject::myMethod', and suggests replacing them with an equivalent lambda expression. Lambda expressions can be easier to modify than method references. Example: 'System.out::println' After the quick-fix is applied: 's -> System.out.println(s)' By default, this inspection does not highlight the code in the editor, but only provides a quick-fix.", - "markdown": "Reports method references, like `MyClass::myMethod` and `myObject::myMethod`, and suggests replacing them with an equivalent lambda expression.\n\nLambda expressions can be easier to modify than method references.\n\nExample:\n\n\n System.out::println\n\nAfter the quick-fix is applied:\n\n\n s -> System.out.println(s)\n\nBy default, this inspection does not highlight the code in the editor, but only provides a quick-fix." + "text": "Reports tail recursion, that is, when a method calls itself as its last action before returning. Tail recursion can always be replaced by looping, which will be considerably faster. Some JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different performance characteristics on different virtual machines. Example: 'int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }' After the quick-fix is applied: 'int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }'", + "markdown": "Reports tail recursion, that is, when a method calls itself as its last action before returning.\n\n\nTail recursion can always be replaced by looping, which will be considerably faster.\nSome JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different\nperformance characteristics on different virtual machines.\n\nExample:\n\n\n int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "suppressToolId": "MethodRefCanBeReplacedWithLambda", + "suppressToolId": "TailRecursion", "ideaSeverity": "INFORMATION", "qodanaSeverity": "Info" } @@ -25367,8 +25367,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -25380,19 +25380,19 @@ ] }, { - "id": "TailRecursion", + "id": "MethodRefCanBeReplacedWithLambda", "shortDescription": { - "text": "Tail recursion" + "text": "Method reference can be replaced with lambda" }, "fullDescription": { - "text": "Reports tail recursion, that is, when a method calls itself as its last action before returning. Tail recursion can always be replaced by looping, which will be considerably faster. Some JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different performance characteristics on different virtual machines. Example: 'int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }' After the quick-fix is applied: 'int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }'", - "markdown": "Reports tail recursion, that is, when a method calls itself as its last action before returning.\n\n\nTail recursion can always be replaced by looping, which will be considerably faster.\nSome JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different\nperformance characteristics on different virtual machines.\n\nExample:\n\n\n int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }\n" + "text": "Reports method references, like 'MyClass::myMethod' and 'myObject::myMethod', and suggests replacing them with an equivalent lambda expression. Lambda expressions can be easier to modify than method references. Example: 'System.out::println' After the quick-fix is applied: 's -> System.out.println(s)' By default, this inspection does not highlight the code in the editor, but only provides a quick-fix.", + "markdown": "Reports method references, like `MyClass::myMethod` and `myObject::myMethod`, and suggests replacing them with an equivalent lambda expression.\n\nLambda expressions can be easier to modify than method references.\n\nExample:\n\n\n System.out::println\n\nAfter the quick-fix is applied:\n\n\n s -> System.out.println(s)\n\nBy default, this inspection does not highlight the code in the editor, but only provides a quick-fix." }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "suppressToolId": "TailRecursion", + "suppressToolId": "MethodRefCanBeReplacedWithLambda", "ideaSeverity": "INFORMATION", "qodanaSeverity": "Info" } @@ -25400,8 +25400,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -25566,7 +25566,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -25665,7 +25665,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -25941,19 +25941,19 @@ ] }, { - "id": "ToArrayCallWithZeroLengthArrayArgument", + "id": "Java9ModuleExportsPackageToItself", "shortDescription": { - "text": "'Collection.toArray()' call style" + "text": "Module exports/opens package to itself" }, "fullDescription": { - "text": "Reports 'Collection.toArray()' calls that are not in the preferred style, and suggests applying the preferred style. There are two styles to convert a collection to an array: A pre-sized array, for example, 'c.toArray(new String[c.size()])' An empty array, for example, 'c.toArray(new String[0])' In older Java versions, using a pre-sized array was recommended, as the reflection call necessary to create an array of proper size was quite slow. However, since late updates of OpenJDK 6, this call was intrinsified, making the performance of the empty array version the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the 'size' and 'toArray' calls. This may result in extra 'null's at the end of the array if the collection was concurrently shrunk during the operation. Use the inspection options to select the preferred style.", - "markdown": "Reports `Collection.toArray()` calls that are not in the preferred style, and suggests applying the preferred style.\n\nThere are two styles to convert a collection to an array:\n\n* A pre-sized array, for example, `c.toArray(new String[c.size()])`\n* An empty array, for example, `c.toArray(new String[0])`\n\nIn older Java versions, using a pre-sized array was recommended, as the reflection\ncall necessary to create an array of proper size was quite slow.\n\nHowever, since late updates of OpenJDK 6, this call was intrinsified, making\nthe performance of the empty array version the same, and sometimes even better, compared\nto the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or\nsynchronized collection as a data race is possible between the `size` and `toArray`\ncalls. This may result in extra `null`s at the end of the array if the collection was concurrently\nshrunk during the operation.\n\nUse the inspection options to select the preferred style." + "text": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from 'module-info.java'. Example: 'module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }' After the quick-fix is applied: 'module main {\n }' This inspection only reports if the language level of the project or module is 9 or higher.", + "markdown": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from `module-info.java`.\n\nExample:\n\n\n module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }\n\nAfter the quick-fix is applied:\n\n\n module main {\n }\n\nThis inspection only reports if the language level of the project or module is 9 or higher." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ToArrayCallWithZeroLengthArrayArgument", + "suppressToolId": "Java9ModuleExportsPackageToItself", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25961,8 +25961,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Visibility", + "index": 57, "toolComponent": { "name": "QDJVMC" } @@ -25974,19 +25974,19 @@ ] }, { - "id": "Java9ModuleExportsPackageToItself", + "id": "ToArrayCallWithZeroLengthArrayArgument", "shortDescription": { - "text": "Module exports/opens package to itself" + "text": "'Collection.toArray()' call style" }, "fullDescription": { - "text": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from 'module-info.java'. Example: 'module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }' After the quick-fix is applied: 'module main {\n }' This inspection only reports if the language level of the project or module is 9 or higher.", - "markdown": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from `module-info.java`.\n\nExample:\n\n\n module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }\n\nAfter the quick-fix is applied:\n\n\n module main {\n }\n\nThis inspection only reports if the language level of the project or module is 9 or higher." + "text": "Reports 'Collection.toArray()' calls that are not in the preferred style, and suggests applying the preferred style. There are two styles to convert a collection to an array: A pre-sized array, for example, 'c.toArray(new String[c.size()])' An empty array, for example, 'c.toArray(new String[0])' In older Java versions, using a pre-sized array was recommended, as the reflection call necessary to create an array of proper size was quite slow. However, since late updates of OpenJDK 6, this call was intrinsified, making the performance of the empty array version the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the 'size' and 'toArray' calls. This may result in extra 'null's at the end of the array if the collection was concurrently shrunk during the operation. Use the inspection options to select the preferred style.", + "markdown": "Reports `Collection.toArray()` calls that are not in the preferred style, and suggests applying the preferred style.\n\nThere are two styles to convert a collection to an array:\n\n* A pre-sized array, for example, `c.toArray(new String[c.size()])`\n* An empty array, for example, `c.toArray(new String[0])`\n\nIn older Java versions, using a pre-sized array was recommended, as the reflection\ncall necessary to create an array of proper size was quite slow.\n\nHowever, since late updates of OpenJDK 6, this call was intrinsified, making\nthe performance of the empty array version the same, and sometimes even better, compared\nto the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or\nsynchronized collection as a data race is possible between the `size` and `toArray`\ncalls. This may result in extra `null`s at the end of the array if the collection was concurrently\nshrunk during the operation.\n\nUse the inspection options to select the preferred style." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "Java9ModuleExportsPackageToItself", + "suppressToolId": "ToArrayCallWithZeroLengthArrayArgument", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25994,8 +25994,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 57, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -26072,6 +26072,72 @@ } ] }, + { + "id": "SortedCollectionWithNonComparableKeys", + "shortDescription": { + "text": "Sorted collection with non-comparable elements" + }, + "fullDescription": { + "text": "Reports construction of sorted collections, for example 'TreeSet', that rely on natural ordering, whose element type doesn't implement the 'Comparable' interface. It's unlikely that such a collection will work properly. A false positive is possible if the collection element type is a non-comparable super-type, but the collection is intended to only hold comparable sub-types. Even if this is the case, it's better to narrow the collection element type or declare the super-type as 'Comparable' because the mentioned approach is error-prone. The inspection also reports cases when the collection element is a type parameter which is not declared as 'extends Comparable'. You can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility). New in 2018.3", + "markdown": "Reports construction of sorted collections, for example `TreeSet`, that rely on natural ordering, whose element type doesn't implement the `Comparable` interface.\n\nIt's unlikely that such a collection will work properly.\n\n\nA false positive is possible if the collection element type is a non-comparable super-type,\nbut the collection is intended to only hold comparable sub-types. Even if this is the case,\nit's better to narrow the collection element type or declare the super-type as `Comparable` because the mentioned approach is error-prone.\n\n\nThe inspection also reports cases when the collection element is a type parameter which is not declared as `extends Comparable`.\nYou can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility).\n\n\nNew in 2018.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SortedCollectionWithNonComparableKeys", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToStaticFieldFromInstanceMethod", + "shortDescription": { + "text": "Assignment to static field from instance context" + }, + "fullDescription": { + "text": "Reports assignment to, or modification of 'static' fields from within an instance method. Although legal, such assignments are tricky to do safely and are often a result of marking fields 'static' inadvertently. Example: 'class Counter {\n private static int count = 0;\n\n void increment() {\n // Warning: updating a static field\n // from an instance method\n count++;\n }\n }'", + "markdown": "Reports assignment to, or modification of `static` fields from within an instance method.\n\nAlthough legal, such assignments are tricky to do\nsafely and are often a result of marking fields `static` inadvertently.\n\n**Example:**\n\n\n class Counter {\n private static int count = 0;\n\n void increment() {\n // Warning: updating a static field\n // from an instance method\n count++;\n }\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToStaticFieldFromInstanceMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "CommentedOutCode", "shortDescription": { @@ -26105,72 +26171,6 @@ } ] }, - { - "id": "SortedCollectionWithNonComparableKeys", - "shortDescription": { - "text": "Sorted collection with non-comparable elements" - }, - "fullDescription": { - "text": "Reports construction of sorted collections, for example 'TreeSet', that rely on natural ordering, whose element type doesn't implement the 'Comparable' interface. It's unlikely that such a collection will work properly. A false positive is possible if the collection element type is a non-comparable super-type, but the collection is intended to only hold comparable sub-types. Even if this is the case, it's better to narrow the collection element type or declare the super-type as 'Comparable' because the mentioned approach is error-prone. The inspection also reports cases when the collection element is a type parameter which is not declared as 'extends Comparable'. You can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility). New in 2018.3", - "markdown": "Reports construction of sorted collections, for example `TreeSet`, that rely on natural ordering, whose element type doesn't implement the `Comparable` interface.\n\nIt's unlikely that such a collection will work properly.\n\n\nA false positive is possible if the collection element type is a non-comparable super-type,\nbut the collection is intended to only hold comparable sub-types. Even if this is the case,\nit's better to narrow the collection element type or declare the super-type as `Comparable` because the mentioned approach is error-prone.\n\n\nThe inspection also reports cases when the collection element is a type parameter which is not declared as `extends Comparable`.\nYou can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility).\n\n\nNew in 2018.3" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "SortedCollectionWithNonComparableKeys", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Probable bugs", - "index": 13, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "AssignmentToStaticFieldFromInstanceMethod", - "shortDescription": { - "text": "Assignment to static field from instance context" - }, - "fullDescription": { - "text": "Reports assignment to, or modification of 'static' fields from within an instance method. Although legal, such assignments are tricky to do safely and are often a result of marking fields 'static' inadvertently. Example: 'class Counter {\n private static int count = 0;\n\n void increment() {\n // Warning: updating a static field\n // from an instance method\n count++;\n }\n }'", - "markdown": "Reports assignment to, or modification of `static` fields from within an instance method.\n\nAlthough legal, such assignments are tricky to do\nsafely and are often a result of marking fields `static` inadvertently.\n\n**Example:**\n\n\n class Counter {\n private static int count = 0;\n\n void increment() {\n // Warning: updating a static field\n // from an instance method\n count++;\n }\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "AssignmentToStaticFieldFromInstanceMethod", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Assignment issues", - "index": 34, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "ClassWithoutLogger", "shortDescription": { @@ -26259,7 +26259,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -26469,19 +26469,19 @@ ] }, { - "id": "SynchronizationOnGetClass", + "id": "DuplicateCondition", "shortDescription": { - "text": "Synchronization on 'getClass()'" + "text": "Duplicate condition" }, "fullDescription": { - "text": "Reports synchronization on a call to 'getClass()'. If the class containing the synchronization is subclassed, the subclass will synchronize on a different class object. Usually the call to 'getClass()' can be replaced with a class literal expression, for example 'String.class'. An even better solution is synchronizing on a 'private static final' lock object, access to which can be completely controlled. Example: 'synchronized(getClass()) {}'", - "markdown": "Reports synchronization on a call to `getClass()`.\n\n\nIf the class containing the synchronization is subclassed, the subclass\nwill\nsynchronize on a different class object. Usually the call to `getClass()` can be replaced with a class literal expression, for\nexample `String.class`. An even better solution is synchronizing on a `private static final` lock object, access to\nwhich can be completely controlled.\n\n**Example:**\n\n synchronized(getClass()) {}\n" + "text": "Reports duplicate conditions in '&&' and '||' expressions and branches of 'if' statements. While sometimes duplicate conditions are intended, in most cases they the result of an oversight. Example: 'boolean result = digit1 != digit2 || digit1 != digit2;' To ignore conditions that may produce side effects, use the Ignore conditions with side effects option. Disabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations. Example: 'if (iterator.next() != null || iterator.next() != null) {\n System.out.println(\"Got it\");\n }' Due to possible side effects of 'iterator.next()' (on the example), the warning will only be triggered if the Ignore conditions with side effects option is disabled.", + "markdown": "Reports duplicate conditions in `&&` and `||` expressions and branches of `if` statements. While sometimes duplicate conditions are intended, in most cases they the result of an oversight.\n\nExample:\n\n\n boolean result = digit1 != digit2 || digit1 != digit2;\n\n\nTo ignore conditions that may produce side effects, use the **Ignore conditions with side effects** option.\nDisabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations.\n\nExample:\n\n\n if (iterator.next() != null || iterator.next() != null) {\n System.out.println(\"Got it\");\n }\n\nDue to possible side effects of `iterator.next()` (on the example), the warning will only be\ntriggered if the **Ignore conditions with side effects** option is disabled." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SynchronizationOnGetClass", + "suppressToolId": "DuplicateCondition", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26489,8 +26489,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -26502,28 +26502,28 @@ ] }, { - "id": "DuplicateCondition", + "id": "RedundantExplicitVariableType", "shortDescription": { - "text": "Duplicate condition" + "text": "Local variable type can be omitted" }, "fullDescription": { - "text": "Reports duplicate conditions in '&&' and '||' expressions and branches of 'if' statements. While sometimes duplicate conditions are intended, in most cases they the result of an oversight. Example: 'boolean result = digit1 != digit2 || digit1 != digit2;' To ignore conditions that may produce side effects, use the Ignore conditions with side effects option. Disabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations. Example: 'if (iterator.next() != null || iterator.next() != null) {\n System.out.println(\"Got it\");\n }' Due to possible side effects of 'iterator.next()' (on the example), the warning will only be triggered if the Ignore conditions with side effects option is disabled.", - "markdown": "Reports duplicate conditions in `&&` and `||` expressions and branches of `if` statements. While sometimes duplicate conditions are intended, in most cases they the result of an oversight.\n\nExample:\n\n\n boolean result = digit1 != digit2 || digit1 != digit2;\n\n\nTo ignore conditions that may produce side effects, use the **Ignore conditions with side effects** option.\nDisabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations.\n\nExample:\n\n\n if (iterator.next() != null || iterator.next() != null) {\n System.out.println(\"Got it\");\n }\n\nDue to possible side effects of `iterator.next()` (on the example), the warning will only be\ntriggered if the **Ignore conditions with side effects** option is disabled." + "text": "Reports redundant local variable types. These types can be inferred from the context and thus replaced with 'var'. Example: 'void test(InputStream s) {\n try (InputStream in = s) {}\n }' After the fix is applied: 'void test(InputStream s) {\n try (var in = s) {}\n }'", + "markdown": "Reports redundant local variable types.\n\nThese types can be inferred from the context and thus replaced with `var`.\n\n**Example:**\n\n\n void test(InputStream s) {\n try (InputStream in = s) {}\n }\n\nAfter the fix is applied:\n\n\n void test(InputStream s) {\n try (var in = s) {}\n }\n" }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "DuplicateCondition", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "RedundantExplicitVariableType", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Java language level migration aids/Java 10", + "index": 109, "toolComponent": { "name": "QDJVMC" } @@ -26535,28 +26535,28 @@ ] }, { - "id": "RedundantExplicitVariableType", + "id": "SynchronizationOnGetClass", "shortDescription": { - "text": "Local variable type can be omitted" + "text": "Synchronization on 'getClass()'" }, "fullDescription": { - "text": "Reports redundant local variable types. These types can be inferred from the context and thus replaced with 'var'. Example: 'void test(InputStream s) {\n try (InputStream in = s) {}\n }' After the fix is applied: 'void test(InputStream s) {\n try (var in = s) {}\n }'", - "markdown": "Reports redundant local variable types.\n\nThese types can be inferred from the context and thus replaced with `var`.\n\n**Example:**\n\n\n void test(InputStream s) {\n try (InputStream in = s) {}\n }\n\nAfter the fix is applied:\n\n\n void test(InputStream s) {\n try (var in = s) {}\n }\n" + "text": "Reports synchronization on a call to 'getClass()'. If the class containing the synchronization is subclassed, the subclass will synchronize on a different class object. Usually the call to 'getClass()' can be replaced with a class literal expression, for example 'String.class'. An even better solution is synchronizing on a 'private static final' lock object, access to which can be completely controlled. Example: 'synchronized(getClass()) {}'", + "markdown": "Reports synchronization on a call to `getClass()`.\n\n\nIf the class containing the synchronization is subclassed, the subclass\nwill\nsynchronize on a different class object. Usually the call to `getClass()` can be replaced with a class literal expression, for\nexample `String.class`. An even better solution is synchronizing on a `private static final` lock object, access to\nwhich can be completely controlled.\n\n**Example:**\n\n synchronized(getClass()) {}\n" }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "RedundantExplicitVariableType", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "SynchronizationOnGetClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 10", - "index": 109, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -26622,7 +26622,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -26865,28 +26865,28 @@ ] }, { - "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": { - "suppressToolId": "ObjectEquality", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "CallToTimeToString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Internationalization", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -26898,28 +26898,28 @@ ] }, { - "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": { - "suppressToolId": "CallToTimeToString", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ObjectEquality", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Internationalization", - "index": 9, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -26952,7 +26952,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -27018,7 +27018,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -27030,19 +27030,19 @@ ] }, { - "id": "SystemRunFinalizersOnExit", + "id": "ClassIndependentOfModule", "shortDescription": { - "text": "Call to 'System.runFinalizersOnExit()'" + "text": "Class independent of its module" }, "fullDescription": { - "text": "Reports calls to 'System.runFinalizersOnExit()'. This call is one of the most dangerous in the Java language. It is inherently non-thread-safe, may result in data corruption, a deadlock, and may affect parts of the program far removed from its call point. It is deprecated and was removed in JDK 11, and its use is strongly discouraged. This inspection only reports if the language level of the project or module is 10 or lower.", - "markdown": "Reports calls to `System.runFinalizersOnExit()`.\n\n\nThis call is one of the most dangerous in the Java language. It is inherently non-thread-safe,\nmay result in data corruption, a deadlock, and may affect parts of the program far removed from its call point.\nIt is deprecated and was removed in JDK 11, and its use is strongly discouraged.\n\nThis inspection only reports if the language level of the project or module is 10 or lower." + "text": "Reports classes that: do not depend on any other class in their module are not a dependency for any other class in their module Such classes are an indication of ad-hoc or incoherent modularisation strategies, and may often profitably be moved. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that:\n\n* do not depend on any other class in their module\n* are not a dependency for any other class in their module\n\nSuch classes are an indication of ad-hoc or incoherent modularisation strategies,\nand may often profitably be moved.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CallToSystemRunFinalizersOnExit", + "suppressToolId": "ClassIndependentOfModule", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27050,8 +27050,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Modularization issues", + "index": 67, "toolComponent": { "name": "QDJVMC" } @@ -27063,19 +27063,19 @@ ] }, { - "id": "ClassIndependentOfModule", + "id": "SystemRunFinalizersOnExit", "shortDescription": { - "text": "Class independent of its module" + "text": "Call to 'System.runFinalizersOnExit()'" }, "fullDescription": { - "text": "Reports classes that: do not depend on any other class in their module are not a dependency for any other class in their module Such classes are an indication of ad-hoc or incoherent modularisation strategies, and may often profitably be moved. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports classes that:\n\n* do not depend on any other class in their module\n* are not a dependency for any other class in their module\n\nSuch classes are an indication of ad-hoc or incoherent modularisation strategies,\nand may often profitably be moved.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports calls to 'System.runFinalizersOnExit()'. This call is one of the most dangerous in the Java language. It is inherently non-thread-safe, may result in data corruption, a deadlock, and may affect parts of the program far removed from its call point. It is deprecated and was removed in JDK 11, and its use is strongly discouraged. This inspection only reports if the language level of the project or module is 10 or lower.", + "markdown": "Reports calls to `System.runFinalizersOnExit()`.\n\n\nThis call is one of the most dangerous in the Java language. It is inherently non-thread-safe,\nmay result in data corruption, a deadlock, and may affect parts of the program far removed from its call point.\nIt is deprecated and was removed in JDK 11, and its use is strongly discouraged.\n\nThis inspection only reports if the language level of the project or module is 10 or lower." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassIndependentOfModule", + "suppressToolId": "CallToSystemRunFinalizersOnExit", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27083,8 +27083,8 @@ "relationships": [ { "target": { - "id": "Java/Modularization issues", - "index": 67, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -27612,7 +27612,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -27987,19 +27987,19 @@ ] }, { - "id": "InstantiationOfUtilityClass", + "id": "MapReplaceableByEnumMap", "shortDescription": { - "text": "Instantiation of utility class" + "text": "'Map' can be replaced with 'EnumMap'" }, "fullDescription": { - "text": "Reports instantiation of utility classes using the 'new' keyword. In utility classes, all fields and methods are 'static'. Instantiation of such classes is most likely unnecessary and indicates a mistake. Example: 'class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }' To prevent utility classes from being instantiated, it's recommended to use a 'private' constructor.", - "markdown": "Reports instantiation of utility classes using the `new` keyword.\n\n\nIn utility classes, all fields and methods are `static`.\nInstantiation of such classes is most likely unnecessary and indicates a mistake.\n\n**Example:**\n\n\n class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }\n\n\nTo prevent utility classes from being instantiated,\nit's recommended to use a `private` constructor." + "text": "Reports instantiations of 'java.util.Map' objects whose key types are enumerated classes. Such 'java.util.Map' objects can be replaced with 'java.util.EnumMap' objects. 'java.util.EnumMap' implementations can be much more efficient because the underlying data structure is a simple array. Example: 'Map myEnums = new HashMap<>();' After the quick-fix is applied: 'Map myEnums = new EnumMap<>(MyEnum.class);'", + "markdown": "Reports instantiations of `java.util.Map` objects whose key types are enumerated classes. Such `java.util.Map` objects can be replaced with `java.util.EnumMap` objects.\n\n\n`java.util.EnumMap` implementations can be much more efficient\nbecause the underlying data structure is a simple array.\n\n**Example:**\n\n\n Map myEnums = new HashMap<>();\n\nAfter the quick-fix is applied:\n\n\n Map myEnums = new EnumMap<>(MyEnum.class);\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InstantiationOfUtilityClass", + "suppressToolId": "MapReplaceableByEnumMap", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28007,8 +28007,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -28020,19 +28020,19 @@ ] }, { - "id": "MapReplaceableByEnumMap", + "id": "InstantiationOfUtilityClass", "shortDescription": { - "text": "'Map' can be replaced with 'EnumMap'" + "text": "Instantiation of utility class" }, "fullDescription": { - "text": "Reports instantiations of 'java.util.Map' objects whose key types are enumerated classes. Such 'java.util.Map' objects can be replaced with 'java.util.EnumMap' objects. 'java.util.EnumMap' implementations can be much more efficient because the underlying data structure is a simple array. Example: 'Map myEnums = new HashMap<>();' After the quick-fix is applied: 'Map myEnums = new EnumMap<>(MyEnum.class);'", - "markdown": "Reports instantiations of `java.util.Map` objects whose key types are enumerated classes. Such `java.util.Map` objects can be replaced with `java.util.EnumMap` objects.\n\n\n`java.util.EnumMap` implementations can be much more efficient\nbecause the underlying data structure is a simple array.\n\n**Example:**\n\n\n Map myEnums = new HashMap<>();\n\nAfter the quick-fix is applied:\n\n\n Map myEnums = new EnumMap<>(MyEnum.class);\n" + "text": "Reports instantiation of utility classes using the 'new' keyword. In utility classes, all fields and methods are 'static'. Instantiation of such classes is most likely unnecessary and indicates a mistake. Example: 'class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }' To prevent utility classes from being instantiated, it's recommended to use a 'private' constructor.", + "markdown": "Reports instantiation of utility classes using the `new` keyword.\n\n\nIn utility classes, all fields and methods are `static`.\nInstantiation of such classes is most likely unnecessary and indicates a mistake.\n\n**Example:**\n\n\n class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }\n\n\nTo prevent utility classes from being instantiated,\nit's recommended to use a `private` constructor." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "MapReplaceableByEnumMap", + "suppressToolId": "InstantiationOfUtilityClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28040,8 +28040,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -28206,7 +28206,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -28272,7 +28272,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -28350,19 +28350,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "ConditionalBreakInInfiniteLoop", + "suppressToolId": "StringConcatenationInFormatCall", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28370,8 +28370,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -28383,19 +28383,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "StringConcatenationInFormatCall", + "suppressToolId": "ConditionalBreakInInfiniteLoop", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28403,8 +28403,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -28449,19 +28449,19 @@ ] }, { - "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": { - "suppressToolId": "WaitWhileHoldingTwoLocks", + "suppressToolId": "RedundantClassCall", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28469,8 +28469,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Verbose or redundant code constructs", + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -28482,19 +28482,19 @@ ] }, { - "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": { - "suppressToolId": "RedundantClassCall", + "suppressToolId": "WaitWhileHoldingTwoLocks", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28502,8 +28502,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 37, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -28668,7 +28668,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -28746,19 +28746,19 @@ ] }, { - "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": { - "suppressToolId": "DefaultAnnotationParam", + "suppressToolId": "WhileLoopSpinsOnField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28766,8 +28766,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 14, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -28779,19 +28779,19 @@ ] }, { - "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": { - "suppressToolId": "WhileLoopSpinsOnField", + "suppressToolId": "DefaultAnnotationParam", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28799,8 +28799,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Declaration redundancy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -28833,7 +28833,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -28866,7 +28866,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -29010,19 +29010,19 @@ ] }, { - "id": "BadExceptionCaught", + "id": "IdempotentLoopBody", "shortDescription": { - "text": "Prohibited 'Exception' caught" + "text": "Idempotent loop body" }, "fullDescription": { - "text": "Reports 'catch' clauses that catch an inappropriate exception. Some exceptions, for example 'java.lang.NullPointerException' or 'java.lang.IllegalMonitorStateException', represent programming errors and therefore almost certainly should not be caught in production code. Example: 'try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }' Use the Prohibited exceptions list to specify which exceptions should be reported.", - "markdown": "Reports `catch` clauses that catch an inappropriate exception.\n\nSome exceptions, for example\n`java.lang.NullPointerException` or\n`java.lang.IllegalMonitorStateException`, represent programming errors\nand therefore almost certainly should not be caught in production code.\n\n**Example:**\n\n\n try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported." + "text": "Reports loops whose second and all subsequent iterations do not produce any additional side effects other than the one produced by the first iteration, which can indicate a programming error. Such loops may iterate only zero, one, or infinite number of times. If the infinite number of times case is unreachable, such a loop can be replaced with an 'if' statement. Otherwise, there's a possibility that the program can get stuck. Example: 'public void foo(String baseName, String names) {\n int suffix = 1;\n String name = baseName;\n while (names.contains(name)) {\n // error: suffix is not updated making loop body idempotent\n name = baseName + suffix;\n }\n }' New in 2018.1", + "markdown": "Reports loops whose second and all subsequent iterations do not produce any additional side effects other than the one produced by the first iteration, which can indicate a programming error.\n\nSuch loops may iterate only zero, one, or infinite number of times.\nIf the infinite number of times case is unreachable, such a loop can be replaced with an `if` statement.\nOtherwise, there's a possibility that the program can get stuck.\n\nExample:\n\n\n public void foo(String baseName, String names) {\n int suffix = 1;\n String name = baseName;\n while (names.contains(name)) {\n // error: suffix is not updated making loop body idempotent\n name = baseName + suffix;\n }\n }\n\nNew in 2018.1" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ProhibitedExceptionCaught", + "suppressToolId": "IdempotentLoopBody", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29030,8 +29030,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 15, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -29043,19 +29043,19 @@ ] }, { - "id": "IdempotentLoopBody", + "id": "BadExceptionCaught", "shortDescription": { - "text": "Idempotent loop body" + "text": "Prohibited 'Exception' caught" }, "fullDescription": { - "text": "Reports loops whose second and all subsequent iterations do not produce any additional side effects other than the one produced by the first iteration, which can indicate a programming error. Such loops may iterate only zero, one, or infinite number of times. If the infinite number of times case is unreachable, such a loop can be replaced with an 'if' statement. Otherwise, there's a possibility that the program can get stuck. Example: 'public void foo(String baseName, String names) {\n int suffix = 1;\n String name = baseName;\n while (names.contains(name)) {\n // error: suffix is not updated making loop body idempotent\n name = baseName + suffix;\n }\n }' New in 2018.1", - "markdown": "Reports loops whose second and all subsequent iterations do not produce any additional side effects other than the one produced by the first iteration, which can indicate a programming error.\n\nSuch loops may iterate only zero, one, or infinite number of times.\nIf the infinite number of times case is unreachable, such a loop can be replaced with an `if` statement.\nOtherwise, there's a possibility that the program can get stuck.\n\nExample:\n\n\n public void foo(String baseName, String names) {\n int suffix = 1;\n String name = baseName;\n while (names.contains(name)) {\n // error: suffix is not updated making loop body idempotent\n name = baseName + suffix;\n }\n }\n\nNew in 2018.1" + "text": "Reports 'catch' clauses that catch an inappropriate exception. Some exceptions, for example 'java.lang.NullPointerException' or 'java.lang.IllegalMonitorStateException', represent programming errors and therefore almost certainly should not be caught in production code. Example: 'try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }' Use the Prohibited exceptions list to specify which exceptions should be reported.", + "markdown": "Reports `catch` clauses that catch an inappropriate exception.\n\nSome exceptions, for example\n`java.lang.NullPointerException` or\n`java.lang.IllegalMonitorStateException`, represent programming errors\nand therefore almost certainly should not be caught in production code.\n\n**Example:**\n\n\n try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "IdempotentLoopBody", + "suppressToolId": "ProhibitedExceptionCaught", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29063,8 +29063,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Error handling", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -29130,7 +29130,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -29295,7 +29295,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -29373,19 +29373,19 @@ ] }, { - "id": "AtomicFieldUpdaterNotStaticFinal", + "id": "FieldNamingConvention", "shortDescription": { - "text": "'AtomicFieldUpdater' field not declared 'static final'" + "text": "Field naming convention" }, "fullDescription": { - "text": "Reports fields of types: 'java.util.concurrent.atomic.AtomicLongFieldUpdater' 'java.util.concurrent.atomic.AtomicIntegerFieldUpdater' 'java.util.concurrent.atomic.AtomicReferenceFieldUpdater' that are not 'static final'. Because only one atomic field updater is needed for updating a 'volatile' field in all instances of a class, it can almost always be 'static'. Making the updater 'final' allows the JVM to optimize access for improved performance. Example: 'class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }' After the quick-fix is applied: 'class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }'", - "markdown": "Reports fields of types:\n\n* `java.util.concurrent.atomic.AtomicLongFieldUpdater`\n* `java.util.concurrent.atomic.AtomicIntegerFieldUpdater`\n* `java.util.concurrent.atomic.AtomicReferenceFieldUpdater`\n\nthat are not `static final`. Because only one atomic field updater is needed for updating a `volatile` field in all instances of a class, it can almost always be `static`.\n\nMaking the updater `final` allows the JVM to optimize access for improved performance.\n\n**Example:**\n\n\n class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n" + "text": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant produces a warning because the length of its name is 3, which is less than 5: 'public static final int MAX = 42;'. A quick-fix that renames such fields is available only in the editor. Configure the inspection: Use the list in the Options section to specify which fields should be checked. Deselect the checkboxes for the fields for which you want to skip the check. For each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the provided input fields. Specify 0 in the length fields to skip the corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format.", + "markdown": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant\nproduces a warning because the length of its name is 3, which is less than 5: `public static final int MAX = 42;`.\n\nA quick-fix that renames such fields is available only in the editor.\n\nConfigure the inspection:\n\nUse the list in the **Options** section to specify which fields should be checked. Deselect the checkboxes for the fields for which\nyou want to skip the check.\n\nFor each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the\nprovided input fields.\nSpecify **0** in the length fields to skip the corresponding checks.\n\nRegular expressions should be specified in the standard\n`java.util.regex` format." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "AtomicFieldUpdaterNotStaticFinal", + "suppressToolId": "FieldNamingConvention", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29393,8 +29393,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Naming conventions", + "index": 51, "toolComponent": { "name": "QDJVMC" } @@ -29406,19 +29406,19 @@ ] }, { - "id": "FieldNamingConvention", + "id": "AtomicFieldUpdaterNotStaticFinal", "shortDescription": { - "text": "Field naming convention" + "text": "'AtomicFieldUpdater' field not declared 'static final'" }, "fullDescription": { - "text": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant produces a warning because the length of its name is 3, which is less than 5: 'public static final int MAX = 42;'. A quick-fix that renames such fields is available only in the editor. Configure the inspection: Use the list in the Options section to specify which fields should be checked. Deselect the checkboxes for the fields for which you want to skip the check. For each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the provided input fields. Specify 0 in the length fields to skip the corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format.", - "markdown": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant\nproduces a warning because the length of its name is 3, which is less than 5: `public static final int MAX = 42;`.\n\nA quick-fix that renames such fields is available only in the editor.\n\nConfigure the inspection:\n\nUse the list in the **Options** section to specify which fields should be checked. Deselect the checkboxes for the fields for which\nyou want to skip the check.\n\nFor each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the\nprovided input fields.\nSpecify **0** in the length fields to skip the corresponding checks.\n\nRegular expressions should be specified in the standard\n`java.util.regex` format." + "text": "Reports fields of types: 'java.util.concurrent.atomic.AtomicLongFieldUpdater' 'java.util.concurrent.atomic.AtomicIntegerFieldUpdater' 'java.util.concurrent.atomic.AtomicReferenceFieldUpdater' that are not 'static final'. Because only one atomic field updater is needed for updating a 'volatile' field in all instances of a class, it can almost always be 'static'. Making the updater 'final' allows the JVM to optimize access for improved performance. Example: 'class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }' After the quick-fix is applied: 'class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }'", + "markdown": "Reports fields of types:\n\n* `java.util.concurrent.atomic.AtomicLongFieldUpdater`\n* `java.util.concurrent.atomic.AtomicIntegerFieldUpdater`\n* `java.util.concurrent.atomic.AtomicReferenceFieldUpdater`\n\nthat are not `static final`. Because only one atomic field updater is needed for updating a `volatile` field in all instances of a class, it can almost always be `static`.\n\nMaking the updater `final` allows the JVM to optimize access for improved performance.\n\n**Example:**\n\n\n class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "FieldNamingConvention", + "suppressToolId": "AtomicFieldUpdaterNotStaticFinal", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29426,8 +29426,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions", - "index": 51, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -29526,7 +29526,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -29559,7 +29559,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -29592,7 +29592,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -29604,19 +29604,19 @@ ] }, { - "id": "ClassWithTooManyDependents", + "id": "RecordStoreResource", "shortDescription": { - "text": "Class with too many dependents" + "text": "'RecordStore' opened but not safely closed" }, "fullDescription": { - "text": "Reports a class on which too many other classes are directly dependent. Any modification to such a class may require changing many other classes, which may be expensive. Only top-level classes are reported. Use the field below to specify the maximum allowed number of dependents for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports a class on which too many other classes are directly dependent.\n\nAny modification to such a class may require changing many other classes, which may be expensive.\n\nOnly top-level classes are reported.\n\nUse the field below to specify the maximum allowed number of dependents for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports Java ME 'javax.microedition.rms.RecordStore' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }'", + "markdown": "Reports Java ME `javax.microedition.rms.RecordStore` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block.\n\nSuch resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassWithTooManyDependents", + "suppressToolId": "RecordStoreOpenedButNotSafelyClosed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29624,8 +29624,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 87, + "id": "Java/Performance/Embedded", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -29637,19 +29637,19 @@ ] }, { - "id": "RecordStoreResource", + "id": "ClassWithTooManyDependents", "shortDescription": { - "text": "'RecordStore' opened but not safely closed" + "text": "Class with too many dependents" }, "fullDescription": { - "text": "Reports Java ME 'javax.microedition.rms.RecordStore' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }'", - "markdown": "Reports Java ME `javax.microedition.rms.RecordStore` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block.\n\nSuch resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }\n" + "text": "Reports a class on which too many other classes are directly dependent. Any modification to such a class may require changing many other classes, which may be expensive. Only top-level classes are reported. Use the field below to specify the maximum allowed number of dependents for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports a class on which too many other classes are directly dependent.\n\nAny modification to such a class may require changing many other classes, which may be expensive.\n\nOnly top-level classes are reported.\n\nUse the field below to specify the maximum allowed number of dependents for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "RecordStoreOpenedButNotSafelyClosed", + "suppressToolId": "ClassWithTooManyDependents", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29657,8 +29657,8 @@ "relationships": [ { "target": { - "id": "Java/Performance/Embedded", - "index": 19, + "id": "Java/Dependency issues", + "index": 87, "toolComponent": { "name": "QDJVMC" } @@ -29670,28 +29670,28 @@ ] }, { - "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": { - "suppressToolId": "ObjectsEqualsCanBeSimplified", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "WrongPackageStatement", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -29703,28 +29703,28 @@ ] }, { - "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": { - "suppressToolId": "WrongPackageStatement", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "suppressToolId": "ObjectsEqualsCanBeSimplified", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -30087,7 +30087,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -30132,19 +30132,19 @@ ] }, { - "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": true, "level": "warning", "parameters": { - "suppressToolId": "NonSerializableClassWithSerialVersionUID", + "suppressToolId": "synchronization", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -30152,8 +30152,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 18, + "id": "Java/Compiler issues", + "index": 88, "toolComponent": { "name": "QDJVMC" } @@ -30165,19 +30165,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "synchronization", + "suppressToolId": "NonSerializableClassWithSerialVersionUID", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -30185,8 +30185,8 @@ "relationships": [ { "target": { - "id": "Java/Compiler issues", - "index": 88, + "id": "Java/Serialization issues", + "index": 18, "toolComponent": { "name": "QDJVMC" } @@ -30219,7 +30219,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -30318,7 +30318,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -30384,7 +30384,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -30450,7 +30450,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -30813,7 +30813,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -31089,19 +31089,19 @@ ] }, { - "id": "SimplifiableAssertion", + "id": "InterfaceMethodClashesWithObject", "shortDescription": { - "text": "Simplifiable assertion" + "text": "Interface method clashes with method in 'Object'" }, "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 interface methods that clash with the protected methods 'clone()' and 'finalize()' from the 'java.lang.Object' class. In an interface, it is possible to declare these methods with a return type that is incompatible with the 'java.lang.Object' methods. A class that implements such an interface will not be compilable. When the interface is functional, it remains possible to create a lambda from it, but this is not recommended. Example: '// Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }'", + "markdown": "Reports interface methods that clash with the **protected** methods `clone()` and `finalize()` from the `java.lang.Object` class.\n\nIn an interface, it is possible to declare these methods with a return type that is incompatible with the `java.lang.Object` methods.\nA class that implements such an interface will not be compilable.\nWhen the interface is functional, it remains possible to create a lambda from it, but this is not recommended.\n\nExample:\n\n\n // Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }\n" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SimplifiableAssertion", + "suppressToolId": "InterfaceMethodClashesWithObject", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31109,8 +31109,8 @@ "relationships": [ { "target": { - "id": "Java/Test frameworks", - "index": 95, + "id": "Java/Abstraction issues", + "index": 76, "toolComponent": { "name": "QDJVMC" } @@ -31155,19 +31155,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "InterfaceMethodClashesWithObject", + "suppressToolId": "SimplifiableAssertion", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31175,8 +31175,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 76, + "id": "Java/Test frameworks", + "index": 95, "toolComponent": { "name": "QDJVMC" } @@ -31452,19 +31452,19 @@ ] }, { - "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": { - "suppressToolId": "UseOfSunClasses", + "suppressToolId": "ComparatorMethodParameterNotUsed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31472,8 +31472,8 @@ "relationships": [ { "target": { - "id": "Java/Portability", - "index": 7, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -31485,19 +31485,19 @@ ] }, { - "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": { - "suppressToolId": "ComparatorMethodParameterNotUsed", + "suppressToolId": "UseOfSunClasses", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31505,8 +31505,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Portability", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -31683,19 +31683,19 @@ ] }, { - "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": { - "suppressToolId": "UseOfStringTokenizer", + "suppressToolId": "PrimitiveArrayArgumentToVarargsMethod", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31703,8 +31703,8 @@ "relationships": [ { "target": { - "id": "Java/Internationalization", - "index": 9, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -31749,19 +31749,19 @@ ] }, { - "id": "PrimitiveArrayArgumentToVariableArgMethod", + "id": "StringTokenizer", "shortDescription": { - "text": "Confusing primitive array argument to varargs method" + "text": "Use of 'StringTokenizer'" }, "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 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": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "PrimitiveArrayArgumentToVarargsMethod", + "suppressToolId": "UseOfStringTokenizer", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31769,8 +31769,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Internationalization", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -31935,7 +31935,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -32100,7 +32100,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -32232,7 +32232,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -32331,7 +32331,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -32541,19 +32541,19 @@ ] }, { - "id": "ExceptionPackage", + "id": "CyclicClassDependency", "shortDescription": { - "text": "Exception package" + "text": "Cyclic class dependency" }, "fullDescription": { - "text": "Reports packages that only contain classes that extend 'java.lang.Throwable', either directly or indirectly. Although exceptions usually don't depend on other classes for their implementation, they are normally not used separately. It is often a better design to locate exceptions in the same package as the classes that use them. 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 only contain classes that extend `java.lang.Throwable`, either directly or indirectly.\n\nAlthough exceptions usually don't depend on other classes for their implementation, they are normally not used separately.\nIt is often a better design to locate exceptions in the same package as the classes that use them.\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 classes that are mutually or cyclically dependent on other classes. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that are mutually or cyclically dependent on other classes.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ExceptionPackage", + "suppressToolId": "CyclicClassDependency", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32561,8 +32561,8 @@ "relationships": [ { "target": { - "id": "Java/Packaging issues", - "index": 36, + "id": "Java/Dependency issues", + "index": 87, "toolComponent": { "name": "QDJVMC" } @@ -32574,19 +32574,19 @@ ] }, { - "id": "CyclicClassDependency", + "id": "ExceptionPackage", "shortDescription": { - "text": "Cyclic class dependency" + "text": "Exception package" }, "fullDescription": { - "text": "Reports classes that are mutually or cyclically dependent on other classes. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports classes that are mutually or cyclically dependent on other classes.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports packages that only contain classes that extend 'java.lang.Throwable', either directly or indirectly. Although exceptions usually don't depend on other classes for their implementation, they are normally not used separately. It is often a better design to locate exceptions in the same package as the classes that use them. 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 only contain classes that extend `java.lang.Throwable`, either directly or indirectly.\n\nAlthough exceptions usually don't depend on other classes for their implementation, they are normally not used separately.\nIt is often a better design to locate exceptions in the same package as the classes that use them.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CyclicClassDependency", + "suppressToolId": "ExceptionPackage", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32594,8 +32594,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 87, + "id": "Java/Packaging issues", + "index": 36, "toolComponent": { "name": "QDJVMC" } @@ -32904,19 +32904,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryToStringCall", + "suppressToolId": "SuppressionAnnotation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32924,8 +32924,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Code maturity", + "index": 50, "toolComponent": { "name": "QDJVMC" } @@ -32937,19 +32937,19 @@ ] }, { - "id": "ClassOnlyUsedInOnePackage", + "id": "UnnecessaryToStringCall", "shortDescription": { - "text": "Class only used from one other package" + "text": "Unnecessary call to 'toString()'" }, "fullDescription": { - "text": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null.", + "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods, and the explicit call to `toString()` is not needed.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassOnlyUsedInOnePackage", + "suppressToolId": "UnnecessaryToStringCall", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32957,8 +32957,8 @@ "relationships": [ { "target": { - "id": "Java/Packaging issues", - "index": 36, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -32970,19 +32970,19 @@ ] }, { - "id": "SuppressionAnnotation", + "id": "ClassOnlyUsedInOnePackage", "shortDescription": { - "text": "Inspection suppression annotation" + "text": "Class only used from one other package" }, "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 classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SuppressionAnnotation", + "suppressToolId": "ClassOnlyUsedInOnePackage", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32990,8 +32990,8 @@ "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 50, + "id": "Java/Packaging issues", + "index": 36, "toolComponent": { "name": "QDJVMC" } @@ -33069,19 +33069,19 @@ ] }, { - "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": { - "suppressToolId": "NumericCastThatLosesPrecision", + "suppressToolId": "SynchronizeOnNonFinalField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -33089,8 +33089,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues/Cast", - "index": 101, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -33102,19 +33102,19 @@ ] }, { - "id": "SynchronizeOnNonFinalField", + "id": "CastThatLosesPrecision", "shortDescription": { - "text": "Synchronization on a non-final field" + "text": "Numeric cast that loses precision" }, "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 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": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SynchronizeOnNonFinalField", + "suppressToolId": "NumericCastThatLosesPrecision", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -33122,8 +33122,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Numeric issues/Cast", + "index": 101, "toolComponent": { "name": "QDJVMC" } @@ -33189,7 +33189,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -33300,19 +33300,19 @@ ] }, { - "id": "ThreadWithDefaultRunMethod", + "id": "ThreeNegationsPerMethod", "shortDescription": { - "text": "Instantiating a 'Thread' with default 'run()' method" + "text": "Method with more than three negations" }, "fullDescription": { - "text": "Reports instantiations of 'Thread' or an inheritor without specifying a 'Runnable' parameter or overriding the 'run()' method. Such threads do nothing useful. Example: 'new Thread().start();'", - "markdown": "Reports instantiations of `Thread` or an inheritor without specifying a `Runnable` parameter or overriding the `run()` method. Such threads do nothing useful.\n\n**Example:**\n\n\n new Thread().start();\n" + "text": "Reports methods with three or more negations. Such methods may be confusing. Example: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }' Without negations, the method becomes easier to understand: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }' Configure the inspection: Use the Ignore negations in 'equals()' methods option to disable the inspection within 'equals()' methods. Use the Ignore negations in 'assert' statements to disable the inspection within 'assert' statements.", + "markdown": "Reports methods with three or more negations. Such methods may be confusing.\n\n**Example:**\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }\n\nWithout negations, the method becomes easier to understand:\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }\n\nConfigure the inspection:\n\n* Use the **Ignore negations in 'equals()' methods** option to disable the inspection within `equals()` methods.\n* Use the **Ignore negations in 'assert' statements** to disable the inspection within `assert` statements." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InstantiatingAThreadWithDefaultRunMethod", + "suppressToolId": "MethodWithMoreThanThreeNegations", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -33320,8 +33320,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Method metrics", + "index": 93, "toolComponent": { "name": "QDJVMC" } @@ -33333,19 +33333,19 @@ ] }, { - "id": "ThreeNegationsPerMethod", + "id": "ThreadWithDefaultRunMethod", "shortDescription": { - "text": "Method with more than three negations" + "text": "Instantiating a 'Thread' with default 'run()' method" }, "fullDescription": { - "text": "Reports methods with three or more negations. Such methods may be confusing. Example: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }' Without negations, the method becomes easier to understand: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }' Configure the inspection: Use the Ignore negations in 'equals()' methods option to disable the inspection within 'equals()' methods. Use the Ignore negations in 'assert' statements to disable the inspection within 'assert' statements.", - "markdown": "Reports methods with three or more negations. Such methods may be confusing.\n\n**Example:**\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }\n\nWithout negations, the method becomes easier to understand:\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }\n\nConfigure the inspection:\n\n* Use the **Ignore negations in 'equals()' methods** option to disable the inspection within `equals()` methods.\n* Use the **Ignore negations in 'assert' statements** to disable the inspection within `assert` statements." + "text": "Reports instantiations of 'Thread' or an inheritor without specifying a 'Runnable' parameter or overriding the 'run()' method. Such threads do nothing useful. Example: 'new Thread().start();'", + "markdown": "Reports instantiations of `Thread` or an inheritor without specifying a `Runnable` parameter or overriding the `run()` method. Such threads do nothing useful.\n\n**Example:**\n\n\n new Thread().start();\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "MethodWithMoreThanThreeNegations", + "suppressToolId": "InstantiatingAThreadWithDefaultRunMethod", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -33353,8 +33353,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 93, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -33531,19 +33531,19 @@ ] }, { - "id": "AssignmentToSuperclassField", + "id": "SuspiciousIndentAfterControlStatement", "shortDescription": { - "text": "Constructor assigns value to field defined in superclass" + "text": "Suspicious indentation after control statement without braces" }, "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 suspicious indentation of statements after a control statement without braces. Such indentation can make it look like the statement is inside the control statement, when in fact it will be executed unconditionally after the control statement. Example: 'class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }'", + "markdown": "Reports suspicious indentation of statements after a control statement without braces.\n\n\nSuch indentation can make it look like the statement is inside the control statement,\nwhen in fact it will be executed unconditionally after the control statement.\n\n**Example:**\n\n\n class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "AssignmentToSuperclassField", + "suppressToolId": "SuspiciousIndentAfterControlStatement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -33551,8 +33551,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 34, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -33564,19 +33564,19 @@ ] }, { - "id": "SuspiciousIndentAfterControlStatement", + "id": "AssignmentToSuperclassField", "shortDescription": { - "text": "Suspicious indentation after control statement without braces" + "text": "Constructor assigns value to field defined in superclass" }, "fullDescription": { - "text": "Reports suspicious indentation of statements after a control statement without braces. Such indentation can make it look like the statement is inside the control statement, when in fact it will be executed unconditionally after the control statement. Example: 'class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }'", - "markdown": "Reports suspicious indentation of statements after a control statement without braces.\n\n\nSuch indentation can make it look like the statement is inside the control statement,\nwhen in fact it will be executed unconditionally after the control statement.\n\n**Example:**\n\n\n class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }\n" + "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": { - "suppressToolId": "SuspiciousIndentAfterControlStatement", + "suppressToolId": "AssignmentToSuperclassField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -33584,8 +33584,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Assignment issues", + "index": 34, "toolComponent": { "name": "QDJVMC" } @@ -33618,7 +33618,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -33695,39 +33695,6 @@ } ] }, - { - "id": "SuspiciousDateFormat", - "shortDescription": { - "text": "Suspicious date format pattern" - }, - "fullDescription": { - "text": "Reports date format patterns that are likely used by mistake. The following patterns are reported: Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December. Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended. Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended. Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended. Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended. Examples: 'new SimpleDateFormat(\"YYYY-MM-dd\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"yyyy-MM-DD\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"HH:MM\")': likely '\"HH:mm\"' was intended. New in 2020.1", - "markdown": "Reports date format patterns that are likely used by mistake.\n\nThe following patterns are reported:\n\n* Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December.\n* Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended.\n* Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended.\n* Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended.\n* Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended.\n\n\nExamples: \n\n`new SimpleDateFormat(\"YYYY-MM-dd\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"yyyy-MM-DD\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"HH:MM\")`: likely `\"HH:mm\"` was intended.\n\nNew in 2020.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "SuspiciousDateFormat", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Probable bugs", - "index": 13, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "ClassNewInstance", "shortDescription": { @@ -33794,6 +33761,39 @@ } ] }, + { + "id": "SuspiciousDateFormat", + "shortDescription": { + "text": "Suspicious date format pattern" + }, + "fullDescription": { + "text": "Reports date format patterns that are likely used by mistake. The following patterns are reported: Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December. Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended. Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended. Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended. Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended. Examples: 'new SimpleDateFormat(\"YYYY-MM-dd\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"yyyy-MM-DD\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"HH:MM\")': likely '\"HH:mm\"' was intended. New in 2020.1", + "markdown": "Reports date format patterns that are likely used by mistake.\n\nThe following patterns are reported:\n\n* Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December.\n* Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended.\n* Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended.\n* Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended.\n* Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended.\n\n\nExamples: \n\n`new SimpleDateFormat(\"YYYY-MM-dd\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"yyyy-MM-DD\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"HH:MM\")`: likely `\"HH:mm\"` was intended.\n\nNew in 2020.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousDateFormat", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "LimitedScopeInnerClass", "shortDescription": { @@ -33849,7 +33849,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -33882,7 +33882,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -33948,7 +33948,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -34278,7 +34278,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -34323,28 +34323,28 @@ ] }, { - "id": "SwitchExpressionCanBePushedDown", + "id": "NonExtendableApiUsage", "shortDescription": { - "text": "Common subexpression can be extracted from 'switch'" + "text": "Class, interface, or method should not be extended" }, "fullDescription": { - "text": "Reports switch expressions and statements where every branch has a common subexpression, and the 'switch' can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method. Example: 'switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }' After the quick-fix is applied: 'System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });' This inspection is applicable only for enhanced switches with arrow syntax. New in 2022.3", - "markdown": "Reports switch expressions and statements where every branch has a common subexpression, and the `switch` can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method.\n\nExample:\n\n\n switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }\n\nAfter the quick-fix is applied:\n\n\n System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });\n\n\nThis inspection is applicable only for enhanced switches with arrow syntax.\n\nNew in 2022.3" + "text": "Reports classes, interfaces and methods that extend, implement, or override API elements marked with '@ApiStatus.NonExtendable'. The '@ApiStatus.NonExtendable' annotation indicates that the class, interface, or method must not be extended, implemented, or overridden. Since casting such interfaces and classes to the internal library implementation is rather common, if a client provides a different implementation, you will get 'ClassCastException'. Adding new abstract methods to such classes and interfaces will break the compatibility with the client's implementations.", + "markdown": "Reports classes, interfaces and methods that extend, implement, or override API elements marked with `@ApiStatus.NonExtendable`.\n\n\nThe `@ApiStatus.NonExtendable` annotation indicates that the class, interface, or method **must not be extended,\nimplemented, or overridden** .\nSince casting such interfaces and classes to the internal library implementation is rather common,\nif a client provides a different implementation, you will get `ClassCastException`.\nAdding new abstract methods to such classes and interfaces will break the compatibility with the client's implementations." }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "SwitchExpressionCanBePushedDown", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "NonExtendableApiUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "JVM languages", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -34356,28 +34356,28 @@ ] }, { - "id": "NonExtendableApiUsage", + "id": "SwitchExpressionCanBePushedDown", "shortDescription": { - "text": "Class, interface, or method should not be extended" + "text": "Common subexpression can be extracted from 'switch'" }, "fullDescription": { - "text": "Reports classes, interfaces and methods that extend, implement, or override API elements marked with '@ApiStatus.NonExtendable'. The '@ApiStatus.NonExtendable' annotation indicates that the class, interface, or method must not be extended, implemented, or overridden. Since casting such interfaces and classes to the internal library implementation is rather common, if a client provides a different implementation, you will get 'ClassCastException'. Adding new abstract methods to such classes and interfaces will break the compatibility with the client's implementations.", - "markdown": "Reports classes, interfaces and methods that extend, implement, or override API elements marked with `@ApiStatus.NonExtendable`.\n\n\nThe `@ApiStatus.NonExtendable` annotation indicates that the class, interface, or method **must not be extended,\nimplemented, or overridden** .\nSince casting such interfaces and classes to the internal library implementation is rather common,\nif a client provides a different implementation, you will get `ClassCastException`.\nAdding new abstract methods to such classes and interfaces will break the compatibility with the client's implementations." + "text": "Reports switch expressions and statements where every branch has a common subexpression, and the 'switch' can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method. Example: 'switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }' After the quick-fix is applied: 'System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });' This inspection is applicable only for enhanced switches with arrow syntax. New in 2022.3", + "markdown": "Reports switch expressions and statements where every branch has a common subexpression, and the `switch` can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method.\n\nExample:\n\n\n switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }\n\nAfter the quick-fix is applied:\n\n\n System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });\n\n\nThis inspection is applicable only for enhanced switches with arrow syntax.\n\nNew in 2022.3" }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "NonExtendableApiUsage", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "SwitchExpressionCanBePushedDown", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "JVM languages", - "index": 4, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -34542,7 +34542,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -34554,19 +34554,19 @@ ] }, { - "id": "ChannelResource", + "id": "ScheduledThreadPoolExecutorWithZeroCoreThreads", "shortDescription": { - "text": "'Channel' opened but not safely closed" + "text": "'ScheduledThreadPoolExecutor' with zero core threads" }, "fullDescription": { - "text": "Reports 'Channel' resources that are not safely closed, including any instances created by calling 'getChannel()' on a file or socket resource. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }' Use the following options to configure the inspection: Whether a 'Channel' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a 'Channel' in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.", - "markdown": "Reports `Channel` resources that are not safely closed, including any instances created by calling `getChannel()` on a file or socket resource.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `Channel` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a `Channel` in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument." + "text": "Reports any 'java.util.concurrent.ScheduledThreadPoolExecutor' instances in which 'corePoolSize' is set to zero via the 'setCorePoolSize' method or the object constructor. A 'ScheduledThreadPoolExecutor' with zero core threads will run nothing. Example: 'void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }'", + "markdown": "Reports any `java.util.concurrent.ScheduledThreadPoolExecutor` instances in which `corePoolSize` is set to zero via the `setCorePoolSize` method or the object constructor.\n\n\nA `ScheduledThreadPoolExecutor` with zero core threads will run nothing.\n\n**Example:**\n\n\n void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ChannelOpenedButNotSafelyClosed", + "suppressToolId": "ScheduledThreadPoolExecutorWithZeroCoreThreads", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -34574,8 +34574,8 @@ "relationships": [ { "target": { - "id": "Java/Resource management", - "index": 47, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -34587,19 +34587,19 @@ ] }, { - "id": "ScheduledThreadPoolExecutorWithZeroCoreThreads", + "id": "ChannelResource", "shortDescription": { - "text": "'ScheduledThreadPoolExecutor' with zero core threads" + "text": "'Channel' opened but not safely closed" }, "fullDescription": { - "text": "Reports any 'java.util.concurrent.ScheduledThreadPoolExecutor' instances in which 'corePoolSize' is set to zero via the 'setCorePoolSize' method or the object constructor. A 'ScheduledThreadPoolExecutor' with zero core threads will run nothing. Example: 'void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }'", - "markdown": "Reports any `java.util.concurrent.ScheduledThreadPoolExecutor` instances in which `corePoolSize` is set to zero via the `setCorePoolSize` method or the object constructor.\n\n\nA `ScheduledThreadPoolExecutor` with zero core threads will run nothing.\n\n**Example:**\n\n\n void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }\n" + "text": "Reports 'Channel' resources that are not safely closed, including any instances created by calling 'getChannel()' on a file or socket resource. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }' Use the following options to configure the inspection: Whether a 'Channel' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a 'Channel' in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.", + "markdown": "Reports `Channel` resources that are not safely closed, including any instances created by calling `getChannel()` on a file or socket resource.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `Channel` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a `Channel` in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ScheduledThreadPoolExecutorWithZeroCoreThreads", + "suppressToolId": "ChannelOpenedButNotSafelyClosed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -34607,8 +34607,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Resource management", + "index": 47, "toolComponent": { "name": "QDJVMC" } @@ -34884,19 +34884,19 @@ ] }, { - "id": "UnnecessaryCallToStringValueOf", + "id": "FloatingPointEquality", "shortDescription": { - "text": "Unnecessary conversion to 'String'" + "text": "Floating-point equality comparison" }, "fullDescription": { - "text": "Reports calls to static methods like 'String.valueOf()' or 'Integer.toString()' when they are used in a string concatenation or as an argument of a library method in which the explicit string conversion is not needed. Example: 'System.out.println(\"Number: \" + Integer.toString(count));' After the quick-fix is applied: 'System.out.println(\"Number: \" + count);' Library methods in which explicit string conversion is considered redundant: Classes 'java.io.PrintWriter', 'java.io.PrintStream' 'print()', 'println()' Classes 'java.lang.StringBuilder', 'java.lang.StringBuffer' 'append()' Class 'org.slf4j.Logger' 'trace()', 'debug()', 'info()', 'warn()', 'error()' Use the Report calls, which can be replaced with concatenations with empty string option to additionally report cases when concatenations with empty string can be used instead of 'String.valueOf()'.", - "markdown": "Reports calls to static methods like `String.valueOf()` or `Integer.toString()` when they are used in a string concatenation or as an argument of a library method in which the explicit string conversion is not needed.\n\nExample:\n\n\n System.out.println(\"Number: \" + Integer.toString(count));\n\nAfter the quick-fix is applied:\n\n\n System.out.println(\"Number: \" + count);\n\nLibrary methods in which explicit string conversion is considered redundant:\n\n* Classes `java.io.PrintWriter`, `java.io.PrintStream`\n * `print()`, `println()`\n* Classes `java.lang.StringBuilder`, `java.lang.StringBuffer`\n * `append()`\n* Class `org.slf4j.Logger`\n * `trace()`, `debug()`, `info()`, `warn()`, `error()`\n\n\nUse the **Report calls, which can be replaced with concatenations with empty string**\noption to additionally report cases when concatenations with empty string can be used instead of `String.valueOf()`." + "text": "Reports floating-point values that are being compared using the '==' or '!=' operator. Floating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics. This inspection ignores comparisons with zero and infinity literals. Example: 'void m(double d1, double d2) {\n if (d1 == d2) {}\n }'", + "markdown": "Reports floating-point values that are being compared using the `==` or `!=` operator.\n\nFloating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics.\n\nThis inspection ignores comparisons with zero and infinity literals.\n\n**Example:**\n\n\n void m(double d1, double d2) {\n if (d1 == d2) {}\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryCallToStringValueOf", + "suppressToolId": "FloatingPointEquality", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -34904,8 +34904,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 11, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -34917,19 +34917,19 @@ ] }, { - "id": "FloatingPointEquality", + "id": "UnnecessaryCallToStringValueOf", "shortDescription": { - "text": "Floating-point equality comparison" + "text": "Unnecessary conversion to 'String'" }, "fullDescription": { - "text": "Reports floating-point values that are being compared using the '==' or '!=' operator. Floating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics. This inspection ignores comparisons with zero and infinity literals. Example: 'void m(double d1, double d2) {\n if (d1 == d2) {}\n }'", - "markdown": "Reports floating-point values that are being compared using the `==` or `!=` operator.\n\nFloating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics.\n\nThis inspection ignores comparisons with zero and infinity literals.\n\n**Example:**\n\n\n void m(double d1, double d2) {\n if (d1 == d2) {}\n }\n" + "text": "Reports calls to static methods like 'String.valueOf()' or 'Integer.toString()' when they are used in a string concatenation or as an argument of a library method in which the explicit string conversion is not needed. Example: 'System.out.println(\"Number: \" + Integer.toString(count));' After the quick-fix is applied: 'System.out.println(\"Number: \" + count);' Library methods in which explicit string conversion is considered redundant: Classes 'java.io.PrintWriter', 'java.io.PrintStream' 'print()', 'println()' Classes 'java.lang.StringBuilder', 'java.lang.StringBuffer' 'append()' Class 'org.slf4j.Logger' 'trace()', 'debug()', 'info()', 'warn()', 'error()' Use the Report calls, which can be replaced with concatenations with empty string option to additionally report cases when concatenations with empty string can be used instead of 'String.valueOf()'.", + "markdown": "Reports calls to static methods like `String.valueOf()` or `Integer.toString()` when they are used in a string concatenation or as an argument of a library method in which the explicit string conversion is not needed.\n\nExample:\n\n\n System.out.println(\"Number: \" + Integer.toString(count));\n\nAfter the quick-fix is applied:\n\n\n System.out.println(\"Number: \" + count);\n\nLibrary methods in which explicit string conversion is considered redundant:\n\n* Classes `java.io.PrintWriter`, `java.io.PrintStream`\n * `print()`, `println()`\n* Classes `java.lang.StringBuilder`, `java.lang.StringBuffer`\n * `append()`\n* Class `org.slf4j.Logger`\n * `trace()`, `debug()`, `info()`, `warn()`, `error()`\n\n\nUse the **Report calls, which can be replaced with concatenations with empty string**\noption to additionally report cases when concatenations with empty string can be used instead of `String.valueOf()`." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "FloatingPointEquality", + "suppressToolId": "UnnecessaryCallToStringValueOf", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -34937,8 +34937,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 27, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -35070,7 +35070,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -35268,7 +35268,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -35499,7 +35499,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -35676,19 +35676,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "AssignmentToLambdaParameter", + "suppressToolId": "LocalVariableHidesMemberVariable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -35696,8 +35696,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 34, + "id": "Java/Visibility", + "index": 57, "toolComponent": { "name": "QDJVMC" } @@ -35709,19 +35709,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "LocalVariableHidesMemberVariable", + "suppressToolId": "AssignmentToLambdaParameter", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -35729,8 +35729,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 57, + "id": "Java/Assignment issues", + "index": 34, "toolComponent": { "name": "QDJVMC" } @@ -35862,7 +35862,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -35895,7 +35895,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -36039,19 +36039,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryLabelOnContinueStatement", + "suppressToolId": "PackageDotHtmlMayBePackageInfo", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -36059,8 +36059,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 37, + "id": "Java/Javadoc", + "index": 45, "toolComponent": { "name": "QDJVMC" } @@ -36072,19 +36072,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "PackageDotHtmlMayBePackageInfo", + "suppressToolId": "UnnecessaryLabelOnContinueStatement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -36092,8 +36092,8 @@ "relationships": [ { "target": { - "id": "Java/Javadoc", - "index": 45, + "id": "Java/Verbose or redundant code constructs", + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -36126,7 +36126,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -36390,7 +36390,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -36951,7 +36951,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -36984,7 +36984,7 @@ { "target": { "id": "Java/Performance/Embedded", - "index": 19, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -37446,7 +37446,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -37512,7 +37512,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -37545,7 +37545,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -37677,7 +37677,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -37842,7 +37842,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -37985,6 +37985,39 @@ } ] }, + { + "id": "RuntimeExecWithNonConstantString", + "shortDescription": { + "text": "Call to 'Runtime.exec()' with non-constant string" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.Runtime.exec()' which take a dynamically-constructed string as the command to execute. Constructed execution strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning' Use the inspection settings to consider any 'static' 'final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";'", + "markdown": "Reports calls to `java.lang.Runtime.exec()` which take a dynamically-constructed string as the command to execute.\n\n\nConstructed execution strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning\n\n\nUse the inspection settings to consider any `static` `final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToRuntimeExecWithNonConstantString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "UnnecessaryUnboxing", "shortDescription": { @@ -38051,39 +38084,6 @@ } ] }, - { - "id": "RuntimeExecWithNonConstantString", - "shortDescription": { - "text": "Call to 'Runtime.exec()' with non-constant string" - }, - "fullDescription": { - "text": "Reports calls to 'java.lang.Runtime.exec()' which take a dynamically-constructed string as the command to execute. Constructed execution strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning' Use the inspection settings to consider any 'static' 'final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";'", - "markdown": "Reports calls to `java.lang.Runtime.exec()` which take a dynamically-constructed string as the command to execute.\n\n\nConstructed execution strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning\n\n\nUse the inspection settings to consider any `static` `final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CallToRuntimeExecWithNonConstantString", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Security", - "index": 30, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "OptionalAssignedToNull", "shortDescription": { @@ -38139,7 +38139,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -38172,7 +38172,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -38250,19 +38250,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "CyclicPackageDependency", + "suppressToolId": "StringRepeatCanBeUsed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -38270,8 +38270,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 87, + "id": "Java/Java language level migration aids/Java 11", + "index": 120, "toolComponent": { "name": "QDJVMC" } @@ -38283,19 +38283,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "StringRepeatCanBeUsed", + "suppressToolId": "CyclicPackageDependency", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -38303,8 +38303,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 11", - "index": 120, + "id": "Java/Dependency issues", + "index": 87, "toolComponent": { "name": "QDJVMC" } @@ -38535,7 +38535,7 @@ { "target": { "id": "Java/Error handling", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -38733,7 +38733,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -38997,7 +38997,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -39129,7 +39129,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -39294,7 +39294,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -39306,19 +39306,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "MethodWithMultipleLoops", + "suppressToolId": "NegativelyNamedBooleanVariable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -39326,8 +39326,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 93, + "id": "Java/Data flow", + "index": 23, "toolComponent": { "name": "QDJVMC" } @@ -39372,19 +39372,19 @@ ] }, { - "id": "NegativelyNamedBooleanVariable", + "id": "MethodWithMultipleLoops", "shortDescription": { - "text": "Negatively named boolean variable" + "text": "Method with multiple loops" }, "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 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": false, "level": "warning", "parameters": { - "suppressToolId": "NegativelyNamedBooleanVariable", + "suppressToolId": "MethodWithMultipleLoops", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -39392,8 +39392,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 23, + "id": "Java/Method metrics", + "index": 93, "toolComponent": { "name": "QDJVMC" } @@ -39690,7 +39690,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -39723,7 +39723,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -39855,7 +39855,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -39987,7 +39987,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -40098,19 +40098,19 @@ ] }, { - "id": "NonPublicClone", + "id": "IfCanBeSwitch", "shortDescription": { - "text": "'clone()' method not 'public'" + "text": "'if' can be replaced with 'switch'" }, "fullDescription": { - "text": "Reports 'clone()' methods that are 'protected' and not 'public'. When overriding the 'clone()' method from 'java.lang.Object', it is expected to make the method 'public', so that it is accessible from non-subclasses outside the package.", - "markdown": "Reports `clone()` methods that are `protected` and not `public`.\n\nWhen overriding the `clone()` method from `java.lang.Object`, it is expected to make the method `public`,\nso that it is accessible from non-subclasses outside the package." + "text": "Reports 'if' statements that can be replaced with 'switch' statements. The replacement result is usually shorter and clearer. Example: 'void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }' After the quick-fix is applied: 'void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }' This inspection only reports if the language level of the project or module is 7 or higher. Use the Minimum number of 'if' condition branches field to specify the minimum number of 'if' condition branches for an 'if' statement to have to be reported. Note that the terminal 'else' branch (without 'if') is not counted. Use the Suggest switch on numbers option to enable the suggestion of 'switch' statements on primitive and boxed numbers and characters. Use the Suggest switch on enums option to enable the suggestion of 'switch' statements on 'enum' constants. Use the Only suggest on null-safe expressions option to suggest 'switch' statements that can't introduce a 'NullPointerException' only.", + "markdown": "Reports `if` statements that can be replaced with `switch` statements.\n\nThe replacement result is usually shorter and clearer.\n\n**Example:**\n\n\n void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }\n \nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nUse the **Minimum number of 'if' condition branches** field to specify the minimum number of `if` condition branches\nfor an `if` statement to have to be reported. Note that the terminal `else` branch (without `if`) is not counted.\n\n\nUse the **Suggest switch on numbers** option to enable the suggestion of `switch` statements on\nprimitive and boxed numbers and characters.\n\n\nUse the **Suggest switch on enums** option to enable the suggestion of `switch` statements on\n`enum` constants.\n\n\nUse the **Only suggest on null-safe expressions** option to suggest `switch` statements that can't introduce a `NullPointerException` only." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonPublicClone", + "suppressToolId": "IfCanBeSwitch", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40118,8 +40118,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 81, + "id": "Java/Java language level migration aids", + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -40131,19 +40131,19 @@ ] }, { - "id": "IfCanBeSwitch", + "id": "NonPublicClone", "shortDescription": { - "text": "'if' can be replaced with 'switch'" + "text": "'clone()' method not 'public'" }, "fullDescription": { - "text": "Reports 'if' statements that can be replaced with 'switch' statements. The replacement result is usually shorter and clearer. Example: 'void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }' After the quick-fix is applied: 'void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }' This inspection only reports if the language level of the project or module is 7 or higher. Use the Minimum number of 'if' condition branches field to specify the minimum number of 'if' condition branches for an 'if' statement to have to be reported. Note that the terminal 'else' branch (without 'if') is not counted. Use the Suggest switch on numbers option to enable the suggestion of 'switch' statements on primitive and boxed numbers and characters. Use the Suggest switch on enums option to enable the suggestion of 'switch' statements on 'enum' constants. Use the Only suggest on null-safe expressions option to suggest 'switch' statements that can't introduce a 'NullPointerException' only.", - "markdown": "Reports `if` statements that can be replaced with `switch` statements.\n\nThe replacement result is usually shorter and clearer.\n\n**Example:**\n\n\n void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }\n \nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nUse the **Minimum number of 'if' condition branches** field to specify the minimum number of `if` condition branches\nfor an `if` statement to have to be reported. Note that the terminal `else` branch (without `if`) is not counted.\n\n\nUse the **Suggest switch on numbers** option to enable the suggestion of `switch` statements on\nprimitive and boxed numbers and characters.\n\n\nUse the **Suggest switch on enums** option to enable the suggestion of `switch` statements on\n`enum` constants.\n\n\nUse the **Only suggest on null-safe expressions** option to suggest `switch` statements that can't introduce a `NullPointerException` only." + "text": "Reports 'clone()' methods that are 'protected' and not 'public'. When overriding the 'clone()' method from 'java.lang.Object', it is expected to make the method 'public', so that it is accessible from non-subclasses outside the package.", + "markdown": "Reports `clone()` methods that are `protected` and not `public`.\n\nWhen overriding the `clone()` method from `java.lang.Object`, it is expected to make the method `public`,\nso that it is accessible from non-subclasses outside the package." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "IfCanBeSwitch", + "suppressToolId": "NonPublicClone", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40151,8 +40151,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids", - "index": 52, + "id": "Java/Cloning issues", + "index": 81, "toolComponent": { "name": "QDJVMC" } @@ -40164,19 +40164,19 @@ ] }, { - "id": "InfiniteRecursion", + "id": "UseOfObsoleteDateTimeApi", "shortDescription": { - "text": "Infinite recursion" + "text": "Use of obsolete date-time API" }, "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" + "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": { - "suppressToolId": "InfiniteRecursion", + "suppressToolId": "UseOfObsoleteDateTimeApi", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40184,8 +40184,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Code maturity", + "index": 50, "toolComponent": { "name": "QDJVMC" } @@ -40230,19 +40230,19 @@ ] }, { - "id": "NullArgumentToVariableArgMethod", + "id": "InfiniteRecursion", "shortDescription": { - "text": "Confusing argument to varargs method" + "text": "Infinite recursion" }, "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 methods that call themselves infinitely unless an exception is thrown. Methods reported by this inspection cannot return normally. While such behavior may be intended, in many cases this is just an oversight. Example: 'int baz() {\n return baz();\n }'", + "markdown": "Reports methods that call themselves infinitely unless an exception is thrown.\n\n\nMethods reported by this inspection cannot return normally.\nWhile such behavior may be intended, in many cases this is just an oversight.\n\n**Example:**\n\n int baz() {\n return baz();\n }\n" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ConfusingArgumentToVarargsMethod", + "suppressToolId": "InfiniteRecursion", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40263,19 +40263,19 @@ ] }, { - "id": "UseOfObsoleteDateTimeApi", + "id": "NullArgumentToVariableArgMethod", "shortDescription": { - "text": "Use of obsolete date-time API" + "text": "Confusing argument to varargs method" }, "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 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": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "UseOfObsoleteDateTimeApi", + "suppressToolId": "ConfusingArgumentToVarargsMethod", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40283,8 +40283,8 @@ "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 50, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -40482,7 +40482,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -40527,28 +40527,28 @@ ] }, { - "id": "CollectionAddAllCanBeReplacedWithConstructor", + "id": "UsagesOfObsoleteApi", "shortDescription": { - "text": "Redundant 'Collection.addAll()' call" + "text": "Usages of ApiStatus.@Obsolete" }, "fullDescription": { - "text": "Reports 'Collection.addAll()' and 'Map.putAll()' calls immediately after an instantiation of a collection using a no-arg constructor. Such constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement might be more performant. Example: 'Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' After the quick-fix is applied: 'Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' The JDK collection classes are supported by default. Additionally, you can specify other classes using the Classes to check panel.", - "markdown": "Reports `Collection.addAll()` and `Map.putAll()` calls immediately after an instantiation of a collection using a no-arg constructor.\n\nSuch constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement\nmight be more performant.\n\n**Example:**\n\n\n Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\nAfter the quick-fix is applied:\n\n\n Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\n\nThe JDK collection classes are supported by default.\nAdditionally, you can specify other classes using the **Classes to check** panel." + "text": "Reports declarations (classes, methods, fields) annotated as '@ApiStatus.Obsolete'. Sometimes it's impossible to delete the current API, though it might not work correctly, there is a newer, or better, or more generic API. This way, it's a weaker variant of '@Deprecated' annotation. The annotated API is not supposed to be used in the new code, but it's permitted to postpone the migration of the existing code, therefore the usage is not considered a warning.", + "markdown": "Reports declarations (classes, methods, fields) annotated as `@ApiStatus.Obsolete`.\n\n\nSometimes it's impossible to delete the current API, though it might not work correctly, there is a newer, or better, or more generic API.\nThis way, it's a weaker variant of `@Deprecated` annotation.\nThe annotated API is not supposed to be used in the new code, but it's permitted to postpone the migration of the existing code,\ntherefore the usage is not considered a warning." }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "CollectionAddAllCanBeReplacedWithConstructor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "UsagesOfObsoleteApi", + "ideaSeverity": "TEXT ATTRIBUTES", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "JVM languages", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -40560,28 +40560,28 @@ ] }, { - "id": "UsagesOfObsoleteApi", + "id": "CollectionAddAllCanBeReplacedWithConstructor", "shortDescription": { - "text": "Usages of ApiStatus.@Obsolete" + "text": "Redundant 'Collection.addAll()' call" }, "fullDescription": { - "text": "Reports declarations (classes, methods, fields) annotated as '@ApiStatus.Obsolete'. Sometimes it's impossible to delete the current API, though it might not work correctly, there is a newer, or better, or more generic API. This way, it's a weaker variant of '@Deprecated' annotation. The annotated API is not supposed to be used in the new code, but it's permitted to postpone the migration of the existing code, therefore the usage is not considered a warning.", - "markdown": "Reports declarations (classes, methods, fields) annotated as `@ApiStatus.Obsolete`.\n\n\nSometimes it's impossible to delete the current API, though it might not work correctly, there is a newer, or better, or more generic API.\nThis way, it's a weaker variant of `@Deprecated` annotation.\nThe annotated API is not supposed to be used in the new code, but it's permitted to postpone the migration of the existing code,\ntherefore the usage is not considered a warning." + "text": "Reports 'Collection.addAll()' and 'Map.putAll()' calls immediately after an instantiation of a collection using a no-arg constructor. Such constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement might be more performant. Example: 'Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' After the quick-fix is applied: 'Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' The JDK collection classes are supported by default. Additionally, you can specify other classes using the Classes to check panel.", + "markdown": "Reports `Collection.addAll()` and `Map.putAll()` calls immediately after an instantiation of a collection using a no-arg constructor.\n\nSuch constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement\nmight be more performant.\n\n**Example:**\n\n\n Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\nAfter the quick-fix is applied:\n\n\n Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\n\nThe JDK collection classes are supported by default.\nAdditionally, you can specify other classes using the **Classes to check** panel." }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "UsagesOfObsoleteApi", - "ideaSeverity": "TEXT ATTRIBUTES", - "qodanaSeverity": "Info" + "suppressToolId": "CollectionAddAllCanBeReplacedWithConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "JVM languages", - "index": 4, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -40626,19 +40626,19 @@ ] }, { - "id": "ConstantDeclaredInInterface", + "id": "SuspiciousMethodCalls", "shortDescription": { - "text": "Constant declared in interface" + "text": "Suspicious collection method call" }, "fullDescription": { - "text": "Reports constants ('public static final' fields) declared in interfaces. Some coding standards require declaring constants in abstract classes instead.", - "markdown": "Reports constants (`public static final` fields) declared in interfaces.\n\nSome coding standards require declaring constants in abstract classes instead." + "text": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type. Example: 'List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted' In the inspection settings, you can disable warnings for potentially correct code like the following: 'public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }'", + "markdown": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type.\n\n**Example:**\n\n\n List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted\n\n\nIn the inspection settings, you can disable warnings for potentially correct code like the following:\n\n\n public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ConstantDeclaredInInterface", + "suppressToolId": "SuspiciousMethodCalls", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40646,8 +40646,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 12, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -40659,19 +40659,19 @@ ] }, { - "id": "SuspiciousMethodCalls", + "id": "ConstantDeclaredInInterface", "shortDescription": { - "text": "Suspicious collection method call" + "text": "Constant declared in interface" }, "fullDescription": { - "text": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type. Example: 'List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted' In the inspection settings, you can disable warnings for potentially correct code like the following: 'public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }'", - "markdown": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type.\n\n**Example:**\n\n\n List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted\n\n\nIn the inspection settings, you can disable warnings for potentially correct code like the following:\n\n\n public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }\n" + "text": "Reports constants ('public static final' fields) declared in interfaces. Some coding standards require declaring constants in abstract classes instead.", + "markdown": "Reports constants (`public static final` fields) declared in interfaces.\n\nSome coding standards require declaring constants in abstract classes instead." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SuspiciousMethodCalls", + "suppressToolId": "ConstantDeclaredInInterface", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40679,8 +40679,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -40857,19 +40857,19 @@ ] }, { - "id": "NoExplicitFinalizeCalls", + "id": "StaticImport", "shortDescription": { - "text": "'finalize()' called explicitly" + "text": "Static import" }, "fullDescription": { - "text": "Reports calls to 'Object.finalize()'. Calling 'Object.finalize()' explicitly may result in objects being placed in an inconsistent state. The garbage collector automatically calls this method on an object when it determines that there are no references to this object. The inspection doesn't report calls to 'super.finalize()' from within implementations of 'finalize()' as they're benign. Example: 'MyObject m = new MyObject();\n m.finalize();\n System.gc()'", - "markdown": "Reports calls to `Object.finalize()`.\n\nCalling `Object.finalize()` explicitly may result in objects being placed in an\ninconsistent state.\nThe garbage collector automatically calls this method on an object when it determines that there are no references to this object.\n\nThe inspection doesn't report calls to `super.finalize()` from within implementations of `finalize()` as\nthey're benign.\n\n**Example:**\n\n\n MyObject m = new MyObject();\n m.finalize();\n System.gc()\n" + "text": "Reports 'import static' statements. Such 'import' statements are not supported under Java 1.4 or earlier JVMs. Configure the inspection: Use the table below to specify the classes that will be ignored by the inspection when used in an 'import static' statement. Use the Ignore single field static imports checkbox to ignore single-field 'import static' statements. Use the Ignore single method static imports checkbox to ignore single-method 'import static' statements.", + "markdown": "Reports `import static` statements.\n\nSuch `import` statements are not supported under Java 1.4 or earlier JVMs.\n\nConfigure the inspection:\n\n* Use the table below to specify the classes that will be ignored by the inspection when used in an `import static` statement.\n* Use the **Ignore single field static imports** checkbox to ignore single-field `import static` statements.\n* Use the **Ignore single method static imports** checkbox to ignore single-method `import static` statements." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "FinalizeCalledExplicitly", + "suppressToolId": "StaticImport", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40877,8 +40877,8 @@ "relationships": [ { "target": { - "id": "Java/Finalization", - "index": 64, + "id": "Java/Imports", + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -40890,19 +40890,19 @@ ] }, { - "id": "StaticImport", + "id": "NoExplicitFinalizeCalls", "shortDescription": { - "text": "Static import" + "text": "'finalize()' called explicitly" }, "fullDescription": { - "text": "Reports 'import static' statements. Such 'import' statements are not supported under Java 1.4 or earlier JVMs. Configure the inspection: Use the table below to specify the classes that will be ignored by the inspection when used in an 'import static' statement. Use the Ignore single field static imports checkbox to ignore single-field 'import static' statements. Use the Ignore single method static imports checkbox to ignore single-method 'import static' statements.", - "markdown": "Reports `import static` statements.\n\nSuch `import` statements are not supported under Java 1.4 or earlier JVMs.\n\nConfigure the inspection:\n\n* Use the table below to specify the classes that will be ignored by the inspection when used in an `import static` statement.\n* Use the **Ignore single field static imports** checkbox to ignore single-field `import static` statements.\n* Use the **Ignore single method static imports** checkbox to ignore single-method `import static` statements." + "text": "Reports calls to 'Object.finalize()'. Calling 'Object.finalize()' explicitly may result in objects being placed in an inconsistent state. The garbage collector automatically calls this method on an object when it determines that there are no references to this object. The inspection doesn't report calls to 'super.finalize()' from within implementations of 'finalize()' as they're benign. Example: 'MyObject m = new MyObject();\n m.finalize();\n System.gc()'", + "markdown": "Reports calls to `Object.finalize()`.\n\nCalling `Object.finalize()` explicitly may result in objects being placed in an\ninconsistent state.\nThe garbage collector automatically calls this method on an object when it determines that there are no references to this object.\n\nThe inspection doesn't report calls to `super.finalize()` from within implementations of `finalize()` as\nthey're benign.\n\n**Example:**\n\n\n MyObject m = new MyObject();\n m.finalize();\n System.gc()\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "StaticImport", + "suppressToolId": "FinalizeCalledExplicitly", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40910,8 +40910,8 @@ "relationships": [ { "target": { - "id": "Java/Imports", - "index": 22, + "id": "Java/Finalization", + "index": 64, "toolComponent": { "name": "QDJVMC" } @@ -40977,7 +40977,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -41154,7 +41154,7 @@ { "target": { "id": "Groovy/GPath", - "index": 21, + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -41319,7 +41319,7 @@ { "target": { "id": "Groovy/GPath", - "index": 21, + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -41781,7 +41781,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -41847,7 +41847,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -41946,7 +41946,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -42210,7 +42210,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -42243,7 +42243,7 @@ { "target": { "id": "Groovy/GPath", - "index": 21, + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -42255,19 +42255,19 @@ ] }, { - "id": "GroovyResultOfAssignmentUsed", + "id": "GroovyUntypedAccess", "shortDescription": { - "text": "Result of assignment used" + "text": "Untyped reference expression" }, "fullDescription": { - "text": "Reports assignment expressions nested inside other expressions to use the assigned value immediately. Such expressions may be confusing and violating the general design principle that a given construct should do precisely one thing.", - "markdown": "Reports assignment expressions nested inside other expressions to use the assigned value immediately.\n\n\nSuch expressions may be confusing and violating the general design principle that a\ngiven construct should do precisely one thing." + "text": "Reports reference expressions whose type can't be determined.", + "markdown": "Reports reference expressions whose type can't be determined." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovyResultOfAssignmentUsed", + "suppressToolId": "GroovyUntypedAccess", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42275,8 +42275,8 @@ "relationships": [ { "target": { - "id": "Groovy/Assignment issues", - "index": 65, + "id": "Groovy/Probable bugs", + "index": 55, "toolComponent": { "name": "QDJVMC" } @@ -42288,19 +42288,19 @@ ] }, { - "id": "GroovyUntypedAccess", + "id": "GroovyResultOfAssignmentUsed", "shortDescription": { - "text": "Untyped reference expression" + "text": "Result of assignment used" }, "fullDescription": { - "text": "Reports reference expressions whose type can't be determined.", - "markdown": "Reports reference expressions whose type can't be determined." + "text": "Reports assignment expressions nested inside other expressions to use the assigned value immediately. Such expressions may be confusing and violating the general design principle that a given construct should do precisely one thing.", + "markdown": "Reports assignment expressions nested inside other expressions to use the assigned value immediately.\n\n\nSuch expressions may be confusing and violating the general design principle that a\ngiven construct should do precisely one thing." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovyUntypedAccess", + "suppressToolId": "GroovyResultOfAssignmentUsed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42308,8 +42308,8 @@ "relationships": [ { "target": { - "id": "Groovy/Probable bugs", - "index": 55, + "id": "Groovy/Assignment issues", + "index": 65, "toolComponent": { "name": "QDJVMC" } @@ -42717,19 +42717,19 @@ ] }, { - "id": "GroovyDuplicateSwitchBranch", + "id": "GroovySwitchStatementWithNoDefault", "shortDescription": { - "text": "Duplicate switch case" + "text": "Switch statement with no default case" }, "fullDescription": { - "text": "Reports duplicated expressions in 'case' labels for 'switch' statements. Example: 'switch (n) {\n case 1: //duplicate\n break\n case 1: //duplicate\n System.out.println(\"2\")\n break\n default:\n System.out.println(\"default\");\n}'", - "markdown": "Reports duplicated expressions in `case` labels for `switch` statements.\n\n**Example:**\n\n\n switch (n) {\n case 1: //duplicate\n break\n case 1: //duplicate\n System.out.println(\"2\")\n break\n default:\n System.out.println(\"default\");\n }\n\n" + "text": "Reports 'switch' statements that do not contain 'default' labels. Some coding practices may insist on adding this label to all 'switch' statements.", + "markdown": "Reports `switch` statements that do not contain `default` labels.\n\n\nSome coding practices may insist on adding this label to all `switch` statements." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovyDuplicateSwitchBranch", + "suppressToolId": "GroovySwitchStatementWithNoDefault", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42737,8 +42737,8 @@ "relationships": [ { "target": { - "id": "Groovy/Validity issues", - "index": 100, + "id": "Groovy/Control flow issues", + "index": 70, "toolComponent": { "name": "QDJVMC" } @@ -42750,19 +42750,19 @@ ] }, { - "id": "GroovySwitchStatementWithNoDefault", + "id": "GroovyDuplicateSwitchBranch", "shortDescription": { - "text": "Switch statement with no default case" + "text": "Duplicate switch case" }, "fullDescription": { - "text": "Reports 'switch' statements that do not contain 'default' labels. Some coding practices may insist on adding this label to all 'switch' statements.", - "markdown": "Reports `switch` statements that do not contain `default` labels.\n\n\nSome coding practices may insist on adding this label to all `switch` statements." + "text": "Reports duplicated expressions in 'case' labels for 'switch' statements. Example: 'switch (n) {\n case 1: //duplicate\n break\n case 1: //duplicate\n System.out.println(\"2\")\n break\n default:\n System.out.println(\"default\");\n}'", + "markdown": "Reports duplicated expressions in `case` labels for `switch` statements.\n\n**Example:**\n\n\n switch (n) {\n case 1: //duplicate\n break\n case 1: //duplicate\n System.out.println(\"2\")\n break\n default:\n System.out.println(\"default\");\n }\n\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovySwitchStatementWithNoDefault", + "suppressToolId": "GroovyDuplicateSwitchBranch", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42770,8 +42770,8 @@ "relationships": [ { "target": { - "id": "Groovy/Control flow issues", - "index": 70, + "id": "Groovy/Validity issues", + "index": 100, "toolComponent": { "name": "QDJVMC" } @@ -42804,7 +42804,7 @@ { "target": { "id": "Groovy/GPath", - "index": 21, + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -43134,7 +43134,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -43212,19 +43212,19 @@ ] }, { - "id": "GroovyEmptyStatementBody", + "id": "GroovyLabeledStatement", "shortDescription": { - "text": "Statement with empty body" + "text": "Labeled statement inspection" }, "fullDescription": { - "text": "Reports 'if', 'while', 'do' or 'for' statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo. Example: 'if (condition) {}\nwhile(true){}'", - "markdown": "Reports `if`, `while`, `do` or `for` statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo.\n\n**Example:**\n\n\n if (condition) {}\n while(true){}\n\n" + "text": "Reports labels already used in parent workflow. Example: 'def list = [\"foo\"]\ncycle:\nfor (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n}'", + "markdown": "Reports labels already used in parent workflow.\n\n**Example:**\n\n\n def list = [\"foo\"]\n cycle:\n for (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n }\n\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovyEmptyStatementBody", + "suppressToolId": "GroovyLabeledStatement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -43232,8 +43232,8 @@ "relationships": [ { "target": { - "id": "Groovy/Potentially confusing code constructs", - "index": 72, + "id": "Groovy/Probable bugs", + "index": 55, "toolComponent": { "name": "QDJVMC" } @@ -43245,19 +43245,19 @@ ] }, { - "id": "GroovyLabeledStatement", + "id": "GroovyEmptyStatementBody", "shortDescription": { - "text": "Labeled statement inspection" + "text": "Statement with empty body" }, "fullDescription": { - "text": "Reports labels already used in parent workflow. Example: 'def list = [\"foo\"]\ncycle:\nfor (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n}'", - "markdown": "Reports labels already used in parent workflow.\n\n**Example:**\n\n\n def list = [\"foo\"]\n cycle:\n for (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n }\n\n" + "text": "Reports 'if', 'while', 'do' or 'for' statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo. Example: 'if (condition) {}\nwhile(true){}'", + "markdown": "Reports `if`, `while`, `do` or `for` statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo.\n\n**Example:**\n\n\n if (condition) {}\n while(true){}\n\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovyLabeledStatement", + "suppressToolId": "GroovyEmptyStatementBody", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -43265,8 +43265,8 @@ "relationships": [ { "target": { - "id": "Groovy/Probable bugs", - "index": 55, + "id": "Groovy/Potentially confusing code constructs", + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -43332,7 +43332,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -43530,7 +43530,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -43596,7 +43596,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -43794,7 +43794,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -44124,7 +44124,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -44157,7 +44157,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -45048,7 +45048,7 @@ { "target": { "id": "Groovy/Style", - "index": 83, + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -45489,19 +45489,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "GroovyReturnFromClosureCanBeImplicit", + "suppressToolId": "GroovySynchronizationOnNonFinalField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -45509,8 +45509,8 @@ "relationships": [ { "target": { - "id": "Groovy/Control flow issues", - "index": 70, + "id": "Groovy/Threading issues", + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -45522,19 +45522,19 @@ ] }, { - "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, "level": "warning", "parameters": { - "suppressToolId": "GroovySynchronizationOnNonFinalField", + "suppressToolId": "GroovyReturnFromClosureCanBeImplicit", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -45542,8 +45542,8 @@ "relationships": [ { "target": { - "id": "Groovy/Threading issues", - "index": 38, + "id": "Groovy/Control flow issues", + "index": 70, "toolComponent": { "name": "QDJVMC" } @@ -45852,7 +45852,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -45885,7 +45885,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -45984,7 +45984,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -46116,7 +46116,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -46215,7 +46215,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -46347,7 +46347,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -46380,7 +46380,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -46413,7 +46413,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -46479,7 +46479,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -47007,7 +47007,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -47040,7 +47040,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -47370,7 +47370,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -47403,7 +47403,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -47469,7 +47469,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -47502,7 +47502,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -47535,7 +47535,7 @@ { "target": { "id": "RegExp", - "index": 82, + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -50829,28 +50829,28 @@ ] }, { - "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": { - "suppressToolId": "InspectionDescriptionNotFoundInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "PluginXmlValidity", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Plugin DevKit/Description file", - "index": 102, + "id": "Plugin DevKit/Plugin descriptor", + "index": 74, "toolComponent": { "name": "QDJVMC" } @@ -50862,28 +50862,28 @@ ] }, { - "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": { - "suppressToolId": "PluginXmlValidity", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "suppressToolId": "InspectionDescriptionNotFoundInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Plugin DevKit/Plugin descriptor", - "index": 74, + "id": "Plugin DevKit/Description file", + "index": 102, "toolComponent": { "name": "QDJVMC" } @@ -52545,7 +52545,7 @@ "versionControlProvenance": [ { "repositoryUri": "https://github.com/1c-syntax/bsl-language-server.git", - "revisionId": "5cbfe33de7608a078ea24ed183be8d8bf6297b98", + "revisionId": "e2eccdcd7af3f5a35799ed75330bca3e7d0e0d20", "branch": "refs/heads/develop", "properties": { "repoUrl": "https://github.com/1c-syntax/bsl-language-server.git", @@ -60754,9 +60754,9 @@ ], "automationDetails": { "id": "bsl-language-server/qodana/2023-10-10", - "guid": "edc24941-665b-4339-84f6-10289966d186", + "guid": "086339e4-1453-4503-b0fb-95cafd0c4eb0", "properties": { - "jobUrl": "https://github.com/1c-syntax/bsl-language-server/actions/runs/6465421045" + "jobUrl": "https://github.com/1c-syntax/bsl-language-server/actions/runs/6475178224" } }, "newlineSequences": [ @@ -61136,33 +61136,33 @@ "kind": "fail", "level": "warning", "message": { - "text": "Field 'skipAttachable' may be 'final'", - "markdown": "Field `skipAttachable` may be 'final'" + "text": "Field 'formattingOptions' may be 'final'", + "markdown": "Field `formattingOptions` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FunctionReturnsSamePrimitiveDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 71, - "startColumn": 19, - "charOffset": 2804, - "charLength": 14, + "startLine": 101, + "startColumn": 29, + "charOffset": 4035, + "charLength": 17, "snippet": { - "text": "skipAttachable" + "text": "formattingOptions" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 69, + "startLine": 99, "startColumn": 1, - "charOffset": 2742, - "charLength": 120, + "charOffset": 3941, + "charLength": 218, "snippet": { - "text": " defaultValue = \"\" + SKIP_ATTACHABLE\n )\n private boolean skipAttachable = SKIP_ATTACHABLE;\n\n @DiagnosticParameter(" + "text": " @JsonProperty(\"formatting\")\n @Setter(value = AccessLevel.NONE)\n private FormattingOptions formattingOptions = new FormattingOptions();\n\n private String siteRoot = \"https://1c-syntax.github.io/bsl-language-server\";" }, "sourceLanguage": "JAVA" } @@ -61176,7 +61176,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "0977057f9611196f9c65dd437e0e0e01a96cc4eb063a531df8af48abdd1da1cb" + "equalIndicator/v1": "0a5f1271e31db2a4e5b86f0a8f1bddad77ae6956449089c6c6384b8fa3145d75" }, "properties": { "ideaSeverity": "WARNING", @@ -61188,33 +61188,33 @@ "kind": "fail", "level": "warning", "message": { - "text": "Field 'caseSensitiveForString' may be 'final'", - "markdown": "Field `caseSensitiveForString` may be 'final'" + "text": "Field 'analyzeInternetMailProfileZeroTimeout' may be 'final'", + "markdown": "Field `analyzeInternetMailProfileZeroTimeout` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FunctionReturnsSamePrimitiveDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TimeoutsInExternalResourcesDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { "startLine": 77, "startColumn": 19, - "charOffset": 2961, - "charLength": 22, + "charOffset": 3231, + "charLength": 37, "snippet": { - "text": "caseSensitiveForString" + "text": "analyzeInternetMailProfileZeroTimeout" }, "sourceLanguage": "JAVA" }, "contextRegion": { "startLine": 75, "startColumn": 1, - "charOffset": 2889, - "charLength": 136, + "charOffset": 3170, + "charLength": 163, "snippet": { - "text": " defaultValue = \"\" + CASE_SENSITIVE_FOR_STRING\n )\n private boolean caseSensitiveForString = CASE_SENSITIVE_FOR_STRING;\n\n @Override" + "text": " defaultValue = \"\" + ANALYZING_MAIL\n )\n private boolean analyzeInternetMailProfileZeroTimeout = ANALYZING_MAIL;\n\n private Pattern getPatternNewExpression() {" }, "sourceLanguage": "JAVA" } @@ -61228,7 +61228,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "253bd105bbf46b7c76a6a9c7a4007332c22cb3701445cb613bc48b93a231afda" + "equalIndicator/v1": "0be5f72405a4662d8fd4e4f44b5da630f710e47b0e4cdf501ec86836d1ce5518" }, "properties": { "ideaSeverity": "WARNING", @@ -61240,33 +61240,33 @@ "kind": "fail", "level": "warning", "message": { - "text": "Field 'endpointPath' may be 'final'", - "markdown": "Field `endpointPath` may be 'final'" + "text": "Field 'skipSupport' may be 'final'", + "markdown": "Field `skipSupport` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/websocket/WebSocketConfiguration.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 44, - "startColumn": 18, - "charOffset": 1792, - "charLength": 12, + "startLine": 46, + "startColumn": 23, + "charOffset": 1848, + "charLength": 11, "snippet": { - "text": "endpointPath" + "text": "skipSupport" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 42, + "startLine": 44, "startColumn": 1, - "charOffset": 1736, - "charLength": 83, + "charOffset": 1727, + "charLength": 229, "snippet": { - "text": "\n @Value(\"${app.websocket.lsp-path}\")\n private String endpointPath = \"\";\n\n @Bean" + "text": " private ComputeTrigger computeTrigger = ComputeTrigger.ONSAVE;\n private boolean analyzeOnStart;\n private SkipSupport skipSupport = SkipSupport.NEVER;\n private Mode mode = Mode.ON;\n private boolean ordinaryAppSupport = true;" }, "sourceLanguage": "JAVA" } @@ -61280,7 +61280,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "9e90f205d2530bb6c80c1b7e110aea51c6c9579943223925e6c150d8c8c6b449" + "equalIndicator/v1": "0c17bb656c01a33fa0fe800dbbe8b63f7e73500ca91b5cb23a73fcc3ea7b33c7" }, "properties": { "ideaSeverity": "WARNING", @@ -61292,33 +61292,33 @@ "kind": "fail", "level": "warning", "message": { - "text": "Field 'findFirst' may be 'final'", - "markdown": "Field `findFirst` may be 'final'" + "text": "Field 'computeTrigger' may be 'final'", + "markdown": "Field `computeTrigger` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DataExchangeLoadingDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 75, - "startColumn": 19, - "charOffset": 2882, - "charLength": 9, + "startLine": 44, + "startColumn": 26, + "charOffset": 1752, + "charLength": 14, "snippet": { - "text": "findFirst" + "text": "computeTrigger" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 73, + "startLine": 42, "startColumn": 1, - "charOffset": 2825, - "charLength": 93, + "charOffset": 1649, + "charLength": 231, "snippet": { - "text": " defaultValue = \"\" + FIND_FIRST\n )\n private boolean findFirst = FIND_FIRST;\n\n @Override" + "text": "@JsonIgnoreProperties(ignoreUnknown = true)\npublic class DiagnosticsOptions {\n private ComputeTrigger computeTrigger = ComputeTrigger.ONSAVE;\n private boolean analyzeOnStart;\n private SkipSupport skipSupport = SkipSupport.NEVER;" }, "sourceLanguage": "JAVA" } @@ -61332,7 +61332,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "c1195324e7d45d5200f240c26d107aedddb2d18dde2a71625c53d4f4cb5b8b59" + "equalIndicator/v1": "19b70620e5c3232e198998d10dfd30a037696e6d912974b6fe2b401c248dd2bc" }, "properties": { "ideaSeverity": "WARNING", @@ -61340,37 +61340,349 @@ } }, { - "ruleId": "JavadocReference", + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'inlayHintOptions' may be 'final'", + "markdown": "Field `inlayHintOptions` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 97, + "startColumn": 28, + "charOffset": 3897, + "charLength": 16, + "snippet": { + "text": "inlayHintOptions" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 95, + "startColumn": 1, + "charOffset": 3805, + "charLength": 165, + "snippet": { + "text": " @JsonProperty(\"inlayHint\")\n @Setter(value = AccessLevel.NONE)\n private InlayHintOptions inlayHintOptions = new InlayHintOptions();\n\n @JsonProperty(\"formatting\")" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "1cc7b494cb8b120d856ce3e0fe6377293144c943c36b912fa4465932526616d9" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'mode' may be 'final'", + "markdown": "Field `mode` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 47, + "startColumn": 16, + "charOffset": 1896, + "charLength": 4, + "snippet": { + "text": "mode" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 45, + "startColumn": 1, + "charOffset": 1792, + "charLength": 232, + "snippet": { + "text": " private boolean analyzeOnStart;\n private SkipSupport skipSupport = SkipSupport.NEVER;\n private Mode mode = Mode.ON;\n private boolean ordinaryAppSupport = true;\n private SubsystemFilter subsystemsFilter = new SubsystemFilter();" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "4c28ea190dd62d3f3d454eb16431e07c7b95a3a44b93503d3206d4129b213245" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'codeLensOptions' may be 'final'", + "markdown": "Field `codeLensOptions` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 89, + "startColumn": 27, + "charOffset": 3615, + "charLength": 15, + "snippet": { + "text": "codeLensOptions" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 87, + "startColumn": 1, + "charOffset": 3525, + "charLength": 163, + "snippet": { + "text": " @JsonProperty(\"codeLens\")\n @Setter(value = AccessLevel.NONE)\n private CodeLensOptions codeLensOptions = new CodeLensOptions();\n\n @JsonProperty(\"documentLink\")" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "6f1c2914327e246d2436a994e48d6aa4a3328eb216424c054a6894ce96fe7822" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'documentLinkOptions' may be 'final'", + "markdown": "Field `documentLinkOptions` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 93, + "startColumn": 31, + "charOffset": 3755, + "charLength": 19, + "snippet": { + "text": "documentLinkOptions" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 91, + "startColumn": 1, + "charOffset": 3657, + "charLength": 176, + "snippet": { + "text": " @JsonProperty(\"documentLink\")\n @Setter(value = AccessLevel.NONE)\n private DocumentLinkOptions documentLinkOptions = new DocumentLinkOptions();\n\n @JsonProperty(\"inlayHint\")" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "6fbdf1d56db17fdf825cb093bbdd33bf3a7b6f079f5b2c62678b6b90651f1bfa" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'siteRoot' may be 'final'", + "markdown": "Field `siteRoot` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 103, + "startColumn": 18, + "charOffset": 4098, + "charLength": 8, + "snippet": { + "text": "siteRoot" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 101, + "startColumn": 1, + "charOffset": 4007, + "charLength": 183, + "snippet": { + "text": " private FormattingOptions formattingOptions = new FormattingOptions();\n\n private String siteRoot = \"https://1c-syntax.github.io/bsl-language-server\";\n private boolean useDevSite;\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "83d3e14106ab3feec3d114205df68f37abfebed773b2b5ca3277c80ca632b093" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'sendErrors' may be 'final'", + "markdown": "Field `sendErrors` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 106, + "startColumn": 26, + "charOffset": 4216, + "charLength": 10, + "snippet": { + "text": "sendErrors" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 104, + "startColumn": 1, + "charOffset": 4160, + "charLength": 105, + "snippet": { + "text": " private boolean useDevSite;\n\n private SendErrorsMode sendErrors = SendErrorsMode.DEFAULT;\n\n @Nullable" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "974649d350abb97382164a7d276af735c8330b013dbfdb4c96be44995ba6c9a9" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "FieldMayBeFinal", "kind": "fail", "level": "warning", "message": { - "text": "Cannot resolve symbol 'getUri()'", - "markdown": "Cannot resolve symbol `getUri()`" + "text": "Field 'parameters' may be 'final'", + "markdown": "Field `parameters` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ModuleSymbol.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", "uriBaseId": "SRCROOT" }, "region": { "startLine": 52, - "startColumn": 87, - "charOffset": 1842, - "charLength": 6, + "startColumn": 61, + "charOffset": 2143, + "charLength": 10, "snippet": { - "text": "getUri" + "text": "parameters" }, "sourceLanguage": "JAVA" }, "contextRegion": { "startLine": 50, "startColumn": 1, - "charOffset": 1583, - "charLength": 290, + "charOffset": 2025, + "charLength": 150, "snippet": { - "text": " * Если у документа есть валидный mdoRef, то содержит его и (при необходимости) квалификатор в виде типа модуля\n * ({@link com.github._1c_syntax.bsl.types.ModuleType}).\n * В остальных случаях содержит строковое представление uri ({@link DocumentContext#getUri()}.\n */\n String name;" + "text": "\n @JsonDeserialize(using = ParametersDeserializer.class)\n private Map>> parameters = new HashMap<>();\n}\n" }, "sourceLanguage": "JAVA" } @@ -61384,7 +61696,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "979e8fda5f2de470a0b8ccb0ca592c9b6ccb0520b686f48523bc062485023e23" + "equalIndicator/v1": "b077b179714a7393d8c94c1b14799e4ec06eb478da1942ecda2dc51e2d7019d5" }, "properties": { "ideaSeverity": "WARNING", @@ -61392,37 +61704,89 @@ } }, { - "ruleId": "NullableProblems", + "ruleId": "FieldMayBeFinal", "kind": "fail", "level": "warning", "message": { - "text": "Not annotated parameter overrides @NonNullApi parameter", - "markdown": "Not annotated parameter overrides @NonNullApi parameter" + "text": "Field 'subsystemsFilter' may be 'final'", + "markdown": "Field `subsystemsFilter` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/infrastructure/DiagnosticBeanPostProcessor.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 56, - "startColumn": 68, - "charOffset": 2122, - "charLength": 8, + "startLine": 49, + "startColumn": 27, + "charOffset": 1983, + "charLength": 16, + "snippet": { + "text": "subsystemsFilter" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 47, + "startColumn": 1, + "charOffset": 1881, + "charLength": 201, + "snippet": { + "text": " private Mode mode = Mode.ON;\n private boolean ordinaryAppSupport = true;\n private SubsystemFilter subsystemsFilter = new SubsystemFilter();\n\n @JsonDeserialize(using = ParametersDeserializer.class)" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "b24471c1b7a37a3d5a2760883d002e7c5c4898774280c1a49050ab6aa42e75d7" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'parameters' may be 'final'", + "markdown": "Field `parameters` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/inlayhints/InlayHintOptions.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 49, + "startColumn": 61, + "charOffset": 1892, + "charLength": 10, "snippet": { - "text": "beanName" + "text": "parameters" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 54, + "startLine": 47, "startColumn": 1, - "charOffset": 2042, - "charLength": 158, + "charOffset": 1769, + "charLength": 155, "snippet": { - "text": "\n @Override\n public Object postProcessAfterInitialization(Object bean, String beanName) {\n\n if (!BSLDiagnostic.class.isAssignableFrom(bean.getClass())) {" + "text": " */\n @JsonDeserialize(using = ParametersDeserializer.class)\n private Map>> parameters = new HashMap<>();\n}\n" }, "sourceLanguage": "JAVA" } @@ -61436,7 +61800,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "69f40bd1a6b47026f6793b2b4bb0fb8146bcd18b2302b27a5469039bc220f34a" + "equalIndicator/v1": "b635c8a07ffa4ed2069d04a214bf30f4d8692f014541d72d051032438d3f1048" }, "properties": { "ideaSeverity": "WARNING", @@ -61444,37 +61808,37 @@ } }, { - "ruleId": "NullableProblems", + "ruleId": "FieldMayBeFinal", "kind": "fail", "level": "warning", "message": { - "text": "Not annotated parameter overrides @NonNullApi parameter", - "markdown": "Not annotated parameter overrides @NonNullApi parameter" + "text": "Field 'useStrictValidation' may be 'final'", + "markdown": "Field `useStrictValidation` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/infrastructure/DiagnosticBeanPostProcessor.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SpaceAtStartCommentDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 42, - "startColumn": 69, - "charOffset": 1767, - "charLength": 8, + "startLine": 83, + "startColumn": 19, + "charOffset": 3281, + "charLength": 19, "snippet": { - "text": "beanName" + "text": "useStrictValidation" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 40, + "startLine": 81, "startColumn": 1, - "charOffset": 1686, - "charLength": 177, + "charOffset": 3213, + "charLength": 156, "snippet": { - "text": "\n @Override\n public Object postProcessBeforeInitialization(Object bean, String beanName) {\n if (!BSLDiagnostic.class.isAssignableFrom(bean.getClass())) {\n return bean;" + "text": " defaultValue = \"\" + USE_STRICT_VALIDATION\n )\n private boolean useStrictValidation = USE_STRICT_VALIDATION;\n\n public SpaceAtStartCommentDiagnostic() {" }, "sourceLanguage": "JAVA" } @@ -61488,7 +61852,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "a453ac241fce07460259ceabd7266c48b96099d7888b60c6d3487f798d9d6874" + "equalIndicator/v1": "bb2f36ce9a481cf7dc1b3836482e687eb4d37f95e8734b4c8b2eb9fedfccb288" }, "properties": { "ideaSeverity": "WARNING", @@ -61496,37 +61860,37 @@ } }, { - "ruleId": "TrivialStringConcatenation", + "ruleId": "FieldMayBeFinal", "kind": "fail", "level": "warning", "message": { - "text": "Empty string used in concatenation", - "markdown": "Empty string used in concatenation" + "text": "Field 'language' may be 'final'", + "markdown": "Field `language` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/IncorrectLineBreakDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 74, + "startLine": 81, "startColumn": 20, - "charOffset": 2911, - "charLength": 2, + "charOffset": 3342, + "charLength": 8, "snippet": { - "text": "\"\"" + "text": "language" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 72, + "startLine": 79, "startColumn": 1, - "charOffset": 2843, - "charLength": 215, + "charOffset": 3222, + "charLength": 189, "snippet": { - "text": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_START\n )\n private Pattern listOfIncorrectFirstSymbol = createPatternIncorrectStartLine(DEFAULT_LIST_FOR_CHECK_START);" + "text": " private static final Pattern searchConfiguration = Pattern.compile(\"Configuration\\\\.(xml|mdo)$\");\n\n private Language language = Language.DEFAULT_LANGUAGE;\n\n @JsonProperty(\"diagnostics\")" }, "sourceLanguage": "JAVA" } @@ -61540,7 +61904,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "5355e6263896b63b853194d62435b8e7866ea257b8d1180f53381031fa7f157d" + "equalIndicator/v1": "cc805b1f031c7a98fa2c14667fe1dadc3ddb24e27cf4fd1095fa0ef02a6600fb" }, "properties": { "ideaSeverity": "WARNING", @@ -61548,37 +61912,297 @@ } }, { - "ruleId": "TrivialStringConcatenation", + "ruleId": "FieldMayBeFinal", "kind": "fail", "level": "warning", "message": { - "text": "Empty string used in concatenation", - "markdown": "Empty string used in concatenation" + "text": "Field 'methodPattern' may be 'final'", + "markdown": "Field `methodPattern` may be 'final'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/IncorrectLineBreakDiagnostic.java", + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/AbstractFindMethodDiagnostic.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 86, - "startColumn": 20, - "charOffset": 3280, - "charLength": 2, + "startLine": 45, + "startColumn": 19, + "charOffset": 1926, + "charLength": 13, + "snippet": { + "text": "methodPattern" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 43, + "startColumn": 1, + "charOffset": 1888, + "charLength": 59, + "snippet": { + "text": " @Getter\n @Setter\n private Pattern methodPattern;\n\n /**" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "cf84819f339902603b36a0444f5a874ab84d01b78a229b3969c6a59b45e62af7" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'diagnosticsOptions' may be 'final'", + "markdown": "Field `diagnosticsOptions` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/LanguageServerConfiguration.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 85, + "startColumn": 30, + "charOffset": 3477, + "charLength": 18, + "snippet": { + "text": "diagnosticsOptions" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 83, + "startColumn": 1, + "charOffset": 3381, + "charLength": 171, + "snippet": { + "text": " @JsonProperty(\"diagnostics\")\n @Setter(value = AccessLevel.NONE)\n private DiagnosticsOptions diagnosticsOptions = new DiagnosticsOptions();\n\n @JsonProperty(\"codeLens\")" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "e4a8747518e7359166822947a228e7e821d89bd7bbd862631556fc40b0af2b5e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'ordinaryAppSupport' may be 'final'", + "markdown": "Field `ordinaryAppSupport` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/diagnostics/DiagnosticsOptions.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 48, + "startColumn": 19, + "charOffset": 1930, + "charLength": 18, + "snippet": { + "text": "ordinaryAppSupport" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 46, + "startColumn": 1, + "charOffset": 1826, + "charLength": 199, + "snippet": { + "text": " private SkipSupport skipSupport = SkipSupport.NEVER;\n private Mode mode = Mode.ON;\n private boolean ordinaryAppSupport = true;\n private SubsystemFilter subsystemsFilter = new SubsystemFilter();\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "e595d4c2ddc63ac5783e7ebb56eed6d7b295e25c0bacf86b80a95e921b7df563" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "RedundantCast", + "kind": "fail", + "level": "warning", + "message": { + "text": "Casting 'expression.getParent()' to 'BSLParser.ElsifBranchContext' is redundant", + "markdown": "Casting `expression.getParent()` to `BSLParser.ElsifBranchContext` is redundant" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/AllFunctionPathMustHaveReturnDiagnostic.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 162, + "startColumn": 27, + "charOffset": 6178, + "charLength": 28, + "snippet": { + "text": "BSLParser.ElsifBranchContext" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 160, + "startColumn": 1, + "charOffset": 6010, + "charLength": 229, + "snippet": { + "text": " var expression = v.getExpression();\n if (expression.getParent() instanceof BSLParser.ElsifBranchContext && !ignoreMissingElseOnExit) {\n return Optional.of((BSLParser.ElsifBranchContext) expression.getParent());\n }\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "cf16fab86b340461a763ad3df7290cbbae7fb2dfc659c327c423912ebc40f68b" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "SimplifyStreamApiCallChains", + "kind": "fail", + "level": "warning", + "message": { + "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/RewriteMethodParameterDiagnostic.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 184, + "startColumn": 10, + "charOffset": 7838, + "charLength": 28, + "snippet": { + "text": "collect(Collectors.toList())" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 182, + "startColumn": 1, + "charOffset": 7777, + "charLength": 204, + "snippet": { + "text": " reference.getSelectionRange(),\n \"+1\"\n )).collect(Collectors.toList());\n var resultRefs = new ArrayList();\n resultRefs.add(RelatedInformation.create(" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "bsl-language-server.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "54974f45d0575f20f8528cc62150ef6f99612f9e6f3eaa48bbece33fe40e35eb" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + { + "ruleId": "UNUSED_IMPORT", + "kind": "fail", + "level": "warning", + "message": { + "text": "Unused import 'import org.antlr.v4.runtime.RuleContext;'", + "markdown": "Unused import `import org.antlr.v4.runtime.RuleContext;`" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/com/github/_1c_syntax/bsl/languageserver/codeactions/ExtractStructureConstructorSupplier.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 35, + "startColumn": 1, + "charOffset": 1627, + "charLength": 40, "snippet": { - "text": "\"\"" + "text": "import org.antlr.v4.runtime.RuleContext;" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 84, + "startLine": 33, "startColumn": 1, - "charOffset": 3212, - "charLength": 208, + "charOffset": 1526, + "charLength": 225, "snippet": { - "text": " @DiagnosticParameter(\n type = String.class,\n defaultValue = \"\" + DEFAULT_LIST_FOR_CHECK_END\n )\n private Pattern listOfIncorrectLastSymbol = createPatternIncorrectEndLine(DEFAULT_LIST_FOR_CHECK_END);" + "text": "import com.github._1c_syntax.bsl.parser.BSLParserRuleContext;\nimport lombok.RequiredArgsConstructor;\nimport org.antlr.v4.runtime.RuleContext;\nimport org.antlr.v4.runtime.tree.TerminalNode;\nimport org.eclipse.lsp4j.CodeAction;" }, "sourceLanguage": "JAVA" } @@ -61592,7 +62216,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "71fad01f46f068479c1dec20f8a590a32612f69d6f8ca4af831065bf49393b42" + "equalIndicator/v1": "d6d2b7e443732e19ee62238a2dead2c4681ee40bdc2e748a9be2e70ac5045a33" }, "properties": { "ideaSeverity": "WARNING",