From 4c8c6aa418a949efa411f69c31ff8e70ed94caa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 4 Jul 2024 22:55:43 +0000 Subject: [PATCH] deploy: 3138837408ce13e0e899e825f252e7f6c5d0ff5f --- results/descriptions/Code_Inspection.json | 1092 +++---- results/metaInformation.json | 6 +- results/qodana.sarif.json | 3272 ++++++++++----------- results/sanity.json | 322 +- 4 files changed, 2346 insertions(+), 2346 deletions(-) diff --git a/results/descriptions/Code_Inspection.json b/results/descriptions/Code_Inspection.json index 8d4acef..efc8084 100644 --- a/results/descriptions/Code_Inspection.json +++ b/results/descriptions/Code_Inspection.json @@ -1973,6 +1973,221 @@ } ] }, + { + "name": "Error handling", + "inspections": [ + { + "shortName": "UncheckedExceptionClass", + "displayName": "Unchecked 'Exception' class", + "enabled": false, + "description": "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" + }, + { + "shortName": "CheckedExceptionClass", + "displayName": "Checked exception class", + "enabled": false, + "description": "Reports checked exception classes (that is, subclasses of `java.lang.Exception` that are not subclasses of `java.lang.RuntimeException`).\n\nSome coding standards suppress checked user-defined exception classes.\n\n**Example:**\n\n\n class IllegalMoveException extends Exception {}\n" + }, + { + "shortName": "NestedTryStatement", + "displayName": "Nested 'try' statement", + "enabled": false, + "description": "Reports nested `try` statements.\n\nNested `try` statements\nmay result in unclear code and should probably have their `catch` and `finally` sections\nmerged." + }, + { + "shortName": "BadExceptionThrown", + "displayName": "Prohibited exception thrown", + "enabled": false, + "description": "Reports `throw` statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as `java.lang.Exception` or `java.io.IOException`.\n\n**Example:**\n\n\n void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported." + }, + { + "shortName": "CaughtExceptionImmediatelyRethrown", + "displayName": "Caught exception is immediately rethrown", + "enabled": true, + "description": "Reports `catch` blocks that immediately rethrow the caught exception without performing any action on it. Such `catch` blocks are unnecessary and have no error handling.\n\n**Example:**\n\n\n try {\n new FileInputStream(\"\");\n } catch (FileNotFoundException e) {\n throw e;\n }\n" + }, + { + "shortName": "ThrowFromFinallyBlock", + "displayName": "'throw' inside 'finally' block", + "enabled": true, + "description": "Reports `throw` statements inside `finally` blocks.\n\nWhile occasionally intended, such `throw` statements may conceal exceptions thrown from `try`-`catch` and thus\ntremendously complicate the debugging process." + }, + { + "shortName": "ContinueOrBreakFromFinallyBlock", + "displayName": "'continue' or 'break' inside 'finally' block", + "enabled": true, + "description": "Reports `break` or `continue` statements inside of `finally` blocks.\n\nWhile occasionally intended, such statements are very confusing, may mask thrown exceptions, and complicate debugging.\n\n**Example:**\n\n\n while (true) {\n try {\n throwingMethod();\n } finally {\n continue;\n }\n }\n" + }, + { + "shortName": "BadExceptionDeclared", + "displayName": "Prohibited exception declared", + "enabled": false, + "description": "Reports methods that declare an inappropriate exception in their `throws` clause. For example an exception can be inappropriate because it is overly generic, such as `java.lang.Exception` or `java.lang.Throwable`.\n\n**Example:**\n\n\n void describeModule(String module) throws Exception {} // warning: Prohibited exception 'Exception' declared\n\nConfigure the inspection:\n\n* Use the **Prohibited exceptions** list to specify which exceptions should be reported.\n* Use the **Ignore exceptions declared on methods overriding a library method** option to ignore exceptions declared by methods that override a library method." + }, + { + "shortName": "ReturnFromFinallyBlock", + "displayName": "'return' inside 'finally' block", + "enabled": true, + "description": "Reports `return` statements inside of `finally` blocks.\n\nWhile occasionally intended, such `return` statements may mask thrown exceptions\nand complicate debugging.\n\n**Example:**\n\n\n try {\n foo();\n } finally {\n if (bar()) return;\n }\n" + }, + { + "shortName": "TooBroadThrows", + "displayName": "Overly broad 'throws' clause", + "enabled": false, + "description": "Reports `throws` clauses with exceptions that are more generic than the exceptions that the method actually throws.\n\n**Example:**\n\n\n public void createFile() throws Exception { // warning: 'throws Exception' is too broad, masking exception 'IOException'\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nAfter the quick-fix is applied:\n\n\n public void createFile() throws IOException {\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nConfigure the inspection:\n\n* Use the **Maximum number of hidden exceptions to warn** field to ignore exceptions, that hide a larger number of other exceptions than specified.\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions declared on methods overriding a library method** option to ignore overly broad `throws` clauses in methods that override a library method.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown from the method body and thus are technically not overly broad." + }, + { + "shortName": "BadExceptionCaught", + "displayName": "Prohibited 'Exception' caught", + "enabled": false, + "description": "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." + }, + { + "shortName": "InstanceofCatchParameter", + "displayName": "'instanceof' on 'catch' parameter", + "enabled": false, + "description": "Reports cases in which an `instanceof` expression is used for testing the type of a parameter in a `catch` block.\n\nTesting the type of `catch` parameters is usually better done by having separate\n`catch` blocks instead of using `instanceof`.\n\n**Example:**\n\n\n void foo(Runnable runnable) {\n try {\n runnable.run();\n } catch (Throwable throwable) {\n if (throwable instanceof NoClassDefFoundError) { // warning: 'instanceof' on 'catch' parameter 'throwable'\n System.out.println(\"Class not found!\");\n }\n }\n }\n" + }, + { + "shortName": "FinallyBlockCannotCompleteNormally", + "displayName": "'finally' block which can not complete normally", + "enabled": true, + "description": "Reports `return`, `throw`, `break`, `continue`, and `yield` statements that are used inside `finally` blocks. These cause the `finally` block to not complete normally but to complete abruptly. Any exceptions thrown from the `try` and `catch` blocks of the same `try`-`catch` statement will be suppressed.\n\n**Example:**\n\n\n void x() {\n try {\n throw new RuntimeException();\n } finally {\n // if bar() returns true, the RuntimeException will be suppressed\n if (bar()) return;\n }\n }\n" + }, + { + "shortName": "EmptyFinallyBlock", + "displayName": "Empty 'finally' block", + "enabled": true, + "description": "Reports empty `finally` blocks.\n\nEmpty `finally` blocks usually indicate coding errors. They may also remain after code refactoring and can safely be removed.\n\nThis inspection doesn't report empty `finally` blocks found in JSP files.\n\n**Example:**\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n" + }, + { + "shortName": "ErrorRethrown", + "displayName": "'Error' not rethrown", + "enabled": false, + "description": "Reports `try` statements that catch `java.lang.Error` or any of its subclasses and do not rethrow the error.\n\nStatements that catch `java.lang.ThreadDeath` are not\nreported.\n\n**Example:**\n\n\n try {\n executeTests(request);\n }\n catch (OutOfMemoryError ex) { // warning: Error 'ex' not rethrown\n return false;\n }\n" + }, + { + "shortName": "NewExceptionWithoutArguments", + "displayName": "Exception constructor called without arguments", + "enabled": false, + "description": "Reports creation of a exception instance without any arguments specified.\n\nWhen an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes\ndebugging needlessly hard.\n\n**Example:**\n\n\n throw new IOException(); // warning: exception without arguments\n" + }, + { + "shortName": "TooBroadCatch", + "displayName": "Overly broad 'catch' block", + "enabled": false, + "description": "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." + }, + { + "shortName": "UnnecessaryInitCause", + "displayName": "Unnecessary call to 'Throwable.initCause()'", + "enabled": true, + "description": "Reports calls to `Throwable.initCause()` where an exception constructor also takes a `Throwable cause` argument.\n\nIn this case, the `initCause()` call can be removed and its argument can be added to the call to the exception's constructor.\n\n**Example:**\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }\n\nA quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied:\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }\n \n" + }, + { + "shortName": "ExceptionFromCatchWhichDoesntWrap", + "displayName": "'throw' inside 'catch' block which ignores the caught exception", + "enabled": false, + "description": "Reports exceptions that are thrown from inside `catch` blocks but do not \"wrap\" the caught exception.\n\nWhen an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information,\nsuch as stack frames and line numbers.\n\n**Example:**\n\n\n ...\n catch (IOException e) {\n closeAllConnections();\n throw new ConnectException(\"Connection problem.\"); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if result of exception method call is used** option to indicate whether the inspection should ignore exceptions whose argument is the result of a method call on the original exception, such as `getMessage()`.\n* Use the **Ignore if thrown exception cannot wrap an exception** option to ignore `throw` statements that throw exceptions without a constructor that accepts a `Throwable` cause." + }, + { + "shortName": "NullThrown", + "displayName": "'null' thrown", + "enabled": false, + "description": "Reports `null` literals that are used as the argument of a `throw` statement.\n\nSuch constructs produce a `java.lang.NullPointerException` that usually should not be thrown programmatically." + }, + { + "shortName": "ExtendsThrowable", + "displayName": "Class directly extends 'Throwable'", + "enabled": false, + "description": "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" + }, + { + "shortName": "ThreadDeathRethrown", + "displayName": "'ThreadDeath' not rethrown", + "enabled": false, + "description": "Reports `try` statements that catch `java.lang.ThreadDeath` and do not rethrow the exception.\n\n**Example:**\n\n\n try {\n executeInParallel(request);\n } catch (ThreadDeath ex) { // warning: ThreadDeath 'ex' not rethrown\n return false;\n }\n" + }, + { + "shortName": "EmptyTryBlock", + "displayName": "Empty 'try' block", + "enabled": true, + "description": "Reports empty `try` blocks, including try-with-resources statements.\n\n`try` blocks with comments are considered empty.\n\n\nThis inspection doesn't report empty `try` blocks found in JSP files." + }, + { + "shortName": "ThrowableSupplierOnlyThrowException", + "displayName": "Throwable supplier never returns a value", + "enabled": true, + "description": "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" + }, + { + "shortName": "NonFinalFieldOfException", + "displayName": "Non-final field of 'Exception' class", + "enabled": false, + "description": "Reports fields in subclasses of `java.lang.Exception` that are not declared `final`.\n\nData on exception objects should not be modified\nbecause this may result in losing the error context for later debugging and logging.\n\n**Example:**\n\n\n public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }\n" + }, + { + "shortName": "CatchMayIgnoreException", + "displayName": "Catch block may ignore exception", + "enabled": true, + "description": "Reports `catch` blocks that are empty or may ignore an exception.\n\nWhile occasionally intended, empty `catch` blocks may complicate debugging.\nAlso, ignoring a `catch` parameter might be wrong.\nFinally, the static code analyzer reports if it detects that a `catch` block may silently ignore important VM\nexceptions like `NullPointerException`. Ignoring such an exception\n(without logging or rethrowing it) may hide a bug.\n\n\nThe inspection won't report any `catch` parameters named `ignore` or `ignored`.\nConversely, the inspection will warn you about any `catch` parameters named `ignore` or `ignored` that are actually in use.\nAdditionally, the inspection won't report `catch` parameters inside test sources named `expected` or `ok`.\n\n\nYou can use a quick-fix to change the exception name to `ignored`.\nFor empty **catch** blocks, an additional quick-fix to generate the **catch** body is suggested.\nYou can modify the \"Catch Statement Body\" template on the Code tab in\n[Settings \\| Editor \\| File and Code Templates](settings://fileTemplates).\n\n**Example:**\n\n\n try {\n throwingMethod();\n } catch (IOException ex) {\n\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n System.out.println(System.in.read());\n } catch (IOException ignored) {\n\n }\n\nConfigure the inspection:\n\n* Use the **Do not warn when 'catch' block contains a comment** option to ignore `catch` blocks with comments.\n* Use the **Do not warn when 'catch' block is not empty** option to ignore `catch` blocks that contain statements or comments inside, while the variable itself is not used.\n* Use the **Do not warn when exception named 'ignore(d)' is not actually ignored** option to ignore variables named `ignored` if they are in use.\n\nNew in 2018.1" + }, + { + "shortName": "ThrowCaughtLocally", + "displayName": "'throw' caught by containing 'try' statement", + "enabled": false, + "description": "Reports `throw` statements whose exceptions are always caught by containing `try` statements.\n\nUsing `throw`\nstatements as a \"goto\" to change the local flow of control is confusing and results in poor performance.\n\n**Example:**\n\n\n try {\n if (!Files.isDirectory(PROJECTS)) {\n throw new IllegalStateException(\"Directory not found.\"); // warning: 'throw' caught by containing 'try' statement\n }\n ...\n } catch (Exception e) {\n LOG.error(\"run failed\");\n }\n\nUse the **Ignore rethrown exceptions** option to ignore exceptions that are rethrown." + }, + { + "shortName": "ThrowsRuntimeException", + "displayName": "Unchecked exception declared in 'throws' clause", + "enabled": false, + "description": "Reports declaration of an unchecked exception (`java.lang.RuntimeException` or one of its subclasses) in the `throws` clause of a method.\n\nDeclarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc `@throws` tag.\n\n**Example:**\n\n\n public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }\n" + }, + { + "shortName": "GroovyThrowFromFinallyBlock", + "displayName": "'throw' inside 'finally' block", + "enabled": false, + "description": "Reports `throw` statements inside of `finally` blocks.\n\n\nWhile occasionally intended, such `throw` statements may mask exceptions thrown and\ntremendously complicate debugging." + }, + { + "shortName": "GroovyEmptyCatchBlock", + "displayName": "Empty 'catch' block", + "enabled": false, + "description": "Reports empty `catch` blocks. While occasionally intended, empty `catch` blocks can make debugging extremely difficult.\n\n**Example:**\n\n\n try {\n throw new Exception()\n }\n catch (Exception e) {\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n throw new Exception()\n }\n catch (Exception ignored) {\n }\n\n" + }, + { + "shortName": "GroovyContinueOrBreakFromFinallyBlock", + "displayName": "'continue' or 'break' from 'finally' block", + "enabled": false, + "description": "Reports `break` and `continue` statements inside of `finally` blocks.\n\nWhile occasionally intended, such statements are very confusing, may mask thrown exceptions, and tremendously complicate debugging." + }, + { + "shortName": "GroovyUnusedCatchParameter", + "displayName": "Unused 'catch' parameter", + "enabled": false, + "description": "Reports **catch** parameters that are unused in their\ncorresponding blocks. This inspection will not report any **catch** parameters\nnamed \"ignore\" or \"ignored\".\n\n**Example:**\n\n\n try {\n def arr = new int[3]\n arr[5] = 5\n } catch(Exception ex) {\n println('Catching the exception')\n }\n\nHere the parameter **ex** is never used in **catch** block.\n\nAfter the quick-fix is applied:\n\n\n try {\n def arr = new int[3]\n arr[5] = 5\n } catch(Exception ignored) {\n println('Catching the exception')\n }\n" + }, + { + "shortName": "GroovyReturnFromFinallyBlock", + "displayName": "'return' inside 'finally' block", + "enabled": false, + "description": "Reports `return` statements inside of `finally` blocks.\n\n\nWhile occasionally intended, such `return` statements may mask exceptions thrown, and\ncomplicate debugging." + }, + { + "shortName": "GroovyEmptyTryBlock", + "displayName": "Empty 'try' block", + "enabled": false, + "description": "Reports empty `try` blocks. Empty `try` blocks usually indicate coding errors.\n\n**Example:**\n\n\n try {\n }\n finally {\n close()\n }\n\n" + }, + { + "shortName": "GroovyEmptyFinallyBlock", + "displayName": "Empty 'finally' block", + "enabled": false, + "description": "Reports empty `finally` blocks. Empty `finally` blocks usually indicate coding errors.\n\n**Example:**\n\n\n try {\n throw new Exception()\n }\n finally {\n }\n\n" + } + ] + }, { "name": "Declaration redundancy", "inspections": [ @@ -2123,217 +2338,121 @@ ] }, { - "name": "Error handling", + "name": "Migration", "inspections": [ { - "shortName": "UncheckedExceptionClass", - "displayName": "Unchecked 'Exception' class", - "enabled": false, - "description": "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" - }, - { - "shortName": "CheckedExceptionClass", - "displayName": "Checked exception class", - "enabled": false, - "description": "Reports checked exception classes (that is, subclasses of `java.lang.Exception` that are not subclasses of `java.lang.RuntimeException`).\n\nSome coding standards suppress checked user-defined exception classes.\n\n**Example:**\n\n\n class IllegalMoveException extends Exception {}\n" - }, - { - "shortName": "NestedTryStatement", - "displayName": "Nested 'try' statement", - "enabled": false, - "description": "Reports nested `try` statements.\n\nNested `try` statements\nmay result in unclear code and should probably have their `catch` and `finally` sections\nmerged." - }, - { - "shortName": "BadExceptionThrown", - "displayName": "Prohibited exception thrown", - "enabled": false, - "description": "Reports `throw` statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as `java.lang.Exception` or `java.io.IOException`.\n\n**Example:**\n\n\n void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported." - }, - { - "shortName": "CaughtExceptionImmediatelyRethrown", - "displayName": "Caught exception is immediately rethrown", - "enabled": true, - "description": "Reports `catch` blocks that immediately rethrow the caught exception without performing any action on it. Such `catch` blocks are unnecessary and have no error handling.\n\n**Example:**\n\n\n try {\n new FileInputStream(\"\");\n } catch (FileNotFoundException e) {\n throw e;\n }\n" - }, - { - "shortName": "ThrowFromFinallyBlock", - "displayName": "'throw' inside 'finally' block", - "enabled": true, - "description": "Reports `throw` statements inside `finally` blocks.\n\nWhile occasionally intended, such `throw` statements may conceal exceptions thrown from `try`-`catch` and thus\ntremendously complicate the debugging process." - }, - { - "shortName": "ContinueOrBreakFromFinallyBlock", - "displayName": "'continue' or 'break' inside 'finally' block", - "enabled": true, - "description": "Reports `break` or `continue` statements inside of `finally` blocks.\n\nWhile occasionally intended, such statements are very confusing, may mask thrown exceptions, and complicate debugging.\n\n**Example:**\n\n\n while (true) {\n try {\n throwingMethod();\n } finally {\n continue;\n }\n }\n" - }, - { - "shortName": "BadExceptionDeclared", - "displayName": "Prohibited exception declared", - "enabled": false, - "description": "Reports methods that declare an inappropriate exception in their `throws` clause. For example an exception can be inappropriate because it is overly generic, such as `java.lang.Exception` or `java.lang.Throwable`.\n\n**Example:**\n\n\n void describeModule(String module) throws Exception {} // warning: Prohibited exception 'Exception' declared\n\nConfigure the inspection:\n\n* Use the **Prohibited exceptions** list to specify which exceptions should be reported.\n* Use the **Ignore exceptions declared on methods overriding a library method** option to ignore exceptions declared by methods that override a library method." - }, - { - "shortName": "ReturnFromFinallyBlock", - "displayName": "'return' inside 'finally' block", - "enabled": true, - "description": "Reports `return` statements inside of `finally` blocks.\n\nWhile occasionally intended, such `return` statements may mask thrown exceptions\nand complicate debugging.\n\n**Example:**\n\n\n try {\n foo();\n } finally {\n if (bar()) return;\n }\n" - }, - { - "shortName": "TooBroadThrows", - "displayName": "Overly broad 'throws' clause", - "enabled": false, - "description": "Reports `throws` clauses with exceptions that are more generic than the exceptions that the method actually throws.\n\n**Example:**\n\n\n public void createFile() throws Exception { // warning: 'throws Exception' is too broad, masking exception 'IOException'\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nAfter the quick-fix is applied:\n\n\n public void createFile() throws IOException {\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nConfigure the inspection:\n\n* Use the **Maximum number of hidden exceptions to warn** field to ignore exceptions, that hide a larger number of other exceptions than specified.\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions declared on methods overriding a library method** option to ignore overly broad `throws` clauses in methods that override a library method.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown from the method body and thus are technically not overly broad." - }, - { - "shortName": "BadExceptionCaught", - "displayName": "Prohibited 'Exception' caught", - "enabled": false, - "description": "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." - }, - { - "shortName": "InstanceofCatchParameter", - "displayName": "'instanceof' on 'catch' parameter", - "enabled": false, - "description": "Reports cases in which an `instanceof` expression is used for testing the type of a parameter in a `catch` block.\n\nTesting the type of `catch` parameters is usually better done by having separate\n`catch` blocks instead of using `instanceof`.\n\n**Example:**\n\n\n void foo(Runnable runnable) {\n try {\n runnable.run();\n } catch (Throwable throwable) {\n if (throwable instanceof NoClassDefFoundError) { // warning: 'instanceof' on 'catch' parameter 'throwable'\n System.out.println(\"Class not found!\");\n }\n }\n }\n" - }, - { - "shortName": "FinallyBlockCannotCompleteNormally", - "displayName": "'finally' block which can not complete normally", - "enabled": true, - "description": "Reports `return`, `throw`, `break`, `continue`, and `yield` statements that are used inside `finally` blocks. These cause the `finally` block to not complete normally but to complete abruptly. Any exceptions thrown from the `try` and `catch` blocks of the same `try`-`catch` statement will be suppressed.\n\n**Example:**\n\n\n void x() {\n try {\n throw new RuntimeException();\n } finally {\n // if bar() returns true, the RuntimeException will be suppressed\n if (bar()) return;\n }\n }\n" - }, - { - "shortName": "EmptyFinallyBlock", - "displayName": "Empty 'finally' block", - "enabled": true, - "description": "Reports empty `finally` blocks.\n\nEmpty `finally` blocks usually indicate coding errors. They may also remain after code refactoring and can safely be removed.\n\nThis inspection doesn't report empty `finally` blocks found in JSP files.\n\n**Example:**\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n" - }, - { - "shortName": "ErrorRethrown", - "displayName": "'Error' not rethrown", - "enabled": false, - "description": "Reports `try` statements that catch `java.lang.Error` or any of its subclasses and do not rethrow the error.\n\nStatements that catch `java.lang.ThreadDeath` are not\nreported.\n\n**Example:**\n\n\n try {\n executeTests(request);\n }\n catch (OutOfMemoryError ex) { // warning: Error 'ex' not rethrown\n return false;\n }\n" - }, - { - "shortName": "NewExceptionWithoutArguments", - "displayName": "Exception constructor called without arguments", - "enabled": false, - "description": "Reports creation of a exception instance without any arguments specified.\n\nWhen an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes\ndebugging needlessly hard.\n\n**Example:**\n\n\n throw new IOException(); // warning: exception without arguments\n" - }, - { - "shortName": "TooBroadCatch", - "displayName": "Overly broad 'catch' block", + "shortName": "NonExhaustiveWhenStatementMigration", + "displayName": "Non-exhaustive 'when' statements will be prohibited since 1.7", "enabled": false, - "description": "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." + "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": "UnnecessaryInitCause", - "displayName": "Unnecessary call to 'Throwable.initCause()'", - "enabled": true, - "description": "Reports calls to `Throwable.initCause()` where an exception constructor also takes a `Throwable cause` argument.\n\nIn this case, the `initCause()` call can be removed and its argument can be added to the call to the exception's constructor.\n\n**Example:**\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }\n\nA quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied:\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }\n \n" + "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": "ExceptionFromCatchWhichDoesntWrap", - "displayName": "'throw' inside 'catch' block which ignores the caught exception", + "shortName": "CastDueToProgressionResolutionChangeMigration", + "displayName": "Progression resolution change since 1.9", "enabled": false, - "description": "Reports exceptions that are thrown from inside `catch` blocks but do not \"wrap\" the caught exception.\n\nWhen an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information,\nsuch as stack frames and line numbers.\n\n**Example:**\n\n\n ...\n catch (IOException e) {\n closeAllConnections();\n throw new ConnectException(\"Connection problem.\"); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if result of exception method call is used** option to indicate whether the inspection should ignore exceptions whose argument is the result of a method call on the original exception, such as `getMessage()`.\n* Use the **Ignore if thrown exception cannot wrap an exception** option to ignore `throw` statements that throw exceptions without a constructor that accepts a `Throwable` cause." + "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": "NullThrown", - "displayName": "'null' thrown", + "shortName": "AddConversionCallMigration", + "displayName": "Explicit conversion from `Int` needed since 1.9", "enabled": false, - "description": "Reports `null` literals that are used as the argument of a `throw` statement.\n\nSuch constructs produce a `java.lang.NullPointerException` that usually should not be thrown programmatically." + "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": "ExtendsThrowable", - "displayName": "Class directly extends 'Throwable'", + "shortName": "WarningOnMainUnusedParameterMigration", + "displayName": "Unused 'args' on 'main' since 1.4", "enabled": false, - "description": "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" + "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": "ThreadDeathRethrown", - "displayName": "'ThreadDeath' not rethrown", + "shortName": "RedundantLabelMigration", + "displayName": "Redundant label", "enabled": false, - "description": "Reports `try` statements that catch `java.lang.ThreadDeath` and do not rethrow the exception.\n\n**Example:**\n\n\n try {\n executeInParallel(request);\n } catch (ThreadDeath ex) { // warning: ThreadDeath 'ex' not rethrown\n return false;\n }\n" + "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\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." }, { - "shortName": "EmptyTryBlock", - "displayName": "Empty 'try' block", - "enabled": true, - "description": "Reports empty `try` blocks, including try-with-resources statements.\n\n`try` blocks with comments are considered empty.\n\n\nThis inspection doesn't report empty `try` blocks found in JSP files." + "shortName": "NoConstructorMigration", + "displayName": "Forbidden constructor call", + "enabled": false, + "description": "Reports a constructor calls on functional supertypes that will lead to compilation error since 1.9.\n\nMotivation types:\n\n* The implementation does not abide by a published spec or documentation\n\n**More details:** [KT-46344: No error for a super class constructor call on a function interface in supertypes list](https://youtrack.jetbrains.com/issue/KT-46344)\n\nThe quick-fix removes a constructor call.\n\n**Example:**\n\n\n abstract class A : () -> Int()\n\nAfter the quick-fix is applied:\n\n\n abstract class A : () -> Int\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.7 or higher." }, { - "shortName": "ThrowableSupplierOnlyThrowException", - "displayName": "Throwable supplier never returns a value", - "enabled": true, - "description": "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" + "shortName": "ProhibitTypeParametersForLocalVariablesMigration", + "displayName": "Local variable with type parameters", + "enabled": false, + "description": "Reports local variables with type parameters.\n\nA type parameter for a local variable doesn't make sense because it can't be specialized.\n\n**Example:**\n\n\n fun main() {\n val x = \"\"\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val x = \"\"\n }\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." }, { - "shortName": "NonFinalFieldOfException", - "displayName": "Non-final field of 'Exception' class", + "shortName": "InlineClassDeprecatedMigration", + "displayName": "Inline classes are deprecated since 1.5", "enabled": false, - "description": "Reports fields in subclasses of `java.lang.Exception` that are not declared `final`.\n\nData on exception objects should not be modified\nbecause this may result in losing the error context for later debugging and logging.\n\n**Example:**\n\n\n public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }\n" + "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": "CatchMayIgnoreException", - "displayName": "Catch block may ignore exception", - "enabled": true, - "description": "Reports `catch` blocks that are empty or may ignore an exception.\n\nWhile occasionally intended, empty `catch` blocks may complicate debugging.\nAlso, ignoring a `catch` parameter might be wrong.\nFinally, the static code analyzer reports if it detects that a `catch` block may silently ignore important VM\nexceptions like `NullPointerException`. Ignoring such an exception\n(without logging or rethrowing it) may hide a bug.\n\n\nThe inspection won't report any `catch` parameters named `ignore` or `ignored`.\nConversely, the inspection will warn you about any `catch` parameters named `ignore` or `ignored` that are actually in use.\nAdditionally, the inspection won't report `catch` parameters inside test sources named `expected` or `ok`.\n\n\nYou can use a quick-fix to change the exception name to `ignored`.\nFor empty **catch** blocks, an additional quick-fix to generate the **catch** body is suggested.\nYou can modify the \"Catch Statement Body\" template on the Code tab in\n[Settings \\| Editor \\| File and Code Templates](settings://fileTemplates).\n\n**Example:**\n\n\n try {\n throwingMethod();\n } catch (IOException ex) {\n\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n System.out.println(System.in.read());\n } catch (IOException ignored) {\n\n }\n\nConfigure the inspection:\n\n* Use the **Do not warn when 'catch' block contains a comment** option to ignore `catch` blocks with comments.\n* Use the **Do not warn when 'catch' block is not empty** option to ignore `catch` blocks that contain statements or comments inside, while the variable itself is not used.\n* Use the **Do not warn when exception named 'ignore(d)' is not actually ignored** option to ignore variables named `ignored` if they are in use.\n\nNew in 2018.1" + "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": "ThrowCaughtLocally", - "displayName": "'throw' caught by containing 'try' statement", - "enabled": false, - "description": "Reports `throw` statements whose exceptions are always caught by containing `try` statements.\n\nUsing `throw`\nstatements as a \"goto\" to change the local flow of control is confusing and results in poor performance.\n\n**Example:**\n\n\n try {\n if (!Files.isDirectory(PROJECTS)) {\n throw new IllegalStateException(\"Directory not found.\"); // warning: 'throw' caught by containing 'try' statement\n }\n ...\n } catch (Exception e) {\n LOG.error(\"run failed\");\n }\n\nUse the **Ignore rethrown exceptions** option to ignore exceptions that are rethrown." + "shortName": "KotlinDeprecation", + "displayName": "Usage of redundant or deprecated syntax or deprecated symbols", + "enabled": true, + "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": "ThrowsRuntimeException", - "displayName": "Unchecked exception declared in 'throws' clause", + "shortName": "OverrideDeprecatedMigration", + "displayName": "Do not propagate method deprecation through overrides since 1.9", "enabled": false, - "description": "Reports declaration of an unchecked exception (`java.lang.RuntimeException` or one of its subclasses) in the `throws` clause of a method.\n\nDeclarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc `@throws` tag.\n\n**Example:**\n\n\n public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }\n" + "description": "Reports a declarations that are propagated by `@Deprecated` annotation that will lead to compilation error since 1.9.\n\nMotivation types:\n\n* Implementation changes are required for implementation design/architectural reasons\n* Inconsistency in the design (things are done differently in different contexts)\n\n**More details:** [KT-47902: Do not propagate method deprecation through overrides](https://youtrack.jetbrains.com/issue/KT-47902)\n\nThe quick-fix copies `@Deprecated` annotation from the parent declaration.\n\n**Example:**\n\n\n open class Base {\n @Deprecated(\"Don't use\")\n open fun foo() {}\n }\n\n class Derived : Base() {\n override fun foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n open class Base {\n @Deprecated(\"Don't use\")\n open fun foo() {}\n }\n\n class Derived : Base() {\n @Deprecated(\"Don't use\")\n override fun foo() {}\n }\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.6 or higher." }, { - "shortName": "GroovyThrowFromFinallyBlock", - "displayName": "'throw' inside 'finally' block", + "shortName": "ObsoleteExperimentalCoroutines", + "displayName": "Experimental coroutines usages are deprecated since 1.3", "enabled": false, - "description": "Reports `throw` statements inside of `finally` blocks.\n\n\nWhile occasionally intended, such `throw` statements may mask exceptions thrown and\ntremendously complicate debugging." + "description": "Reports code that uses experimental coroutines.\n\nSuch usages are incompatible with Kotlin 1.3+ and should be updated." }, { - "shortName": "GroovyEmptyCatchBlock", - "displayName": "Empty 'catch' block", + "shortName": "FromClosedRangeMigration", + "displayName": "MIN_VALUE step in fromClosedRange() since 1.3", "enabled": false, - "description": "Reports empty `catch` blocks. While occasionally intended, empty `catch` blocks can make debugging extremely difficult.\n\n**Example:**\n\n\n try {\n throw new Exception()\n }\n catch (Exception e) {\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n throw new Exception()\n }\n catch (Exception ignored) {\n }\n\n" + "description": "Reports `IntProgression.fromClosedRange()` and `LongProgression.fromClosedRange()` with `MIN_VALUE` step.\n\n\nIt is prohibited to call `IntProgression.fromClosedRange()` and `LongProgression.fromClosedRange()` with\n`MIN_VALUE` step. All such calls should be checked during migration to Kotlin 1.3+.\n\n**Example:**\n\n\n IntProgression.fromClosedRange(12, 143, Int.MIN_VALUE)\n\nTo fix the problem change the step of the progression." }, { - "shortName": "GroovyContinueOrBreakFromFinallyBlock", - "displayName": "'continue' or 'break' from 'finally' block", + "shortName": "DeclaringClassMigration", + "displayName": "Deprecated 'Enum.declaringClass' property", "enabled": false, - "description": "Reports `break` and `continue` statements inside of `finally` blocks.\n\nWhile occasionally intended, such statements are very confusing, may mask thrown exceptions, and tremendously complicate debugging." + "description": "Reports 'declaringClass' property calls on Enum that will lead to compilation error since 1.9.\n\n'Enum.getDeclaringClass' is among \"hidden\" Java functions which aren't normally visible by resolve. However, it's visible via synthetic\nproperty that is a front-end bug.\n\n**More details:** [KT-49653 Deprecate and remove Enum.declaringClass synthetic\nproperty](https://youtrack.jetbrains.com/issue/KT-49653)\n\nThe quick-fix replaces a call with 'declaringJavaClass'.\n\n**Example:**\n\n\n fun > foo(values: Array) {\n EnumSet.noneOf(values.first().declaringClass)\n }\n\nAfter the quick-fix is applied:\n\n\n fun > foo(values: Array) {\n EnumSet.noneOf(values.first().declaringJavaClass)\n }\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.7 or higher." }, { - "shortName": "GroovyUnusedCatchParameter", - "displayName": "Unused 'catch' parameter", + "shortName": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", + "displayName": "Meaningless annotations targets on superclass", "enabled": false, - "description": "Reports **catch** parameters that are unused in their\ncorresponding blocks. This inspection will not report any **catch** parameters\nnamed \"ignore\" or \"ignored\".\n\n**Example:**\n\n\n try {\n def arr = new int[3]\n arr[5] = 5\n } catch(Exception ex) {\n println('Catching the exception')\n }\n\nHere the parameter **ex** is never used in **catch** block.\n\nAfter the quick-fix is applied:\n\n\n try {\n def arr = new int[3]\n arr[5] = 5\n } catch(Exception ignored) {\n println('Catching the exception')\n }\n" + "description": "Reports meaningless annotation targets on superclasses since Kotlin 1.4.\n\nAnnotation targets such as `@get:` are meaningless on superclasses and are prohibited.\n\n**Example:**\n\n\n interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo\n\nAfter the quick-fix is applied:\n\n\n interface Foo\n\n annotation class Ann\n\n class E : Foo\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." }, { - "shortName": "GroovyReturnFromFinallyBlock", - "displayName": "'return' inside 'finally' block", + "shortName": "ObsoleteKotlinJsPackages", + "displayName": "'kotlin.browser' and 'kotlin.dom' packages are deprecated since 1.4", "enabled": false, - "description": "Reports `return` statements inside of `finally` blocks.\n\n\nWhile occasionally intended, such `return` statements may mask exceptions thrown, and\ncomplicate debugging." + "description": "Reports usages of `kotlin.dom` and `kotlin.browser` packages.\n\nThese packages were moved to `kotlinx.dom` and `kotlinx.browser`\nrespectively in Kotlin 1.4+." }, { - "shortName": "GroovyEmptyTryBlock", - "displayName": "Empty 'try' block", + "shortName": "RestrictReturnStatementTargetMigration", + "displayName": "Target label does not denote a function since 1.4", "enabled": false, - "description": "Reports empty `try` blocks. Empty `try` blocks usually indicate coding errors.\n\n**Example:**\n\n\n try {\n }\n finally {\n close()\n }\n\n" + "description": "Reports labels that don't points to a functions.\n\nIt's forbidden to declare a target label that does not denote a function.\n\nThe quick-fix removes the label.\n\n**Example:**\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }\n\nAfter the quick-fix is applied:\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }\n\nThis inspection only reports if the language level of the project or module is 1.4 or higher." }, { - "shortName": "GroovyEmptyFinallyBlock", - "displayName": "Empty 'finally' block", + "shortName": "ProhibitRepeatedUseSiteTargetAnnotationsMigration", + "displayName": "Repeated annotation which is not marked as '@Repeatable'", "enabled": false, - "description": "Reports empty `finally` blocks. Empty `finally` blocks usually indicate coding errors.\n\n**Example:**\n\n\n try {\n throw new Exception()\n }\n finally {\n }\n\n" + "description": "Reports the repeated use of a non-`@Repeatable` annotation on property accessors.\n\n\nAs a result of using non-`@Repeatable` annotation multiple times, both annotation usages\nwill appear in the bytecode leading to an ambiguity in reflection calls.\n\n\nSince Kotlin 1.4 it's mandatory to either mark annotation as `@Repeatable` or not\nrepeat the annotation, otherwise it will lead to compilation error.\n\n**Example:**\n\n\n annotation class Foo(val x: Int)\n\n @get:Foo(10)\n val a: String\n @Foo(20) get() = \"foo\" // annotation repeated twice but not marked as @Repeatable\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." } ] }, @@ -2370,18 +2489,18 @@ "enabled": true, "description": "Reports calls to `StringBuffer` and `StringBuilder` constructors with `char` as the argument. In this case, `char` is silently cast to an integer and interpreted as the initial capacity of the buffer.\n\n**Example:**\n\n\n new StringBuilder('(').append(\"1\").append(')');\n\nAfter the quick-fix is applied:\n\n\n new StringBuilder(\"(\").append(\"1\").append(')');\n" }, - { - "shortName": "ResultOfObjectAllocationIgnored", - "displayName": "Result of object allocation ignored", - "enabled": false, - "description": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." - }, { "shortName": "ClassGetClass", "displayName": "Suspicious 'Class.getClass()' call", "enabled": true, "description": "Reports `getClass()` methods that are called on a `java.lang.Class` instance.\n\nThis is usually a mistake as the result is always equivalent to `Class.class`.\nIf it's a mistake, then it's better to remove the `getClass()` call and use the qualifier directly.\nIf the behavior is intended, then it's better to write `Class.class` explicitly to avoid confusion.\n\nExample:\n\n\n void test(Class clazz) {\n String name = clazz.getClass().getName();\n }\n\nAfter one of the possible quick-fixes is applied:\n\n\n void test(Class clazz) {\n String name = clazz.getName();\n }\n\nNew in 2018.2" }, + { + "shortName": "ResultOfObjectAllocationIgnored", + "displayName": "Result of object allocation ignored", + "enabled": false, + "description": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." + }, { "shortName": "MismatchedStringBuilderQueryUpdate", "displayName": "Mismatched query and update of 'StringBuilder'", @@ -2880,18 +2999,18 @@ "enabled": true, "description": "Reports annotations used on record components that have no effect.\n\nThis can happen in two cases:\n\n* The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined.\n* The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined.\n\nExample:\n\n\n @Target(ElementType.METHOD)\n @interface A { }\n \n // The annotation will not appear in bytecode at all,\n // as it should be propagated to the accessor but accessor is explicitly defined \n record R(@A int x) {\n public int x() { return x; }\n }\n\nThis inspection depends on the Java feature 'Records' which is available since Java 16.\n\nNew in 2021.1" }, - { - "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": "MagicConstant", "displayName": "Magic constant", "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": "MismatchedCollectionQueryUpdate", "displayName": "Mismatched query and update of collection", @@ -3310,198 +3429,79 @@ "shortName": "GroovyRangeTypeCheck", "displayName": "Incorrect range arguments", "enabled": false, - "description": "Reports types used in ranges that do not have a `next()` or `previous()` method or do not implement the `java.lang.Comparable` interface." - }, - { - "shortName": "GroovyDivideByZero", - "displayName": "Division by zero", - "enabled": false, - "description": "Reports divisions by zero or remainders by zero.\n\n**Example:**\n\n\n def a = 42\n a / 0 // warning\n a % 0.0 // warning\n" - }, - { - "shortName": "GrSwitchExhaustivenessCheck", - "displayName": "Exhaustiveness check for switch expressions", - "enabled": false, - "description": "Reports switch expressions that do not cover all possible outcomes of the matched expression.\n\nGroovy does not require that switch expression must be exhaustive. It acts as if an implicit `default -> null` branch is inserted.\nIt may cause unexpected nulls if a developer forgets to insert necessary `case` branches.\n\n**Example:**\n\n\n enum A { X, Y }\n\n def foo(A a) {\n def x = switch (a) { // reports switch\n case A.X -> ...\n }\n }\n" - }, - { - "shortName": "GroovyUntypedAccess", - "displayName": "Untyped reference expression", - "enabled": false, - "description": "Reports reference expressions whose type can't be determined." - }, - { - "shortName": "GroovyResultOfObjectAllocationIgnored", - "displayName": "Result of object allocation ignored", - "enabled": false, - "description": "Reports object allocation where the result of this operation is ignored.\n\n\nSuch allocation expressions are legal Groovy, but are usually either inadvertent, or\nevidence of a complicated object initialization strategy." - }, - { - "shortName": "GroovyDocCheck", - "displayName": "Unresolved GroovyDoc reference", - "enabled": false, - "description": "Reports unresolved references inside GroovyDoc comments." - }, - { - "shortName": "GroovyConstructorNamedArguments", - "displayName": "Named arguments of constructor call", - "enabled": false, - "description": "Reports named arguments of a default class constructor call which don't correspond to properties of this class.\n\n**Example:**\n\n\n class Person {\n def name\n def age\n }\n\n // 'firstName' property doesn't exist\n new Person(firstName: \"John\")\n" - }, - { - "shortName": "GrUnresolvedAccess", - "displayName": "Unresolved reference expression", - "enabled": false, - "description": "Reports reference expressions which cannot be resolved." - }, - { - "shortName": "GroovyInfiniteLoopStatement", - "displayName": "Infinite loop statement", - "enabled": false, - "description": "Reports `for`, `while`, or `do` statements which can only exit by throwing an exception. While such statements may be correct, they usually happen by mistake.\n\n**Example:**\n\n\n while(true) {\n Thread.sleep(1000)\n }\n\n" - }, - { - "shortName": "GrPermitsClause", - "displayName": "Non-extending permitted subclasses", - "enabled": false, - "description": "Reports permitted classes that do not extend the sealed base class.\n\nGroovy does not require that all permitted classes should be available in compile-time and compiled along with base class. Compiler will not warn the user on dealing with non-extending permitted subclass, but it contradicts the nature of sealed classes.\n\n**Example:**\n\n\n class A permits B {} // reports B\n class B {}\n" - }, - { - "shortName": "GrEqualsBetweenInconvertibleTypes", - "displayName": "'equals()' between objects of inconvertible types", - "enabled": false, - "description": "Reports calls to `equals()` where the target and argument are of incompatible types.\n\nWhile such a call might theoretically be useful, most likely it represents a bug.\n\n**Example:**\n\n\n new HashSet() == new TreeSet())\n" - }, - { - "shortName": "GroovyInfiniteRecursion", - "displayName": "Infinite recursion", - "enabled": false, - "description": "Reports methods which must either recurse infinitely or throw an exception. Methods reported by this inspection could not be finished correct.\n\n**Example:**\n\n\n // this function always dive deeper\n def fibonacci(int n) {\n return fibonacci(n-1) + fibonacci(n-2)\n }\n\n" - }, - { - "shortName": "NonExternalClassifierExtendingStateOrProps", - "displayName": "Non-external classifier extending State or Props", - "enabled": true, - "description": "Reports non-external classifier extending State or Props. Read more in the [migration guide](https://kotlinlang.org/docs/js-ir-migration.html#convert-js-and-react-related-classes-and-interfaces-to-external-interfaces)." - } - ] - }, - { - "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": "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": "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": "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\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." - }, - { - "shortName": "NoConstructorMigration", - "displayName": "Forbidden constructor call", - "enabled": false, - "description": "Reports a constructor calls on functional supertypes that will lead to compilation error since 1.9.\n\nMotivation types:\n\n* The implementation does not abide by a published spec or documentation\n\n**More details:** [KT-46344: No error for a super class constructor call on a function interface in supertypes list](https://youtrack.jetbrains.com/issue/KT-46344)\n\nThe quick-fix removes a constructor call.\n\n**Example:**\n\n\n abstract class A : () -> Int()\n\nAfter the quick-fix is applied:\n\n\n abstract class A : () -> Int\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.7 or higher." + "description": "Reports types used in ranges that do not have a `next()` or `previous()` method or do not implement the `java.lang.Comparable` interface." }, { - "shortName": "ProhibitTypeParametersForLocalVariablesMigration", - "displayName": "Local variable with type parameters", + "shortName": "GroovyDivideByZero", + "displayName": "Division by zero", "enabled": false, - "description": "Reports local variables with type parameters.\n\nA type parameter for a local variable doesn't make sense because it can't be specialized.\n\n**Example:**\n\n\n fun main() {\n val x = \"\"\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val x = \"\"\n }\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." + "description": "Reports divisions by zero or remainders by zero.\n\n**Example:**\n\n\n def a = 42\n a / 0 // warning\n a % 0.0 // warning\n" }, { - "shortName": "InlineClassDeprecatedMigration", - "displayName": "Inline classes are deprecated since 1.5", + "shortName": "GrSwitchExhaustivenessCheck", + "displayName": "Exhaustiveness check for switch expressions", "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 switch expressions that do not cover all possible outcomes of the matched expression.\n\nGroovy does not require that switch expression must be exhaustive. It acts as if an implicit `default -> null` branch is inserted.\nIt may cause unexpected nulls if a developer forgets to insert necessary `case` branches.\n\n**Example:**\n\n\n enum A { X, Y }\n\n def foo(A a) {\n def x = switch (a) { // reports switch\n case A.X -> ...\n }\n }\n" }, { - "shortName": "ProhibitJvmOverloadsOnConstructorsOfAnnotationClassesMigration", - "displayName": "'@JvmOverloads' annotation cannot be used on constructors of annotation classes since 1.4", + "shortName": "GroovyUntypedAccess", + "displayName": "Untyped reference expression", "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 reference expressions whose type can't be determined." }, { - "shortName": "KotlinDeprecation", - "displayName": "Usage of redundant or deprecated syntax or deprecated symbols", - "enabled": true, - "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": "GroovyResultOfObjectAllocationIgnored", + "displayName": "Result of object allocation ignored", + "enabled": false, + "description": "Reports object allocation where the result of this operation is ignored.\n\n\nSuch allocation expressions are legal Groovy, but are usually either inadvertent, or\nevidence of a complicated object initialization strategy." }, { - "shortName": "OverrideDeprecatedMigration", - "displayName": "Do not propagate method deprecation through overrides since 1.9", + "shortName": "GroovyDocCheck", + "displayName": "Unresolved GroovyDoc reference", "enabled": false, - "description": "Reports a declarations that are propagated by `@Deprecated` annotation that will lead to compilation error since 1.9.\n\nMotivation types:\n\n* Implementation changes are required for implementation design/architectural reasons\n* Inconsistency in the design (things are done differently in different contexts)\n\n**More details:** [KT-47902: Do not propagate method deprecation through overrides](https://youtrack.jetbrains.com/issue/KT-47902)\n\nThe quick-fix copies `@Deprecated` annotation from the parent declaration.\n\n**Example:**\n\n\n open class Base {\n @Deprecated(\"Don't use\")\n open fun foo() {}\n }\n\n class Derived : Base() {\n override fun foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n open class Base {\n @Deprecated(\"Don't use\")\n open fun foo() {}\n }\n\n class Derived : Base() {\n @Deprecated(\"Don't use\")\n override fun foo() {}\n }\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.6 or higher." + "description": "Reports unresolved references inside GroovyDoc comments." }, { - "shortName": "ObsoleteExperimentalCoroutines", - "displayName": "Experimental coroutines usages are deprecated since 1.3", + "shortName": "GroovyConstructorNamedArguments", + "displayName": "Named arguments of constructor call", "enabled": false, - "description": "Reports code that uses experimental coroutines.\n\nSuch usages are incompatible with Kotlin 1.3+ and should be updated." + "description": "Reports named arguments of a default class constructor call which don't correspond to properties of this class.\n\n**Example:**\n\n\n class Person {\n def name\n def age\n }\n\n // 'firstName' property doesn't exist\n new Person(firstName: \"John\")\n" }, { - "shortName": "FromClosedRangeMigration", - "displayName": "MIN_VALUE step in fromClosedRange() since 1.3", + "shortName": "GrUnresolvedAccess", + "displayName": "Unresolved reference expression", "enabled": false, - "description": "Reports `IntProgression.fromClosedRange()` and `LongProgression.fromClosedRange()` with `MIN_VALUE` step.\n\n\nIt is prohibited to call `IntProgression.fromClosedRange()` and `LongProgression.fromClosedRange()` with\n`MIN_VALUE` step. All such calls should be checked during migration to Kotlin 1.3+.\n\n**Example:**\n\n\n IntProgression.fromClosedRange(12, 143, Int.MIN_VALUE)\n\nTo fix the problem change the step of the progression." + "description": "Reports reference expressions which cannot be resolved." }, { - "shortName": "DeclaringClassMigration", - "displayName": "Deprecated 'Enum.declaringClass' property", + "shortName": "GroovyInfiniteLoopStatement", + "displayName": "Infinite loop statement", "enabled": false, - "description": "Reports 'declaringClass' property calls on Enum that will lead to compilation error since 1.9.\n\n'Enum.getDeclaringClass' is among \"hidden\" Java functions which aren't normally visible by resolve. However, it's visible via synthetic\nproperty that is a front-end bug.\n\n**More details:** [KT-49653 Deprecate and remove Enum.declaringClass synthetic\nproperty](https://youtrack.jetbrains.com/issue/KT-49653)\n\nThe quick-fix replaces a call with 'declaringJavaClass'.\n\n**Example:**\n\n\n fun > foo(values: Array) {\n EnumSet.noneOf(values.first().declaringClass)\n }\n\nAfter the quick-fix is applied:\n\n\n fun > foo(values: Array) {\n EnumSet.noneOf(values.first().declaringJavaClass)\n }\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.7 or higher." + "description": "Reports `for`, `while`, or `do` statements which can only exit by throwing an exception. While such statements may be correct, they usually happen by mistake.\n\n**Example:**\n\n\n while(true) {\n Thread.sleep(1000)\n }\n\n" }, { - "shortName": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", - "displayName": "Meaningless annotations targets on superclass", + "shortName": "GrPermitsClause", + "displayName": "Non-extending permitted subclasses", "enabled": false, - "description": "Reports meaningless annotation targets on superclasses since Kotlin 1.4.\n\nAnnotation targets such as `@get:` are meaningless on superclasses and are prohibited.\n\n**Example:**\n\n\n interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo\n\nAfter the quick-fix is applied:\n\n\n interface Foo\n\n annotation class Ann\n\n class E : Foo\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." + "description": "Reports permitted classes that do not extend the sealed base class.\n\nGroovy does not require that all permitted classes should be available in compile-time and compiled along with base class. Compiler will not warn the user on dealing with non-extending permitted subclass, but it contradicts the nature of sealed classes.\n\n**Example:**\n\n\n class A permits B {} // reports B\n class B {}\n" }, { - "shortName": "ObsoleteKotlinJsPackages", - "displayName": "'kotlin.browser' and 'kotlin.dom' packages are deprecated since 1.4", + "shortName": "GrEqualsBetweenInconvertibleTypes", + "displayName": "'equals()' between objects of inconvertible types", "enabled": false, - "description": "Reports usages of `kotlin.dom` and `kotlin.browser` packages.\n\nThese packages were moved to `kotlinx.dom` and `kotlinx.browser`\nrespectively in Kotlin 1.4+." + "description": "Reports calls to `equals()` where the target and argument are of incompatible types.\n\nWhile such a call might theoretically be useful, most likely it represents a bug.\n\n**Example:**\n\n\n new HashSet() == new TreeSet())\n" }, { - "shortName": "RestrictReturnStatementTargetMigration", - "displayName": "Target label does not denote a function since 1.4", + "shortName": "GroovyInfiniteRecursion", + "displayName": "Infinite recursion", "enabled": false, - "description": "Reports labels that don't points to a functions.\n\nIt's forbidden to declare a target label that does not denote a function.\n\nThe quick-fix removes the label.\n\n**Example:**\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }\n\nAfter the quick-fix is applied:\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }\n\nThis inspection only reports if the language level of the project or module is 1.4 or higher." + "description": "Reports methods which must either recurse infinitely or throw an exception. Methods reported by this inspection could not be finished correct.\n\n**Example:**\n\n\n // this function always dive deeper\n def fibonacci(int n) {\n return fibonacci(n-1) + fibonacci(n-2)\n }\n\n" }, { - "shortName": "ProhibitRepeatedUseSiteTargetAnnotationsMigration", - "displayName": "Repeated annotation which is not marked as '@Repeatable'", - "enabled": false, - "description": "Reports the repeated use of a non-`@Repeatable` annotation on property accessors.\n\n\nAs a result of using non-`@Repeatable` annotation multiple times, both annotation usages\nwill appear in the bytecode leading to an ambiguity in reflection calls.\n\n\nSince Kotlin 1.4 it's mandatory to either mark annotation as `@Repeatable` or not\nrepeat the annotation, otherwise it will lead to compilation error.\n\n**Example:**\n\n\n annotation class Foo(val x: Int)\n\n @get:Foo(10)\n val a: String\n @Foo(20) get() = \"foo\" // annotation repeated twice but not marked as @Repeatable\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." + "shortName": "NonExternalClassifierExtendingStateOrProps", + "displayName": "Non-external classifier extending State or Props", + "enabled": true, + "description": "Reports non-external classifier extending State or Props. Read more in the [migration guide](https://kotlinlang.org/docs/js-ir-migration.html#convert-js-and-react-related-classes-and-interfaces-to-external-interfaces)." } ] }, @@ -4331,232 +4331,59 @@ "enabled": false, "description": "Reports calls to `java.lang.Thread.sleep()` that occur inside loops.\n\n\nSuch calls are indicative of \"busy-waiting\". Busy-waiting is often inefficient, and may result in unexpected deadlocks\nas busy-waiting threads do not release locked resources." }, - { - "shortName": "GroovySynchronizationOnVariableInitializedWithLiteral", - "displayName": "Synchronization on variable initialized with literal", - "enabled": false, - "description": "Reports synchronized blocks which lock on an object which is initialized with a literal.\n\n\nString literals are interned and `Number` literals can be allocated from a cache. Because of\nthis, it is possible that some other part of the system which uses an object initialized with the same\nliteral, is actually holding a reference to the exact same object. This can create unexpected dead-lock\nsituations, if the string was thought to be private." - }, - { - "shortName": "GroovySynchronizationOnNonFinalField", - "displayName": "Synchronization on non-final field", - "enabled": false, - "description": "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." - }, - { - "shortName": "GroovyThreadStopSuspendResume", - "displayName": "Call to Thread.stop(), Thread.suspend(), or Thread.resume()", - "enabled": false, - "description": "Reports calls to `Thread.stop()`,`Thread.suspend()`, or `Thread.resume()`.\n\n\nThese calls are inherently prone to data corruption and deadlock, and their use is strongly\ndiscouraged." - }, - { - "shortName": "GroovySynchronizationOnThis", - "displayName": "Synchronization on 'this'", - "enabled": false, - "description": "Reports synchronization which uses `this` as its lock expression.\n\n\nConstructs reported include `synchronized`\nblocks which lock `this`, and calls to `wait()`\n`notify()` or `notifyAll()` which target `wait()`.\nSuch constructs, like synchronized methods, make it hard to track just who is locking on a given\nobject, and make possible \"denial of service\" attacks on objects. As an alternative, consider\nlocking on a private instance variable, access to which can be completely controlled." - }, - { - "shortName": "GroovyNestedSynchronizedStatement", - "displayName": "Nested 'synchronized' statement", - "enabled": false, - "description": "Reports nested `synchronized` statements.\n\n\nNested `synchronized` statements\nare either redundant (if the lock objects are identical) or prone to deadlock." - }, - { - "shortName": "GroovyWaitCallNotInLoop", - "displayName": "'wait()' not in loop", - "enabled": false, - "description": "Reports calls to `wait()` not made inside a loop.\n\n`wait()` is normally used to suspend a thread until a condition is true, and that condition should be checked after the `wait()`\nreturns. A loop is the clearest way to achieve this." - }, - { - "shortName": "GroovyAccessToStaticFieldLockedOnInstance", - "displayName": "Access to static field locked on instance data", - "enabled": false, - "description": "Reports accesses to a non-constant static field which is locked on either `this` or an instance field of `this`.\n\n\nLocking a static field on instance data does not prevent the field from being\nmodified by other instances, and thus may result in surprising race conditions.\n\n**Example:**\n\n\n static String s;\n def foo() {\n synchronized (this) {\n System.out.println(s); // warning\n }\n }\n" - }, - { - "shortName": "GroovyEmptySyncBlock", - "displayName": "Empty 'synchronized' block", - "enabled": false, - "description": "Reports `synchronized` statements with empty bodies. While theoretically this may be the semantics intended, this construction is confusing, and often the result of a typo.\n\n**Example:**\n\n\n synchronized(lock) {\n }\n\n" - }, - { - "shortName": "GroovyNotifyWhileNotSynchronized", - "displayName": "'notify()' or 'notifyAll()' while not synced", - "enabled": false, - "description": "Reports calls to `notify()` and `notifyAll()` not within a corresponding synchronized statement or synchronized method.\n\n\nCalling these methods on an object\nwithout holding a lock on that object will result in an `IllegalMonitorStateException` being thrown.\nSuch a construct is not necessarily an error, as the necessary lock may be acquired before\nthe containing method is called, but it's worth looking at." - } - ] - }, - { - "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "GroovySynchronizationOnVariableInitializedWithLiteral", + "displayName": "Synchronization on variable initialized with literal", + "enabled": false, + "description": "Reports synchronized blocks which lock on an object which is initialized with a literal.\n\n\nString literals are interned and `Number` literals can be allocated from a cache. Because of\nthis, it is possible that some other part of the system which uses an object initialized with the same\nliteral, is actually holding a reference to the exact same object. This can create unexpected dead-lock\nsituations, if the string was thought to be private." }, { - "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": "GroovySynchronizationOnNonFinalField", + "displayName": "Synchronization on non-final field", + "enabled": false, + "description": "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." }, { - "shortName": "BigDecimalEquals", - "displayName": "'equals()' called on 'BigDecimal'", + "shortName": "GroovyThreadStopSuspendResume", + "displayName": "Call to Thread.stop(), Thread.suspend(), or Thread.resume()", "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 calls to `Thread.stop()`,`Thread.suspend()`, or `Thread.resume()`.\n\n\nThese calls are inherently prone to data corruption and deadlock, and their use is strongly\ndiscouraged." }, { - "shortName": "ConstantMathCall", - "displayName": "Constant call to 'Math'", + "shortName": "GroovySynchronizationOnThis", + "displayName": "Synchronization on 'this'", "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 synchronization which uses `this` as its lock expression.\n\n\nConstructs reported include `synchronized`\nblocks which lock `this`, and calls to `wait()`\n`notify()` or `notifyAll()` which target `wait()`.\nSuch constructs, like synchronized methods, make it hard to track just who is locking on a given\nobject, and make possible \"denial of service\" attacks on objects. As an alternative, consider\nlocking on a private instance variable, access to which can be completely controlled." }, { - "shortName": "NonReproducibleMathCall", - "displayName": "Non-reproducible call to 'Math'", + "shortName": "GroovyNestedSynchronizedStatement", + "displayName": "Nested 'synchronized' 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 nested `synchronized` statements.\n\n\nNested `synchronized` statements\nare either redundant (if the lock objects are identical) or prone to deadlock." }, { - "shortName": "FloatingPointEquality", - "displayName": "Floating-point equality comparison", + "shortName": "GroovyWaitCallNotInLoop", + "displayName": "'wait()' not in loop", "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 calls to `wait()` not made inside a loop.\n\n`wait()` is normally used to suspend a thread until a condition is true, and that condition should be checked after the `wait()`\nreturns. A loop is the clearest way to achieve this." }, { - "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": "GroovyAccessToStaticFieldLockedOnInstance", + "displayName": "Access to static field locked on instance data", + "enabled": false, + "description": "Reports accesses to a non-constant static field which is locked on either `this` or an instance field of `this`.\n\n\nLocking a static field on instance data does not prevent the field from being\nmodified by other instances, and thus may result in surprising race conditions.\n\n**Example:**\n\n\n static String s;\n def foo() {\n synchronized (this) {\n System.out.println(s); // warning\n }\n }\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": "GroovyEmptySyncBlock", + "displayName": "Empty 'synchronized' block", + "enabled": false, + "description": "Reports `synchronized` statements with empty bodies. While theoretically this may be the semantics intended, this construction is confusing, and often the result of a typo.\n\n**Example:**\n\n\n synchronized(lock) {\n }\n\n" }, { - "shortName": "OverlyComplexArithmeticExpression", - "displayName": "Overly complex arithmetic expression", + "shortName": "GroovyNotifyWhileNotSynchronized", + "displayName": "'notify()' or 'notifyAll()' while not synced", "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 calls to `notify()` and `notifyAll()` not within a corresponding synchronized statement or synchronized method.\n\n\nCalling these methods on an object\nwithout holding a lock on that object will result in an `IllegalMonitorStateException` being thrown.\nSuch a construct is not necessarily an error, as the necessary lock may be acquired before\nthe containing method is called, but it's worth looking at." } ] }, @@ -4569,18 +4396,18 @@ "enabled": false, "description": "Reports equality expressions which are negated by a prefix expression.\n\nSuch expressions can be simplified using the `!=` operator.\n\nExample:\n\n\n !(i == 1)\n\nAfter the quick-fix is applied:\n\n\n i != 1\n" }, - { - "shortName": "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\nThis inspection depends on the Java feature 'Assertions' which is available since Java 4." - }, { "shortName": "DoubleNegation", "displayName": "Double negation", "enabled": true, "description": "Reports double negations that can be simplified.\n\nExample:\n\n\n if (!!functionCall()) {}\n\nAfter the quick-fix is applied:\n\n\n if (functionCall()) {}\n\nExample:\n\n\n if (!(a != b)) {}\n\nAfter the quick-fix is applied:\n\n\n if (a == b) {}\n" }, + { + "shortName": "AssertionCanBeIf", + "displayName": "Assertion can be replaced with 'if' statement", + "enabled": false, + "description": "Reports `assert` statements and suggests replacing them with `if` statements that throw `java.lang.AssertionError`.\n\nExample:\n\n\n assert param != null;\n\nAfter the quick-fix is applied:\n\n\n if (param == null) throw new AssertionError();\n\nThis inspection depends on the Java feature 'Assertions' which is available since Java 4." + }, { "shortName": "BreakStatement", "displayName": "'break' statement", @@ -4973,6 +4800,179 @@ } ] }, + { + "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "Initialization", "inspections": [ @@ -8801,18 +8801,18 @@ "enabled": false, "description": "Reports methods whose number of statements exceeds the specified maximum.\n\nMethods with too many statements may be confusing and are a good sign that refactoring is necessary.\n\nThe following statements are not counted:\n\n* empty statements (semicolons)\n* block statements\n* `for` loop initialization statements, that is, `int i = ...` within a `for(int i = ...;...)` statement\n* `for` loop update statements, that is, `i += 2` within a `for(int i = ...;...; i += 2)` statement\n\nUse the **Maximum statements per method** field to specify the maximum allowed number of statements in a method." }, - { - "shortName": "OverlyLongLambda", - "displayName": "Overly long lambda expression", - "enabled": false, - "description": "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." - }, { "shortName": "ParametersPerMethod", "displayName": "Method with too many parameters", "enabled": false, "description": "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." }, + { + "shortName": "OverlyLongLambda", + "displayName": "Overly long lambda expression", + "enabled": false, + "description": "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." + }, { "shortName": "MethodCoupling", "displayName": "Overly coupled method", diff --git a/results/metaInformation.json b/results/metaInformation.json index ab1f812..be6c1a4 100644 --- a/results/metaInformation.json +++ b/results/metaInformation.json @@ -8,12 +8,12 @@ "vcs": { "sarifIdea": { "repositoryUri": "https://github.com/cvette/intellij-neos.git", - "revisionId": "16604d1ca31186399bf04ee36b68ff447c7c7efe", - "branch": "dependabot/github_actions/JetBrains/qodana-action-2024.1.8" + "revisionId": "3138837408ce13e0e899e825f252e7f6c5d0ff5f", + "branch": "dependabot/gradle/org.jetbrains.changelog-2.2.1" } }, "repoUrl": "https://github.com/cvette/intellij-neos.git", "deviceId": "200820300000000-beff-b97d-1142-74f9c0f3468c", - "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/9785614877" + "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/9800593903" } } \ No newline at end of file diff --git a/results/qodana.sarif.json b/results/qodana.sarif.json index c7be54e..e1d6b5c 100644 --- a/results/qodana.sarif.json +++ b/results/qodana.sarif.json @@ -117,8 +117,8 @@ ] }, { - "id": "Java/Declaration redundancy", - "name": "Declaration redundancy", + "id": "Java/Error handling", + "name": "Error handling", "relationships": [ { "target": { @@ -135,8 +135,8 @@ ] }, { - "id": "Java/Error handling", - "name": "Error handling", + "id": "Java/Declaration redundancy", + "name": "Declaration redundancy", "relationships": [ { "target": { @@ -153,13 +153,13 @@ ] }, { - "id": "Java/Probable bugs", - "name": "Probable bugs", + "id": "Kotlin/Migration", + "name": "Migration", "relationships": [ { "target": { - "id": "Java", - "index": 5, + "id": "Kotlin", + "index": 1, "toolComponent": { "name": "QDJVMC" } @@ -171,13 +171,13 @@ ] }, { - "id": "Kotlin/Migration", - "name": "Migration", + "id": "Java/Probable bugs", + "name": "Probable bugs", "relationships": [ { "target": { - "id": "Kotlin", - "index": 1, + "id": "Java", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -305,8 +305,8 @@ ] }, { - "id": "Java/Numeric issues", - "name": "Numeric issues", + "id": "Java/Control flow issues", + "name": "Control flow issues", "relationships": [ { "target": { @@ -323,8 +323,8 @@ ] }, { - "id": "Java/Control flow issues", - "name": "Control flow issues", + "id": "Java/Numeric issues", + "name": "Numeric issues", "relationships": [ { "target": { @@ -523,13 +523,13 @@ ] }, { - "id": "Groovy/Probable bugs", - "name": "Probable bugs", + "id": "Kotlin/Other problems", + "name": "Other problems", "relationships": [ { "target": { - "id": "Groovy", - "index": 15, + "id": "Kotlin", + "index": 1, "toolComponent": { "name": "QDJVMC" } @@ -541,13 +541,13 @@ ] }, { - "id": "Kotlin/Other problems", - "name": "Other problems", + "id": "Groovy/Probable bugs", + "name": "Probable bugs", "relationships": [ { "target": { - "id": "Kotlin", - "index": 1, + "id": "Groovy", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -1367,7 +1367,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -1501,7 +1501,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -1581,7 +1581,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -1639,7 +1639,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -2305,7 +2305,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -2503,7 +2503,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -2767,7 +2767,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -3328,7 +3328,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -3427,7 +3427,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -3889,7 +3889,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -3934,19 +3934,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": true, + "enabled": false, "level": "note", "parameters": { - "suppressToolId": "RedundantWith", + "suppressToolId": "WarningOnMainUnusedParameterMigration", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -3954,8 +3954,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 4, + "id": "Kotlin/Migration", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -3967,19 +3967,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, + "enabled": true, "level": "note", "parameters": { - "suppressToolId": "WarningOnMainUnusedParameterMigration", + "suppressToolId": "RedundantWith", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -3987,8 +3987,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 12, + "id": "Kotlin/Redundant constructs", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -4021,7 +4021,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -4252,7 +4252,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -5341,7 +5341,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -6013,28 +6013,28 @@ ] }, { - "id": "PropertyName", + "id": "InlineClassDeprecatedMigration", "shortDescription": { - "text": "Property naming convention" + "text": "Inline classes are deprecated since 1.5" }, "fullDescription": { - "text": "Reports property names that do not follow the recommended naming conventions. Consistent naming allows for easier code reading and understanding. According to the Kotlin official style guide, property names should start with a lowercase letter and use camel case. It is possible to introduce other naming rules by changing the \"Pattern\" regular expression. Example: 'val My_Cool_Property = \"\"' The quick-fix renames the class according to the Kotlin naming conventions: 'val myCoolProperty = \"\"'", - "markdown": "Reports property names that do not follow the recommended naming conventions.\n\n\nConsistent naming allows for easier code reading and understanding.\nAccording to the [Kotlin official style guide](https://kotlinlang.org/docs/coding-conventions.html#naming-rules),\nproperty names should start with a lowercase letter and use camel case.\n\nIt is possible to introduce other naming rules by changing the \"Pattern\" regular expression.\n\n**Example:**\n\n\n val My_Cool_Property = \"\"\n\nThe quick-fix renames the class according to the Kotlin naming conventions:\n\n\n val myCoolProperty = \"\"\n" + "text": "Reports inline classes that are deprecated and cause compilation warnings in Kotlin 1.5 and later. See What's new in Kotlin 1.5.0 Example: 'inline class Password(val s: String)' After the quick-fix is applied: '@JvmInline\n value class Password(val s: String)' Inspection is available for Kotlin language level starting from 1.5.", + "markdown": "Reports inline classes that are deprecated and cause compilation warnings in Kotlin 1.5 and later.\nSee [What's new in Kotlin 1.5.0](https://kotlinlang.org/docs/whatsnew15.html#inline-classes)\n\nExample:\n\n\n inline class Password(val s: String)\n\nAfter the quick-fix is applied:\n\n\n @JvmInline\n value class Password(val s: String)\n\nInspection is available for Kotlin language level starting from 1.5." }, "defaultConfiguration": { - "enabled": true, - "level": "note", + "enabled": false, + "level": "warning", "parameters": { - "suppressToolId": "PropertyName", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "InlineClassDeprecatedMigration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Naming conventions", - "index": 44, + "id": "Kotlin/Migration", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -6046,28 +6046,28 @@ ] }, { - "id": "InlineClassDeprecatedMigration", + "id": "PropertyName", "shortDescription": { - "text": "Inline classes are deprecated since 1.5" + "text": "Property naming convention" }, "fullDescription": { - "text": "Reports inline classes that are deprecated and cause compilation warnings in Kotlin 1.5 and later. See What's new in Kotlin 1.5.0 Example: 'inline class Password(val s: String)' After the quick-fix is applied: '@JvmInline\n value class Password(val s: String)' Inspection is available for Kotlin language level starting from 1.5.", - "markdown": "Reports inline classes that are deprecated and cause compilation warnings in Kotlin 1.5 and later.\nSee [What's new in Kotlin 1.5.0](https://kotlinlang.org/docs/whatsnew15.html#inline-classes)\n\nExample:\n\n\n inline class Password(val s: String)\n\nAfter the quick-fix is applied:\n\n\n @JvmInline\n value class Password(val s: String)\n\nInspection is available for Kotlin language level starting from 1.5." + "text": "Reports property names that do not follow the recommended naming conventions. Consistent naming allows for easier code reading and understanding. According to the Kotlin official style guide, property names should start with a lowercase letter and use camel case. It is possible to introduce other naming rules by changing the \"Pattern\" regular expression. Example: 'val My_Cool_Property = \"\"' The quick-fix renames the class according to the Kotlin naming conventions: 'val myCoolProperty = \"\"'", + "markdown": "Reports property names that do not follow the recommended naming conventions.\n\n\nConsistent naming allows for easier code reading and understanding.\nAccording to the [Kotlin official style guide](https://kotlinlang.org/docs/coding-conventions.html#naming-rules),\nproperty names should start with a lowercase letter and use camel case.\n\nIt is possible to introduce other naming rules by changing the \"Pattern\" regular expression.\n\n**Example:**\n\n\n val My_Cool_Property = \"\"\n\nThe quick-fix renames the class according to the Kotlin naming conventions:\n\n\n val myCoolProperty = \"\"\n" }, "defaultConfiguration": { - "enabled": false, - "level": "warning", + "enabled": true, + "level": "note", "parameters": { - "suppressToolId": "InlineClassDeprecatedMigration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "PropertyName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 12, + "id": "Kotlin/Naming conventions", + "index": 44, "toolComponent": { "name": "QDJVMC" } @@ -6331,7 +6331,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -6595,7 +6595,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -6694,7 +6694,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -7222,7 +7222,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -7387,7 +7387,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -7519,7 +7519,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -7618,7 +7618,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -7948,7 +7948,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -8245,7 +8245,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -8773,7 +8773,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -9136,7 +9136,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -9301,7 +9301,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -9334,7 +9334,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -9598,7 +9598,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -9631,7 +9631,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -9664,7 +9664,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -9808,28 +9808,28 @@ ] }, { - "id": "ObsoleteKotlinJsPackages", + "id": "KotlinJvmAnnotationInJava", "shortDescription": { - "text": "'kotlin.browser' and 'kotlin.dom' packages are deprecated since 1.4" + "text": "Kotlin JVM annotation in Java" }, "fullDescription": { - "text": "Reports usages of 'kotlin.dom' and 'kotlin.browser' packages. These packages were moved to 'kotlinx.dom' and 'kotlinx.browser' respectively in Kotlin 1.4+.", - "markdown": "Reports usages of `kotlin.dom` and `kotlin.browser` packages.\n\nThese packages were moved to `kotlinx.dom` and `kotlinx.browser`\nrespectively in Kotlin 1.4+." + "text": "Reports useless Kotlin JVM annotations in Java code. Example: 'import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }'", + "markdown": "Reports useless Kotlin JVM annotations in Java code.\n\n**Example:**\n\n\n import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }\n" }, "defaultConfiguration": { - "enabled": false, - "level": "error", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "ObsoleteKotlinJsPackages", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "suppressToolId": "KotlinJvmAnnotationInJava", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 12, + "id": "Kotlin/Java interop issues", + "index": 49, "toolComponent": { "name": "QDJVMC" } @@ -9841,28 +9841,28 @@ ] }, { - "id": "KotlinJvmAnnotationInJava", + "id": "ObsoleteKotlinJsPackages", "shortDescription": { - "text": "Kotlin JVM annotation in Java" + "text": "'kotlin.browser' and 'kotlin.dom' packages are deprecated since 1.4" }, "fullDescription": { - "text": "Reports useless Kotlin JVM annotations in Java code. Example: 'import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }'", - "markdown": "Reports useless Kotlin JVM annotations in Java code.\n\n**Example:**\n\n\n import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }\n" + "text": "Reports usages of 'kotlin.dom' and 'kotlin.browser' packages. These packages were moved to 'kotlinx.dom' and 'kotlinx.browser' respectively in Kotlin 1.4+.", + "markdown": "Reports usages of `kotlin.dom` and `kotlin.browser` packages.\n\nThese packages were moved to `kotlinx.dom` and `kotlinx.browser`\nrespectively in Kotlin 1.4+." }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "error", "parameters": { - "suppressToolId": "KotlinJvmAnnotationInJava", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ObsoleteKotlinJsPackages", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Kotlin/Java interop issues", - "index": 49, + "id": "Kotlin/Migration", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -10093,7 +10093,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -10126,7 +10126,7 @@ { "target": { "id": "Kotlin/Other problems", - "index": 38, + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -10390,7 +10390,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -10876,19 +10876,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" } @@ -10896,7 +10896,7 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", + "id": "Java/Error handling", "index": 9, "toolComponent": { "name": "QDJVMC" @@ -10909,19 +10909,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" } @@ -10929,7 +10929,7 @@ "relationships": [ { "target": { - "id": "Java/Error handling", + "id": "Java/Declaration redundancy", "index": 10, "toolComponent": { "name": "QDJVMC" @@ -10996,7 +10996,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -11032,7 +11032,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -11179,27 +11179,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": 21, "toolComponent": { "name": "QDJVMC" @@ -11212,27 +11212,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": 22, "toolComponent": { "name": "QDJVMC" @@ -11270,7 +11270,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -11405,7 +11405,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -11417,28 +11417,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();' This inspection depends on the Java feature 'Assertions' which is available since Java 4.", - "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\nThis inspection depends on the Java feature 'Assertions' which is available since Java 4." + "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": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -11450,28 +11450,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();' This inspection depends on the Java feature 'Assertions' which is available since Java 4.", + "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\nThis inspection depends on the Java feature 'Assertions' which is available since Java 4." }, "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": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -11582,19 +11582,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" } @@ -11602,8 +11602,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 21, + "id": "JVM languages/Logging", + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -11615,19 +11615,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" } @@ -11635,8 +11635,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Logging", - "index": 32, + "id": "Java/Numeric issues", + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -11702,7 +11702,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -11768,7 +11768,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -11801,7 +11801,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -11908,7 +11908,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -11920,19 +11920,19 @@ ] }, { - "id": "ResultOfObjectAllocationIgnored", + "id": "ClassGetClass", "shortDescription": { - "text": "Result of object allocation ignored" + "text": "Suspicious 'Class.getClass()' call" }, "fullDescription": { - "text": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way. Such allocation expressions are legal in Java, but are usually either unintended, or evidence of a very odd object initialization strategy. Use the options to list classes whose allocations should be ignored by this inspection.", - "markdown": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." + "text": "Reports '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": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ResultOfObjectAllocationIgnored", + "suppressToolId": "ClassGetClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11941,7 +11941,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -11953,19 +11953,19 @@ ] }, { - "id": "ClassGetClass", + "id": "ResultOfObjectAllocationIgnored", "shortDescription": { - "text": "Suspicious 'Class.getClass()' call" + "text": "Result of object allocation ignored" }, "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 object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way. Such allocation expressions are legal in Java, but are usually either unintended, or evidence of a very odd object initialization strategy. Use the options to list classes whose allocations should be ignored by this inspection.", + "markdown": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassGetClass", + "suppressToolId": "ResultOfObjectAllocationIgnored", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11974,7 +11974,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -12007,7 +12007,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -12110,7 +12110,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -12242,7 +12242,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -12836,7 +12836,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -12869,7 +12869,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -12971,7 +12971,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13049,19 +13049,23 @@ ] }, { - "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", + "cweIds": [ + 116, + 134 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13069,8 +13073,8 @@ "relationships": [ { "target": { - "id": "Java/Concurrency annotation issues", - "index": 64, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13082,23 +13086,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", - "cweIds": [ - 116, - 134 - ], + "suppressToolId": "NonFinalFieldInImmutable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13106,8 +13106,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Concurrency annotation issues", + "index": 64, "toolComponent": { "name": "QDJVMC" } @@ -13206,7 +13206,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -13305,7 +13305,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13416,19 +13416,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" } @@ -13436,8 +13436,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 22, + "id": "Java/Class structure", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -13449,19 +13449,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" } @@ -13469,8 +13469,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 14, + "id": "Java/Control flow issues", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -13503,7 +13503,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13569,7 +13569,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -13602,7 +13602,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -13635,7 +13635,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13734,7 +13734,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -13800,7 +13800,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -13866,7 +13866,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -14068,7 +14068,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14332,7 +14332,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -14530,7 +14530,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14596,7 +14596,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -14728,7 +14728,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -14831,7 +14831,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14897,7 +14897,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -14933,7 +14933,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -15077,19 +15077,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" } @@ -15097,8 +15097,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Declaration redundancy", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -15110,19 +15110,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" } @@ -15130,8 +15130,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 9, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -15428,7 +15428,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -15461,7 +15461,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -15626,7 +15626,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -15869,19 +15869,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" } @@ -15902,19 +15902,19 @@ ] }, { - "id": "ParametersPerMethod", + "id": "OverlyLongLambda", "shortDescription": { - "text": "Method with too many parameters" + "text": "Overly long lambda expression" }, "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 lambda expressions whose number of statements exceeds the specified maximum. Lambda expressions that are too long may be confusing, and it is often better to extract the statements into a separate method. The following statements are not counted: empty statements (semicolons) block statements 'for' loop initialization statements, that is, 'int i = ...' within a 'for(int i = ...;...)' statement 'for' loop update statements, that is, 'i += 2' within a 'for(int i = ...;...; i += 2)' statement Use the Non-comment source statements limit field to specify the maximum allowed number of statements in a lambda expression.", + "markdown": "Reports lambda expressions whose number of statements exceeds the specified maximum.\n\nLambda expressions that are too long may be confusing, and it is often better to extract the statements into a separate method.\n\n\nThe following statements are not counted:\n\n* empty statements (semicolons)\n* block statements\n* `for` loop initialization statements, that is, `int i = ...` within a `for(int i = ...;...)` statement\n* `for` loop update statements, that is, `i += 2` within a `for(int i = ...;...; i += 2)` statement\n\nUse the **Non-comment source statements limit** field to specify the maximum allowed number of statements in a lambda expression." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MethodWithTooManyParameters", + "suppressToolId": "OverlyLongLambda", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -15989,7 +15989,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -16154,7 +16154,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -16319,7 +16319,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -16352,7 +16352,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -16451,7 +16451,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -16484,7 +16484,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -16595,19 +16595,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 }' This inspection depends on the Java feature 'Generics' which is available since Java 5.", - "markdown": "Reports type parameters declared to extend a `final` class.\n\nSuggests replacing the type parameter with the type of the specified `final` class since\n`final` classes cannot be extended.\n\n**Example:**\n\n\n void foo() {\n List list; // Warning: the Integer class is a final class\n }\n\nAfter the quick-fix is applied:\n\n\n void foo() {\n List list;\n }\n\nThis inspection depends on the Java feature 'Generics' which is available since Java 5." + "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" } @@ -16615,8 +16615,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 97, + "id": "Java/Class structure", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -16628,19 +16628,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 }' This inspection depends on the Java feature 'Generics' which is available since Java 5.", + "markdown": "Reports type parameters declared to extend a `final` class.\n\nSuggests replacing the type parameter with the type of the specified `final` class since\n`final` classes cannot be extended.\n\n**Example:**\n\n\n void foo() {\n List list; // Warning: the Integer class is a final class\n }\n\nAfter the quick-fix is applied:\n\n\n void foo() {\n List list;\n }\n\nThis inspection depends on the Java feature 'Generics' which is available since Java 5." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UtilityClassWithPublicConstructor", + "suppressToolId": "TypeParameterExtendsFinalClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -16648,8 +16648,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 14, + "id": "Java/Inheritance issues", + "index": 97, "toolComponent": { "name": "QDJVMC" } @@ -16682,7 +16682,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -16946,7 +16946,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -17148,7 +17148,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -17214,7 +17214,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -17247,7 +17247,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -17424,28 +17424,28 @@ ] }, { - "id": "AbstractMethodCallInConstructor", + "id": "EqualsReplaceableByObjectsCall", "shortDescription": { - "text": "Abstract method called during object construction" + "text": "'equals()' expression replaceable by 'Objects.equals()' expression" }, "fullDescription": { - "text": "Reports calls to 'abstract' methods of the current class during object construction. A method is called during object construction if it is inside a: Constructor Non-static instance initializer Non-static field initializer 'clone()' method 'readObject()' method 'readObjectNoData()' method Such calls may result in subtle bugs, as object initialization may happen before the method call. Example: 'abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }' This inspection shares the functionality with the following inspections: Overridable method called during object construction Overridden method called during object construction Only one inspection should be enabled at once to prevent warning duplication.", - "markdown": "Reports calls to `abstract` methods of the current class during object construction.\n\nA method is called during object construction if it is inside a:\n\n* Constructor\n* Non-static instance initializer\n* Non-static field initializer\n* `clone()` method\n* `readObject()` method\n* `readObjectNoData()` method\n\nSuch calls may result in subtle bugs, as object initialization may happen before the method call.\n\n**Example:**\n\n\n abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }\n\nThis inspection shares the functionality with the following inspections:\n\n* Overridable method called during object construction\n* Overridden method called during object construction\n\nOnly one inspection should be enabled at once to prevent warning duplication." + "text": "Reports expressions that can be replaced with a call to 'java.util.Objects#equals'. Example: 'void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }' After the quick-fix is applied: 'void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }' Replacing expressions like 'a != null && a.equals(b)' with 'Objects.equals(a, b)' slightly changes the semantics. Use the Highlight expressions like 'a != null && a.equals(b)' option to enable or disable this behavior. This inspection only reports if the language level of the project or module is 7 or higher.", + "markdown": "Reports expressions that can be replaced with a call to `java.util.Objects#equals`.\n\n**Example:**\n\n\n void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }\n\nAfter the quick-fix is applied:\n\n\n void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }\n\n\nReplacing expressions like `a != null && a.equals(b)` with `Objects.equals(a, b)`\nslightly changes the semantics. Use the **Highlight expressions like 'a != null \\&\\& a.equals(b)'** option to enable or disable this behavior.\n\nThis inspection only reports if the language level of the project or module is 7 or higher." }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "AbstractMethodCallInConstructor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "EqualsReplaceableByObjectsCall", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 23, + "id": "Java/Java language level migration aids/Java 7", + "index": 101, "toolComponent": { "name": "QDJVMC" } @@ -17457,28 +17457,28 @@ ] }, { - "id": "EqualsReplaceableByObjectsCall", + "id": "AbstractMethodCallInConstructor", "shortDescription": { - "text": "'equals()' expression replaceable by 'Objects.equals()' expression" + "text": "Abstract method called during object construction" }, "fullDescription": { - "text": "Reports expressions that can be replaced with a call to 'java.util.Objects#equals'. Example: 'void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }' After the quick-fix is applied: 'void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }' Replacing expressions like 'a != null && a.equals(b)' with 'Objects.equals(a, b)' slightly changes the semantics. Use the Highlight expressions like 'a != null && a.equals(b)' option to enable or disable this behavior. This inspection only reports if the language level of the project or module is 7 or higher.", - "markdown": "Reports expressions that can be replaced with a call to `java.util.Objects#equals`.\n\n**Example:**\n\n\n void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }\n\nAfter the quick-fix is applied:\n\n\n void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }\n\n\nReplacing expressions like `a != null && a.equals(b)` with `Objects.equals(a, b)`\nslightly changes the semantics. Use the **Highlight expressions like 'a != null \\&\\& a.equals(b)'** option to enable or disable this behavior.\n\nThis inspection only reports if the language level of the project or module is 7 or higher." + "text": "Reports calls to 'abstract' methods of the current class during object construction. A method is called during object construction if it is inside a: Constructor Non-static instance initializer Non-static field initializer 'clone()' method 'readObject()' method 'readObjectNoData()' method Such calls may result in subtle bugs, as object initialization may happen before the method call. Example: 'abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }' This inspection shares the functionality with the following inspections: Overridable method called during object construction Overridden method called during object construction Only one inspection should be enabled at once to prevent warning duplication.", + "markdown": "Reports calls to `abstract` methods of the current class during object construction.\n\nA method is called during object construction if it is inside a:\n\n* Constructor\n* Non-static instance initializer\n* Non-static field initializer\n* `clone()` method\n* `readObject()` method\n* `readObjectNoData()` method\n\nSuch calls may result in subtle bugs, as object initialization may happen before the method call.\n\n**Example:**\n\n\n abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }\n\nThis inspection shares the functionality with the following inspections:\n\n* Overridable method called during object construction\n* Overridden method called during object construction\n\nOnly one inspection should be enabled at once to prevent warning duplication." }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "EqualsReplaceableByObjectsCall", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "AbstractMethodCallInConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 7", - "index": 101, + "id": "Java/Initialization", + "index": 23, "toolComponent": { "name": "QDJVMC" } @@ -17610,7 +17610,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -17782,7 +17782,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -17950,7 +17950,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -18258,6 +18258,39 @@ } ] }, + { + "id": "LambdaBodyCanBeCodeBlock", + "shortDescription": { + "text": "Lambda body can be code block" + }, + "fullDescription": { + "text": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks. Example: 'n -> n + 1' After the quick-fix is applied: 'n -> {\n return n + 1;\n}' This inspection depends on the Java feature 'Lambda expressions' which is available since Java 8.", + "markdown": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks.\n\nExample:\n\n\n n -> n + 1\n\nAfter the quick-fix is applied:\n\n n -> {\n return n + 1;\n }\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LambdaBodyCanBeCodeBlock", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "ParameterHidingMemberVariable", "shortDescription": { @@ -18291,39 +18324,6 @@ } ] }, - { - "id": "LambdaBodyCanBeCodeBlock", - "shortDescription": { - "text": "Lambda body can be code block" - }, - "fullDescription": { - "text": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks. Example: 'n -> n + 1' After the quick-fix is applied: 'n -> {\n return n + 1;\n}' This inspection depends on the Java feature 'Lambda expressions' which is available since Java 8.", - "markdown": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks.\n\nExample:\n\n\n n -> n + 1\n\nAfter the quick-fix is applied:\n\n n -> {\n return n + 1;\n }\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "LambdaBodyCanBeCodeBlock", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Code style issues", - "index": 8, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "CustomSecurityManager", "shortDescription": { @@ -18358,28 +18358,31 @@ ] }, { - "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", + "cweIds": [ + 480 + ], + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Internationalization", - "index": 6, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -18391,31 +18394,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", - "cweIds": [ - 480 - ], - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "CallToTimeToString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Internationalization", + "index": 6, "toolComponent": { "name": "QDJVMC" } @@ -18712,7 +18712,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -18816,7 +18816,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -18915,7 +18915,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -19084,7 +19084,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -19186,7 +19186,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -19219,7 +19219,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -19231,19 +19231,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": true, "level": "warning", "parameters": { - "suppressToolId": "DefaultAnnotationParam", + "suppressToolId": "WhileLoopSpinsOnField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19251,8 +19251,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 9, + "id": "Java/Threading issues", + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -19264,19 +19264,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, "level": "warning", "parameters": { - "suppressToolId": "WhileLoopSpinsOnField", + "suppressToolId": "DefaultAnnotationParam", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19284,8 +19284,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "Java/Declaration redundancy", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -19351,7 +19351,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -19384,7 +19384,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -19454,7 +19454,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -19520,7 +19520,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -19556,7 +19556,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -19823,7 +19823,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -19922,7 +19922,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -19934,19 +19934,19 @@ ] }, { - "id": "WhileCanBeForeach", + "id": "BulkFileAttributesRead", "shortDescription": { - "text": "'while' loop can be replaced with enhanced 'for' loop" + "text": "Bulk 'Files.readAttributes()' call can be used" }, "fullDescription": { - "text": "Reports 'while' loops that iterate over collections and can be replaced with enhanced 'for' loops (foreach iteration syntax). Example: 'Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }' Can be replaced with: 'for (Object obj : c) {\n System.out.println(obj);\n }' This inspection depends on the Java feature 'For-each loops' which is available since Java 5.", - "markdown": "Reports `while` loops that iterate over collections and can be replaced with enhanced `for` loops (foreach iteration syntax).\n\n**Example:**\n\n\n Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }\n\nCan be replaced with:\n\n\n for (Object obj : c) {\n System.out.println(obj);\n }\n\nThis inspection depends on the Java feature 'For-each loops' which is available since Java 5." + "text": "Reports multiple sequential 'java.io.File' attribute checks, such as: 'isDirectory()' 'isFile()' 'lastModified()' 'length()' Such calls can be replaced with a bulk 'Files.readAttributes()' call. This is usually more performant than multiple separate attribute checks. Example: 'boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }' After the quick-fix is applied: 'boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }' This inspection does not show a warning if 'IOException' is not handled in the current context, but the quick-fix is still available. Note that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if the file does not exist at all. This inspection only reports if the language level of the project or module is 7 or higher. New in 2022.1", + "markdown": "Reports multiple sequential `java.io.File` attribute checks, such as:\n\n* `isDirectory()`\n* `isFile()`\n* `lastModified()`\n* `length()`\n\nSuch calls can be replaced with a bulk `Files.readAttributes()` call. This is usually more performant than multiple separate attribute checks.\n\nExample:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }\n\nThis inspection does not show a warning if `IOException` is not handled in the current context, but the quick-fix is still available.\n\nNote that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if\nthe file does not exist at all.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nNew in 2022.1" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "WhileLoopReplaceableByForEach", + "suppressToolId": "BulkFileAttributesRead", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19954,8 +19954,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 5", - "index": 77, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -19967,19 +19967,19 @@ ] }, { - "id": "BulkFileAttributesRead", + "id": "WhileCanBeForeach", "shortDescription": { - "text": "Bulk 'Files.readAttributes()' call can be used" + "text": "'while' loop can be replaced with enhanced 'for' loop" }, "fullDescription": { - "text": "Reports multiple sequential 'java.io.File' attribute checks, such as: 'isDirectory()' 'isFile()' 'lastModified()' 'length()' Such calls can be replaced with a bulk 'Files.readAttributes()' call. This is usually more performant than multiple separate attribute checks. Example: 'boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }' After the quick-fix is applied: 'boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }' This inspection does not show a warning if 'IOException' is not handled in the current context, but the quick-fix is still available. Note that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if the file does not exist at all. This inspection only reports if the language level of the project or module is 7 or higher. New in 2022.1", - "markdown": "Reports multiple sequential `java.io.File` attribute checks, such as:\n\n* `isDirectory()`\n* `isFile()`\n* `lastModified()`\n* `length()`\n\nSuch calls can be replaced with a bulk `Files.readAttributes()` call. This is usually more performant than multiple separate attribute checks.\n\nExample:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }\n\nThis inspection does not show a warning if `IOException` is not handled in the current context, but the quick-fix is still available.\n\nNote that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if\nthe file does not exist at all.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nNew in 2022.1" + "text": "Reports 'while' loops that iterate over collections and can be replaced with enhanced 'for' loops (foreach iteration syntax). Example: 'Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }' Can be replaced with: 'for (Object obj : c) {\n System.out.println(obj);\n }' This inspection depends on the Java feature 'For-each loops' which is available since Java 5.", + "markdown": "Reports `while` loops that iterate over collections and can be replaced with enhanced `for` loops (foreach iteration syntax).\n\n**Example:**\n\n\n Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }\n\nCan be replaced with:\n\n\n for (Object obj : c) {\n System.out.println(obj);\n }\n\nThis inspection depends on the Java feature 'For-each loops' which is available since Java 5." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "BulkFileAttributesRead", + "suppressToolId": "WhileLoopReplaceableByForEach", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19987,8 +19987,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Java language level migration aids/Java 5", + "index": 77, "toolComponent": { "name": "QDJVMC" } @@ -20021,7 +20021,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -20090,7 +20090,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -20432,25 +20432,19 @@ ] }, { - "id": "LoadLibraryWithNonConstantString", + "id": "InterfaceMethodClashesWithObject", "shortDescription": { - "text": "Call to 'System.loadLibrary()' with non-constant string" + "text": "Interface method clashes with method in 'Object'" }, "fullDescription": { - "text": "Reports calls to 'java.lang.System.loadLibrary()', 'java.lang.System.load()', 'java.lang.Runtime.loadLibrary()' and 'java.lang.Runtime.load()' which take a dynamically-constructed string as the name of the library. Constructed library name strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }' Use the inspection settings to consider any 'static final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'private static final String LIBRARY = getUserInput();'", - "markdown": "Reports calls to `java.lang.System.loadLibrary()`, `java.lang.System.load()`, `java.lang.Runtime.loadLibrary()` and `java.lang.Runtime.load()` which take a dynamically-constructed string as the name of the library.\n\n\nConstructed library name strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }\n\n\nUse the inspection settings to consider any `static final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n private static final String LIBRARY = getUserInput();\n" + "text": "Reports interface methods that clash with the protected methods 'clone()' and 'finalize()' from the 'java.lang.Object' class. In an interface, it is possible to declare these methods with a return type that is incompatible with the 'java.lang.Object' methods. A class that implements such an interface will not be compilable. When the interface is functional, it remains possible to create a lambda from it, but this is not recommended. Example: '// Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }'", + "markdown": "Reports interface methods that clash with the **protected** methods `clone()` and `finalize()` from the `java.lang.Object` class.\n\nIn an interface, it is possible to declare these methods with a return type that is incompatible with the `java.lang.Object` methods.\nA class that implements such an interface will not be compilable.\nWhen the interface is functional, it remains possible to create a lambda from it, but this is not recommended.\n\nExample:\n\n\n // Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "LoadLibraryWithNonConstantString", - "cweIds": [ - 114, - 494, - 676, - 829 - ], + "suppressToolId": "InterfaceMethodClashesWithObject", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20458,8 +20452,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 25, + "id": "Java/Abstraction issues", + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -20471,19 +20465,25 @@ ] }, { - "id": "InterfaceMethodClashesWithObject", + "id": "LoadLibraryWithNonConstantString", "shortDescription": { - "text": "Interface method clashes with method in 'Object'" + "text": "Call to 'System.loadLibrary()' with non-constant string" }, "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 calls to 'java.lang.System.loadLibrary()', 'java.lang.System.load()', 'java.lang.Runtime.loadLibrary()' and 'java.lang.Runtime.load()' which take a dynamically-constructed string as the name of the library. Constructed library name strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }' Use the inspection settings to consider any 'static final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'private static final String LIBRARY = getUserInput();'", + "markdown": "Reports calls to `java.lang.System.loadLibrary()`, `java.lang.System.load()`, `java.lang.Runtime.loadLibrary()` and `java.lang.Runtime.load()` which take a dynamically-constructed string as the name of the library.\n\n\nConstructed library name strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }\n\n\nUse the inspection settings to consider any `static final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n private static final String LIBRARY = getUserInput();\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InterfaceMethodClashesWithObject", + "suppressToolId": "LoadLibraryWithNonConstantString", + "cweIds": [ + 114, + 494, + 676, + 829 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20491,8 +20491,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 53, + "id": "Java/Security", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -20855,7 +20855,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -20892,7 +20892,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -20925,7 +20925,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21024,7 +21024,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -21332,39 +21332,6 @@ } ] }, - { - "id": "SuppressionAnnotation", - "shortDescription": { - "text": "Inspection suppression annotation" - }, - "fullDescription": { - "text": "Reports comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\nstatic Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n}'", - "markdown": "Reports comments or annotations suppressing inspections.\n\nThis inspection can be useful when leaving suppressions intentionally for further review.\n\n**Example:**\n\n\n @SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SuppressionAnnotation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JVM languages", - "index": 3, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "UnnecessaryToStringCall", "shortDescription": { @@ -21432,19 +21399,19 @@ ] }, { - "id": "SynchronizeOnNonFinalField", + "id": "SuppressionAnnotation", "shortDescription": { - "text": "Synchronization on a non-final field" + "text": "Inspection suppression annotation" }, "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 comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\nstatic Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n}'", + "markdown": "Reports comments or annotations suppressing inspections.\n\nThis inspection can be useful when leaving suppressions intentionally for further review.\n\n**Example:**\n\n\n @SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SynchronizeOnNonFinalField", + "suppressToolId": "SuppressionAnnotation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21452,8 +21419,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "JVM languages", + "index": 3, "toolComponent": { "name": "QDJVMC" } @@ -21497,6 +21464,39 @@ } ] }, + { + "id": "SynchronizeOnNonFinalField", + "shortDescription": { + "text": "Synchronization on a non-final field" + }, + "fullDescription": { + "text": "Reports 'synchronized' statement lock expressions that consist of a non-'final' field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object. Example: 'private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }'", + "markdown": "Reports `synchronized` statement lock expressions that consist of a non-`final` field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object.\n\n**Example:**\n\n\n private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }\n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SynchronizeOnNonFinalField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 20, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "ArrayObjectsEquals", "shortDescription": { @@ -21522,7 +21522,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21558,7 +21558,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21603,19 +21603,22 @@ ] }, { - "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", + "cweIds": [ + 483 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21623,8 +21626,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 54, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21636,19 +21639,19 @@ ] }, { - "id": "NumericOverflow", + "id": "AssignmentToSuperclassField", "shortDescription": { - "text": "Numeric overflow" + "text": "Constructor assigns value to field defined in superclass" }, "fullDescription": { - "text": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction . Examples: 'float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;'", - "markdown": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction .\n\n**Examples:**\n\n\n float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;\n" + "text": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor. It is considered preferable to initialize the fields of a superclass in its own constructor and delegate to that constructor in a subclass. This will also allow declaring a field 'final' if it isn't changed after the construction. Example: 'class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }' To avoid the problem, declare a superclass constructor: 'class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }'", + "markdown": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor.\n\nIt is considered preferable to initialize the fields of a superclass in its own constructor and\ndelegate to that constructor in a subclass. This will also allow declaring a field `final`\nif it isn't changed after the construction.\n\n**Example:**\n\n\n class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }\n\nTo avoid the problem, declare a superclass constructor:\n\n\n class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NumericOverflow", + "suppressToolId": "AssignmentToSuperclassField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21656,8 +21659,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 21, + "id": "Java/Assignment issues", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -21669,22 +21672,19 @@ ] }, { - "id": "SuspiciousIndentAfterControlStatement", + "id": "NumericOverflow", "shortDescription": { - "text": "Suspicious indentation after control statement without braces" + "text": "Numeric overflow" }, "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 expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction . Examples: 'float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;'", + "markdown": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction .\n\n**Examples:**\n\n\n float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;\n" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SuspiciousIndentAfterControlStatement", - "cweIds": [ - 483 - ], + "suppressToolId": "NumericOverflow", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21692,8 +21692,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Numeric issues", + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -21726,7 +21726,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21837,19 +21837,19 @@ ] }, { - "id": "ForLoopReplaceableByWhile", + "id": "MethodCount", "shortDescription": { - "text": "'for' loop may be replaced by 'while' loop" + "text": "Class with too many methods" }, "fullDescription": { - "text": "Reports 'for' loops that contain neither initialization nor update components, and suggests converting them to 'while' loops. This makes the code easier to read. Example: 'for(; exitCondition(); ) {\n process();\n }' After the quick-fix is applied: 'while(exitCondition()) {\n process();\n }' The quick-fix is also available for other 'for' loops, so you can replace any 'for' loop with a 'while' loop. Use the Ignore 'infinite' for loops without conditions option if you want to ignore 'for' loops with trivial or non-existent conditions.", - "markdown": "Reports `for` loops that contain neither initialization nor update components, and suggests converting them to `while` loops. This makes the code easier to read.\n\nExample:\n\n\n for(; exitCondition(); ) {\n process();\n }\n\nAfter the quick-fix is applied:\n\n\n while(exitCondition()) {\n process();\n }\n\nThe quick-fix is also available for other `for` loops, so you can replace any `for` loop with a\n`while` loop.\n\nUse the **Ignore 'infinite' for loops without conditions** option if you want to ignore `for`\nloops with trivial or non-existent conditions." + "text": "Reports classes whose number of methods exceeds the specified maximum. Classes with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes. Configure the inspection: Use the Method count limit field to specify the maximum allowed number of methods in a class. Use the Ignore simple getter and setter methods option to ignore simple getters and setters in method count. Use the Ignore methods overriding/implementing a super method to ignore methods that override or implement a method from a superclass.", + "markdown": "Reports classes whose number of methods exceeds the specified maximum.\n\nClasses with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes.\n\nConfigure the inspection:\n\n* Use the **Method count limit** field to specify the maximum allowed number of methods in a class.\n* Use the **Ignore simple getter and setter methods** option to ignore simple getters and setters in method count.\n* Use the **Ignore methods overriding/implementing a super method** to ignore methods that override or implement a method from a superclass." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ForLoopReplaceableByWhile", + "suppressToolId": "ClassWithTooManyMethods", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21857,8 +21857,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 22, + "id": "Java/Class metrics", + "index": 81, "toolComponent": { "name": "QDJVMC" } @@ -21870,19 +21870,19 @@ ] }, { - "id": "MethodCount", + "id": "ForLoopReplaceableByWhile", "shortDescription": { - "text": "Class with too many methods" + "text": "'for' loop may be replaced by 'while' loop" }, "fullDescription": { - "text": "Reports classes whose number of methods exceeds the specified maximum. Classes with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes. Configure the inspection: Use the Method count limit field to specify the maximum allowed number of methods in a class. Use the Ignore simple getter and setter methods option to ignore simple getters and setters in method count. Use the Ignore methods overriding/implementing a super method to ignore methods that override or implement a method from a superclass.", - "markdown": "Reports classes whose number of methods exceeds the specified maximum.\n\nClasses with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes.\n\nConfigure the inspection:\n\n* Use the **Method count limit** field to specify the maximum allowed number of methods in a class.\n* Use the **Ignore simple getter and setter methods** option to ignore simple getters and setters in method count.\n* Use the **Ignore methods overriding/implementing a super method** to ignore methods that override or implement a method from a superclass." + "text": "Reports 'for' loops that contain neither initialization nor update components, and suggests converting them to 'while' loops. This makes the code easier to read. Example: 'for(; exitCondition(); ) {\n process();\n }' After the quick-fix is applied: 'while(exitCondition()) {\n process();\n }' The quick-fix is also available for other 'for' loops, so you can replace any 'for' loop with a 'while' loop. Use the Ignore 'infinite' for loops without conditions option if you want to ignore 'for' loops with trivial or non-existent conditions.", + "markdown": "Reports `for` loops that contain neither initialization nor update components, and suggests converting them to `while` loops. This makes the code easier to read.\n\nExample:\n\n\n for(; exitCondition(); ) {\n process();\n }\n\nAfter the quick-fix is applied:\n\n\n while(exitCondition()) {\n process();\n }\n\nThe quick-fix is also available for other `for` loops, so you can replace any `for` loop with a\n`while` loop.\n\nUse the **Ignore 'infinite' for loops without conditions** option if you want to ignore `for`\nloops with trivial or non-existent conditions." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassWithTooManyMethods", + "suppressToolId": "ForLoopReplaceableByWhile", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21890,8 +21890,8 @@ "relationships": [ { "target": { - "id": "Java/Class metrics", - "index": 81, + "id": "Java/Control flow issues", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -21924,7 +21924,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21961,7 +21961,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -22060,7 +22060,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -22093,7 +22093,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -22126,7 +22126,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -22192,7 +22192,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -22357,7 +22357,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -22402,19 +22402,19 @@ ] }, { - "id": "ObjectToString", + "id": "UnnecessarilyQualifiedStaticallyImportedElement", "shortDescription": { - "text": "Call to default 'toString()'" + "text": "Unnecessarily qualified statically imported element" }, "fullDescription": { - "text": "Reports calls to 'toString()' that use the default implementation from 'java.lang.Object'. The default implementation is rarely intended but may be used by accident. Calls to 'toString()' on objects with 'java.lang.Object', interface or abstract class type are ignored by this inspection. Example: 'class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }'", - "markdown": "Reports calls to `toString()` that use the default implementation from `java.lang.Object`.\n\nThe default implementation is rarely intended but may be used by accident.\n\n\nCalls to `toString()` on objects with `java.lang.Object`,\ninterface or abstract class type are ignored by this inspection.\n\n**Example:**\n\n\n class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }\n" + "text": "Reports usage of statically imported members qualified with their containing class name. Such qualification is unnecessary and can be removed because statically imported members can be accessed directly by member name. Example: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }' After the quick-fix is applied: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }'", + "markdown": "Reports usage of statically imported members qualified with their containing class name.\n\nSuch qualification is unnecessary and can be removed\nbecause statically imported members can be accessed directly by member name.\n\n**Example:**\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ObjectToString", + "suppressToolId": "UnnecessarilyQualifiedStaticallyImportedElement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22422,8 +22422,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -22435,19 +22435,19 @@ ] }, { - "id": "UnnecessarilyQualifiedStaticallyImportedElement", + "id": "ObjectToString", "shortDescription": { - "text": "Unnecessarily qualified statically imported element" + "text": "Call to default 'toString()'" }, "fullDescription": { - "text": "Reports usage of statically imported members qualified with their containing class name. Such qualification is unnecessary and can be removed because statically imported members can be accessed directly by member name. Example: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }' After the quick-fix is applied: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }'", - "markdown": "Reports usage of statically imported members qualified with their containing class name.\n\nSuch qualification is unnecessary and can be removed\nbecause statically imported members can be accessed directly by member name.\n\n**Example:**\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }\n" + "text": "Reports calls to 'toString()' that use the default implementation from 'java.lang.Object'. The default implementation is rarely intended but may be used by accident. Calls to 'toString()' on objects with 'java.lang.Object', interface or abstract class type are ignored by this inspection. Example: 'class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }'", + "markdown": "Reports calls to `toString()` that use the default implementation from `java.lang.Object`.\n\nThe default implementation is rarely intended but may be used by accident.\n\n\nCalls to `toString()` on objects with `java.lang.Object`,\ninterface or abstract class type are ignored by this inspection.\n\n**Example:**\n\n\n class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessarilyQualifiedStaticallyImportedElement", + "suppressToolId": "ObjectToString", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22455,8 +22455,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -22588,7 +22588,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -22786,7 +22786,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -22798,19 +22798,22 @@ ] }, { - "id": "SuspiciousLiteralUnderscore", + "id": "StringEquality", "shortDescription": { - "text": "Suspicious underscore in number literal" + "text": "String comparison using '==', instead of 'equals()'" }, "fullDescription": { - "text": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo. This inspection will not warn on literals containing two consecutive underscores. It is also allowed to omit underscores in the fractional part of 'double' and 'float' literals. Example: 'int oneMillion = 1_000_0000;'", - "markdown": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo.\n\nThis inspection will not warn on literals containing two consecutive underscores.\nIt is also allowed to omit underscores in the fractional part of `double` and `float` literals.\n\n**Example:** `int oneMillion = 1_000_0000;`" + "text": "Reports code that uses of == or != to compare strings. These operators determine referential equality instead of comparing content. In most cases, strings should be compared using 'equals()', which does a character-by-character comparison when the strings are different objects. Example: 'void foo(String s, String t) {\n final boolean b = t == s;\n }' If 't' is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following: 'void foo(String s, String t) {\n final boolean b = t.equals(s);\n }'", + "markdown": "Reports code that uses of **==** or **!=** to compare strings.\n\n\nThese operators determine referential equality instead of comparing content.\nIn most cases, strings should be compared using `equals()`,\nwhich does a character-by-character comparison when the strings are different objects.\n\n**Example:**\n\n\n void foo(String s, String t) {\n final boolean b = t == s;\n }\n\nIf `t` is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following:\n\n\n void foo(String s, String t) {\n final boolean b = t.equals(s);\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SuspiciousLiteralUnderscore", + "suppressToolId": "StringEquality", + "cweIds": [ + 597 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22818,8 +22821,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 21, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -22831,22 +22834,19 @@ ] }, { - "id": "StringEquality", + "id": "SuspiciousLiteralUnderscore", "shortDescription": { - "text": "String comparison using '==', instead of 'equals()'" + "text": "Suspicious underscore in number literal" }, "fullDescription": { - "text": "Reports code that uses of == or != to compare strings. These operators determine referential equality instead of comparing content. In most cases, strings should be compared using 'equals()', which does a character-by-character comparison when the strings are different objects. Example: 'void foo(String s, String t) {\n final boolean b = t == s;\n }' If 't' is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following: 'void foo(String s, String t) {\n final boolean b = t.equals(s);\n }'", - "markdown": "Reports code that uses of **==** or **!=** to compare strings.\n\n\nThese operators determine referential equality instead of comparing content.\nIn most cases, strings should be compared using `equals()`,\nwhich does a character-by-character comparison when the strings are different objects.\n\n**Example:**\n\n\n void foo(String s, String t) {\n final boolean b = t == s;\n }\n\nIf `t` is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following:\n\n\n void foo(String s, String t) {\n final boolean b = t.equals(s);\n }\n" + "text": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo. This inspection will not warn on literals containing two consecutive underscores. It is also allowed to omit underscores in the fractional part of 'double' and 'float' literals. Example: 'int oneMillion = 1_000_0000;'", + "markdown": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo.\n\nThis inspection will not warn on literals containing two consecutive underscores.\nIt is also allowed to omit underscores in the fractional part of `double` and `float` literals.\n\n**Example:** `int oneMillion = 1_000_0000;`" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "StringEquality", - "cweIds": [ - 597 - ], + "suppressToolId": "SuspiciousLiteralUnderscore", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22854,8 +22854,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Numeric issues", + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -22888,7 +22888,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -23251,7 +23251,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -23329,19 +23329,19 @@ ] }, { - "id": "SystemGC", + "id": "ClassComplexity", "shortDescription": { - "text": "Call to 'System.gc()' or 'Runtime.gc()'" + "text": "Overly complex class" }, "fullDescription": { - "text": "Reports 'System.gc()' or 'Runtime.gc()' calls. While occasionally useful in testing, explicitly triggering garbage collection via 'System.gc()' is almost never recommended in production code and can result in serious performance issues.", - "markdown": "Reports `System.gc()` or `Runtime.gc()` calls. While occasionally useful in testing, explicitly triggering garbage collection via `System.gc()` is almost never recommended in production code and can result in serious performance issues." + "text": "Reports classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Too high complexity indicates that the class should be refactored into several smaller classes. Use the Cyclomatic complexity limit field below to specify the maximum allowed complexity for a class.", + "markdown": "Reports classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nToo high complexity indicates that the class should be refactored into several smaller classes.\n\nUse the **Cyclomatic complexity limit** field below to specify the maximum allowed complexity for a class." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CallToSystemGC", + "suppressToolId": "OverlyComplexClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23349,8 +23349,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 105, + "id": "Java/Class metrics", + "index": 81, "toolComponent": { "name": "QDJVMC" } @@ -23362,19 +23362,19 @@ ] }, { - "id": "ClassComplexity", + "id": "SystemGC", "shortDescription": { - "text": "Overly complex class" + "text": "Call to 'System.gc()' or 'Runtime.gc()'" }, "fullDescription": { - "text": "Reports classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Too high complexity indicates that the class should be refactored into several smaller classes. Use the Cyclomatic complexity limit field below to specify the maximum allowed complexity for a class.", - "markdown": "Reports classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nToo high complexity indicates that the class should be refactored into several smaller classes.\n\nUse the **Cyclomatic complexity limit** field below to specify the maximum allowed complexity for a class." + "text": "Reports 'System.gc()' or 'Runtime.gc()' calls. While occasionally useful in testing, explicitly triggering garbage collection via 'System.gc()' is almost never recommended in production code and can result in serious performance issues.", + "markdown": "Reports `System.gc()` or `Runtime.gc()` calls. While occasionally useful in testing, explicitly triggering garbage collection via `System.gc()` is almost never recommended in production code and can result in serious performance issues." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "OverlyComplexClass", + "suppressToolId": "CallToSystemGC", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23382,8 +23382,8 @@ "relationships": [ { "target": { - "id": "Java/Class metrics", - "index": 81, + "id": "Java/Memory", + "index": 105, "toolComponent": { "name": "QDJVMC" } @@ -23420,40 +23420,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "InnerClassMayBeStatic", - "shortDescription": { - "text": "Inner class may be 'static'" - }, - "fullDescription": { - "text": "Reports inner classes that can be made 'static'. A 'static' inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class. Example: 'public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' After the quick-fix is applied: 'public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }'", - "markdown": "Reports inner classes that can be made `static`.\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nThis prevents a common cause of memory leaks and uses less memory per instance of the class.\n\n**Example:**\n\n\n public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "InnerClassMayBeStatic", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Memory", - "index": 105, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -23497,6 +23464,39 @@ } ] }, + { + "id": "InnerClassMayBeStatic", + "shortDescription": { + "text": "Inner class may be 'static'" + }, + "fullDescription": { + "text": "Reports inner classes that can be made 'static'. A 'static' inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class. Example: 'public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' After the quick-fix is applied: 'public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }'", + "markdown": "Reports inner classes that can be made `static`.\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nThis prevents a common cause of memory leaks and uses less memory per instance of the class.\n\n**Example:**\n\n\n public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InnerClassMayBeStatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Memory", + "index": 105, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "Java9UndeclaredServiceUsage", "shortDescription": { @@ -23651,7 +23651,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -23753,7 +23753,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -23786,7 +23786,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -24024,7 +24024,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -24069,22 +24069,21 @@ ] }, { - "id": "UnsatisfiedRange", + "id": "SystemSetSecurityManager", "shortDescription": { - "text": "Return value is outside of declared range" + "text": "Call to 'System.setSecurityManager()'" }, "fullDescription": { - "text": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations: 'org.jetbrains.annotations.Range' from JetBrains annotations package (specify 'from' and 'to') 'org.checkerframework.common.value.qual.IntRange' from Checker Framework annotations package (specify 'from' and 'to') 'org.checkerframework.checker.index.qual.GTENegativeOne' from Checker Framework annotations package (range is '>= -1') 'org.checkerframework.checker.index.qual.NonNegative' from Checker Framework annotations package (range is '>= 0') 'org.checkerframework.checker.index.qual.Positive' from Checker Framework annotations package (range is '> 0') 'javax.annotation.Nonnegative' from JSR 305 annotations package (range is '>= 0') 'javax.validation.constraints.Min' (specify minimum value) 'javax.validation.constraints.Max' (specify maximum value) Example: '@Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }' New in 2021.2", - "markdown": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations:\n\n* `org.jetbrains.annotations.Range` from JetBrains annotations package (specify 'from' and 'to')\n* `org.checkerframework.common.value.qual.IntRange` from Checker Framework annotations package (specify 'from' and 'to')\n* `org.checkerframework.checker.index.qual.GTENegativeOne` from Checker Framework annotations package (range is '\\>= -1')\n* `org.checkerframework.checker.index.qual.NonNegative` from Checker Framework annotations package (range is '\\>= 0')\n* `org.checkerframework.checker.index.qual.Positive` from Checker Framework annotations package (range is '\\> 0')\n* `javax.annotation.Nonnegative` from JSR 305 annotations package (range is '\\>= 0')\n* `javax.validation.constraints.Min` (specify minimum value)\n* `javax.validation.constraints.Max` (specify maximum value)\n\nExample:\n\n\n @Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }\n\nNew in 2021.2" + "text": "Reports calls to 'System.setSecurityManager()'. While often benign, any call to 'System.setSecurityManager()' should be closely examined in any security audit.", + "markdown": "Reports calls to `System.setSecurityManager()`.\n\nWhile often benign, any call to `System.setSecurityManager()` should be closely examined in any security audit." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnsatisfiedRange", + "suppressToolId": "CallToSystemSetSecurityManager", "cweIds": [ - 129, - 682 + 250 ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" @@ -24093,8 +24092,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs/Nullability problems", - "index": 108, + "id": "Java/Security", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -24106,21 +24105,22 @@ ] }, { - "id": "SystemSetSecurityManager", + "id": "UnsatisfiedRange", "shortDescription": { - "text": "Call to 'System.setSecurityManager()'" + "text": "Return value is outside of declared range" }, "fullDescription": { - "text": "Reports calls to 'System.setSecurityManager()'. While often benign, any call to 'System.setSecurityManager()' should be closely examined in any security audit.", - "markdown": "Reports calls to `System.setSecurityManager()`.\n\nWhile often benign, any call to `System.setSecurityManager()` should be closely examined in any security audit." + "text": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations: 'org.jetbrains.annotations.Range' from JetBrains annotations package (specify 'from' and 'to') 'org.checkerframework.common.value.qual.IntRange' from Checker Framework annotations package (specify 'from' and 'to') 'org.checkerframework.checker.index.qual.GTENegativeOne' from Checker Framework annotations package (range is '>= -1') 'org.checkerframework.checker.index.qual.NonNegative' from Checker Framework annotations package (range is '>= 0') 'org.checkerframework.checker.index.qual.Positive' from Checker Framework annotations package (range is '> 0') 'javax.annotation.Nonnegative' from JSR 305 annotations package (range is '>= 0') 'javax.validation.constraints.Min' (specify minimum value) 'javax.validation.constraints.Max' (specify maximum value) Example: '@Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }' New in 2021.2", + "markdown": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations:\n\n* `org.jetbrains.annotations.Range` from JetBrains annotations package (specify 'from' and 'to')\n* `org.checkerframework.common.value.qual.IntRange` from Checker Framework annotations package (specify 'from' and 'to')\n* `org.checkerframework.checker.index.qual.GTENegativeOne` from Checker Framework annotations package (range is '\\>= -1')\n* `org.checkerframework.checker.index.qual.NonNegative` from Checker Framework annotations package (range is '\\>= 0')\n* `org.checkerframework.checker.index.qual.Positive` from Checker Framework annotations package (range is '\\> 0')\n* `javax.annotation.Nonnegative` from JSR 305 annotations package (range is '\\>= 0')\n* `javax.validation.constraints.Min` (specify minimum value)\n* `javax.validation.constraints.Max` (specify maximum value)\n\nExample:\n\n\n @Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }\n\nNew in 2021.2" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "CallToSystemSetSecurityManager", + "suppressToolId": "UnsatisfiedRange", "cweIds": [ - 250 + 129, + 682 ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" @@ -24129,8 +24129,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 25, + "id": "Java/Probable bugs/Nullability problems", + "index": 108, "toolComponent": { "name": "QDJVMC" } @@ -24142,19 +24142,19 @@ ] }, { - "id": "ClassWithTooManyDependencies", + "id": "ClassWithoutNoArgConstructor", "shortDescription": { - "text": "Class with too many dependencies" + "text": "Class without no-arg constructor" }, "fullDescription": { - "text": "Reports classes that are directly dependent on too many other classes in the project. Modifications to any dependency of such classes may require changing the class, thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of dependencies field to specify the maximum allowed number of dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports classes that are directly dependent on too many other classes in the project.\n\nModifications to any dependency of such classes may require changing the class, thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of dependencies** field to specify the maximum allowed number of dependencies for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection. Example: 'public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }' Use the checkbox below to ignore classes without explicit constructors. The compiler provides a default no-arg constructor to such classes.", + "markdown": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection.\n\n**Example:**\n\n\n public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }\n\n\nUse the checkbox below to ignore classes without explicit constructors.\nThe compiler provides a default no-arg constructor to such classes." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassWithTooManyDependencies", + "suppressToolId": "ClassWithoutNoArgConstructor", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24162,8 +24162,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 93, + "id": "Java/JavaBeans issues", + "index": 91, "toolComponent": { "name": "QDJVMC" } @@ -24175,19 +24175,19 @@ ] }, { - "id": "ClassWithoutNoArgConstructor", + "id": "ClassWithTooManyDependencies", "shortDescription": { - "text": "Class without no-arg constructor" + "text": "Class with too many dependencies" }, "fullDescription": { - "text": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection. Example: 'public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }' Use the checkbox below to ignore classes without explicit constructors. The compiler provides a default no-arg constructor to such classes.", - "markdown": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection.\n\n**Example:**\n\n\n public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }\n\n\nUse the checkbox below to ignore classes without explicit constructors.\nThe compiler provides a default no-arg constructor to such classes." + "text": "Reports classes that are directly dependent on too many other classes in the project. Modifications to any dependency of such classes may require changing the class, thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of dependencies field to specify the maximum allowed number of dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that are directly dependent on too many other classes in the project.\n\nModifications to any dependency of such classes may require changing the class, thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of dependencies** field to specify the maximum allowed number of dependencies for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassWithoutNoArgConstructor", + "suppressToolId": "ClassWithTooManyDependencies", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24195,8 +24195,8 @@ "relationships": [ { "target": { - "id": "Java/JavaBeans issues", - "index": 91, + "id": "Java/Dependency issues", + "index": 93, "toolComponent": { "name": "QDJVMC" } @@ -24232,7 +24232,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -24244,19 +24244,19 @@ ] }, { - "id": "NewExceptionWithoutArguments", + "id": "Contract", "shortDescription": { - "text": "Exception constructor called without arguments" + "text": "Contract issues" }, "fullDescription": { - "text": "Reports creation of a exception instance without any arguments specified. When an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes debugging needlessly hard. Example: 'throw new IOException(); // warning: exception without arguments'", - "markdown": "Reports creation of a exception instance without any arguments specified.\n\nWhen an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes\ndebugging needlessly hard.\n\n**Example:**\n\n\n throw new IOException(); // warning: exception without arguments\n" + "text": "Reports issues in method '@Contract' annotations. The types of issues that can be reported are: Errors in contract syntax Contracts that do not conform to the method signature (wrong parameter count) Method implementations that contradict the contract (e.g. return 'true' when the contract says 'false') Example: '// method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }'", + "markdown": "Reports issues in method `@Contract` annotations. The types of issues that can be reported are:\n\n* Errors in contract syntax\n* Contracts that do not conform to the method signature (wrong parameter count)\n* Method implementations that contradict the contract (e.g. return `true` when the contract says `false`)\n\nExample:\n\n\n // method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "NewExceptionWithoutArguments", + "suppressToolId": "Contract", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24264,8 +24264,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 10, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -24277,19 +24277,19 @@ ] }, { - "id": "Contract", + "id": "NewExceptionWithoutArguments", "shortDescription": { - "text": "Contract issues" + "text": "Exception constructor called without arguments" }, "fullDescription": { - "text": "Reports issues in method '@Contract' annotations. The types of issues that can be reported are: Errors in contract syntax Contracts that do not conform to the method signature (wrong parameter count) Method implementations that contradict the contract (e.g. return 'true' when the contract says 'false') Example: '// method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }'", - "markdown": "Reports issues in method `@Contract` annotations. The types of issues that can be reported are:\n\n* Errors in contract syntax\n* Contracts that do not conform to the method signature (wrong parameter count)\n* Method implementations that contradict the contract (e.g. return `true` when the contract says `false`)\n\nExample:\n\n\n // method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }\n" + "text": "Reports creation of a exception instance without any arguments specified. When an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes debugging needlessly hard. Example: 'throw new IOException(); // warning: exception without arguments'", + "markdown": "Reports creation of a exception instance without any arguments specified.\n\nWhen an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes\ndebugging needlessly hard.\n\n**Example:**\n\n\n throw new IOException(); // warning: exception without arguments\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "Contract", + "suppressToolId": "NewExceptionWithoutArguments", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24297,8 +24297,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Error handling", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -24541,19 +24541,19 @@ ] }, { - "id": "UnnecessaryLocalVariable", + "id": "Java9RedundantRequiresStatement", "shortDescription": { - "text": "Redundant local variable" + "text": "Redundant 'requires' directive in module-info" }, "fullDescription": { - "text": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including: Local variables that are immediately returned. Local variables that are immediately assigned to another variable and then not used. Local variables that always have the same value as another local variable or parameter. Example: 'boolean yes() {\n boolean b = true;\n return b;\n }' After the quick-fix is applied: 'boolean yes() {\n return true;\n }' Configure the inspection: Use the Ignore immediately returned or thrown variables option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging. Use the Ignore variables which have an annotation option to ignore annotated variables.", - "markdown": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:\n\n* Local variables that are immediately returned.\n* Local variables that are immediately assigned to another variable and then not used.\n* Local variables that always have the same value as another local variable or parameter.\n\n**Example:**\n\n\n boolean yes() {\n boolean b = true;\n return b;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean yes() {\n return true;\n }\n \nConfigure the inspection:\n\n* Use the **Ignore immediately returned or thrown variables** option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging.\n* Use the **Ignore variables which have an annotation** option to ignore annotated variables." + "text": "Reports redundant 'requires' directives in Java Platform Module System 'module-info.java' files. A 'requires' directive is redundant when a module 'A' requires a module 'B', but the code in module 'A' doesn't import any packages or classes from 'B'. Furthermore, all modules have an implicitly declared dependence on the 'java.base' module, therefore a 'requires java.base;' directive is always redundant. The quick-fix deletes the redundant 'requires' directive. If the deleted dependency re-exported modules that are actually used, the fix adds a 'requires' directives for these modules. This inspection only reports if the language level of the project or module is 9 or higher. New in 2017.1", + "markdown": "Reports redundant `requires` directives in Java Platform Module System `module-info.java` files. A `requires` directive is redundant when a module `A` requires a module `B`, but the code in module `A` doesn't import any packages or classes from `B`. Furthermore, all modules have an implicitly declared dependence on the `java.base` module, therefore a `requires java.base;` directive is always redundant.\n\n\nThe quick-fix deletes the redundant `requires` directive.\nIf the deleted dependency re-exported modules that are actually used, the fix adds a `requires` directives for these modules.\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2017.1" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryLocalVariable", + "suppressToolId": "Java9RedundantRequiresStatement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24561,8 +24561,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 41, + "id": "Java/Declaration redundancy", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -24574,19 +24574,19 @@ ] }, { - "id": "Java9RedundantRequiresStatement", + "id": "UnnecessaryLocalVariable", "shortDescription": { - "text": "Redundant 'requires' directive in module-info" + "text": "Redundant local variable" }, "fullDescription": { - "text": "Reports redundant 'requires' directives in Java Platform Module System 'module-info.java' files. A 'requires' directive is redundant when a module 'A' requires a module 'B', but the code in module 'A' doesn't import any packages or classes from 'B'. Furthermore, all modules have an implicitly declared dependence on the 'java.base' module, therefore a 'requires java.base;' directive is always redundant. The quick-fix deletes the redundant 'requires' directive. If the deleted dependency re-exported modules that are actually used, the fix adds a 'requires' directives for these modules. This inspection only reports if the language level of the project or module is 9 or higher. New in 2017.1", - "markdown": "Reports redundant `requires` directives in Java Platform Module System `module-info.java` files. A `requires` directive is redundant when a module `A` requires a module `B`, but the code in module `A` doesn't import any packages or classes from `B`. Furthermore, all modules have an implicitly declared dependence on the `java.base` module, therefore a `requires java.base;` directive is always redundant.\n\n\nThe quick-fix deletes the redundant `requires` directive.\nIf the deleted dependency re-exported modules that are actually used, the fix adds a `requires` directives for these modules.\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2017.1" + "text": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including: Local variables that are immediately returned. Local variables that are immediately assigned to another variable and then not used. Local variables that always have the same value as another local variable or parameter. Example: 'boolean yes() {\n boolean b = true;\n return b;\n }' After the quick-fix is applied: 'boolean yes() {\n return true;\n }' Configure the inspection: Use the Ignore immediately returned or thrown variables option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging. Use the Ignore variables which have an annotation option to ignore annotated variables.", + "markdown": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:\n\n* Local variables that are immediately returned.\n* Local variables that are immediately assigned to another variable and then not used.\n* Local variables that always have the same value as another local variable or parameter.\n\n**Example:**\n\n\n boolean yes() {\n boolean b = true;\n return b;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean yes() {\n return true;\n }\n \nConfigure the inspection:\n\n* Use the **Ignore immediately returned or thrown variables** option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging.\n* Use the **Ignore variables which have an annotation** option to ignore annotated variables." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "Java9RedundantRequiresStatement", + "suppressToolId": "UnnecessaryLocalVariable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24594,8 +24594,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 9, + "id": "Java/Data flow", + "index": 41, "toolComponent": { "name": "QDJVMC" } @@ -24661,7 +24661,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -24694,7 +24694,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -24760,7 +24760,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -24796,7 +24796,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -24829,7 +24829,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -24895,7 +24895,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -24928,7 +24928,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -25130,7 +25130,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -25232,7 +25232,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -25334,7 +25334,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -25766,7 +25766,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -25898,7 +25898,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -25910,19 +25910,22 @@ ] }, { - "id": "SuspiciousGetterSetter", + "id": "MismatchedStringCase", "shortDescription": { - "text": "Suspicious getter/setter" + "text": "Mismatched case in 'String' operation" }, "fullDescription": { - "text": "Reports getter or setter methods that access a field that is not expected by its name. For example, when 'getY()' returns the 'x' field. Usually, it might be a copy-paste error. Example: 'class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }' Use the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter.", - "markdown": "Reports getter or setter methods that access a field that is not expected by its name. For example, when `getY()` returns the `x` field. Usually, it might be a copy-paste error.\n\n**Example:**\n\n class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }\n\n\nUse the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter." + "text": "Reports 'String' method calls that always return the same value ('-1' or 'false') because a lowercase character is searched in an uppercase-only string or vice versa. Reported methods include 'equals', 'startsWith', 'endsWith', 'contains', 'indexOf', and 'lastIndexOf'. Example: if (columnName.toLowerCase().equals(\"ID\")) {...}\n New in 2019.3", + "markdown": "Reports `String` method calls that always return the same value (`-1` or `false`) because a lowercase character is searched in an uppercase-only string or vice versa.\n\nReported methods include `equals`, `startsWith`, `endsWith`, `contains`,\n`indexOf`, and `lastIndexOf`.\n\n**Example:**\n\n```\n if (columnName.toLowerCase().equals(\"ID\")) {...}\n```\n\nNew in 2019.3" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SuspiciousGetterSetter", + "suppressToolId": "MismatchedStringCase", + "cweIds": [ + 597 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25930,8 +25933,8 @@ "relationships": [ { "target": { - "id": "Java/JavaBeans issues", - "index": 91, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -25943,22 +25946,19 @@ ] }, { - "id": "MismatchedStringCase", + "id": "SuspiciousGetterSetter", "shortDescription": { - "text": "Mismatched case in 'String' operation" + "text": "Suspicious getter/setter" }, "fullDescription": { - "text": "Reports 'String' method calls that always return the same value ('-1' or 'false') because a lowercase character is searched in an uppercase-only string or vice versa. Reported methods include 'equals', 'startsWith', 'endsWith', 'contains', 'indexOf', and 'lastIndexOf'. Example: if (columnName.toLowerCase().equals(\"ID\")) {...}\n New in 2019.3", - "markdown": "Reports `String` method calls that always return the same value (`-1` or `false`) because a lowercase character is searched in an uppercase-only string or vice versa.\n\nReported methods include `equals`, `startsWith`, `endsWith`, `contains`,\n`indexOf`, and `lastIndexOf`.\n\n**Example:**\n\n```\n if (columnName.toLowerCase().equals(\"ID\")) {...}\n```\n\nNew in 2019.3" + "text": "Reports getter or setter methods that access a field that is not expected by its name. For example, when 'getY()' returns the 'x' field. Usually, it might be a copy-paste error. Example: 'class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }' Use the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter.", + "markdown": "Reports getter or setter methods that access a field that is not expected by its name. For example, when `getY()` returns the `x` field. Usually, it might be a copy-paste error.\n\n**Example:**\n\n class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }\n\n\nUse the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MismatchedStringCase", - "cweIds": [ - 597 - ], + "suppressToolId": "SuspiciousGetterSetter", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25966,8 +25966,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/JavaBeans issues", + "index": 91, "toolComponent": { "name": "QDJVMC" } @@ -26078,19 +26078,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": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ProtectedMemberInFinalClass", + "suppressToolId": "OverlyBroadCatchBlock", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26098,7 +26098,7 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", + "id": "Java/Error handling", "index": 9, "toolComponent": { "name": "QDJVMC" @@ -26111,19 +26111,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, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "OverlyBroadCatchBlock", + "suppressToolId": "ProtectedMemberInFinalClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26131,7 +26131,7 @@ "relationships": [ { "target": { - "id": "Java/Error handling", + "id": "Java/Declaration redundancy", "index": 10, "toolComponent": { "name": "QDJVMC" @@ -26231,7 +26231,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -26264,7 +26264,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -26429,7 +26429,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -26771,19 +26771,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": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalFieldInEnum", + "suppressToolId": "SingleCharacterStringConcatenation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26791,8 +26791,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 14, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -26804,19 +26804,19 @@ ] }, { - "id": "LengthOneStringInIndexOf", + "id": "NonFinalFieldInEnum", "shortDescription": { - "text": "Single character string argument in 'String.indexOf()' call" + "text": "Non-final field in 'enum'" }, "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 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, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SingleCharacterStringConcatenation", + "suppressToolId": "NonFinalFieldInEnum", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26824,8 +26824,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Class structure", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -26861,7 +26861,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -26927,7 +26927,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -27095,7 +27095,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27161,7 +27161,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -27227,7 +27227,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27326,7 +27326,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -27392,7 +27392,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -27458,7 +27458,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27635,19 +27635,19 @@ ] }, { - "id": "UnnecessaryModifier", + "id": "NonThreadSafeLazyInitialization", "shortDescription": { - "text": "Unnecessary modifier" + "text": "Unsafe lazy initialization of 'static' field" }, "fullDescription": { - "text": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same. Example 1: '// all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }' Example 2: 'final record R() {\n // all records are implicitly final\n }' Example 3: '// all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }'", - "markdown": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same.\n\n**Example 1:**\n\n\n // all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }\n\n**Example 2:**\n\n\n final record R() {\n // all records are implicitly final\n }\n\n**Example 3:**\n\n\n // all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }\n" + "text": "Reports 'static' variables that are lazily initialized in a non-thread-safe manner. Lazy initialization of 'static' variables should be done with an appropriate synchronization construct to prevent different threads from performing conflicting initialization. When applicable, a quick-fix, which introduces the lazy initialization holder class idiom, is suggested. This idiom makes use of the fact that the JVM guarantees that a class will not be initialized until it is used. Example: 'class X {\n private static List list;\n\n public List getList() {\n if (list == null) {\n list = List.of(\"one\", \"two\", \"tree\");\n }\n return list;\n }\n }' After the quick-fix is applied: 'class X {\n private static final class ListHolder {\n static final List list = List.of(\"one\", \"two\", \"tree\");\n }\n\n public List getList() {\n return ListHolder.list;\n }\n }'", + "markdown": "Reports `static` variables that are lazily initialized in a non-thread-safe manner.\n\nLazy initialization of `static` variables should be done with an appropriate synchronization construct\nto prevent different threads from performing conflicting initialization.\n\nWhen applicable, a quick-fix, which introduces the\n[lazy initialization holder class idiom](https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom), is suggested.\nThis idiom makes use of the fact that the JVM guarantees that a class will not be initialized until it is used.\n\n**Example:**\n\n\n class X {\n private static List list;\n\n public List getList() {\n if (list == null) {\n list = List.of(\"one\", \"two\", \"tree\");\n }\n return list;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n private static final class ListHolder {\n static final List list = List.of(\"one\", \"two\", \"tree\");\n }\n\n public List getList() {\n return ListHolder.list;\n }\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryModifier", + "suppressToolId": "NonThreadSafeLazyInitialization", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27655,8 +27655,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Initialization", + "index": 23, "toolComponent": { "name": "QDJVMC" } @@ -27668,19 +27668,19 @@ ] }, { - "id": "NonThreadSafeLazyInitialization", + "id": "UnnecessaryModifier", "shortDescription": { - "text": "Unsafe lazy initialization of 'static' field" + "text": "Unnecessary modifier" }, "fullDescription": { - "text": "Reports 'static' variables that are lazily initialized in a non-thread-safe manner. Lazy initialization of 'static' variables should be done with an appropriate synchronization construct to prevent different threads from performing conflicting initialization. When applicable, a quick-fix, which introduces the lazy initialization holder class idiom, is suggested. This idiom makes use of the fact that the JVM guarantees that a class will not be initialized until it is used. Example: 'class X {\n private static List list;\n\n public List getList() {\n if (list == null) {\n list = List.of(\"one\", \"two\", \"tree\");\n }\n return list;\n }\n }' After the quick-fix is applied: 'class X {\n private static final class ListHolder {\n static final List list = List.of(\"one\", \"two\", \"tree\");\n }\n\n public List getList() {\n return ListHolder.list;\n }\n }'", - "markdown": "Reports `static` variables that are lazily initialized in a non-thread-safe manner.\n\nLazy initialization of `static` variables should be done with an appropriate synchronization construct\nto prevent different threads from performing conflicting initialization.\n\nWhen applicable, a quick-fix, which introduces the\n[lazy initialization holder class idiom](https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom), is suggested.\nThis idiom makes use of the fact that the JVM guarantees that a class will not be initialized until it is used.\n\n**Example:**\n\n\n class X {\n private static List list;\n\n public List getList() {\n if (list == null) {\n list = List.of(\"one\", \"two\", \"tree\");\n }\n return list;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n private static final class ListHolder {\n static final List list = List.of(\"one\", \"two\", \"tree\");\n }\n\n public List getList() {\n return ListHolder.list;\n }\n }\n" + "text": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same. Example 1: '// all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }' Example 2: 'final record R() {\n // all records are implicitly final\n }' Example 3: '// all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }'", + "markdown": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same.\n\n**Example 1:**\n\n\n // all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }\n\n**Example 2:**\n\n\n final record R() {\n // all records are implicitly final\n }\n\n**Example 3:**\n\n\n // all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "NonThreadSafeLazyInitialization", + "suppressToolId": "UnnecessaryModifier", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27688,8 +27688,8 @@ "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 23, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -27722,7 +27722,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -27932,19 +27932,19 @@ ] }, { - "id": "ClassNameSameAsAncestorName", + "id": "RedundantMethodOverride", "shortDescription": { - "text": "Class name same as ancestor name" + "text": "Method is identical to its super method" }, "fullDescription": { - "text": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing. Example: 'package util;\n abstract class Iterable implements java.lang.Iterable {}' A quick-fix that renames such classes is available only in the editor.", - "markdown": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing.\n\n**Example:**\n\n\n package util;\n abstract class Iterable implements java.lang.Iterable {}\n\nA quick-fix that renames such classes is available only in the editor." + "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, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassNameSameAsAncestorName", + "suppressToolId": "RedundantMethodOverride", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27952,8 +27952,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions/Class", - "index": 51, + "id": "Java/Inheritance issues", + "index": 97, "toolComponent": { "name": "QDJVMC" } @@ -27965,19 +27965,19 @@ ] }, { - "id": "RedundantMethodOverride", + "id": "ClassNameSameAsAncestorName", "shortDescription": { - "text": "Method is identical to its super method" + "text": "Class name same as ancestor name" }, "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 classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing. Example: 'package util;\n abstract class Iterable implements java.lang.Iterable {}' A quick-fix that renames such classes is available only in the editor.", + "markdown": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing.\n\n**Example:**\n\n\n package util;\n abstract class Iterable implements java.lang.Iterable {}\n\nA quick-fix that renames such classes is available only in the editor." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "RedundantMethodOverride", + "suppressToolId": "ClassNameSameAsAncestorName", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27985,8 +27985,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 97, + "id": "Java/Naming conventions/Class", + "index": 51, "toolComponent": { "name": "QDJVMC" } @@ -28019,7 +28019,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -28052,7 +28052,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -28217,7 +28217,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -28262,19 +28262,19 @@ ] }, { - "id": "IncrementDecrementUsedAsExpression", + "id": "DisjointPackage", "shortDescription": { - "text": "Result of '++' or '--' used" + "text": "Package with disjoint dependency graph" }, "fullDescription": { - "text": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing. The quick-fix extracts the increment or decrement operation to a separate expression statement. Example: 'int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }' After the quick-fix is applied: 'int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;'", - "markdown": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing.\n\nThe quick-fix extracts the increment or decrement operation to a separate expression statement.\n\n**Example:**\n\n\n int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }\n\nAfter the quick-fix is applied:\n\n\n int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;\n" + "text": "Reports packages whose classes can be separated into mutually independent subsets. Such disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports packages whose classes can be separated into mutually independent subsets.\n\nSuch disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ValueOfIncrementOrDecrementUsed", + "suppressToolId": "DisjointPackage", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28282,8 +28282,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 54, + "id": "Java/Packaging issues", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -28295,19 +28295,19 @@ ] }, { - "id": "DisjointPackage", + "id": "IncrementDecrementUsedAsExpression", "shortDescription": { - "text": "Package with disjoint dependency graph" + "text": "Result of '++' or '--' used" }, "fullDescription": { - "text": "Reports packages whose classes can be separated into mutually independent subsets. Such disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports packages whose classes can be separated into mutually independent subsets.\n\nSuch disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing. The quick-fix extracts the increment or decrement operation to a separate expression statement. Example: 'int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }' After the quick-fix is applied: 'int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;'", + "markdown": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing.\n\nThe quick-fix extracts the increment or decrement operation to a separate expression statement.\n\n**Example:**\n\n\n int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }\n\nAfter the quick-fix is applied:\n\n\n int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "DisjointPackage", + "suppressToolId": "ValueOfIncrementOrDecrementUsed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28315,8 +28315,8 @@ "relationships": [ { "target": { - "id": "Java/Packaging issues", - "index": 28, + "id": "Java/Assignment issues", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -28517,7 +28517,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -28652,7 +28652,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -28817,7 +28817,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -28883,7 +28883,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -29015,7 +29015,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29117,7 +29117,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29249,7 +29249,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -29282,7 +29282,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -29381,7 +29381,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29550,7 +29550,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29583,7 +29583,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29649,7 +29649,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -29682,7 +29682,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -29847,7 +29847,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -30015,7 +30015,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -30147,7 +30147,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -30180,7 +30180,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -30225,19 +30225,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" } @@ -30245,8 +30245,8 @@ "relationships": [ { "target": { - "id": "Java/Bitwise operation issues", - "index": 118, + "id": "Java/Logging", + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -30258,19 +30258,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" } @@ -30278,8 +30278,8 @@ "relationships": [ { "target": { - "id": "Java/Logging", - "index": 46, + "id": "Java/Bitwise operation issues", + "index": 118, "toolComponent": { "name": "QDJVMC" } @@ -30345,7 +30345,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -30444,7 +30444,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -30510,7 +30510,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -30741,7 +30741,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -30885,28 +30885,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": 3, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -30918,28 +30918,28 @@ ] }, { - "id": "RedundantFieldInitialization", + "id": "Since15", "shortDescription": { - "text": "Redundant field initialization" + "text": "Usages of API which isn't available at the configured language level" }, "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 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": "RedundantFieldInitialization", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "Since15", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "JVM languages", + "index": 3, "toolComponent": { "name": "QDJVMC" } @@ -31050,19 +31050,19 @@ ] }, { - "id": "RedundantLengthCheck", + "id": "UNCHECKED_WARNING", "shortDescription": { - "text": "Redundant array length check" + "text": "Unchecked warning" }, "fullDescription": { - "text": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly. Example: 'void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }' A quick-fix is suggested to unwrap or remove the length check: 'void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }' New in 2022.3", - "markdown": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly.\n\nExample:\n\n\n void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }\n\nA quick-fix is suggested to unwrap or remove the length check:\n\n\n void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }\n\nNew in 2022.3" + "text": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger 'ClassCastException' at runtime. Example: 'List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment'", + "markdown": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger `ClassCastException` at runtime.\n\nExample:\n\n\n List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment\n" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "RedundantLengthCheck", + "suppressToolId": "unchecked", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31070,8 +31070,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 29, + "id": "Java/Compiler issues", + "index": 102, "toolComponent": { "name": "QDJVMC" } @@ -31083,19 +31083,19 @@ ] }, { - "id": "UNCHECKED_WARNING", + "id": "RedundantLengthCheck", "shortDescription": { - "text": "Unchecked warning" + "text": "Redundant array length check" }, "fullDescription": { - "text": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger 'ClassCastException' at runtime. Example: 'List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment'", - "markdown": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger `ClassCastException` at runtime.\n\nExample:\n\n\n List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment\n" + "text": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly. Example: 'void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }' A quick-fix is suggested to unwrap or remove the length check: 'void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }' New in 2022.3", + "markdown": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly.\n\nExample:\n\n\n void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }\n\nA quick-fix is suggested to unwrap or remove the length check:\n\n\n void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }\n\nNew in 2022.3" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "unchecked", + "suppressToolId": "RedundantLengthCheck", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31103,8 +31103,8 @@ "relationships": [ { "target": { - "id": "Java/Compiler issues", - "index": 102, + "id": "Java/Verbose or redundant code constructs", + "index": 29, "toolComponent": { "name": "QDJVMC" } @@ -31148,7 +31148,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -31214,7 +31214,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -31511,7 +31511,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -31709,7 +31709,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -31841,7 +31841,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -31940,7 +31940,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -31976,7 +31976,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -32453,19 +32453,19 @@ ] }, { - "id": "NestedSwitchStatement", + "id": "EmptyTryBlock", "shortDescription": { - "text": "Nested 'switch' statement" + "text": "Empty 'try' block" }, "fullDescription": { - "text": "Reports nested 'switch' statements or expressions. Nested 'switch' statements may result in extremely confusing code. These statements may be extracted to a separate method. Example: 'int res = switch (i) {\n case 0 -> 0;\n default -> switch (i) {\n case 100 -> 0;\n default -> i;\n };\n };'", - "markdown": "Reports nested `switch` statements or expressions.\n\nNested `switch` statements\nmay result in extremely confusing code. These statements may be extracted to a separate method.\n\nExample:\n\n\n int res = switch (i) {\n case 0 -> 0;\n default -> switch (i) {\n case 100 -> 0;\n default -> i;\n };\n };\n" + "text": "Reports empty 'try' blocks, including try-with-resources statements. 'try' blocks with comments are considered empty. This inspection doesn't report empty 'try' blocks found in JSP files.", + "markdown": "Reports empty `try` blocks, including try-with-resources statements.\n\n`try` blocks with comments are considered empty.\n\n\nThis inspection doesn't report empty `try` blocks found in JSP files." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "NestedSwitchStatement", + "suppressToolId": "EmptyTryBlock", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32473,8 +32473,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 22, + "id": "Java/Error handling", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -32486,19 +32486,19 @@ ] }, { - "id": "EmptyTryBlock", + "id": "NestedSwitchStatement", "shortDescription": { - "text": "Empty 'try' block" + "text": "Nested 'switch' statement" }, "fullDescription": { - "text": "Reports empty 'try' blocks, including try-with-resources statements. 'try' blocks with comments are considered empty. This inspection doesn't report empty 'try' blocks found in JSP files.", - "markdown": "Reports empty `try` blocks, including try-with-resources statements.\n\n`try` blocks with comments are considered empty.\n\n\nThis inspection doesn't report empty `try` blocks found in JSP files." + "text": "Reports nested 'switch' statements or expressions. Nested 'switch' statements may result in extremely confusing code. These statements may be extracted to a separate method. Example: 'int res = switch (i) {\n case 0 -> 0;\n default -> switch (i) {\n case 100 -> 0;\n default -> i;\n };\n };'", + "markdown": "Reports nested `switch` statements or expressions.\n\nNested `switch` statements\nmay result in extremely confusing code. These statements may be extracted to a separate method.\n\nExample:\n\n\n int res = switch (i) {\n case 0 -> 0;\n default -> switch (i) {\n case 100 -> 0;\n default -> i;\n };\n };\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "EmptyTryBlock", + "suppressToolId": "NestedSwitchStatement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32506,8 +32506,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 10, + "id": "Java/Control flow issues", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -32552,19 +32552,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" } @@ -32572,8 +32572,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Threading issues", + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -32585,19 +32585,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" } @@ -32605,8 +32605,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -32651,19 +32651,19 @@ ] }, { - "id": "LiteralAsArgToStringEquals", + "id": "UnnecessaryEmptyArrayUsage", "shortDescription": { - "text": "String literal may be 'equals()' qualifier" + "text": "Unnecessary zero length array usage" }, "fullDescription": { - "text": "Reports 'String.equals()' or 'String.equalsIgnoreCase()' calls with a string literal argument. Some coding standards specify that string literals should be the qualifier of 'equals()', rather than argument, thus minimizing 'NullPointerException'-s. A quick-fix is available to exchange the literal and the expression. Example: 'boolean isFoo(String value) {\n return value.equals(\"foo\");\n }' After the quick-fix is applied: 'boolean isFoo(String value) {\n return \"foo\".equals(value);\n }'", - "markdown": "Reports `String.equals()` or `String.equalsIgnoreCase()` calls with a string literal argument.\n\nSome coding standards specify that string literals should be the qualifier of `equals()`, rather than\nargument, thus minimizing `NullPointerException`-s.\n\nA quick-fix is available to exchange the literal and the expression.\n\n**Example:**\n\n\n boolean isFoo(String value) {\n return value.equals(\"foo\");\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isFoo(String value) {\n return \"foo\".equals(value);\n }\n" + "text": "Reports allocations of arrays with known lengths of zero when there is a constant for that in the class of the array's element type. As zero-length arrays are immutable, you can save memory reusing the same array instance. Example: 'class Item {\n // Public zero-length array constant that can be reused \n public static final Item[] EMPTY_ARRAY = new Item[0];\n }\n class EmptyNode {\n Item[] getChildren() {\n // Unnecessary zero-length array creation\n return new Item[0];\n }\n }' After the quick-fix is applied: 'class EmptyNode {\n Item[] getChildren() {\n return Item.EMPTY_ARRAY;\n }\n }'", + "markdown": "Reports allocations of arrays with known lengths of zero when there is a constant for that in the class of the array's element type. As zero-length arrays are immutable, you can save memory reusing the same array instance.\n\n**Example:**\n\n\n class Item {\n // Public zero-length array constant that can be reused \n public static final Item[] EMPTY_ARRAY = new Item[0];\n }\n class EmptyNode {\n Item[] getChildren() {\n // Unnecessary zero-length array creation\n return new Item[0];\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class EmptyNode {\n Item[] getChildren() {\n return Item.EMPTY_ARRAY;\n }\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "LiteralAsArgToStringEquals", + "suppressToolId": "ConstantForZeroLengthArrayAllocation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32671,8 +32671,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Memory", + "index": 105, "toolComponent": { "name": "QDJVMC" } @@ -32684,19 +32684,19 @@ ] }, { - "id": "UnnecessaryEmptyArrayUsage", + "id": "LiteralAsArgToStringEquals", "shortDescription": { - "text": "Unnecessary zero length array usage" + "text": "String literal may be 'equals()' qualifier" }, "fullDescription": { - "text": "Reports allocations of arrays with known lengths of zero when there is a constant for that in the class of the array's element type. As zero-length arrays are immutable, you can save memory reusing the same array instance. Example: 'class Item {\n // Public zero-length array constant that can be reused \n public static final Item[] EMPTY_ARRAY = new Item[0];\n }\n class EmptyNode {\n Item[] getChildren() {\n // Unnecessary zero-length array creation\n return new Item[0];\n }\n }' After the quick-fix is applied: 'class EmptyNode {\n Item[] getChildren() {\n return Item.EMPTY_ARRAY;\n }\n }'", - "markdown": "Reports allocations of arrays with known lengths of zero when there is a constant for that in the class of the array's element type. As zero-length arrays are immutable, you can save memory reusing the same array instance.\n\n**Example:**\n\n\n class Item {\n // Public zero-length array constant that can be reused \n public static final Item[] EMPTY_ARRAY = new Item[0];\n }\n class EmptyNode {\n Item[] getChildren() {\n // Unnecessary zero-length array creation\n return new Item[0];\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class EmptyNode {\n Item[] getChildren() {\n return Item.EMPTY_ARRAY;\n }\n }\n" + "text": "Reports 'String.equals()' or 'String.equalsIgnoreCase()' calls with a string literal argument. Some coding standards specify that string literals should be the qualifier of 'equals()', rather than argument, thus minimizing 'NullPointerException'-s. A quick-fix is available to exchange the literal and the expression. Example: 'boolean isFoo(String value) {\n return value.equals(\"foo\");\n }' After the quick-fix is applied: 'boolean isFoo(String value) {\n return \"foo\".equals(value);\n }'", + "markdown": "Reports `String.equals()` or `String.equalsIgnoreCase()` calls with a string literal argument.\n\nSome coding standards specify that string literals should be the qualifier of `equals()`, rather than\nargument, thus minimizing `NullPointerException`-s.\n\nA quick-fix is available to exchange the literal and the expression.\n\n**Example:**\n\n\n boolean isFoo(String value) {\n return value.equals(\"foo\");\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isFoo(String value) {\n return \"foo\".equals(value);\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ConstantForZeroLengthArrayAllocation", + "suppressToolId": "LiteralAsArgToStringEquals", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32704,8 +32704,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 105, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -32816,19 +32816,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" } @@ -32836,8 +32836,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 10, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -32849,19 +32849,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" } @@ -32869,8 +32869,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Error handling", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -32948,19 +32948,19 @@ ] }, { - "id": "RedundantStringFormatCall", + "id": "NonFinalFieldOfException", "shortDescription": { - "text": "Redundant call to 'String.format()'" + "text": "Non-final field of 'Exception' class" }, "fullDescription": { - "text": "Reports calls to methods like 'format()' and 'printf()' that can be safely removed or simplified. Example: 'System.out.println(String.format(\"Total count: %d\", 42));' After the quick-fix is applied: 'System.out.printf(\"Total count: %d%n\", 42);'", - "markdown": "Reports calls to methods like `format()` and `printf()` that can be safely removed or simplified.\n\n**Example:**\n\n\n System.out.println(String.format(\"Total count: %d\", 42));\n\nAfter the quick-fix is applied:\n\n\n System.out.printf(\"Total count: %d%n\", 42);\n" + "text": "Reports fields in subclasses of 'java.lang.Exception' that are not declared 'final'. Data on exception objects should not be modified because this may result in losing the error context for later debugging and logging. Example: 'public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }'", + "markdown": "Reports fields in subclasses of `java.lang.Exception` that are not declared `final`.\n\nData on exception objects should not be modified\nbecause this may result in losing the error context for later debugging and logging.\n\n**Example:**\n\n\n public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "RedundantStringFormatCall", + "suppressToolId": "NonFinalFieldOfException", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32968,8 +32968,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Error handling", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -32981,19 +32981,19 @@ ] }, { - "id": "NonFinalFieldOfException", + "id": "RedundantStringFormatCall", "shortDescription": { - "text": "Non-final field of 'Exception' class" + "text": "Redundant call to 'String.format()'" }, "fullDescription": { - "text": "Reports fields in subclasses of 'java.lang.Exception' that are not declared 'final'. Data on exception objects should not be modified because this may result in losing the error context for later debugging and logging. Example: 'public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }'", - "markdown": "Reports fields in subclasses of `java.lang.Exception` that are not declared `final`.\n\nData on exception objects should not be modified\nbecause this may result in losing the error context for later debugging and logging.\n\n**Example:**\n\n\n public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }\n" + "text": "Reports calls to methods like 'format()' and 'printf()' that can be safely removed or simplified. Example: 'System.out.println(String.format(\"Total count: %d\", 42));' After the quick-fix is applied: 'System.out.printf(\"Total count: %d%n\", 42);'", + "markdown": "Reports calls to methods like `format()` and `printf()` that can be safely removed or simplified.\n\n**Example:**\n\n\n System.out.println(String.format(\"Total count: %d\", 42));\n\nAfter the quick-fix is applied:\n\n\n System.out.printf(\"Total count: %d%n\", 42);\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "NonFinalFieldOfException", + "suppressToolId": "RedundantStringFormatCall", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -33001,8 +33001,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 10, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -33035,7 +33035,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -33079,6 +33079,39 @@ } ] }, + { + "id": "RedundantCompareToJavaTime", + "shortDescription": { + "text": "Expression with 'java.time' 'compareTo()' call can be simplified" + }, + "fullDescription": { + "text": "Reports 'java.time' comparisons with 'compareTo()' calls that can be replaced with 'isAfter()', 'isBefore()' or 'isEqual()' calls. Example: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;' After the quick-fix is applied: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);' New in 2022.3", + "markdown": "Reports `java.time` comparisons with `compareTo()` calls that can be replaced with `isAfter()`, `isBefore()` or `isEqual()` calls.\n\nExample:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;\n\nAfter the quick-fix is applied:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);\n\nNew in 2022.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantCompareToJavaTime", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "UnclearBinaryExpression", "shortDescription": { @@ -33113,19 +33146,19 @@ ] }, { - "id": "RedundantCompareToJavaTime", + "id": "ChainedMethodCall", "shortDescription": { - "text": "Expression with 'java.time' 'compareTo()' call can be simplified" + "text": "Chained method calls" }, "fullDescription": { - "text": "Reports 'java.time' comparisons with 'compareTo()' calls that can be replaced with 'isAfter()', 'isBefore()' or 'isEqual()' calls. Example: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;' After the quick-fix is applied: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);' New in 2022.3", - "markdown": "Reports `java.time` comparisons with `compareTo()` calls that can be replaced with `isAfter()`, `isBefore()` or `isEqual()` calls.\n\nExample:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;\n\nAfter the quick-fix is applied:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);\n\nNew in 2022.3" + "text": "Reports method calls whose target is another method call. The quick-fix suggests to introduce a local variable. Example: 'class X {\n int foo(File f) {\n return f.getName().length();\n }\n }' After the quick-fix is applied: 'class X {\n int foo(File f) {\n final String name = f.getName();\n return name.length();\n }\n }' Use the inspection options to toggle warnings for the following cases: chained method calls in field initializers, for instance, 'private final int i = new Random().nextInt();' chained method calls operating on the same type, for instance, 'new StringBuilder().append(\"x: \").append(new X()).append(\"y: \").append(new Y()).toString();'.", + "markdown": "Reports method calls whose target is another method call. The quick-fix suggests to introduce a local variable.\n\n**Example:**\n\n\n class X {\n int foo(File f) {\n return f.getName().length();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n int foo(File f) {\n final String name = f.getName();\n return name.length();\n }\n }\n\nUse the inspection options to toggle warnings for the following cases:\n\n*\n chained method calls in field initializers,\n for instance, `private final int i = new Random().nextInt();`\n\n*\n chained method calls operating on the same type,\n for instance, `new StringBuilder().append(\"x: \").append(new X()).append(\"y: \").append(new Y()).toString();`." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "RedundantCompareToJavaTime", + "suppressToolId": "ChainedMethodCall", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -33133,8 +33166,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 29, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -33146,19 +33179,19 @@ ] }, { - "id": "ChainedMethodCall", + "id": "UtilityClassWithoutPrivateConstructor", "shortDescription": { - "text": "Chained method calls" + "text": "Utility class without 'private' constructor" }, "fullDescription": { - "text": "Reports method calls whose target is another method call. The quick-fix suggests to introduce a local variable. Example: 'class X {\n int foo(File f) {\n return f.getName().length();\n }\n }' After the quick-fix is applied: 'class X {\n int foo(File f) {\n final String name = f.getName();\n return name.length();\n }\n }' Use the inspection options to toggle warnings for the following cases: chained method calls in field initializers, for instance, 'private final int i = new Random().nextInt();' chained method calls operating on the same type, for instance, 'new StringBuilder().append(\"x: \").append(new X()).append(\"y: \").append(new Y()).toString();'.", - "markdown": "Reports method calls whose target is another method call. The quick-fix suggests to introduce a local variable.\n\n**Example:**\n\n\n class X {\n int foo(File f) {\n return f.getName().length();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n int foo(File f) {\n final String name = f.getName();\n return name.length();\n }\n }\n\nUse the inspection options to toggle warnings for the following cases:\n\n*\n chained method calls in field initializers,\n for instance, `private final int i = new Random().nextInt();`\n\n*\n chained method calls operating on the same type,\n for instance, `new StringBuilder().append(\"x: \").append(new X()).append(\"y: \").append(new Y()).toString();`." + "text": "Reports utility classes without 'private' constructors. Utility classes have all fields and methods declared as 'static'. Creating 'private' constructors in utility classes prevents them from being accidentally instantiated. Use the Ignore if annotated by option to specify special annotations. The inspection ignores classes marked with one of these annotations. Use the Ignore classes with only a main method option to ignore classes with no methods other than the main one.", + "markdown": "Reports utility classes without `private` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating `private`\nconstructors in utility classes prevents them from being accidentally instantiated.\n\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection ignores classes marked with one of\nthese annotations.\n\n\nUse the **Ignore classes with only a main method** option to ignore classes with no methods other than the main one." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ChainedMethodCall", + "suppressToolId": "UtilityClassWithoutPrivateConstructor", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -33166,8 +33199,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Class structure", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -33211,39 +33244,6 @@ } ] }, - { - "id": "UtilityClassWithoutPrivateConstructor", - "shortDescription": { - "text": "Utility class without 'private' constructor" - }, - "fullDescription": { - "text": "Reports utility classes without 'private' constructors. Utility classes have all fields and methods declared as 'static'. Creating 'private' constructors in utility classes prevents them from being accidentally instantiated. Use the Ignore if annotated by option to specify special annotations. The inspection ignores classes marked with one of these annotations. Use the Ignore classes with only a main method option to ignore classes with no methods other than the main one.", - "markdown": "Reports utility classes without `private` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating `private`\nconstructors in utility classes prevents them from being accidentally instantiated.\n\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection ignores classes marked with one of\nthese annotations.\n\n\nUse the **Ignore classes with only a main method** option to ignore classes with no methods other than the main one." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UtilityClassWithoutPrivateConstructor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Class structure", - "index": 14, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "AssertMessageNotString", "shortDescription": { @@ -33464,7 +33464,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -33530,7 +33530,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -33632,7 +33632,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -33837,7 +33837,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -33903,7 +33903,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -33969,7 +33969,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -34068,7 +34068,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -34434,7 +34434,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -34635,7 +34635,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -34771,7 +34771,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -34804,7 +34804,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -34870,7 +34870,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -35068,7 +35068,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -35233,7 +35233,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -35344,19 +35344,19 @@ ] }, { - "id": "ConstantConditionalExpression", + "id": "ClassNamePrefixedWithPackageName", "shortDescription": { - "text": "Constant conditional expression" + "text": "Class name prefixed with package name" }, "fullDescription": { - "text": "Reports conditional expressions in which the condition is either a 'true' or 'false' constant. These expressions sometimes occur as a result of automatic refactorings and may be simplified. Example: 'return true ? \"Yes\" : \"No\";' After quick-fix is applied: 'return \"Yes\";'", - "markdown": "Reports conditional expressions in which the condition is either a `true` or `false` constant. These expressions sometimes occur as a result of automatic refactorings and may be simplified.\n\nExample:\n\n\n return true ? \"Yes\" : \"No\";\n\nAfter quick-fix is applied:\n\n\n return \"Yes\";\n" + "text": "Reports classes whose names are prefixed with their package names, ignoring differences in capitalization. While occasionally having such names is reasonable, they are often used due to a poor naming scheme, may be redundant and annoying. Example: 'package byteCode;\n class ByteCodeAnalyzer {}' A quick-fix that renames such classes is available only in the editor.", + "markdown": "Reports classes whose names are prefixed with their package names, ignoring differences in capitalization.\n\nWhile occasionally having such names is reasonable, they are often used due to a poor naming scheme, may be redundant and\nannoying.\n\n**Example:**\n\n\n package byteCode;\n class ByteCodeAnalyzer {}\n\nA quick-fix that renames such classes is available only in the editor." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ConstantConditionalExpression", + "suppressToolId": "ClassNamePrefixedWithPackageName", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -35364,8 +35364,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 22, + "id": "Java/Naming conventions/Class", + "index": 51, "toolComponent": { "name": "QDJVMC" } @@ -35377,19 +35377,19 @@ ] }, { - "id": "ClassNamePrefixedWithPackageName", + "id": "ConstantConditionalExpression", "shortDescription": { - "text": "Class name prefixed with package name" + "text": "Constant conditional expression" }, "fullDescription": { - "text": "Reports classes whose names are prefixed with their package names, ignoring differences in capitalization. While occasionally having such names is reasonable, they are often used due to a poor naming scheme, may be redundant and annoying. Example: 'package byteCode;\n class ByteCodeAnalyzer {}' A quick-fix that renames such classes is available only in the editor.", - "markdown": "Reports classes whose names are prefixed with their package names, ignoring differences in capitalization.\n\nWhile occasionally having such names is reasonable, they are often used due to a poor naming scheme, may be redundant and\nannoying.\n\n**Example:**\n\n\n package byteCode;\n class ByteCodeAnalyzer {}\n\nA quick-fix that renames such classes is available only in the editor." + "text": "Reports conditional expressions in which the condition is either a 'true' or 'false' constant. These expressions sometimes occur as a result of automatic refactorings and may be simplified. Example: 'return true ? \"Yes\" : \"No\";' After quick-fix is applied: 'return \"Yes\";'", + "markdown": "Reports conditional expressions in which the condition is either a `true` or `false` constant. These expressions sometimes occur as a result of automatic refactorings and may be simplified.\n\nExample:\n\n\n return true ? \"Yes\" : \"No\";\n\nAfter quick-fix is applied:\n\n\n return \"Yes\";\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassNamePrefixedWithPackageName", + "suppressToolId": "ConstantConditionalExpression", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -35397,8 +35397,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions/Class", - "index": 51, + "id": "Java/Control flow issues", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -35431,7 +35431,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -35464,7 +35464,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -35530,7 +35530,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -35596,7 +35596,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -35695,7 +35695,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -35707,19 +35707,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" } @@ -35727,8 +35727,8 @@ "relationships": [ { "target": { - "id": "Java/Compiler issues", - "index": 102, + "id": "Java/Serialization issues", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -35740,19 +35740,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" } @@ -35760,8 +35760,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 13, + "id": "Java/Compiler issues", + "index": 102, "toolComponent": { "name": "QDJVMC" } @@ -35794,7 +35794,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -35992,7 +35992,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -36028,7 +36028,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -36298,7 +36298,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -36343,19 +36343,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});' This inspection depends on the Java feature 'Variable arity methods' which is available since Java 5.", - "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\nThis inspection depends on the Java feature 'Variable arity methods' which is available since Java 5." + "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" } @@ -36363,8 +36363,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Internationalization", + "index": 6, "toolComponent": { "name": "QDJVMC" } @@ -36376,19 +36376,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});' This inspection depends on the Java feature 'Variable arity methods' which is available since Java 5.", + "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\nThis inspection depends on the Java feature 'Variable arity methods' which is available since Java 5." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "UseOfStringTokenizer", + "suppressToolId": "PrimitiveArrayArgumentToVarargsMethod", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -36396,8 +36396,8 @@ "relationships": [ { "target": { - "id": "Java/Internationalization", - "index": 6, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -36529,7 +36529,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -36628,7 +36628,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -36760,7 +36760,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -37189,7 +37189,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -37420,7 +37420,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -37465,19 +37465,22 @@ ] }, { - "id": "SuspiciousDateFormat", + "id": "MagicConstant", "shortDescription": { - "text": "Suspicious date format pattern" + "text": "Magic constant" }, "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" + "text": "Reports expressions that can be replaced with \"magic\" constants. Example 1: '// Bare literal \"2\" is used, warning:\n Font font = new Font(\"Arial\", 2)' Example 2: '// Predefined constant is used, good:\n Font font = new Font(\"Arial\", Font.ITALIC)' When possible, the quick-fix inserts an appropriate predefined constant. The behavior of this inspection is controlled by 'org.intellij.lang.annotations.MagicConstant' annotation. Some standard Java library methods are pre-annotated, but you can use this annotation in your code as well.", + "markdown": "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." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SuspiciousDateFormat", + "suppressToolId": "MagicConstant", + "cweIds": [ + 489 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -37486,7 +37489,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -37498,22 +37501,19 @@ ] }, { - "id": "MagicConstant", + "id": "SuspiciousDateFormat", "shortDescription": { - "text": "Magic constant" + "text": "Suspicious date format pattern" }, "fullDescription": { - "text": "Reports expressions that can be replaced with \"magic\" constants. Example 1: '// Bare literal \"2\" is used, warning:\n Font font = new Font(\"Arial\", 2)' Example 2: '// Predefined constant is used, good:\n Font font = new Font(\"Arial\", Font.ITALIC)' When possible, the quick-fix inserts an appropriate predefined constant. The behavior of this inspection is controlled by 'org.intellij.lang.annotations.MagicConstant' annotation. Some standard Java library methods are pre-annotated, but you can use this annotation in your code as well.", - "markdown": "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." + "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": "MagicConstant", - "cweIds": [ - 489 - ], + "suppressToolId": "SuspiciousDateFormat", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -37522,7 +37522,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -37687,7 +37687,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -37856,7 +37856,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -37959,7 +37959,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -37992,7 +37992,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -38157,7 +38157,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -38322,7 +38322,7 @@ { "target": { "id": "Java/Error handling", - "index": 10, + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -38391,7 +38391,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -38501,6 +38501,39 @@ } ] }, + { + "id": "EmptyClass", + "shortDescription": { + "text": "Empty class" + }, + "fullDescription": { + "text": "Reports empty classes and empty Java files. A class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes are sometimes left over after significant changes or refactorings. Example: 'class Example {\n List getList() {\n return new ArrayList<>() {\n\n };\n }\n }' After the quick-fix is applied: 'class Example {\n List getList() {\n return new ArrayList<>();\n }\n }' Configure the inspection: Use the Ignore if annotated by option to specify special annotations. The inspection will ignore the classes marked with these annotations. Use the Ignore class if it is a parametrization of a super type option to ignore classes that parameterize a superclass. For example: 'class MyList extends ArrayList {}' Use the Ignore subclasses of java.lang.Throwable to ignore classes that extend 'java.lang.Throwable'. Use the Comments count as content option to ignore classes that contain comments.", + "markdown": "Reports empty classes and empty Java files.\n\nA class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes are sometimes left over\nafter significant changes or refactorings.\n\n**Example:**\n\n\n class Example {\n List getList() {\n return new ArrayList<>() {\n\n };\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n List getList() {\n return new ArrayList<>();\n }\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if annotated by** option to specify special annotations. The inspection will ignore the classes marked with these annotations.\n*\n Use the **Ignore class if it is a parametrization of a super type** option to ignore classes that parameterize a superclass. For example:\n\n class MyList extends ArrayList {}\n\n* Use the **Ignore subclasses of java.lang.Throwable** to ignore classes that extend `java.lang.Throwable`.\n* Use the **Comments count as content** option to ignore classes that contain comments." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "TextBlockBackwardMigration", "shortDescription": { @@ -38534,39 +38567,6 @@ } ] }, - { - "id": "EmptyClass", - "shortDescription": { - "text": "Empty class" - }, - "fullDescription": { - "text": "Reports empty classes and empty Java files. A class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes are sometimes left over after significant changes or refactorings. Example: 'class Example {\n List getList() {\n return new ArrayList<>() {\n\n };\n }\n }' After the quick-fix is applied: 'class Example {\n List getList() {\n return new ArrayList<>();\n }\n }' Configure the inspection: Use the Ignore if annotated by option to specify special annotations. The inspection will ignore the classes marked with these annotations. Use the Ignore class if it is a parametrization of a super type option to ignore classes that parameterize a superclass. For example: 'class MyList extends ArrayList {}' Use the Ignore subclasses of java.lang.Throwable to ignore classes that extend 'java.lang.Throwable'. Use the Comments count as content option to ignore classes that contain comments.", - "markdown": "Reports empty classes and empty Java files.\n\nA class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes are sometimes left over\nafter significant changes or refactorings.\n\n**Example:**\n\n\n class Example {\n List getList() {\n return new ArrayList<>() {\n\n };\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n List getList() {\n return new ArrayList<>();\n }\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if annotated by** option to specify special annotations. The inspection will ignore the classes marked with these annotations.\n*\n Use the **Ignore class if it is a parametrization of a super type** option to ignore classes that parameterize a superclass. For example:\n\n class MyList extends ArrayList {}\n\n* Use the **Ignore subclasses of java.lang.Throwable** to ignore classes that extend `java.lang.Throwable`.\n* Use the **Comments count as content** option to ignore classes that contain comments." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EmptyClass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Class structure", - "index": 14, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "ConditionalCanBeOptional", "shortDescription": { @@ -38754,7 +38754,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -38824,7 +38824,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -38890,7 +38890,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -39026,7 +39026,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -39269,19 +39269,19 @@ ] }, { - "id": "NonSerializableWithSerializationMethods", + "id": "CloneReturnsClassType", "shortDescription": { - "text": "Non-serializable class with 'readObject()' or 'writeObject()'" + "text": "'clone()' should have return type equal to the class it contains" }, "fullDescription": { - "text": "Reports non-'Serializable' classes that define 'readObject()' or 'writeObject()' methods. Such methods in that context normally indicate an error. Example: 'public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }'", - "markdown": "Reports non-`Serializable` classes that define `readObject()` or `writeObject()` methods. Such methods in that context normally indicate an error.\n\n**Example:**\n\n\n public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }\n" + "text": "Reports 'clone()' methods with return types different from the class they're located in. Often a 'clone()' method will have a return type of 'java.lang.Object', which makes it harder to use by its clients. Effective Java (the second and third editions) recommends making the return type of the 'clone()' method the same as the class type of the object it returns. Example: 'class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' After the quick-fix is applied: 'class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }'", + "markdown": "Reports `clone()` methods with return types different from the class they're located in.\n\nOften a `clone()` method will have a return type of `java.lang.Object`, which makes it harder to use by its clients.\n*Effective Java* (the second and third editions) recommends making the return type of the `clone()` method the same as the\nclass type of the object it returns.\n\n**Example:**\n\n\n class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonSerializableClassWithSerializationMethods", + "suppressToolId": "CloneReturnsClassType", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -39289,8 +39289,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 13, + "id": "Java/Cloning issues", + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -39302,19 +39302,19 @@ ] }, { - "id": "CloneReturnsClassType", + "id": "NonSerializableWithSerializationMethods", "shortDescription": { - "text": "'clone()' should have return type equal to the class it contains" + "text": "Non-serializable class with 'readObject()' or 'writeObject()'" }, "fullDescription": { - "text": "Reports 'clone()' methods with return types different from the class they're located in. Often a 'clone()' method will have a return type of 'java.lang.Object', which makes it harder to use by its clients. Effective Java (the second and third editions) recommends making the return type of the 'clone()' method the same as the class type of the object it returns. Example: 'class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' After the quick-fix is applied: 'class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }'", - "markdown": "Reports `clone()` methods with return types different from the class they're located in.\n\nOften a `clone()` method will have a return type of `java.lang.Object`, which makes it harder to use by its clients.\n*Effective Java* (the second and third editions) recommends making the return type of the `clone()` method the same as the\nclass type of the object it returns.\n\n**Example:**\n\n\n class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n" + "text": "Reports non-'Serializable' classes that define 'readObject()' or 'writeObject()' methods. Such methods in that context normally indicate an error. Example: 'public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }'", + "markdown": "Reports non-`Serializable` classes that define `readObject()` or `writeObject()` methods. Such methods in that context normally indicate an error.\n\n**Example:**\n\n\n public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CloneReturnsClassType", + "suppressToolId": "NonSerializableClassWithSerializationMethods", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -39322,8 +39322,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 73, + "id": "Java/Serialization issues", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -39422,7 +39422,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -39455,7 +39455,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -39554,7 +39554,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -39632,19 +39632,19 @@ ] }, { - "id": "UnnecessaryUnboxing", + "id": "AssignmentOrReturnOfFieldWithMutableType", "shortDescription": { - "text": "Unnecessary unboxing" + "text": "Assignment or return of field with mutable type" }, "fullDescription": { - "text": "Reports unboxing, that is explicit unwrapping of wrapped primitive values. Unboxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = Integer.valueOf(42).intValue();' → 'Integer i = Integer.valueOf(42);' 'int k = Integer.valueOf(42).intValue();' → 'int k = Integer.valueOf(42);' (reports only when the Only report truly superfluously unboxed expressions option is not checked) Use the Only report truly superfluously unboxed expressions option to only report truly superfluous unboxing, where an unboxed value is immediately boxed either implicitly or explicitly. In this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing. This inspection only reports if the language level of the project or module is 5 or higher.", - "markdown": "Reports unboxing, that is explicit unwrapping of wrapped primitive values.\n\nUnboxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = Integer.valueOf(42).intValue();` → `Integer i = Integer.valueOf(42);`\n* `int k = Integer.valueOf(42).intValue();` → `int k = Integer.valueOf(42);`\n\n (reports only when the **Only report truly superfluously unboxed expressions** option is not checked)\n\n\nUse the **Only report truly superfluously unboxed expressions** option to only report truly superfluous unboxing,\nwhere an unboxed value is immediately boxed either implicitly or explicitly.\nIn this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher." + "text": "Reports return of, or assignment from a method parameter to an array or a mutable type like 'Collection', 'Date', 'Map', 'Calendar', etc. Because such types are mutable, this construct may result in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for performance reasons, it is inherently prone to bugs. The following mutable types are reported: 'java.util.Date' 'java.util.Calendar' 'java.util.Collection' 'java.util.Map' 'com.google.common.collect.Multimap' 'com.google.common.collect.Table' The quick-fix adds a call to the field's '.clone()' method. Example: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }' After the quick-fix is applied: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }' Use the Ignore assignments in and returns from private methods option to ignore assignments and returns in 'private' methods.", + "markdown": "Reports return of, or assignment from a method parameter to an array or a mutable type like `Collection`, `Date`, `Map`, `Calendar`, etc.\n\nBecause such types are mutable, this construct may\nresult in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for\nperformance reasons, it is inherently prone to bugs.\n\nThe following mutable types are reported:\n\n* `java.util.Date`\n* `java.util.Calendar`\n* `java.util.Collection`\n* `java.util.Map`\n* `com.google.common.collect.Multimap`\n* `com.google.common.collect.Table`\n\nThe quick-fix adds a call to the field's `.clone()` method.\n\n**Example:**\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }\n\nUse the **Ignore assignments in and returns from private methods** option to ignore assignments and returns in `private` methods." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryUnboxing", + "suppressToolId": "AssignmentOrReturnOfFieldWithMutableType", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -39652,8 +39652,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 5", - "index": 77, + "id": "Java/Encapsulation", + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -39665,19 +39665,19 @@ ] }, { - "id": "AssignmentOrReturnOfFieldWithMutableType", + "id": "UnnecessaryUnboxing", "shortDescription": { - "text": "Assignment or return of field with mutable type" + "text": "Unnecessary unboxing" }, "fullDescription": { - "text": "Reports return of, or assignment from a method parameter to an array or a mutable type like 'Collection', 'Date', 'Map', 'Calendar', etc. Because such types are mutable, this construct may result in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for performance reasons, it is inherently prone to bugs. The following mutable types are reported: 'java.util.Date' 'java.util.Calendar' 'java.util.Collection' 'java.util.Map' 'com.google.common.collect.Multimap' 'com.google.common.collect.Table' The quick-fix adds a call to the field's '.clone()' method. Example: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }' After the quick-fix is applied: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }' Use the Ignore assignments in and returns from private methods option to ignore assignments and returns in 'private' methods.", - "markdown": "Reports return of, or assignment from a method parameter to an array or a mutable type like `Collection`, `Date`, `Map`, `Calendar`, etc.\n\nBecause such types are mutable, this construct may\nresult in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for\nperformance reasons, it is inherently prone to bugs.\n\nThe following mutable types are reported:\n\n* `java.util.Date`\n* `java.util.Calendar`\n* `java.util.Collection`\n* `java.util.Map`\n* `com.google.common.collect.Multimap`\n* `com.google.common.collect.Table`\n\nThe quick-fix adds a call to the field's `.clone()` method.\n\n**Example:**\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }\n\nUse the **Ignore assignments in and returns from private methods** option to ignore assignments and returns in `private` methods." + "text": "Reports unboxing, that is explicit unwrapping of wrapped primitive values. Unboxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = Integer.valueOf(42).intValue();' → 'Integer i = Integer.valueOf(42);' 'int k = Integer.valueOf(42).intValue();' → 'int k = Integer.valueOf(42);' (reports only when the Only report truly superfluously unboxed expressions option is not checked) Use the Only report truly superfluously unboxed expressions option to only report truly superfluous unboxing, where an unboxed value is immediately boxed either implicitly or explicitly. In this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing. This inspection only reports if the language level of the project or module is 5 or higher.", + "markdown": "Reports unboxing, that is explicit unwrapping of wrapped primitive values.\n\nUnboxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = Integer.valueOf(42).intValue();` → `Integer i = Integer.valueOf(42);`\n* `int k = Integer.valueOf(42).intValue();` → `int k = Integer.valueOf(42);`\n\n (reports only when the **Only report truly superfluously unboxed expressions** option is not checked)\n\n\nUse the **Only report truly superfluously unboxed expressions** option to only report truly superfluous unboxing,\nwhere an unboxed value is immediately boxed either implicitly or explicitly.\nIn this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "AssignmentOrReturnOfFieldWithMutableType", + "suppressToolId": "UnnecessaryUnboxing", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -39685,8 +39685,8 @@ "relationships": [ { "target": { - "id": "Java/Encapsulation", - "index": 82, + "id": "Java/Java language level migration aids/Java 5", + "index": 77, "toolComponent": { "name": "QDJVMC" } @@ -39752,7 +39752,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -39785,7 +39785,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -39818,7 +39818,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -39887,7 +39887,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -39953,7 +39953,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -40019,7 +40019,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -40184,7 +40184,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -40196,22 +40196,19 @@ ] }, { - "id": "SuspiciousIntegerDivAssignment", + "id": "NegativelyNamedBooleanVariable", "shortDescription": { - "text": "Suspicious integer division assignment" + "text": "Negatively named boolean variable" }, "fullDescription": { - "text": "Reports assignments whose right side is a division that shouldn't be truncated to integer. While occasionally intended, this construction is often buggy. Example: 'int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result' This code should be replaced with: 'int x = 18;\n x *= 3.0/2;' In the inspection options, you can disable warnings for suspicious but possibly correct divisions, for example, when the dividend can't be calculated statically. 'void calc(int d) {\n int x = 18;\n x *= d/2;\n }' New in 2019.2", - "markdown": "Reports assignments whose right side is a division that shouldn't be truncated to integer.\n\nWhile occasionally intended, this construction is often buggy.\n\n**Example:**\n\n\n int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result\n\n\nThis code should be replaced with:\n\n\n int x = 18;\n x *= 3.0/2;\n\n\nIn the inspection options, you can disable warnings for suspicious but possibly correct divisions,\nfor example, when the dividend can't be calculated statically.\n\n\n void calc(int d) {\n int x = 18;\n x *= d/2;\n }\n\n\nNew in 2019.2" + "text": "Reports 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": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SuspiciousIntegerDivAssignment", - "cweIds": [ - 682 - ], + "suppressToolId": "NegativelyNamedBooleanVariable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40219,8 +40216,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Data flow", + "index": 41, "toolComponent": { "name": "QDJVMC" } @@ -40232,19 +40229,22 @@ ] }, { - "id": "MethodWithMultipleLoops", + "id": "SuspiciousIntegerDivAssignment", "shortDescription": { - "text": "Method with multiple loops" + "text": "Suspicious integer division assignment" }, "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 assignments whose right side is a division that shouldn't be truncated to integer. While occasionally intended, this construction is often buggy. Example: 'int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result' This code should be replaced with: 'int x = 18;\n x *= 3.0/2;' In the inspection options, you can disable warnings for suspicious but possibly correct divisions, for example, when the dividend can't be calculated statically. 'void calc(int d) {\n int x = 18;\n x *= d/2;\n }' New in 2019.2", + "markdown": "Reports assignments whose right side is a division that shouldn't be truncated to integer.\n\nWhile occasionally intended, this construction is often buggy.\n\n**Example:**\n\n\n int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result\n\n\nThis code should be replaced with:\n\n\n int x = 18;\n x *= 3.0/2;\n\n\nIn the inspection options, you can disable warnings for suspicious but possibly correct divisions,\nfor example, when the dividend can't be calculated statically.\n\n\n void calc(int d) {\n int x = 18;\n x *= d/2;\n }\n\n\nNew in 2019.2" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "MethodWithMultipleLoops", + "suppressToolId": "SuspiciousIntegerDivAssignment", + "cweIds": [ + 682 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -40252,8 +40252,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 86, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -40265,19 +40265,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" } @@ -40285,8 +40285,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 41, + "id": "Java/Method metrics", + "index": 86, "toolComponent": { "name": "QDJVMC" } @@ -40517,7 +40517,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 9, + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -40616,7 +40616,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -40751,7 +40751,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -40916,7 +40916,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -40994,19 +40994,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" } @@ -41014,8 +41014,8 @@ "relationships": [ { "target": { - "id": "Java/Imports", - "index": 17, + "id": "Java/Finalization", + "index": 45, "toolComponent": { "name": "QDJVMC" } @@ -41027,19 +41027,19 @@ ] }, { - "id": "NoExplicitFinalizeCalls", + "id": "ReplaceNullCheck", "shortDescription": { - "text": "'finalize()' called explicitly" + "text": "Null check can be replaced with method call" }, "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 'null' checks that can be replaced with a call to a static method from 'Objects' or 'Stream'. Example: 'if (message == null) {\n application.messageStorage().save(new EmptyMessage());\n } else {\n application.messageStorage().save(message);\n }' After the quick-fix is applied: 'application.messageStorage()\n .save(Objects.requireNonNullElseGet(message, () -> new EmptyMessage()));' Use the Don't warn if the replacement is longer than the original option to ignore the cases when the replacement is longer than the original code. New in 2017.3", + "markdown": "Reports `null` checks that can be replaced with a call to a static method from `Objects` or `Stream`.\n\n**Example:**\n\n\n if (message == null) {\n application.messageStorage().save(new EmptyMessage());\n } else {\n application.messageStorage().save(message);\n }\n\nAfter the quick-fix is applied:\n\n\n application.messageStorage()\n .save(Objects.requireNonNullElseGet(message, () -> new EmptyMessage()));\n\n\nUse the **Don't warn if the replacement is longer than the original** option to ignore the cases when the replacement is longer than the\noriginal code.\n\nNew in 2017.3" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "FinalizeCalledExplicitly", + "suppressToolId": "ReplaceNullCheck", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -41047,8 +41047,8 @@ "relationships": [ { "target": { - "id": "Java/Finalization", - "index": 45, + "id": "Java/Java language level migration aids/Java 9", + "index": 55, "toolComponent": { "name": "QDJVMC" } @@ -41060,19 +41060,19 @@ ] }, { - "id": "ReplaceNullCheck", + "id": "StaticImport", "shortDescription": { - "text": "Null check can be replaced with method call" + "text": "Static import" }, "fullDescription": { - "text": "Reports 'null' checks that can be replaced with a call to a static method from 'Objects' or 'Stream'. Example: 'if (message == null) {\n application.messageStorage().save(new EmptyMessage());\n } else {\n application.messageStorage().save(message);\n }' After the quick-fix is applied: 'application.messageStorage()\n .save(Objects.requireNonNullElseGet(message, () -> new EmptyMessage()));' Use the Don't warn if the replacement is longer than the original option to ignore the cases when the replacement is longer than the original code. New in 2017.3", - "markdown": "Reports `null` checks that can be replaced with a call to a static method from `Objects` or `Stream`.\n\n**Example:**\n\n\n if (message == null) {\n application.messageStorage().save(new EmptyMessage());\n } else {\n application.messageStorage().save(message);\n }\n\nAfter the quick-fix is applied:\n\n\n application.messageStorage()\n .save(Objects.requireNonNullElseGet(message, () -> new EmptyMessage()));\n\n\nUse the **Don't warn if the replacement is longer than the original** option to ignore the cases when the replacement is longer than the\noriginal code.\n\nNew in 2017.3" + "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": false, "level": "warning", "parameters": { - "suppressToolId": "ReplaceNullCheck", + "suppressToolId": "StaticImport", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -41080,8 +41080,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 9", - "index": 55, + "id": "Java/Imports", + "index": 17, "toolComponent": { "name": "QDJVMC" } @@ -41114,7 +41114,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -41258,7 +41258,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -41324,7 +41324,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -41489,7 +41489,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -42160,6 +42160,39 @@ } ] }, + { + "id": "GrReassignedInClosureLocalVar", + "shortDescription": { + "text": "Local variable is reassigned in closure or anonymous class" + }, + "fullDescription": { + "text": "Reports local variables assigned to expression with different type inside of closure or anonymous class. Example: 'int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)' As a result, the 'integer' variable sum is reassigned to a 'String' expression.", + "markdown": "Reports local variables assigned to expression with different type inside of closure or anonymous class.\n\n**Example:**\n\n\n int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)\n\nAs a result, the `integer` variable **sum** is reassigned to a `String` expression." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrReassignedInClosureLocalVar", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 75, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "GroovyMethodParameterCount", "shortDescription": { @@ -42194,19 +42227,19 @@ ] }, { - "id": "GrReassignedInClosureLocalVar", + "id": "GroovyNestedConditional", "shortDescription": { - "text": "Local variable is reassigned in closure or anonymous class" + "text": "Nested conditional expression" }, "fullDescription": { - "text": "Reports local variables assigned to expression with different type inside of closure or anonymous class. Example: 'int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)' As a result, the 'integer' variable sum is reassigned to a 'String' expression.", - "markdown": "Reports local variables assigned to expression with different type inside of closure or anonymous class.\n\n**Example:**\n\n\n int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)\n\nAs a result, the `integer` variable **sum** is reassigned to a `String` expression." + "text": "Reports ternary conditional expressions that are nested inside other conditional expressions. Such nested conditionals may be very confusing. \"Elvis\" expressions are counted as conditionals for purpose of this inspection. Example: 'return (condition ? \"result\" : null) ?: \"fail\"'", + "markdown": "Reports ternary conditional expressions that are nested inside other conditional expressions. Such nested conditionals may be very confusing. \"Elvis\" expressions are counted as conditionals for purpose of this inspection.\n\n**Example:**\n\n\n return (condition ? \"result\" : null) ?: \"fail\"\n\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GrReassignedInClosureLocalVar", + "suppressToolId": "GroovyNestedConditional", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42227,19 +42260,19 @@ ] }, { - "id": "GroovyNestedConditional", + "id": "GroovyEmptyStatementBody", "shortDescription": { - "text": "Nested conditional expression" + "text": "Statement with empty body" }, "fullDescription": { - "text": "Reports ternary conditional expressions that are nested inside other conditional expressions. Such nested conditionals may be very confusing. \"Elvis\" expressions are counted as conditionals for purpose of this inspection. Example: 'return (condition ? \"result\" : null) ?: \"fail\"'", - "markdown": "Reports ternary conditional expressions that are nested inside other conditional expressions. Such nested conditionals may be very confusing. \"Elvis\" expressions are counted as conditionals for purpose of this inspection.\n\n**Example:**\n\n\n return (condition ? \"result\" : null) ?: \"fail\"\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": "GroovyNestedConditional", + "suppressToolId": "GroovyEmptyStatementBody", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42281,40 +42314,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "GroovyEmptyStatementBody", - "shortDescription": { - "text": "Statement with empty body" - }, - "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" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "GroovyEmptyStatementBody", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Groovy/Potentially confusing code constructs", - "index": 75, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -42677,7 +42677,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -43205,7 +43205,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -43832,7 +43832,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -43877,28 +43877,28 @@ ] }, { - "id": "ChangeToMethod", + "id": "UnnecessaryQualifiedReference", "shortDescription": { - "text": "Operator invocation can be replaced with method call" + "text": "Unnecessary qualified reference" }, "fullDescription": { - "text": "Reports operator invocations that can be replaced with method calls. Example: 'a + b' After the quick-fix is applied: 'a.plus(b)'", - "markdown": "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" + "text": "Reports fully qualified references, which can be replaced with import. Example: 'def swingBuilder = new groovy.swing.SwingBuilder()' After the quick-fix is applied: 'import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()'", + "markdown": "Reports fully qualified references, which can be replaced with import.\n\n**Example:**\n\n\n def swingBuilder = new groovy.swing.SwingBuilder()\n\nAfter the quick-fix is applied:\n\n\n import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()\n" }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "ChangeToMethod", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "UnnecessaryQualifiedReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Groovy/Style", - "index": 59, + "id": "Groovy/Potentially confusing code constructs", + "index": 75, "toolComponent": { "name": "QDJVMC" } @@ -43910,28 +43910,28 @@ ] }, { - "id": "UnnecessaryQualifiedReference", + "id": "ChangeToMethod", "shortDescription": { - "text": "Unnecessary qualified reference" + "text": "Operator invocation can be replaced with method call" }, "fullDescription": { - "text": "Reports fully qualified references, which can be replaced with import. Example: 'def swingBuilder = new groovy.swing.SwingBuilder()' After the quick-fix is applied: 'import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()'", - "markdown": "Reports fully qualified references, which can be replaced with import.\n\n**Example:**\n\n\n def swingBuilder = new groovy.swing.SwingBuilder()\n\nAfter the quick-fix is applied:\n\n\n import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()\n" + "text": "Reports operator invocations that can be replaced with method calls. Example: 'a + b' After the quick-fix is applied: 'a.plus(b)'", + "markdown": "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" }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "UnnecessaryQualifiedReference", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ChangeToMethod", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Groovy/Potentially confusing code constructs", - "index": 75, + "id": "Groovy/Style", + "index": 59, "toolComponent": { "name": "QDJVMC" } @@ -44030,7 +44030,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -44096,7 +44096,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -44129,7 +44129,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -44162,7 +44162,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -44624,7 +44624,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -44690,7 +44690,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -45020,7 +45020,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -45086,7 +45086,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -45284,7 +45284,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -45383,7 +45383,7 @@ { "target": { "id": "Groovy/Probable bugs", - "index": 37, + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -53437,7 +53437,7 @@ }, "invocations": [ { - "startTimeUtc": "2024-07-03T22:35:53.221465575Z", + "startTimeUtc": "2024-07-04T22:51:11.482116275Z", "exitCode": 0, "toolExecutionNotifications": [ { @@ -53445,7 +53445,7 @@ "text": "Analysis by sanity inspection \"Java sanity\" was suspended due to high number of problems." }, "level": "error", - "timeUtc": "2024-07-03T22:40:07.884039685Z", + "timeUtc": "2024-07-04T22:55:27.285780162Z", "properties": { "qodanaKind": "sanityFailure" } @@ -53458,8 +53458,8 @@ "versionControlProvenance": [ { "repositoryUri": "https://github.com/cvette/intellij-neos.git", - "revisionId": "16604d1ca31186399bf04ee36b68ff447c7c7efe", - "branch": "dependabot/github_actions/JetBrains/qodana-action-2024.1.8", + "revisionId": "3138837408ce13e0e899e825f252e7f6c5d0ff5f", + "branch": "dependabot/gradle/org.jetbrains.changelog-2.2.1", "properties": { "repoUrl": "https://github.com/cvette/intellij-neos.git", "lastAuthorName": "dependabot[bot]", @@ -65813,10 +65813,10 @@ } ], "automationDetails": { - "id": "Intellij Neos/qodana/2024-07-03", - "guid": "ed29f0ad-cfce-40fe-a443-0b5e13537578", + "id": "Intellij Neos/qodana/2024-07-04", + "guid": "ae5314f6-0ae1-471d-96c9-4468a1be5118", "properties": { - "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/9785614877" + "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/9800593903" } }, "newlineSequences": [ @@ -65825,112 +65825,6 @@ ], "properties": { "qodana.sanity.results": [ - { - "ruleId": "QodanaJavaSanity", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference FusionPrototypeSignature", - "markdown": "Unresolved reference FusionPrototypeSignature" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/lang/afx/codeInsight/AfxTagProvider.java", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 20, - "startColumn": 43, - "charOffset": 940, - "charLength": 24, - "snippet": { - "text": "FusionPrototypeSignature" - }, - "sourceLanguage": "JAVA" - }, - "contextRegion": { - "startLine": 18, - "startColumn": 1, - "charOffset": 793, - "charLength": 316, - "snippet": { - "text": "import de.vette.idea.neos.lang.afx.AfxLanguage;\nimport de.vette.idea.neos.lang.fusion.icons.FusionIcons;\nimport de.vette.idea.neos.lang.fusion.psi.FusionPrototypeSignature;\nimport de.vette.idea.neos.lang.fusion.resolve.ResolveEngine;\nimport de.vette.idea.neos.lang.fusion.stubs.index.FusionPrototypeDeclarationIndex;" - }, - "sourceLanguage": "JAVA" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "Intellij_Neos.main", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "f3611376f7f49e9f", - "equalIndicator/v1": "162fd5308bcc303c330d50b2ae403a0c4d66ad307a7105864c2f1be04433b00b" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "QodanaJavaSanity", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference FusionNamespaceDeclaration", - "markdown": "Unresolved reference FusionNamespaceDeclaration" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 49, - "startColumn": 67, - "charOffset": 2021, - "charLength": 26, - "snippet": { - "text": "FusionNamespaceDeclaration" - }, - "sourceLanguage": "JAVA" - }, - "contextRegion": { - "startLine": 47, - "startColumn": 1, - "charOffset": 1920, - "charLength": 336, - "snippet": { - "text": " @NotNull\n @Override\n public FusionNamespaceDeclarationStub createStub(@NotNull FusionNamespaceDeclaration psi, StubElement parentStub) {\n String alias = psi.getAlias() != null ? psi.getAlias().getText() : \"\";\n String namespace = psi.getNamespace() != null ? psi.getNamespace().getText() : \"\";" - }, - "sourceLanguage": "JAVA" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "Intellij_Neos.main", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "4fc60ca7a3305664", - "equalIndicator/v1": "2f2ac3cee83b24724b6c63224a82db62dab6db9a7bdf737e5e5b9a340a42b06d" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, { "ruleId": "QodanaJavaSanity", "kind": "fail", @@ -66201,61 +66095,8 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionPrototypeSignature", - "markdown": "Unresolved reference FusionPrototypeSignature" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/lang/afx/codeInsight/AfxTagProvider.java", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 94, - "startColumn": 24, - "charOffset": 4226, - "charLength": 24, - "snippet": { - "text": "FusionPrototypeSignature" - }, - "sourceLanguage": "JAVA" - }, - "contextRegion": { - "startLine": 92, - "startColumn": 1, - "charOffset": 4168, - "charLength": 362, - "snippet": { - "text": "\n for (String key : keys) {\n Collection prototypes = StubIndex.getElements(FusionPrototypeDeclarationIndex.KEY, key, project, GlobalSearchScope.projectScope(project), FusionPrototypeSignature.class);\n for (FusionPrototypeSignature signature : prototypes) {\n if (signature.getType() != null) {" - }, - "sourceLanguage": "JAVA" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "Intellij_Neos.main", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "b1dbea2a83a98336", - "equalIndicator/v1": "53caa15780dc49f2a01a98397da002ac1b9fc541eca0671cf3e9e089979b10bf" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "QodanaJavaSanity", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference FusionPropertyCopy", - "markdown": "Unresolved reference FusionPropertyCopy" + "text": "Unresolved reference FusionPrototypeInstance", + "markdown": "Unresolved reference FusionPrototypeInstance" }, "locations": [ { @@ -66265,22 +66106,22 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 144, - "startColumn": 13, - "charOffset": 5184, - "charLength": 18, + "startLine": 108, + "startColumn": 34, + "charOffset": 3843, + "charLength": 23, "snippet": { - "text": "FusionPropertyCopy" + "text": "FusionPrototypeInstance" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 142, + "startLine": 106, "startColumn": 1, - "charOffset": 5067, - "charLength": 250, + "charOffset": 3682, + "charLength": 264, "snippet": { - "text": " PsiElement parent = parentBlock.getParent();\n if (parent instanceof FusionPropertyCopy) {\n FusionPropertyCopy copy = (FusionPropertyCopy) parent;\n if (!copy.isPrototypeInheritance()) {\n return null;" + "text": " while(!(parent instanceof FusionFile) && parent != null) {\n if (parent instanceof FusionPrototypeInstance) {\n prototypes.add(((FusionPrototypeInstance) parent).getType().getText());\n return prototypes;\n }" }, "sourceLanguage": "JAVA" } @@ -66294,8 +66135,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "3ae8676065ca2bc6", - "equalIndicator/v1": "7f575161f1c9469bb596b014d9a9cc79c1374ae0e55fd792439bfd96179b8d1a" + "equalIndicator/v2": "493afa00dc938feb", + "equalIndicator/v1": "5a87d82f776c9119edceb5c21b1cc490f943f6074023913fe3ed0dd60aa48dd6" }, "properties": { "ideaSeverity": "ERROR", @@ -66314,13 +66155,13 @@ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/index/FusionPrototypeDeclarationIndex.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 56, - "startColumn": 13, - "charOffset": 2146, + "startLine": 31, + "startColumn": 33, + "charOffset": 1365, "charLength": 24, "snippet": { "text": "FusionPrototypeSignature" @@ -66328,12 +66169,12 @@ "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 54, + "startLine": 29, "startColumn": 1, - "charOffset": 2037, - "charLength": 292, + "charOffset": 1306, + "charLength": 121, "snippet": { - "text": " public String getName() {\n if (getFirstChild() instanceof FusionPrototypeSignature) {\n FusionPrototypeSignature signature = ((FusionPrototypeSignature) getFirstChild());\n if (signature.getType() != null) {\n return signature.getType().getText();" + "text": " @NotNull\n @Override\n public StubIndexKey getKey() {\n return KEY;\n }" }, "sourceLanguage": "JAVA" } @@ -66347,8 +66188,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "c21862effc138d5a", - "equalIndicator/v1": "8e6b7d89c16737af996387f521a77e6902098b58a3b69cfba32b8fdd726af3b4" + "equalIndicator/v2": "7edffe3b2de95908", + "equalIndicator/v1": "62e2190126f26aec854c930dd4eb84f90a099cc04314ced540ca32f726312b4f" }, "properties": { "ideaSeverity": "ERROR", @@ -66371,22 +66212,75 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 43, - "startColumn": 16, - "charOffset": 1757, + "startLine": 22, + "startColumn": 43, + "charOffset": 879, "charLength": 26, "snippet": { "text": "FusionNamespaceDeclaration" }, "sourceLanguage": "JAVA" }, + "contextRegion": { + "startLine": 20, + "startColumn": 1, + "charOffset": 803, + "charLength": 265, + "snippet": { + "text": "\nimport com.intellij.psi.stubs.*;\nimport de.vette.idea.neos.lang.fusion.psi.FusionNamespaceDeclaration;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionNamespaceDeclarationImpl;\nimport de.vette.idea.neos.lang.fusion.stubs.index.FusionNamespaceDeclarationIndex;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "Intellij_Neos.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "fa6676aa64ef0ad0", + "equalIndicator/v1": "73fb333f26f9084dcb187e5949ed237ac6f29d9c2c62bf12238cd220ee8cec5f" + }, + "properties": { + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" + } + }, + { + "ruleId": "QodanaJavaSanity", + "kind": "fail", + "level": "error", + "message": { + "text": "Unresolved reference FusionMetaProperty", + "markdown": "Unresolved reference FusionMetaProperty" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 43, + "startColumn": 46, + "charOffset": 1748, + "charLength": 18, + "snippet": { + "text": "FusionMetaProperty" + }, + "sourceLanguage": "JAVA" + }, "contextRegion": { "startLine": 41, "startColumn": 1, - "charOffset": 1723, - "charLength": 195, + "charOffset": 1603, + "charLength": 212, "snippet": { - "text": "\n @Override\n public FusionNamespaceDeclaration createPsi(@NotNull FusionNamespaceDeclarationStub stub) {\n return new FusionNamespaceDeclarationImpl(stub, this);\n }" + "text": " public boolean isPrototypeClassProperty() {\n if (getPrototypeSignatureList().size() == 1\n && getLastChild() instanceof FusionMetaProperty\n && getChildren().length == 2) {\n" }, "sourceLanguage": "JAVA" } @@ -66400,8 +66294,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "61a2b7c3beab9712", - "equalIndicator/v1": "90a814194cd17dec520de9407bcabf20aad986c2cfa4c7ace7b75b6922709cd8" + "equalIndicator/v2": "9de6d996fdf85565", + "equalIndicator/v1": "775754fe84c06053ddf40ca2584949269b316b2f7247cb42d84a1fc1510525b8" }, "properties": { "ideaSeverity": "ERROR", @@ -66413,33 +66307,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionType", - "markdown": "Unresolved reference FusionType" + "text": "Unresolved reference FusionPrototypeSignature", + "markdown": "Unresolved reference FusionPrototypeSignature" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionTypeImplMixin.java", + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/index/FusionPrototypeDeclarationIndex.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 29, - "startColumn": 80, - "charOffset": 1263, - "charLength": 10, + "startLine": 22, + "startColumn": 43, + "charOffset": 951, + "charLength": 24, "snippet": { - "text": "FusionType" + "text": "FusionPrototypeSignature" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 27, + "startLine": 20, "startColumn": 1, - "charOffset": 1141, - "charLength": 194, + "charOffset": 809, + "charLength": 210, "snippet": { - "text": "import org.jetbrains.annotations.NotNull;\n\npublic abstract class FusionTypeImplMixin extends FusionElementImpl implements FusionType {\n\n public FusionTypeImplMixin(@NotNull ASTNode astNode) {" + "text": "import com.intellij.psi.stubs.StringStubIndexExtension;\nimport com.intellij.psi.stubs.StubIndexKey;\nimport de.vette.idea.neos.lang.fusion.psi.FusionPrototypeSignature;\nimport org.jetbrains.annotations.NotNull;\n" }, "sourceLanguage": "JAVA" } @@ -66453,8 +66347,61 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "2e0bf98668042fbb", - "equalIndicator/v1": "a92e37d289d440dd8b776f43dddca418e7ca5cf0429cac3d390940e6801f8d9f" + "equalIndicator/v2": "dcf53baaa7b74985", + "equalIndicator/v1": "7c827a3df7e4805a39d768cfb4ce1fe14fa467410b638f1821a22ff4a65b3790" + }, + "properties": { + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" + } + }, + { + "ruleId": "QodanaJavaSanity", + "kind": "fail", + "level": "error", + "message": { + "text": "Unresolved reference FusionPrototypeSignature", + "markdown": "Unresolved reference FusionPrototypeSignature" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 56, + "startColumn": 13, + "charOffset": 2146, + "charLength": 24, + "snippet": { + "text": "FusionPrototypeSignature" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 54, + "startColumn": 1, + "charOffset": 2037, + "charLength": 292, + "snippet": { + "text": " public String getName() {\n if (getFirstChild() instanceof FusionPrototypeSignature) {\n FusionPrototypeSignature signature = ((FusionPrototypeSignature) getFirstChild());\n if (signature.getType() != null) {\n return signature.getType().getText();" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "Intellij_Neos.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "c21862effc138d5a", + "equalIndicator/v1": "8e6b7d89c16737af996387f521a77e6902098b58a3b69cfba32b8fdd726af3b4" }, "properties": { "ideaSeverity": "ERROR", @@ -66477,22 +66424,75 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 29, - "startColumn": 62, - "charOffset": 1202, + "startLine": 43, + "startColumn": 16, + "charOffset": 1757, "charLength": 26, "snippet": { "text": "FusionNamespaceDeclaration" }, "sourceLanguage": "JAVA" }, + "contextRegion": { + "startLine": 41, + "startColumn": 1, + "charOffset": 1723, + "charLength": 195, + "snippet": { + "text": "\n @Override\n public FusionNamespaceDeclaration createPsi(@NotNull FusionNamespaceDeclarationStub stub) {\n return new FusionNamespaceDeclarationImpl(stub, this);\n }" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "Intellij_Neos.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "61a2b7c3beab9712", + "equalIndicator/v1": "90a814194cd17dec520de9407bcabf20aad986c2cfa4c7ace7b75b6922709cd8" + }, + "properties": { + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" + } + }, + { + "ruleId": "QodanaJavaSanity", + "kind": "fail", + "level": "error", + "message": { + "text": "Unresolved reference FusionType", + "markdown": "Unresolved reference FusionType" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionTypeImplMixin.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 29, + "startColumn": 80, + "charOffset": 1263, + "charLength": 10, + "snippet": { + "text": "FusionType" + }, + "sourceLanguage": "JAVA" + }, "contextRegion": { "startLine": 27, "startColumn": 1, - "charOffset": 1112, - "charLength": 148, + "charOffset": 1141, + "charLength": 194, "snippet": { - "text": "import java.io.IOException;\n\npublic class FusionNamespaceDeclarationStub extends StubBase {\n\n protected String alias;" + "text": "import org.jetbrains.annotations.NotNull;\n\npublic abstract class FusionTypeImplMixin extends FusionElementImpl implements FusionType {\n\n public FusionTypeImplMixin(@NotNull ASTNode astNode) {" }, "sourceLanguage": "JAVA" } @@ -66506,8 +66506,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "7ca6c329a138b8e1", - "equalIndicator/v1": "ad4de3c6cb48d8f8f060c5c40a469fec9490f8214ea8dac6d4f375c8fe66f9a5" + "equalIndicator/v2": "2e0bf98668042fbb", + "equalIndicator/v1": "a92e37d289d440dd8b776f43dddca418e7ca5cf0429cac3d390940e6801f8d9f" }, "properties": { "ideaSeverity": "ERROR", @@ -66519,33 +66519,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionPropertyAssignment", - "markdown": "Unresolved reference FusionPropertyAssignment" + "text": "Unresolved reference FusionNamespaceDeclarationImpl", + "markdown": "Unresolved reference FusionNamespaceDeclarationImpl" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 136, - "startColumn": 51, - "charOffset": 4882, - "charLength": 24, + "startLine": 44, + "startColumn": 24, + "charOffset": 1865, + "charLength": 30, "snippet": { - "text": "FusionPropertyAssignment" + "text": "FusionNamespaceDeclarationImpl" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 134, + "startLine": 42, "startColumn": 1, - "charOffset": 4825, - "charLength": 205, + "charOffset": 1724, + "charLength": 195, "snippet": { - "text": " }\n\n public static String getDefiningPrototypeName(FusionPropertyAssignment assignment) {\n PsiElement parentBlock = assignment.getParent();\n if (!(parentBlock instanceof FusionBlock)) {" + "text": " @Override\n public FusionNamespaceDeclaration createPsi(@NotNull FusionNamespaceDeclarationStub stub) {\n return new FusionNamespaceDeclarationImpl(stub, this);\n }\n" }, "sourceLanguage": "JAVA" } @@ -66559,8 +66559,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "e3c91a70ac137718", - "equalIndicator/v1": "b13fc37d14755ac676b504b0d43a199a8e405ac1df739e48bc57f90e797c9fa9" + "equalIndicator/v2": "fcf20026e3de62bf", + "equalIndicator/v1": "bd344c9f95d2eae8fa7431d35bbacc2eeefdbef50ce8f275f9b99baa6fc0eb07" }, "properties": { "ideaSeverity": "ERROR", @@ -66572,8 +66572,8 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionPropertyCopy", - "markdown": "Unresolved reference FusionPropertyCopy" + "text": "Unresolved reference FusionPrototypeInstance", + "markdown": "Unresolved reference FusionPrototypeInstance" }, "locations": [ { @@ -66583,22 +66583,22 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 143, - "startColumn": 31, - "charOffset": 5150, - "charLength": 18, + "startLine": 107, + "startColumn": 35, + "charOffset": 3783, + "charLength": 23, "snippet": { - "text": "FusionPropertyCopy" + "text": "FusionPrototypeInstance" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 141, + "startLine": 105, "startColumn": 1, - "charOffset": 5066, - "charLength": 222, + "charOffset": 3637, + "charLength": 295, "snippet": { - "text": "\n PsiElement parent = parentBlock.getParent();\n if (parent instanceof FusionPropertyCopy) {\n FusionPropertyCopy copy = (FusionPropertyCopy) parent;\n if (!copy.isPrototypeInheritance()) {" + "text": " PsiElement parent = psi.getParent();\n while(!(parent instanceof FusionFile) && parent != null) {\n if (parent instanceof FusionPrototypeInstance) {\n prototypes.add(((FusionPrototypeInstance) parent).getType().getText());\n return prototypes;" }, "sourceLanguage": "JAVA" } @@ -66612,8 +66612,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "b5e1e373de90c5be", - "equalIndicator/v1": "c48f216a2fdd769acbe487b9b2a6588a931f3484eef74d9ac4f1935457faceb0" + "equalIndicator/v2": "c7ca10b2ce6f366f", + "equalIndicator/v1": "bfe3f74a00d4e1bd98f560359662253c75c8e8de42a84227e42ce80fe3f74c39" }, "properties": { "ideaSeverity": "ERROR", @@ -66731,8 +66731,8 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionBlock", - "markdown": "Unresolved reference FusionBlock" + "text": "Unresolved reference FusionPropertyCopy", + "markdown": "Unresolved reference FusionPropertyCopy" }, "locations": [ { @@ -66742,22 +66742,22 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 138, - "startColumn": 38, - "charOffset": 5015, - "charLength": 11, + "startLine": 112, + "startColumn": 35, + "charOffset": 3982, + "charLength": 18, "snippet": { - "text": "FusionBlock" + "text": "FusionPropertyCopy" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 136, + "startLine": 110, "startColumn": 1, - "charOffset": 4832, - "charLength": 233, + "charOffset": 3933, + "charLength": 191, "snippet": { - "text": " public static String getDefiningPrototypeName(FusionPropertyAssignment assignment) {\n PsiElement parentBlock = assignment.getParent();\n if (!(parentBlock instanceof FusionBlock)) {\n return null;\n }" + "text": " }\n\n if (parent instanceof FusionPropertyCopy) {\n FusionPropertyCopy copy = (FusionPropertyCopy) parent;\n FusionPath path = copy.getPath();" }, "sourceLanguage": "JAVA" } @@ -66771,8 +66771,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "d0e667d840e87d73", - "equalIndicator/v1": "d4bdb10b34d0837117c2bfd93d6d84db2482e7b140ef7f0f76c33e9786fb4e1d" + "equalIndicator/v2": "a58bb91128204f45", + "equalIndicator/v1": "cb81dd70503104d5a3174507dc6f9fcfbe57b2c6620019bae30e660163be0d1d" }, "properties": { "ideaSeverity": "ERROR", @@ -66784,33 +66784,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionPath", - "markdown": "Unresolved reference FusionPath" + "text": "Unresolved reference FusionType", + "markdown": "Unresolved reference FusionType" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionTypeImplMixin.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 26, - "startColumn": 80, - "charOffset": 1113, + "startLine": 23, + "startColumn": 43, + "charOffset": 925, "charLength": 10, "snippet": { - "text": "FusionPath" + "text": "FusionType" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 24, + "startLine": 21, "startColumn": 1, - "charOffset": 991, - "charLength": 217, + "charOffset": 811, + "charLength": 258, "snippet": { - "text": "import org.jetbrains.annotations.NotNull;\n\npublic abstract class FusionPathImplMixin extends FusionElementImpl implements FusionPath {\n public FusionPathImplMixin(@NotNull ASTNode astNode) {\n super(astNode);" + "text": "import com.intellij.lang.ASTNode;\nimport com.intellij.psi.PsiReference;\nimport de.vette.idea.neos.lang.fusion.psi.FusionType;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionElementImpl;\nimport de.vette.idea.neos.lang.fusion.resolve.ref.FusionReference;" }, "sourceLanguage": "JAVA" } @@ -66824,8 +66824,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "52515624c098f456", - "equalIndicator/v1": "dd89448a7e42bdc725913790f1d3b58e1ebc28c74807cf22b4efed5fe91f2604" + "equalIndicator/v2": "c64d6a32b1177f59", + "equalIndicator/v1": "dfb17773c53ec0e26a4c6879295215d10b9aa9c45c6f93eb1e8a61045a77a8ec" }, "properties": { "ideaSeverity": "ERROR", @@ -66837,33 +66837,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionType", - "markdown": "Unresolved reference FusionType" + "text": "Unresolved reference FusionPropertyCopy", + "markdown": "Unresolved reference FusionPropertyCopy" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionTypeImplMixin.java", + "uri": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 23, - "startColumn": 43, - "charOffset": 925, - "charLength": 10, + "startLine": 113, + "startColumn": 17, + "charOffset": 4020, + "charLength": 18, "snippet": { - "text": "FusionType" + "text": "FusionPropertyCopy" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 21, + "startLine": 111, "startColumn": 1, - "charOffset": 811, - "charLength": 258, + "charOffset": 3947, + "charLength": 178, "snippet": { - "text": "import com.intellij.lang.ASTNode;\nimport com.intellij.psi.PsiReference;\nimport de.vette.idea.neos.lang.fusion.psi.FusionType;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionElementImpl;\nimport de.vette.idea.neos.lang.fusion.resolve.ref.FusionReference;" + "text": "\n if (parent instanceof FusionPropertyCopy) {\n FusionPropertyCopy copy = (FusionPropertyCopy) parent;\n FusionPath path = copy.getPath();\n" }, "sourceLanguage": "JAVA" } @@ -66877,8 +66877,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "c64d6a32b1177f59", - "equalIndicator/v1": "dfb17773c53ec0e26a4c6879295215d10b9aa9c45c6f93eb1e8a61045a77a8ec" + "equalIndicator/v2": "7f850b2bed9a7ec4", + "equalIndicator/v1": "f1562135ae41368b60faae3b774883aea299f439399ca545540510f682330925" }, "properties": { "ideaSeverity": "ERROR", @@ -66890,8 +66890,8 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionNamespaceDeclaration", - "markdown": "Unresolved reference FusionNamespaceDeclaration" + "text": "Unresolved reference FusionNamespaceDeclarationImpl", + "markdown": "Unresolved reference FusionNamespaceDeclarationImpl" }, "locations": [ { @@ -66901,22 +66901,22 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 40, - "startColumn": 73, - "charOffset": 1626, - "charLength": 26, + "startLine": 23, + "startColumn": 48, + "charOffset": 954, + "charLength": 30, "snippet": { - "text": "FusionNamespaceDeclaration" + "text": "FusionNamespaceDeclarationImpl" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 38, + "startLine": 21, "startColumn": 1, - "charOffset": 1547, - "charLength": 194, + "charOffset": 804, + "charLength": 306, "snippet": { - "text": " }\n\n public static FusionStubElementType TYPE = new FusionStubElementType<>(\"FUSION_NAMESPACE_DECLARATION\") {\n\n @Override" + "text": "import com.intellij.psi.stubs.*;\nimport de.vette.idea.neos.lang.fusion.psi.FusionNamespaceDeclaration;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionNamespaceDeclarationImpl;\nimport de.vette.idea.neos.lang.fusion.stubs.index.FusionNamespaceDeclarationIndex;\nimport org.jetbrains.annotations.NotNull;" }, "sourceLanguage": "JAVA" } @@ -66930,8 +66930,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "5e1c5878f2def127", - "equalIndicator/v1": "eb855ddb3f03cef5149ab03074b75dc3af8092956701d41f154f3090fcb98938" + "equalIndicator/v2": "250dfbc9fd840a31", + "equalIndicator/v1": "f4e86814ccf2a2f6344dd68e5c9945a11bd7e990c3112215ef46654b967d3eb1" }, "properties": { "ideaSeverity": "ERROR", diff --git a/results/sanity.json b/results/sanity.json index fccb291..0efc240 100644 --- a/results/sanity.json +++ b/results/sanity.json @@ -6,21 +6,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionPrototypeSignature", + "comment": "Unresolved reference _AfxLexer", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/afx/codeInsight/AfxTagProvider.java", + "path": "src/main/java/de/vette/idea/neos/lang/afx/parser/InnerAfxLexer.java", "language": "JAVA", - "line": 20, - "offset": 43, - "length": 24, + "line": 13, + "offset": 35, + "length": 9, "code": { - "startLine": 18, - "length": 24, - "offset": 147, - "surroundingCode": "import de.vette.idea.neos.lang.afx.AfxLanguage;\nimport de.vette.idea.neos.lang.fusion.icons.FusionIcons;\nimport de.vette.idea.neos.lang.fusion.psi.FusionPrototypeSignature;\nimport de.vette.idea.neos.lang.fusion.resolve.ResolveEngine;\nimport de.vette.idea.neos.lang.fusion.stubs.index.FusionPrototypeDeclarationIndex;" + "startLine": 11, + "length": 9, + "offset": 64, + "surroundingCode": "\n public InnerAfxLexer() {\n super(new FlexAdapter(new _AfxLexer()), TOKENS_TO_MERGE);\n }\n" } } ], @@ -28,7 +28,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "162fd5308bcc303c330d50b2ae403a0c4d66ad307a7105864c2f1be04433b00b" + "hash": "333183bc92ee70046b6d65439e091574cf336d9d7135e83e41bd0989b209ec1d" },{ "tool": "Code Inspection", "category": "General", @@ -42,16 +42,16 @@ "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", + "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionNamespaceDeclarationImplMixin.java", "language": "JAVA", - "line": 49, - "offset": 67, + "line": 32, + "offset": 135, "length": 26, "code": { - "startLine": 47, + "startLine": 30, "length": 26, - "offset": 101, - "surroundingCode": " @NotNull\n @Override\n public FusionNamespaceDeclarationStub createStub(@NotNull FusionNamespaceDeclaration psi, StubElement parentStub) {\n String alias = psi.getAlias() != null ? psi.getAlias().getText() : \"\";\n String namespace = psi.getNamespace() != null ? psi.getNamespace().getText() : \"\";" + "offset": 178, + "surroundingCode": "import org.jetbrains.annotations.Nullable;\n\npublic abstract class FusionNamespaceDeclarationImplMixin extends FusionStubbedElementImpl implements FusionNamespaceDeclaration {\n\n public FusionNamespaceDeclarationImplMixin(@NotNull ASTNode node) {" } } ], @@ -59,7 +59,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "2f2ac3cee83b24724b6c63224a82db62dab6db9a7bdf737e5e5b9a340a42b06d" + "hash": "3b0075bf8b2b61677afbeeccc999483e0cd8175e4be8cf0b89a884271ef841b1" },{ "tool": "Code Inspection", "category": "General", @@ -68,21 +68,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference _AfxLexer", + "comment": "Unresolved reference FusionPropertyAssignment", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/afx/parser/InnerAfxLexer.java", + "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPropertyAssignmentImplMixin.java", "language": "JAVA", - "line": 13, - "offset": 35, - "length": 9, + "line": 35, + "offset": 20, + "length": 24, "code": { - "startLine": 11, - "length": 9, - "offset": 64, - "surroundingCode": "\n public InnerAfxLexer() {\n super(new FlexAdapter(new _AfxLexer()), TOKENS_TO_MERGE);\n }\n" + "startLine": 33, + "length": 24, + "offset": 146, + "surroundingCode": "public abstract class FusionPropertyAssignmentImplMixin\n extends FusionStubbedElementImpl\n implements FusionPropertyAssignment {\n\n public FusionPropertyAssignmentImplMixin(@NotNull ASTNode astNode) {" } } ], @@ -90,7 +90,38 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "333183bc92ee70046b6d65439e091574cf336d9d7135e83e41bd0989b209ec1d" + "hash": "47d5098dda142a91dc689082717bfc759f1009bab03d2b6fe5e5e02b2c1132e7" +},{ + "tool": "Code Inspection", + "category": "General", + "type": "Java sanity", + "tags": [ + "Sanity" + ], + "severity": "Critical", + "comment": "Unresolved reference FusionPrototypeSignature", + "detailsInfo": "Reports unresolved references in Java code.", + "sources": [ + { + "type": "file", + "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", + "language": "JAVA", + "line": 55, + "offset": 40, + "length": 24, + "code": { + "startLine": 53, + "length": 24, + "offset": 83, + "surroundingCode": " @Override\n public String getName() {\n if (getFirstChild() instanceof FusionPrototypeSignature) {\n FusionPrototypeSignature signature = ((FusionPrototypeSignature) getFirstChild());\n if (signature.getType() != null) {" + } + } + ], + "attributes": { + "module": "Intellij_Neos.main", + "inspectionName": "QodanaJavaSanity" + }, + "hash": "4a476e8ef83d6174293bcd03365d8fbdc1e976b70d346ab84ca4f1d99facb06b" },{ "tool": "Code Inspection", "category": "General", @@ -106,14 +137,14 @@ "type": "file", "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionNamespaceDeclarationImplMixin.java", "language": "JAVA", - "line": 32, - "offset": 135, + "line": 25, + "offset": 43, "length": 26, "code": { - "startLine": 30, + "startLine": 23, "length": 26, - "offset": 178, - "surroundingCode": "import org.jetbrains.annotations.Nullable;\n\npublic abstract class FusionNamespaceDeclarationImplMixin extends FusionStubbedElementImpl implements FusionNamespaceDeclaration {\n\n public FusionNamespaceDeclarationImplMixin(@NotNull ASTNode node) {" + "offset": 144, + "surroundingCode": "import com.intellij.psi.stubs.IStubElementType;\nimport com.intellij.util.IncorrectOperationException;\nimport de.vette.idea.neos.lang.fusion.psi.FusionNamespaceDeclaration;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionStubbedElementImpl;\nimport de.vette.idea.neos.lang.fusion.stubs.FusionNamespaceDeclarationStub;" } } ], @@ -121,7 +152,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "3b0075bf8b2b61677afbeeccc999483e0cd8175e4be8cf0b89a884271ef841b1" + "hash": "4cf9da5f6a76e537fcaf385de21c09ad9c5d77ff94e511c58f1caafacdaa5d2a" },{ "tool": "Code Inspection", "category": "General", @@ -130,21 +161,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionPropertyAssignment", + "comment": "Unresolved reference FusionPrototypeInstance", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPropertyAssignmentImplMixin.java", + "path": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", "language": "JAVA", - "line": 35, - "offset": 20, - "length": 24, + "line": 108, + "offset": 34, + "length": 23, "code": { - "startLine": 33, - "length": 24, - "offset": 146, - "surroundingCode": "public abstract class FusionPropertyAssignmentImplMixin\n extends FusionStubbedElementImpl\n implements FusionPropertyAssignment {\n\n public FusionPropertyAssignmentImplMixin(@NotNull ASTNode astNode) {" + "startLine": 106, + "length": 23, + "offset": 161, + "surroundingCode": " while(!(parent instanceof FusionFile) && parent != null) {\n if (parent instanceof FusionPrototypeInstance) {\n prototypes.add(((FusionPrototypeInstance) parent).getType().getText());\n return prototypes;\n }" } } ], @@ -152,7 +183,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "47d5098dda142a91dc689082717bfc759f1009bab03d2b6fe5e5e02b2c1132e7" + "hash": "5a87d82f776c9119edceb5c21b1cc490f943f6074023913fe3ed0dd60aa48dd6" },{ "tool": "Code Inspection", "category": "General", @@ -166,16 +197,16 @@ "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", + "path": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/index/FusionPrototypeDeclarationIndex.java", "language": "JAVA", - "line": 55, - "offset": 40, + "line": 31, + "offset": 33, "length": 24, "code": { - "startLine": 53, + "startLine": 29, "length": 24, - "offset": 83, - "surroundingCode": " @Override\n public String getName() {\n if (getFirstChild() instanceof FusionPrototypeSignature) {\n FusionPrototypeSignature signature = ((FusionPrototypeSignature) getFirstChild());\n if (signature.getType() != null) {" + "offset": 59, + "surroundingCode": " @NotNull\n @Override\n public StubIndexKey getKey() {\n return KEY;\n }" } } ], @@ -183,7 +214,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "4a476e8ef83d6174293bcd03365d8fbdc1e976b70d346ab84ca4f1d99facb06b" + "hash": "62e2190126f26aec854c930dd4eb84f90a099cc04314ced540ca32f726312b4f" },{ "tool": "Code Inspection", "category": "General", @@ -197,16 +228,16 @@ "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionNamespaceDeclarationImplMixin.java", + "path": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", "language": "JAVA", - "line": 25, + "line": 22, "offset": 43, "length": 26, "code": { - "startLine": 23, + "startLine": 20, "length": 26, - "offset": 144, - "surroundingCode": "import com.intellij.psi.stubs.IStubElementType;\nimport com.intellij.util.IncorrectOperationException;\nimport de.vette.idea.neos.lang.fusion.psi.FusionNamespaceDeclaration;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionStubbedElementImpl;\nimport de.vette.idea.neos.lang.fusion.stubs.FusionNamespaceDeclarationStub;" + "offset": 76, + "surroundingCode": "\nimport com.intellij.psi.stubs.*;\nimport de.vette.idea.neos.lang.fusion.psi.FusionNamespaceDeclaration;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionNamespaceDeclarationImpl;\nimport de.vette.idea.neos.lang.fusion.stubs.index.FusionNamespaceDeclarationIndex;" } } ], @@ -214,7 +245,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "4cf9da5f6a76e537fcaf385de21c09ad9c5d77ff94e511c58f1caafacdaa5d2a" + "hash": "73fb333f26f9084dcb187e5949ed237ac6f29d9c2c62bf12238cd220ee8cec5f" },{ "tool": "Code Inspection", "category": "General", @@ -223,21 +254,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionPrototypeSignature", + "comment": "Unresolved reference FusionMetaProperty", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/afx/codeInsight/AfxTagProvider.java", + "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", "language": "JAVA", - "line": 94, - "offset": 24, - "length": 24, + "line": 43, + "offset": 46, + "length": 18, "code": { - "startLine": 92, - "length": 24, - "offset": 58, - "surroundingCode": "\n for (String key : keys) {\n Collection prototypes = StubIndex.getElements(FusionPrototypeDeclarationIndex.KEY, key, project, GlobalSearchScope.projectScope(project), FusionPrototypeSignature.class);\n for (FusionPrototypeSignature signature : prototypes) {\n if (signature.getType() != null) {" + "startLine": 41, + "length": 18, + "offset": 145, + "surroundingCode": " public boolean isPrototypeClassProperty() {\n if (getPrototypeSignatureList().size() == 1\n && getLastChild() instanceof FusionMetaProperty\n && getChildren().length == 2) {\n" } } ], @@ -245,7 +276,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "53caa15780dc49f2a01a98397da002ac1b9fc541eca0671cf3e9e089979b10bf" + "hash": "775754fe84c06053ddf40ca2584949269b316b2f7247cb42d84a1fc1510525b8" },{ "tool": "Code Inspection", "category": "General", @@ -254,21 +285,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionPropertyCopy", + "comment": "Unresolved reference FusionPrototypeSignature", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", + "path": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/index/FusionPrototypeDeclarationIndex.java", "language": "JAVA", - "line": 144, - "offset": 13, - "length": 18, + "line": 22, + "offset": 43, + "length": 24, "code": { - "startLine": 142, - "length": 18, - "offset": 117, - "surroundingCode": " PsiElement parent = parentBlock.getParent();\n if (parent instanceof FusionPropertyCopy) {\n FusionPropertyCopy copy = (FusionPropertyCopy) parent;\n if (!copy.isPrototypeInheritance()) {\n return null;" + "startLine": 20, + "length": 24, + "offset": 142, + "surroundingCode": "import com.intellij.psi.stubs.StringStubIndexExtension;\nimport com.intellij.psi.stubs.StubIndexKey;\nimport de.vette.idea.neos.lang.fusion.psi.FusionPrototypeSignature;\nimport org.jetbrains.annotations.NotNull;\n" } } ], @@ -276,7 +307,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "7f575161f1c9469bb596b014d9a9cc79c1374ae0e55fd792439bfd96179b8d1a" + "hash": "7c827a3df7e4805a39d768cfb4ce1fe14fa467410b638f1821a22ff4a65b3790" },{ "tool": "Code Inspection", "category": "General", @@ -378,52 +409,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionNamespaceDeclaration", + "comment": "Unresolved reference FusionNamespaceDeclarationImpl", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", "path": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", "language": "JAVA", - "line": 29, - "offset": 62, - "length": 26, - "code": { - "startLine": 27, - "length": 26, - "offset": 90, - "surroundingCode": "import java.io.IOException;\n\npublic class FusionNamespaceDeclarationStub extends StubBase {\n\n protected String alias;" - } - } - ], - "attributes": { - "module": "Intellij_Neos.main", - "inspectionName": "QodanaJavaSanity" - }, - "hash": "ad4de3c6cb48d8f8f060c5c40a469fec9490f8214ea8dac6d4f375c8fe66f9a5" -},{ - "tool": "Code Inspection", - "category": "General", - "type": "Java sanity", - "tags": [ - "Sanity" - ], - "severity": "Critical", - "comment": "Unresolved reference FusionPropertyAssignment", - "detailsInfo": "Reports unresolved references in Java code.", - "sources": [ - { - "type": "file", - "path": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", - "language": "JAVA", - "line": 136, - "offset": 51, - "length": 24, + "line": 44, + "offset": 24, + "length": 30, "code": { - "startLine": 134, - "length": 24, - "offset": 57, - "surroundingCode": " }\n\n public static String getDefiningPrototypeName(FusionPropertyAssignment assignment) {\n PsiElement parentBlock = assignment.getParent();\n if (!(parentBlock instanceof FusionBlock)) {" + "startLine": 42, + "length": 30, + "offset": 141, + "surroundingCode": " @Override\n public FusionNamespaceDeclaration createPsi(@NotNull FusionNamespaceDeclarationStub stub) {\n return new FusionNamespaceDeclarationImpl(stub, this);\n }\n" } } ], @@ -431,7 +431,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "b13fc37d14755ac676b504b0d43a199a8e405ac1df739e48bc57f90e797c9fa9" + "hash": "bd344c9f95d2eae8fa7431d35bbacc2eeefdbef50ce8f275f9b99baa6fc0eb07" },{ "tool": "Code Inspection", "category": "General", @@ -440,21 +440,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionPropertyCopy", + "comment": "Unresolved reference FusionPrototypeInstance", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", "path": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", "language": "JAVA", - "line": 143, - "offset": 31, - "length": 18, + "line": 107, + "offset": 35, + "length": 23, "code": { - "startLine": 141, - "length": 18, - "offset": 84, - "surroundingCode": "\n PsiElement parent = parentBlock.getParent();\n if (parent instanceof FusionPropertyCopy) {\n FusionPropertyCopy copy = (FusionPropertyCopy) parent;\n if (!copy.isPrototypeInheritance()) {" + "startLine": 105, + "length": 23, + "offset": 146, + "surroundingCode": " PsiElement parent = psi.getParent();\n while(!(parent instanceof FusionFile) && parent != null) {\n if (parent instanceof FusionPrototypeInstance) {\n prototypes.add(((FusionPrototypeInstance) parent).getType().getText());\n return prototypes;" } } ], @@ -462,7 +462,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "c48f216a2fdd769acbe487b9b2a6588a931f3484eef74d9ac4f1935457faceb0" + "hash": "bfe3f74a00d4e1bd98f560359662253c75c8e8de42a84227e42ce80fe3f74c39" },{ "tool": "Code Inspection", "category": "General", @@ -533,21 +533,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionBlock", + "comment": "Unresolved reference FusionPropertyCopy", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", "path": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", "language": "JAVA", - "line": 138, - "offset": 38, - "length": 11, + "line": 112, + "offset": 35, + "length": 18, "code": { - "startLine": 136, - "length": 11, - "offset": 183, - "surroundingCode": " public static String getDefiningPrototypeName(FusionPropertyAssignment assignment) {\n PsiElement parentBlock = assignment.getParent();\n if (!(parentBlock instanceof FusionBlock)) {\n return null;\n }" + "startLine": 110, + "length": 18, + "offset": 49, + "surroundingCode": " }\n\n if (parent instanceof FusionPropertyCopy) {\n FusionPropertyCopy copy = (FusionPropertyCopy) parent;\n FusionPath path = copy.getPath();" } } ], @@ -555,7 +555,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "d4bdb10b34d0837117c2bfd93d6d84db2482e7b140ef7f0f76c33e9786fb4e1d" + "hash": "cb81dd70503104d5a3174507dc6f9fcfbe57b2c6620019bae30e660163be0d1d" },{ "tool": "Code Inspection", "category": "General", @@ -564,21 +564,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionPath", + "comment": "Unresolved reference FusionType", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", + "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionTypeImplMixin.java", "language": "JAVA", - "line": 26, - "offset": 80, + "line": 23, + "offset": 43, "length": 10, "code": { - "startLine": 24, + "startLine": 21, "length": 10, - "offset": 122, - "surroundingCode": "import org.jetbrains.annotations.NotNull;\n\npublic abstract class FusionPathImplMixin extends FusionElementImpl implements FusionPath {\n public FusionPathImplMixin(@NotNull ASTNode astNode) {\n super(astNode);" + "offset": 114, + "surroundingCode": "import com.intellij.lang.ASTNode;\nimport com.intellij.psi.PsiReference;\nimport de.vette.idea.neos.lang.fusion.psi.FusionType;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionElementImpl;\nimport de.vette.idea.neos.lang.fusion.resolve.ref.FusionReference;" } } ], @@ -586,7 +586,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "dd89448a7e42bdc725913790f1d3b58e1ebc28c74807cf22b4efed5fe91f2604" + "hash": "dfb17773c53ec0e26a4c6879295215d10b9aa9c45c6f93eb1e8a61045a77a8ec" },{ "tool": "Code Inspection", "category": "General", @@ -595,21 +595,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionType", + "comment": "Unresolved reference FusionPropertyCopy", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionTypeImplMixin.java", + "path": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", "language": "JAVA", - "line": 23, - "offset": 43, - "length": 10, + "line": 113, + "offset": 17, + "length": 18, "code": { - "startLine": 21, - "length": 10, - "offset": 114, - "surroundingCode": "import com.intellij.lang.ASTNode;\nimport com.intellij.psi.PsiReference;\nimport de.vette.idea.neos.lang.fusion.psi.FusionType;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionElementImpl;\nimport de.vette.idea.neos.lang.fusion.resolve.ref.FusionReference;" + "startLine": 111, + "length": 18, + "offset": 73, + "surroundingCode": "\n if (parent instanceof FusionPropertyCopy) {\n FusionPropertyCopy copy = (FusionPropertyCopy) parent;\n FusionPath path = copy.getPath();\n" } } ], @@ -617,7 +617,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "dfb17773c53ec0e26a4c6879295215d10b9aa9c45c6f93eb1e8a61045a77a8ec" + "hash": "f1562135ae41368b60faae3b774883aea299f439399ca545540510f682330925" },{ "tool": "Code Inspection", "category": "General", @@ -626,21 +626,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionNamespaceDeclaration", + "comment": "Unresolved reference FusionNamespaceDeclarationImpl", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", "path": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", "language": "JAVA", - "line": 40, - "offset": 73, - "length": 26, + "line": 23, + "offset": 48, + "length": 30, "code": { - "startLine": 38, - "length": 26, - "offset": 79, - "surroundingCode": " }\n\n public static FusionStubElementType TYPE = new FusionStubElementType<>(\"FUSION_NAMESPACE_DECLARATION\") {\n\n @Override" + "startLine": 21, + "length": 30, + "offset": 150, + "surroundingCode": "import com.intellij.psi.stubs.*;\nimport de.vette.idea.neos.lang.fusion.psi.FusionNamespaceDeclaration;\nimport de.vette.idea.neos.lang.fusion.psi.impl.FusionNamespaceDeclarationImpl;\nimport de.vette.idea.neos.lang.fusion.stubs.index.FusionNamespaceDeclarationIndex;\nimport org.jetbrains.annotations.NotNull;" } } ], @@ -648,5 +648,5 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "eb855ddb3f03cef5149ab03074b75dc3af8092956701d41f154f3090fcb98938" + "hash": "f4e86814ccf2a2f6344dd68e5c9945a11bd7e990c3112215ef46654b967d3eb1" }]} \ No newline at end of file