From cd36115621b882d2c0496ab89a61cb7f7f1d109f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 25 Jul 2024 22:43:44 +0000 Subject: [PATCH] deploy: 834cf38886d64323fe645e93c089818e8d366fbb --- results/descriptions/Code_Inspection.json | 736 ++--- results/metaInformation.json | 6 +- results/projectStructure/Code_Inspection.json | 4 +- results/projectStructure/Gradle.json | 6 +- results/projectStructure/Libraries.json | 4 +- results/qodana.sarif.json | 2936 ++++++++--------- results/sanity.json | 158 +- 7 files changed, 1925 insertions(+), 1925 deletions(-) diff --git a/results/descriptions/Code_Inspection.json b/results/descriptions/Code_Inspection.json index d61fa7f..f542e91 100644 --- a/results/descriptions/Code_Inspection.json +++ b/results/descriptions/Code_Inspection.json @@ -241,18 +241,18 @@ "enabled": true, "description": "Reports calls to `assertTrue()` and `assertFalse()` that can be replaced with assert equality functions.\n\n\n`assertEquals()`, `assertSame()`, and their negating counterparts (-Not-) provide more informative messages on\nfailure.\n\n**Example:**\n\n assertTrue(a == b)\n\nAfter the quick-fix is applied:\n\n assertEquals(a, b)\n" }, - { - "shortName": "ReplaceStringFormatWithLiteral", - "displayName": "'String.format' call can be replaced with string templates", - "enabled": false, - "description": "Reports `String.format` calls that can be replaced with string templates.\n\nUsing string templates makes your code simpler.\n\nThe quick-fix replaces the call with a string template.\n\n**Example:**\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }\n" - }, { "shortName": "ReplaceNotNullAssertionWithElvisReturn", "displayName": "Not-null assertion can be replaced with 'return'", "enabled": false, "description": "Reports not-null assertion (`!!`) calls that can be replaced with the elvis operator and return (`?: return`).\n\nA not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of `!!` is good practice.\n\nThe quick-fix replaces the not-null assertion with `return` or `return null`.\n\n**Example:**\n\n\n fun test(number: Int?) {\n val x = number!!\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(number: Int?) {\n val x = number ?: return\n }\n" }, + { + "shortName": "ReplaceStringFormatWithLiteral", + "displayName": "'String.format' call can be replaced with string templates", + "enabled": false, + "description": "Reports `String.format` calls that can be replaced with string templates.\n\nUsing string templates makes your code simpler.\n\nThe quick-fix replaces the call with a string template.\n\n**Example:**\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }\n" + }, { "shortName": "ReplaceSubstringWithSubstringBefore", "displayName": "'substring' call should be replaced with 'substringBefore'", @@ -2337,6 +2337,125 @@ } ] }, + { + "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." + }, + { + "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": "InlineClassDeprecatedMigration", + "displayName": "Inline classes are deprecated since 1.5", + "enabled": false, + "description": "Reports inline classes that are deprecated and cause compilation warnings in Kotlin 1.5 and later.\nSee [What's new in Kotlin 1.5.0](https://kotlinlang.org/docs/whatsnew15.html#inline-classes)\n\nExample:\n\n\n inline class Password(val s: String)\n\nAfter the quick-fix is applied:\n\n\n @JvmInline\n value class Password(val s: String)\n\nInspection is available for Kotlin language level starting from 1.5." + }, + { + "shortName": "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": "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": "OverrideDeprecatedMigration", + "displayName": "Do not propagate method deprecation through overrides since 1.9", + "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." + }, + { + "shortName": "ObsoleteExperimentalCoroutines", + "displayName": "Experimental coroutines usages are deprecated since 1.3", + "enabled": false, + "description": "Reports code that uses experimental coroutines.\n\nSuch usages are incompatible with Kotlin 1.3+ and should be updated." + }, + { + "shortName": "FromClosedRangeMigration", + "displayName": "MIN_VALUE step in fromClosedRange() since 1.3", + "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." + }, + { + "shortName": "DeclaringClassMigration", + "displayName": "Deprecated 'Enum.declaringClass' property", + "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." + }, + { + "shortName": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", + "displayName": "Meaningless annotations targets on superclass", + "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." + }, + { + "shortName": "ObsoleteKotlinJsPackages", + "displayName": "'kotlin.browser' and 'kotlin.dom' packages are deprecated since 1.4", + "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+." + }, + { + "shortName": "RestrictReturnStatementTargetMigration", + "displayName": "Target label does not denote a function since 1.4", + "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." + }, + { + "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." + } + ] + }, { "name": "Probable bugs", "inspections": [ @@ -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'", @@ -2928,18 +3047,18 @@ "enabled": true, "description": "Reports expressions and conditions that always produce the same result, like true, false, null, or zero. Such expressions could be replaced with the corresponding constant value. Very often though they signal about a bug in the code.\n\nExamples:\n\n // always true\n // root cause: || is used instead of &&\n if (x > 0 || x < 10) {}\n\n System.out.println(str.trim());\n // always false\n // root cause: variable was dereferenced before null-check\n if (str == null) {}\n\n\nThe inspection behavior may be controlled by a number of annotations, such as\n[nullability](https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html) annotations,\n[@Contract](https://www.jetbrains.com/help/idea/contract-annotations.html) annotation,\n`@Range` annotation and so on.\n\nConfigure the inspection:\n\n* Use the **Don't report assertions with condition statically proven to be always true** option to avoid reporting assertions that were statically proven to be always true. This also includes conditions like `if (alwaysFalseCondition) throw new IllegalArgumentException();`.\n* Use the **Ignore assert statements** option to control how the inspection treats `assert` statements. By default, the option is disabled, which means that the assertions are assumed to be executed (-ea mode). If the option is enabled, the assertions will be completely ignored (-da mode).\n* Use the **Warn when constant is stored in variable** option to display warnings when variable is used, whose value is known to be a constant.\n\n\nBefore IntelliJ IDEA 2022.3, this inspection was part of \"Constant Conditions \\& Exceptions\" inspection. Now, it split into two inspections:\n\"Constant Values\" and \"Nullability and data flow problems\"." }, - { - "shortName": "IteratorHasNextCallsIteratorNext", - "displayName": "'Iterator.hasNext()' which calls 'next()'", - "enabled": true, - "description": "Reports implementations of `Iterator.hasNext()` or `ListIterator.hasPrevious()` that call `Iterator.next()` or `ListIterator.previous()` on the iterator instance. Such calls are almost certainly an error, as methods like `hasNext()` should not modify the iterators state, while `next()` should.\n\n**Example:**\n\n\n class MyIterator implements Iterator {\n public boolean hasNext() {\n return next() != null;\n }\n }\n" - }, { "shortName": "EqualsAndHashcode", "displayName": "'equals()' and 'hashCode()' not paired", "enabled": false, "description": "Reports classes that override the `equals()` method but do not override the `hashCode()` method or vice versa, which can potentially lead to problems when the class is added to a `Collection` or a `HashMap`.\n\nThe quick-fix generates the default implementation for an absent method.\n\nExample:\n\n\n class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof StringHolder)) return false;\n\n StringHolder holder = (StringHolder)o;\n\n if (s != null ? !s.equals(holder.s) : holder.s != null) return false;\n\n return true;\n }\n }\n" }, + { + "shortName": "IteratorHasNextCallsIteratorNext", + "displayName": "'Iterator.hasNext()' which calls 'next()'", + "enabled": true, + "description": "Reports implementations of `Iterator.hasNext()` or `ListIterator.hasPrevious()` that call `Iterator.next()` or `ListIterator.previous()` on the iterator instance. Such calls are almost certainly an error, as methods like `hasNext()` should not modify the iterators state, while `next()` should.\n\n**Example:**\n\n\n class MyIterator implements Iterator {\n public boolean hasNext() {\n return next() != null;\n }\n }\n" + }, { "shortName": "MathRoundingWithIntArgument", "displayName": "Call math rounding with 'int' argument", @@ -3387,216 +3506,97 @@ ] }, { - "name": "Migration", + "name": "Class structure", "inspections": [ { - "shortName": "NonExhaustiveWhenStatementMigration", - "displayName": "Non-exhaustive 'when' statements will be prohibited since 1.7", + "shortName": "ClassWithOnlyPrivateConstructors", + "displayName": "Class with only 'private' constructors should be declared 'final'", "enabled": false, - "description": "Reports a non-exhaustive `when` statements that will lead to compilation error since 1.7.\n\nMotivation types:\n\n* Problematic/meaningless usage patterns need to be discouraged/blocked (e.g. counterintuitive behaviors)\n * Code is error-prone\n* Inconsistency in the design (things are done differently in different contexts)\n\nImpact types:\n\n* Compilation. Some code that used to compile won't compile any more\n * There were cases when such code worked with no exceptions\n * Some such code could compile without any warnings\n\n**More details:** [KT-47709: Make when statements with enum, sealed, and Boolean subjects exhaustive by default](https://youtrack.jetbrains.com/issue/KT-47709)\n\nThe quick-fix adds the missing `else -> {}` branch.\n\n**Example:**\n\n\n sealed class Base {\n class A : Base()\n class B : Base()\n }\n\n fun test(base: Base) {\n when (base) {\n is Base.A -> \"\"\n }\n }\n\nAfter the quick-fix is applied:\n\n\n sealed class Base {\n class A : Base()\n class B : Base()\n }\n\n fun test(base: Base) {\n when (base) {\n is Base.A -> \"\"\n else -> {}\n }\n }\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.6 or higher." + "description": "Reports classes with only `private` constructors.\n\nA class that only has `private` constructors cannot be extended outside a file and should be declared as `final`." }, { - "shortName": "AmbiguousExpressionInWhenBranchMigration", - "displayName": "Ambiguous logical expressions in 'when' branches since 1.7", + "shortName": "FinalMethod", + "displayName": "Method can't be overridden", "enabled": false, - "description": "Reports ambiguous logical expressions in `when` branches which cause compilation errors in Kotlin 1.8 and later.\n\n\n fun Int.matches(strict: Boolean): Boolean = when (strict) {\n true -> this == 6\n this in (4..7) -> true // is ambiguous\n else -> false\n }\n\nAfter the quick-fix is applied:\n\n\n fun Int.matches(strict: Boolean): Boolean = when (strict) {\n true -> this == 6\n (this in (4..7)) -> true // wrapped in parentheses\n else -> false\n }\n\nInspection is available for Kotlin language level starting from 1.7." + "description": "Reports 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." }, { - "shortName": "CastDueToProgressionResolutionChangeMigration", - "displayName": "Progression resolution change since 1.9", + "shortName": "StaticNonFinalField", + "displayName": "'static', non-'final' field", "enabled": false, - "description": "Reports overloaded function calls where an argument requires an explicit cast to resolve to a proper declaration.\nThe current compiler warning (available since Kotlin 1.6.20) will become an error in Kotlin 1.8.\n\n\nProgressions and ranges types (`kotlin.ranges`) will start implementing the `Collection` interface in Kotlin\n1.9 and later. This update will cause a change in resolution for overloaded functions. For instance, in the example below, the\n`test(1..5)` call will be resolved to `test(t: Any)` in Kotlin 1.8 and earlier and to\n`test(t: Collection<*>)` in Kotlin 1.9 and later.\n\n\n fun test(t: Any) { }\n fun test(t: Collection<*>) { }\n fun invoke() {\n test(1..5) // IntRange becomes Collection in 1.9\n }\n\nThe provided quick-fix captures the behaviour specific to the compiler of version 1.8 and earlier:\n\n\n fun test(t: Any) { }\n fun test(t: Collection<*>) { }\n\n fun invoke() {\n test(1..5) // resolved to 'test(t: T)' before Kotlin 1.9\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(t: Any) { }\n fun test(t: Collection<*>) { }\n\n fun invoke() {\n test((1..5) as Iterable) // resolved to 'test(t: T)' in Kotlin 1.9\n }\n\nInspection is available for the Kotlin language level starting from 1.6." + "description": "Reports non-`final` `static` fields.\n\nA quick-fix is available to add the `final` modifier to a non-`final` `static` field.\n\nThis inspection doesn't check fields' mutability. For example, adding the `final` modifier to a field that has a value\nbeing set somewhere will cause a compilation error.\n\n\nUse the **Only report 'public' fields** option so that the inspection reported only `public` fields." }, { - "shortName": "AddConversionCallMigration", - "displayName": "Explicit conversion from `Int` needed since 1.9", + "shortName": "ClassInitializer", + "displayName": "Non-'static' initializer", "enabled": false, - "description": "Reports expressions that will be of type `Int`, thus causing compilation errors in Kotlin 1.9 and later.\n\nExample:\n\n\n fun takeByte(x: Byte) {}\n\n fun foo() {\n takeByte(1 + 1) // will be resolved to Int in 1.9\n }\n\nAfter the quick-fix is applied:\n\n\n fun takeByte(x: Byte) {}\n\n fun foo() {\n takeByte((1 + 1).toByte()) // will be resolved to Int in 1.9\n }\n\nInspection is available for Kotlin language level starting from 1.7." + "description": "Reports non-`static` initializers in classes.\n\nSome coding standards prohibit instance initializers and recommend using constructors or field initializers for initialization.\nAlso, deleting the `static` keyword may accidentally create non-`static` initializers and result in obscure bugs.\n\nThis inspection doesn't report instance initializers in anonymous classes.\n\n\nUse the **Only warn when the class has one or more constructors** option to ignore instance initializers in classes that don't have any constructors." }, { - "shortName": "WarningOnMainUnusedParameterMigration", - "displayName": "Unused 'args' on 'main' since 1.4", + "shortName": "UtilityClassWithPublicConstructor", + "displayName": "Utility class with 'public' constructor", "enabled": false, - "description": "Reports `main` function with an unused single parameter.\n\nSince Kotlin 1.4, it is possible to use the `main` function without parameter as the entry point to the Kotlin program.\nThe compiler reports a warning for the `main` function with an unused parameter." + "description": "Reports 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" }, { - "shortName": "RedundantLabelMigration", - "displayName": "Redundant label", + "shortName": "ListenerMayUseAdapter", + "displayName": "Class may extend adapter instead of implementing listener", "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." + "description": "Reports classes implementing listeners instead of extending corresponding adapters.\n\nA quick-fix is available to\nremove any redundant empty methods left after replacing a listener implementation with an adapter extension.\n\n\nUse the **Only warn when empty implementing methods are found** option to configure the inspection to warn even if no empty methods are found." }, { - "shortName": "NoConstructorMigration", - "displayName": "Forbidden constructor call", + "shortName": "MarkerInterface", + "displayName": "Marker interface", "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 marker interfaces without any methods or fields.\n\nSuch interfaces may be confusing and typically indicate a design failure.\n\nThe inspection ignores interfaces that extend two or more interfaces and interfaces\nthat specify the generic type of their superinterface." }, { - "shortName": "ProhibitTypeParametersForLocalVariablesMigration", - "displayName": "Local variable with type parameters", + "shortName": "InnerClassOnInterface", + "displayName": "Inner class of interface", "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 inner classes in `interface` classes.\n\nSome coding standards\ndiscourage the use of such classes. The inspection doesn't report enum classes and annotation interfaces.\n\n\nUse the **Ignore inner interfaces of interfaces** option to ignore inner interfaces. For example:\n\n\n interface I {\n interface Inner {\n }\n }\n" }, { - "shortName": "InlineClassDeprecatedMigration", - "displayName": "Inline classes are deprecated since 1.5", + "shortName": "UtilityClass", + "displayName": "Utility class", "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 utility classes.\n\nUtility classes have all fields and methods declared as `static` and their\npresence may indicate a lack of object-oriented design.\n\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection ignores classes annotated with one of\nthese annotations." }, { - "shortName": "ProhibitJvmOverloadsOnConstructorsOfAnnotationClassesMigration", - "displayName": "'@JvmOverloads' annotation cannot be used on constructors of annotation classes since 1.4", + "shortName": "ClassNameDiffersFromFileName", + "displayName": "Class name differs from file name", "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": "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." + "description": "Reports top-level class names that don't match the name of a file containing them.\n\nWhile the Java specification allows for naming non-`public` classes this way,\nfiles with unmatched names may be confusing and decrease usefulness of various software tools." }, { - "shortName": "OverrideDeprecatedMigration", - "displayName": "Do not propagate method deprecation through overrides since 1.9", + "shortName": "AnonymousInnerClass", + "displayName": "Anonymous class can be replaced with inner class", "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 anonymous classes.\n\nOccasionally replacing anonymous classes with inner classes can lead to more readable and maintainable code.\nSome code standards discourage anonymous classes.\n\n**Example:**\n\n\n class Example {\n public static void main(String[] args) {\n new Thread() {\n public void run() {\n work()\n }\n\n private void work() {}\n }.start();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n public static void main(String[] args) {\n new MyThread().start();\n }\n\n private static class MyThread extends Thread {\n public void run() {\n work();\n }\n\n private void work() {}\n }\n }\n" }, { - "shortName": "ObsoleteExperimentalCoroutines", - "displayName": "Experimental coroutines usages are deprecated since 1.3", + "shortName": "MultipleTopLevelClassesInFile", + "displayName": "Multiple top level classes in single file", "enabled": false, - "description": "Reports code that uses experimental coroutines.\n\nSuch usages are incompatible with Kotlin 1.3+ and should be updated." + "description": "Reports multiple top-level classes in a single Java file.\n\nPutting multiple\ntop-level classes in one file may be confusing and degrade the usefulness of various\nsoftware tools." }, { - "shortName": "FromClosedRangeMigration", - "displayName": "MIN_VALUE step in fromClosedRange() since 1.3", + "shortName": "LimitedScopeInnerClass", + "displayName": "Local class", "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 local classes.\n\nA local class is a named nested class declared inside a code block.\nLocal classes are uncommon and may therefore be confusing.\nIn addition, some code standards discourage the use of local classes.\n\n**Example:**\n\n\n class Example {\n void test() {\n class Local { // here\n }\n new Local();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n void test() {\n new Local();\n }\n\n private static class Local { // here\n }\n }\n" }, { - "shortName": "DeclaringClassMigration", - "displayName": "Deprecated 'Enum.declaringClass' property", + "shortName": "ClassMayBeInterface", + "displayName": "Abstract 'class' may be 'interface'", "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 `abstract` classes that can be converted to interfaces.\n\nUsing interfaces instead of classes is preferable as Java doesn't support multiple class inheritance,\nwhile a class can implement multiple interfaces.\n\nA class may be converted to an interface if it has no superclasses (other\nthan Object), has only `public static final` fields,\n`public abstract` methods, and `public` inner classes.\n\n\nExample:\n\n\n abstract class Example {\n public static final int MY_CONST = 42;\n public abstract void foo();\n }\n\n class Inheritor extends Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n interface Example {\n int MY_CONST = 42;\n void foo();\n }\n\n class Inheritor implements Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Report classes containing non-abstract methods when using Java 8** option to report only the classes with `static` methods and non-abstract methods that can be converted to\n`default` methods (only applicable to language level of 8 or higher)." }, { - "shortName": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", - "displayName": "Meaningless annotations targets on superclass", + "shortName": "InterfaceMayBeAnnotatedFunctional", + "displayName": "Interface may be annotated as '@FunctionalInterface'", "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." - }, - { - "shortName": "ObsoleteKotlinJsPackages", - "displayName": "'kotlin.browser' and 'kotlin.dom' packages are deprecated since 1.4", - "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+." - }, - { - "shortName": "RestrictReturnStatementTargetMigration", - "displayName": "Target label does not denote a function since 1.4", - "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." - }, - { - "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." - } - ] - }, - { - "name": "Class structure", - "inspections": [ - { - "shortName": "ClassWithOnlyPrivateConstructors", - "displayName": "Class with only 'private' constructors should be declared 'final'", - "enabled": false, - "description": "Reports classes with only `private` constructors.\n\nA class that only has `private` constructors cannot be extended outside a file and should be declared as `final`." - }, - { - "shortName": "FinalMethod", - "displayName": "Method can't be overridden", - "enabled": false, - "description": "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." - }, - { - "shortName": "StaticNonFinalField", - "displayName": "'static', non-'final' field", - "enabled": false, - "description": "Reports non-`final` `static` fields.\n\nA quick-fix is available to add the `final` modifier to a non-`final` `static` field.\n\nThis inspection doesn't check fields' mutability. For example, adding the `final` modifier to a field that has a value\nbeing set somewhere will cause a compilation error.\n\n\nUse the **Only report 'public' fields** option so that the inspection reported only `public` fields." - }, - { - "shortName": "ClassInitializer", - "displayName": "Non-'static' initializer", - "enabled": false, - "description": "Reports non-`static` initializers in classes.\n\nSome coding standards prohibit instance initializers and recommend using constructors or field initializers for initialization.\nAlso, deleting the `static` keyword may accidentally create non-`static` initializers and result in obscure bugs.\n\nThis inspection doesn't report instance initializers in anonymous classes.\n\n\nUse the **Only warn when the class has one or more constructors** option to ignore instance initializers in classes that don't have any constructors." - }, - { - "shortName": "UtilityClassWithPublicConstructor", - "displayName": "Utility class with 'public' constructor", - "enabled": false, - "description": "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" - }, - { - "shortName": "ListenerMayUseAdapter", - "displayName": "Class may extend adapter instead of implementing listener", - "enabled": false, - "description": "Reports classes implementing listeners instead of extending corresponding adapters.\n\nA quick-fix is available to\nremove any redundant empty methods left after replacing a listener implementation with an adapter extension.\n\n\nUse the **Only warn when empty implementing methods are found** option to configure the inspection to warn even if no empty methods are found." - }, - { - "shortName": "MarkerInterface", - "displayName": "Marker interface", - "enabled": false, - "description": "Reports marker interfaces without any methods or fields.\n\nSuch interfaces may be confusing and typically indicate a design failure.\n\nThe inspection ignores interfaces that extend two or more interfaces and interfaces\nthat specify the generic type of their superinterface." - }, - { - "shortName": "InnerClassOnInterface", - "displayName": "Inner class of interface", - "enabled": false, - "description": "Reports inner classes in `interface` classes.\n\nSome coding standards\ndiscourage the use of such classes. The inspection doesn't report enum classes and annotation interfaces.\n\n\nUse the **Ignore inner interfaces of interfaces** option to ignore inner interfaces. For example:\n\n\n interface I {\n interface Inner {\n }\n }\n" - }, - { - "shortName": "UtilityClass", - "displayName": "Utility class", - "enabled": false, - "description": "Reports utility classes.\n\nUtility classes have all fields and methods declared as `static` and their\npresence may indicate a lack of object-oriented design.\n\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection ignores classes annotated with one of\nthese annotations." - }, - { - "shortName": "ClassNameDiffersFromFileName", - "displayName": "Class name differs from file name", - "enabled": false, - "description": "Reports top-level class names that don't match the name of a file containing them.\n\nWhile the Java specification allows for naming non-`public` classes this way,\nfiles with unmatched names may be confusing and decrease usefulness of various software tools." - }, - { - "shortName": "AnonymousInnerClass", - "displayName": "Anonymous class can be replaced with inner class", - "enabled": false, - "description": "Reports anonymous classes.\n\nOccasionally replacing anonymous classes with inner classes can lead to more readable and maintainable code.\nSome code standards discourage anonymous classes.\n\n**Example:**\n\n\n class Example {\n public static void main(String[] args) {\n new Thread() {\n public void run() {\n work()\n }\n\n private void work() {}\n }.start();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n public static void main(String[] args) {\n new MyThread().start();\n }\n\n private static class MyThread extends Thread {\n public void run() {\n work();\n }\n\n private void work() {}\n }\n }\n" - }, - { - "shortName": "MultipleTopLevelClassesInFile", - "displayName": "Multiple top level classes in single file", - "enabled": false, - "description": "Reports multiple top-level classes in a single Java file.\n\nPutting multiple\ntop-level classes in one file may be confusing and degrade the usefulness of various\nsoftware tools." - }, - { - "shortName": "LimitedScopeInnerClass", - "displayName": "Local class", - "enabled": false, - "description": "Reports local classes.\n\nA local class is a named nested class declared inside a code block.\nLocal classes are uncommon and may therefore be confusing.\nIn addition, some code standards discourage the use of local classes.\n\n**Example:**\n\n\n class Example {\n void test() {\n class Local { // here\n }\n new Local();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n void test() {\n new Local();\n }\n\n private static class Local { // here\n }\n }\n" - }, - { - "shortName": "ClassMayBeInterface", - "displayName": "Abstract 'class' may be 'interface'", - "enabled": false, - "description": "Reports `abstract` classes that can be converted to interfaces.\n\nUsing interfaces instead of classes is preferable as Java doesn't support multiple class inheritance,\nwhile a class can implement multiple interfaces.\n\nA class may be converted to an interface if it has no superclasses (other\nthan Object), has only `public static final` fields,\n`public abstract` methods, and `public` inner classes.\n\n\nExample:\n\n\n abstract class Example {\n public static final int MY_CONST = 42;\n public abstract void foo();\n }\n\n class Inheritor extends Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n interface Example {\n int MY_CONST = 42;\n void foo();\n }\n\n class Inheritor implements Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Report classes containing non-abstract methods when using Java 8** option to report only the classes with `static` methods and non-abstract methods that can be converted to\n`default` methods (only applicable to language level of 8 or higher)." - }, - { - "shortName": "InterfaceMayBeAnnotatedFunctional", - "displayName": "Interface may be annotated as '@FunctionalInterface'", - "enabled": false, - "description": "Reports interfaces that can be annotated with `@FunctionalInterface` (available since JDK 1.8).\n\nAnnotating an interface with `@FunctionalInterface` indicates that the interface\nis functional and no more `abstract` methods can be added to it.\n\n**Example:**\n\n\n interface FileProcessor {\n void execute(File file);\n }\n\nAfter the quick-fix is applied:\n\n\n @FunctionalInterface\n interface FileProcessor {\n void execute(File file);\n }\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8." + "description": "Reports interfaces that can be annotated with `@FunctionalInterface` (available since JDK 1.8).\n\nAnnotating an interface with `@FunctionalInterface` indicates that the interface\nis functional and no more `abstract` methods can be added to it.\n\n**Example:**\n\n\n interface FileProcessor {\n void execute(File file);\n }\n\nAfter the quick-fix is applied:\n\n\n @FunctionalInterface\n interface FileProcessor {\n void execute(File file);\n }\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8." }, { "shortName": "FinalStaticMethod", @@ -3616,18 +3616,18 @@ "enabled": true, "description": "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." }, - { - "shortName": "NonFinalUtilityClass", - "displayName": "Utility class is not 'final'", - "enabled": false, - "description": "Reports utility classes that aren't `final` or `abstract`.\n\nUtility classes have all fields and methods declared as `static`.\nMaking them `final` prevents them from being accidentally subclassed.\n\n**Example:**\n\n\n public class UtilityClass {\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n public static void foo() {}\n }\n" - }, { "shortName": "Singleton", "displayName": "Singleton", "enabled": false, "description": "Reports singleton classes.\n\nSingleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing,\nand their presence may indicate a lack of object-oriented design.\n\n**Example:**\n\n\n class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }\n" }, + { + "shortName": "NonFinalUtilityClass", + "displayName": "Utility class is not 'final'", + "enabled": false, + "description": "Reports utility classes that aren't `final` or `abstract`.\n\nUtility classes have all fields and methods declared as `static`.\nMaking them `final` prevents them from being accidentally subclassed.\n\n**Example:**\n\n\n public class UtilityClass {\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n public static void foo() {}\n }\n" + }, { "shortName": "ParameterCanBeLocal", "displayName": "Value passed as parameter never read", @@ -4387,6 +4387,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": "Control flow issues", "inspections": [ @@ -4396,18 +4569,18 @@ "enabled": false, "description": "Reports equality expressions which are negated by a prefix expression.\n\nSuch expressions can be simplified using the `!=` operator.\n\nExample:\n\n\n !(i == 1)\n\nAfter the quick-fix is applied:\n\n\n i != 1\n" }, - { - "shortName": "DoubleNegation", - "displayName": "Double negation", - "enabled": true, - "description": "Reports double negations that can be simplified.\n\nExample:\n\n\n if (!!functionCall()) {}\n\nAfter the quick-fix is applied:\n\n\n if (functionCall()) {}\n\nExample:\n\n\n if (!(a != b)) {}\n\nAfter the quick-fix is applied:\n\n\n if (a == b) {}\n" - }, { "shortName": "AssertionCanBeIf", "displayName": "Assertion can be replaced with 'if' statement", "enabled": false, "description": "Reports `assert` statements and suggests replacing them with `if` statements that throw `java.lang.AssertionError`.\n\nExample:\n\n\n assert param != null;\n\nAfter the quick-fix is applied:\n\n\n if (param == null) throw new AssertionError();\n\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": "BreakStatement", "displayName": "'break' statement", @@ -4800,179 +4973,6 @@ } ] }, - { - "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": [ diff --git a/results/metaInformation.json b/results/metaInformation.json index 1653543..ff54292 100644 --- a/results/metaInformation.json +++ b/results/metaInformation.json @@ -8,12 +8,12 @@ "vcs": { "sarifIdea": { "repositoryUri": "https://github.com/cvette/intellij-neos.git", - "revisionId": "873aafcfd947b79b9a9d113402f285a0c5b7d5b5", - "branch": "dependabot/gradle/org.jetbrains.kotlinx.kover-0.8.3" + "revisionId": "834cf38886d64323fe645e93c089818e8d366fbb", + "branch": "dependabot/gradle/io.sentry-sentry-7.12.1" } }, "repoUrl": "https://github.com/cvette/intellij-neos.git", "deviceId": "200820300000000-beff-b97d-1142-74f9c0f3468c", - "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/10015268241" + "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/10102494817" } } \ No newline at end of file diff --git a/results/projectStructure/Code_Inspection.json b/results/projectStructure/Code_Inspection.json index adc4bf9..1a80eb4 100644 --- a/results/projectStructure/Code_Inspection.json +++ b/results/projectStructure/Code_Inspection.json @@ -77,7 +77,7 @@ "type": "Library" }, { - "name": "Gradle: io.sentry:sentry:7.10.0", + "name": "Gradle: io.sentry:sentry:7.12.1", "type": "Library" }, { @@ -180,7 +180,7 @@ "type": "Module" }, { - "name": "Gradle: io.sentry:sentry:7.10.0", + "name": "Gradle: io.sentry:sentry:7.12.1", "type": "Library" }, { diff --git a/results/projectStructure/Gradle.json b/results/projectStructure/Gradle.json index 7bce863..bde29b2 100644 --- a/results/projectStructure/Gradle.json +++ b/results/projectStructure/Gradle.json @@ -18,12 +18,12 @@ "version": "1.9.0" }, { - "ideaName": "Gradle: io.sentry:sentry:7.10.0", - "gradleName": "io.sentry:sentry:7.10.0", + "ideaName": "Gradle: io.sentry:sentry:7.12.1", + "gradleName": "io.sentry:sentry:7.12.1", "unresolved": false, "groupId": "io.sentry", "artifactId": "sentry", - "version": "7.10.0" + "version": "7.12.1" }, { "ideaName": "Gradle: org.apache.commons:commons-text:1.12.0", diff --git a/results/projectStructure/Libraries.json b/results/projectStructure/Libraries.json index 3bb2bfd..b4e439a 100644 --- a/results/projectStructure/Libraries.json +++ b/results/projectStructure/Libraries.json @@ -15,9 +15,9 @@ "properties": {} }, { - "name": "Gradle: io.sentry:sentry:7.10.0", + "name": "Gradle: io.sentry:sentry:7.12.1", "roots": [ - "jar://$PROJECT_DIR$/../cache/gradle/caches/modules-2/files-2.1/io.sentry/sentry/7.10.0/84d4c9715bb03e8625ec49135f2bfdf1296bdbc6/sentry-7.10.0.jar!/" + "jar://$PROJECT_DIR$/../cache/gradle/caches/modules-2/files-2.1/io.sentry/sentry/7.12.1/1ad00aa16607ca31e45b636ef22f61bff0385a4e/sentry-7.12.1.jar!/" ], "properties": {} }, diff --git a/results/qodana.sarif.json b/results/qodana.sarif.json index 97d3a45..dab7fd1 100644 --- a/results/qodana.sarif.json +++ b/results/qodana.sarif.json @@ -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": 2, "toolComponent": { "name": "QDJVMC" } @@ -171,13 +171,13 @@ ] }, { - "id": "Kotlin/Migration", - "name": "Migration", + "id": "Java/Probable bugs", + "name": "Probable bugs", "relationships": [ { "target": { - "id": "Kotlin", - "index": 2, + "id": "Java", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -305,8 +305,8 @@ ] }, { - "id": "Java/Control flow issues", - "name": "Control flow issues", + "id": "Java/Numeric issues", + "name": "Numeric issues", "relationships": [ { "target": { @@ -323,8 +323,8 @@ ] }, { - "id": "Java/Numeric issues", - "name": "Numeric issues", + "id": "Java/Control flow issues", + "name": "Control flow issues", "relationships": [ { "target": { @@ -1367,7 +1367,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "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" } @@ -2437,7 +2437,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -2473,7 +2473,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -2620,27 +2620,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": 21, "toolComponent": { "name": "QDJVMC" @@ -2653,27 +2653,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": 22, "toolComponent": { "name": "QDJVMC" @@ -2711,7 +2711,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -2846,7 +2846,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -2858,28 +2858,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": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -2891,28 +2891,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": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -3077,7 +3077,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -3209,7 +3209,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -3242,7 +3242,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -3349,7 +3349,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -3361,19 +3361,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" } @@ -3382,7 +3382,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -3394,19 +3394,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" } @@ -3415,7 +3415,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -3551,7 +3551,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -3683,7 +3683,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -4277,7 +4277,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -4310,7 +4310,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -4412,7 +4412,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -4515,7 +4515,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -4647,7 +4647,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -4746,7 +4746,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -4857,19 +4857,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" } @@ -4877,8 +4877,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 21, + "id": "Java/Class structure", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -4890,19 +4890,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" } @@ -4910,8 +4910,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 13, + "id": "Java/Control flow issues", + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -4944,7 +4944,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -5043,7 +5043,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -5076,7 +5076,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -5241,7 +5241,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -5509,7 +5509,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -5554,19 +5554,19 @@ ] }, { - "id": "SystemGetProperty", + "id": "CollectionsMustHaveInitialCapacity", "shortDescription": { - "text": "Call to 'System.getProperty(str)' could be simplified" + "text": "Collection without initial capacity" }, "fullDescription": { - "text": "Reports the usage of method 'System.getProperty(str)' and suggests a fix in 2 cases: 'System.getProperty(\"path.separator\")' -> 'File.pathSeparator' 'System.getProperty(\"line.separator\")' -> 'System.lineSeparator()' The second one is not only less error-prone but is likely to be faster, as 'System.lineSeparator()' returns cached value, while 'System.getProperty(\"line.separator\")' each time calls to Properties (Hashtable or CHM depending on implementation).", - "markdown": "Reports the usage of method `System.getProperty(str)` and suggests a fix in 2 cases:\n\n* `System.getProperty(\"path.separator\")` -\\> `File.pathSeparator`\n* `System.getProperty(\"line.separator\")` -\\> `System.lineSeparator()`\n\nThe second one is not only less error-prone but is likely to be faster, as `System.lineSeparator()` returns cached value, while `System.getProperty(\"line.separator\")` each time calls to Properties (Hashtable or CHM depending on implementation)." + "text": "Reports attempts to instantiate a new 'Collection' object without specifying an initial capacity. If no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing to specify initial capacities for collections may result in performance issues if space needs to be reallocated and memory copied when the initial capacity is exceeded. This inspection checks allocations of classes listed in the inspection's settings. Example: 'new HashMap();' Use the following options to configure the inspection: List collection classes that should be checked. Whether to ignore field initializers.", + "markdown": "Reports attempts to instantiate a new `Collection` object without specifying an initial capacity.\n\n\nIf no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing\nto specify initial capacities for collections may result in performance issues if space needs to be reallocated and\nmemory copied when the initial capacity is exceeded.\nThis inspection checks allocations of classes listed in the inspection's settings.\n\n**Example:**\n\n\n new HashMap();\n\nUse the following options to configure the inspection:\n\n* List collection classes that should be checked.\n* Whether to ignore field initializers." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SystemGetProperty", + "suppressToolId": "CollectionWithoutInitialCapacity", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -5574,8 +5574,8 @@ "relationships": [ { "target": { - "id": "JVM languages", - "index": 1, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -5587,19 +5587,19 @@ ] }, { - "id": "CollectionsMustHaveInitialCapacity", + "id": "SystemGetProperty", "shortDescription": { - "text": "Collection without initial capacity" + "text": "Call to 'System.getProperty(str)' could be simplified" }, "fullDescription": { - "text": "Reports attempts to instantiate a new 'Collection' object without specifying an initial capacity. If no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing to specify initial capacities for collections may result in performance issues if space needs to be reallocated and memory copied when the initial capacity is exceeded. This inspection checks allocations of classes listed in the inspection's settings. Example: 'new HashMap();' Use the following options to configure the inspection: List collection classes that should be checked. Whether to ignore field initializers.", - "markdown": "Reports attempts to instantiate a new `Collection` object without specifying an initial capacity.\n\n\nIf no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing\nto specify initial capacities for collections may result in performance issues if space needs to be reallocated and\nmemory copied when the initial capacity is exceeded.\nThis inspection checks allocations of classes listed in the inspection's settings.\n\n**Example:**\n\n\n new HashMap();\n\nUse the following options to configure the inspection:\n\n* List collection classes that should be checked.\n* Whether to ignore field initializers." + "text": "Reports the usage of method 'System.getProperty(str)' and suggests a fix in 2 cases: 'System.getProperty(\"path.separator\")' -> 'File.pathSeparator' 'System.getProperty(\"line.separator\")' -> 'System.lineSeparator()' The second one is not only less error-prone but is likely to be faster, as 'System.lineSeparator()' returns cached value, while 'System.getProperty(\"line.separator\")' each time calls to Properties (Hashtable or CHM depending on implementation).", + "markdown": "Reports the usage of method `System.getProperty(str)` and suggests a fix in 2 cases:\n\n* `System.getProperty(\"path.separator\")` -\\> `File.pathSeparator`\n* `System.getProperty(\"line.separator\")` -\\> `System.lineSeparator()`\n\nThe second one is not only less error-prone but is likely to be faster, as `System.lineSeparator()` returns cached value, while `System.getProperty(\"line.separator\")` each time calls to Properties (Hashtable or CHM depending on implementation)." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "CollectionWithoutInitialCapacity", + "suppressToolId": "SystemGetProperty", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -5607,8 +5607,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "JVM languages", + "index": 1, "toolComponent": { "name": "QDJVMC" } @@ -5686,19 +5686,19 @@ ] }, { - "id": "CloneableImplementsClone", + "id": "TypeMayBeWeakened", "shortDescription": { - "text": "Cloneable class without 'clone()' method" + "text": "Type may be weakened" }, "fullDescription": { - "text": "Reports classes implementing the 'Cloneable' interface that don't override the 'clone()' method. Such classes use the default implementation of 'clone()', which isn't 'public' but 'protected', and which does not copy the mutable state of the class. A quick-fix is available to generate a basic 'clone()' method, which can be used as a basis for a properly functioning 'clone()' method expected from a 'Cloneable' class. Example: 'public class Data implements Cloneable {\n private String[] names;\n }' After the quick-fix is applied: 'public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' Use the Ignore classes cloneable due to inheritance option to ignore classes that are 'Cloneable' because they inherit from the 'Cloneable' class. Use the Ignore when Cloneable is necessary to call clone() method of super class option to ignore classes that require implementing 'Cloneable' because they call the 'clone()' method from a superclass.", - "markdown": "Reports classes implementing the `Cloneable` interface that don't override the `clone()` method.\n\nSuch classes use the default implementation of `clone()`,\nwhich isn't `public` but `protected`, and which does not copy the mutable state of the class.\n\nA quick-fix is available to generate a basic `clone()` method,\nwhich can be used as a basis for a properly functioning `clone()` method\nexpected from a `Cloneable` class.\n\n**Example:**\n\n\n public class Data implements Cloneable {\n private String[] names;\n }\n\nAfter the quick-fix is applied:\n\n\n public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nUse the **Ignore classes cloneable due to inheritance** option to ignore classes that are\n`Cloneable` because they inherit from the `Cloneable` class.\n\nUse the **Ignore when Cloneable is necessary to call clone() method of super class**\noption to ignore classes that require implementing `Cloneable` because they call the `clone()` method from a superclass." + "text": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable. Example: '// Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }' Enable the Only weaken to an interface checkbox below to only report a problem when the type can be weakened to an interface type. Enable the Do not suggest weakening variable declared as 'var' checkbox below to prevent reporting on local variables declared using the 'var' keyword (Java 10+) Stop classes are intended to prevent weakening to classes lower than stop classes, even if it is possible. In some cases, this may improve readability.", + "markdown": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable.\n\nExample:\n\n\n // Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }\n\n\nEnable the **Only weaken to an interface** checkbox below\nto only report a problem when the type can be weakened to an interface type.\n\n\nEnable the **Do not suggest weakening variable declared as 'var'** checkbox below\nto prevent reporting on local variables declared using the 'var' keyword (Java 10+)\n\n\n**Stop classes** are intended to prevent weakening to classes\nlower than stop classes, even if it is possible.\nIn some cases, this may improve readability." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CloneableClassWithoutClone", + "suppressToolId": "TypeMayBeWeakened", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -5706,8 +5706,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 73, + "id": "Java/Abstraction issues", + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -5719,19 +5719,19 @@ ] }, { - "id": "TypeMayBeWeakened", + "id": "CloneableImplementsClone", "shortDescription": { - "text": "Type may be weakened" + "text": "Cloneable class without 'clone()' method" }, "fullDescription": { - "text": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable. Example: '// Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }' Enable the Only weaken to an interface checkbox below to only report a problem when the type can be weakened to an interface type. Enable the Do not suggest weakening variable declared as 'var' checkbox below to prevent reporting on local variables declared using the 'var' keyword (Java 10+) Stop classes are intended to prevent weakening to classes lower than stop classes, even if it is possible. In some cases, this may improve readability.", - "markdown": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable.\n\nExample:\n\n\n // Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }\n\n\nEnable the **Only weaken to an interface** checkbox below\nto only report a problem when the type can be weakened to an interface type.\n\n\nEnable the **Do not suggest weakening variable declared as 'var'** checkbox below\nto prevent reporting on local variables declared using the 'var' keyword (Java 10+)\n\n\n**Stop classes** are intended to prevent weakening to classes\nlower than stop classes, even if it is possible.\nIn some cases, this may improve readability." + "text": "Reports classes implementing the 'Cloneable' interface that don't override the 'clone()' method. Such classes use the default implementation of 'clone()', which isn't 'public' but 'protected', and which does not copy the mutable state of the class. A quick-fix is available to generate a basic 'clone()' method, which can be used as a basis for a properly functioning 'clone()' method expected from a 'Cloneable' class. Example: 'public class Data implements Cloneable {\n private String[] names;\n }' After the quick-fix is applied: 'public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' Use the Ignore classes cloneable due to inheritance option to ignore classes that are 'Cloneable' because they inherit from the 'Cloneable' class. Use the Ignore when Cloneable is necessary to call clone() method of super class option to ignore classes that require implementing 'Cloneable' because they call the 'clone()' method from a superclass.", + "markdown": "Reports classes implementing the `Cloneable` interface that don't override the `clone()` method.\n\nSuch classes use the default implementation of `clone()`,\nwhich isn't `public` but `protected`, and which does not copy the mutable state of the class.\n\nA quick-fix is available to generate a basic `clone()` method,\nwhich can be used as a basis for a properly functioning `clone()` method\nexpected from a `Cloneable` class.\n\n**Example:**\n\n\n public class Data implements Cloneable {\n private String[] names;\n }\n\nAfter the quick-fix is applied:\n\n\n public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nUse the **Ignore classes cloneable due to inheritance** option to ignore classes that are\n`Cloneable` because they inherit from the `Cloneable` class.\n\nUse the **Ignore when Cloneable is necessary to call clone() method of super class**\noption to ignore classes that require implementing `Cloneable` because they call the `clone()` method from a superclass." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "TypeMayBeWeakened", + "suppressToolId": "CloneableClassWithoutClone", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -5739,8 +5739,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 53, + "id": "Java/Cloning issues", + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -5773,7 +5773,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -5971,7 +5971,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -6037,7 +6037,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -6169,7 +6169,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -6272,7 +6272,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -6374,7 +6374,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -6782,19 +6782,19 @@ ] }, { - "id": "NonFinalClone", + "id": "ChainedEquality", "shortDescription": { - "text": "Non-final 'clone()' in secure context" + "text": "Chained equality comparisons" }, "fullDescription": { - "text": "Reports 'clone()' methods without the 'final' modifier. Since 'clone()' can be used to instantiate objects without using a constructor, allowing the 'clone()' method to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the 'clone()' method or the enclosing class itself 'final'. Example: 'class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }'", - "markdown": "Reports `clone()` methods without the `final` modifier.\n\n\nSince `clone()` can be used to instantiate objects without using a constructor, allowing the `clone()`\nmethod to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the\n`clone()` method or the enclosing class itself `final`.\n\n**Example:**\n\n\n class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }\n" + "text": "Reports chained equality comparisons. Such comparisons may be confusing: 'a == b == c' means '(a == b) == c', but possibly 'a == b && a == c' is intended. Example: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }' You can use parentheses to make the comparison less confusing: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }'", + "markdown": "Reports chained equality comparisons.\n\nSuch comparisons may be confusing: `a == b == c` means `(a == b) == c`,\nbut possibly `a == b && a == c` is intended.\n\n**Example:**\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }\n\nYou can use parentheses to make the comparison less confusing:\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalClone", + "suppressToolId": "ChainedEqualityComparisons", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -6802,8 +6802,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 25, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -6815,19 +6815,19 @@ ] }, { - "id": "ChainedEquality", + "id": "NonFinalClone", "shortDescription": { - "text": "Chained equality comparisons" + "text": "Non-final 'clone()' in secure context" }, "fullDescription": { - "text": "Reports chained equality comparisons. Such comparisons may be confusing: 'a == b == c' means '(a == b) == c', but possibly 'a == b && a == c' is intended. Example: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }' You can use parentheses to make the comparison less confusing: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }'", - "markdown": "Reports chained equality comparisons.\n\nSuch comparisons may be confusing: `a == b == c` means `(a == b) == c`,\nbut possibly `a == b && a == c` is intended.\n\n**Example:**\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }\n\nYou can use parentheses to make the comparison less confusing:\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }\n" + "text": "Reports 'clone()' methods without the 'final' modifier. Since 'clone()' can be used to instantiate objects without using a constructor, allowing the 'clone()' method to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the 'clone()' method or the enclosing class itself 'final'. Example: 'class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }'", + "markdown": "Reports `clone()` methods without the `final` modifier.\n\n\nSince `clone()` can be used to instantiate objects without using a constructor, allowing the `clone()`\nmethod to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the\n`clone()` method or the enclosing class itself `final`.\n\n**Example:**\n\n\n class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ChainedEqualityComparisons", + "suppressToolId": "NonFinalClone", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -6835,8 +6835,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Security", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -6869,7 +6869,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -7067,7 +7067,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -7430,7 +7430,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -7640,19 +7640,19 @@ ] }, { - "id": "UnnecessaryThis", + "id": "ClassWithTooManyTransitiveDependencies", "shortDescription": { - "text": "Unnecessary 'this' qualifier" + "text": "Class with too many transitive dependencies" }, "fullDescription": { - "text": "Reports unnecessary 'this' qualifier. Using 'this' to disambiguate a code reference is discouraged by many coding styles and may easily become unnecessary via automatic refactorings. Example: 'class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }' After the quick-fix is applied: 'class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }' Use the inspection settings to ignore assignments to fields. For instance, 'this.x = 2;' won't be reported, but 'int y = this.x;' will be.", - "markdown": "Reports unnecessary `this` qualifier.\n\n\nUsing `this` to disambiguate a code reference is discouraged by many coding styles\nand may easily become unnecessary\nvia automatic refactorings.\n\n**Example:**\n\n\n class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }\n\n\nUse the inspection settings to ignore assignments to fields.\nFor instance, `this.x = 2;` won't be reported, but `int y = this.x;` will be." + "text": "Reports classes that are directly or indirectly dependent on too many other classes. Modifications to any dependency of such a class may require changing the class thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of transitive dependencies field to specify the maximum allowed number of direct or indirect dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that are directly or indirectly dependent on too many other classes.\n\nModifications to any dependency of such a class may require changing the class thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of transitive dependencies** field to specify the maximum allowed number of direct or indirect dependencies\nfor a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryThis", + "suppressToolId": "ClassWithTooManyTransitiveDependencies", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -7660,8 +7660,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Dependency issues", + "index": 93, "toolComponent": { "name": "QDJVMC" } @@ -7673,19 +7673,19 @@ ] }, { - "id": "ClassWithTooManyTransitiveDependencies", + "id": "UnnecessaryThis", "shortDescription": { - "text": "Class with too many transitive dependencies" + "text": "Unnecessary 'this' qualifier" }, "fullDescription": { - "text": "Reports classes that are directly or indirectly dependent on too many other classes. Modifications to any dependency of such a class may require changing the class thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of transitive dependencies field to specify the maximum allowed number of direct or indirect dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports classes that are directly or indirectly dependent on too many other classes.\n\nModifications to any dependency of such a class may require changing the class thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of transitive dependencies** field to specify the maximum allowed number of direct or indirect dependencies\nfor a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports unnecessary 'this' qualifier. Using 'this' to disambiguate a code reference is discouraged by many coding styles and may easily become unnecessary via automatic refactorings. Example: 'class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }' After the quick-fix is applied: 'class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }' Use the inspection settings to ignore assignments to fields. For instance, 'this.x = 2;' won't be reported, but 'int y = this.x;' will be.", + "markdown": "Reports unnecessary `this` qualifier.\n\n\nUsing `this` to disambiguate a code reference is discouraged by many coding styles\nand may easily become unnecessary\nvia automatic refactorings.\n\n**Example:**\n\n\n class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }\n\n\nUse the inspection settings to ignore assignments to fields.\nFor instance, `this.x = 2;` won't be reported, but `int y = this.x;` will be." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassWithTooManyTransitiveDependencies", + "suppressToolId": "UnnecessaryThis", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -7693,8 +7693,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 93, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -7727,7 +7727,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -8036,19 +8036,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" } @@ -8056,8 +8056,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 97, + "id": "Java/Class structure", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -8069,19 +8069,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" } @@ -8089,8 +8089,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 13, + "id": "Java/Inheritance issues", + "index": 97, "toolComponent": { "name": "QDJVMC" } @@ -8123,7 +8123,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -8135,19 +8135,19 @@ ] }, { - "id": "InstanceGuardedByStatic", + "id": "BooleanMethodIsAlwaysInverted", "shortDescription": { - "text": "Instance member guarded by static field" + "text": "Boolean method is always inverted" }, "fullDescription": { - "text": "Reports '@GuardedBy' annotations on instance fields or methods in which the guard is a 'static' field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance. Example: 'private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", - "markdown": "Reports `@GuardedBy` annotations on instance fields or methods in which the guard is a `static` field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance.\n\nExample:\n\n\n private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" + "text": "Reports methods with a 'boolean' return type that are always negated when called. A quick-fix is provided to invert and optionally rename the method. For performance reasons, not all problematic methods may be highlighted in the editor. Example: 'class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }' After the quick-fix is applied: 'class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }'", + "markdown": "Reports methods with a `boolean` return type that are always negated when called.\n\nA quick-fix is provided to invert and optionally rename the method.\nFor performance reasons, not all problematic methods may be highlighted in the editor.\n\nExample:\n\n\n class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }\n\nAfter the quick-fix is applied:\n\n\n class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InstanceGuardedByStatic", + "suppressToolId": "BooleanMethodIsAlwaysInverted", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -8155,8 +8155,8 @@ "relationships": [ { "target": { - "id": "Java/Concurrency annotation issues", - "index": 64, + "id": "Java/Data flow", + "index": 41, "toolComponent": { "name": "QDJVMC" } @@ -8168,19 +8168,19 @@ ] }, { - "id": "BooleanMethodIsAlwaysInverted", + "id": "InstanceGuardedByStatic", "shortDescription": { - "text": "Boolean method is always inverted" + "text": "Instance member guarded by static field" }, "fullDescription": { - "text": "Reports methods with a 'boolean' return type that are always negated when called. A quick-fix is provided to invert and optionally rename the method. For performance reasons, not all problematic methods may be highlighted in the editor. Example: 'class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }' After the quick-fix is applied: 'class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }'", - "markdown": "Reports methods with a `boolean` return type that are always negated when called.\n\nA quick-fix is provided to invert and optionally rename the method.\nFor performance reasons, not all problematic methods may be highlighted in the editor.\n\nExample:\n\n\n class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }\n\nAfter the quick-fix is applied:\n\n\n class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }\n" + "text": "Reports '@GuardedBy' annotations on instance fields or methods in which the guard is a 'static' field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance. Example: 'private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", + "markdown": "Reports `@GuardedBy` annotations on instance fields or methods in which the guard is a `static` field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance.\n\nExample:\n\n\n private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "BooleanMethodIsAlwaysInverted", + "suppressToolId": "InstanceGuardedByStatic", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -8188,8 +8188,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 41, + "id": "Java/Concurrency annotation issues", + "index": 64, "toolComponent": { "name": "QDJVMC" } @@ -8387,7 +8387,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -8589,7 +8589,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -8655,7 +8655,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -8688,7 +8688,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -8865,28 +8865,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" } @@ -8898,28 +8898,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" } @@ -9223,7 +9223,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -9367,31 +9367,28 @@ ] }, { - "id": "SortedCollectionWithNonComparableKeys", + "id": "CommentedOutCode", "shortDescription": { - "text": "Sorted collection with non-comparable elements" + "text": "Commented out code" }, "fullDescription": { - "text": "Reports construction of sorted collections, for example 'TreeSet', that rely on natural ordering, whose element type doesn't implement the 'Comparable' interface. It's unlikely that such a collection will work properly. A false positive is possible if the collection element type is a non-comparable super-type, but the collection is intended to only hold comparable sub-types. Even if this is the case, it's better to narrow the collection element type or declare the super-type as 'Comparable' because the mentioned approach is error-prone. The inspection also reports cases when the collection element is a type parameter which is not declared as 'extends Comparable'. You can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility). New in 2018.3", - "markdown": "Reports construction of sorted collections, for example `TreeSet`, that rely on natural ordering, whose element type doesn't implement the `Comparable` interface.\n\nIt's unlikely that such a collection will work properly.\n\n\nA false positive is possible if the collection element type is a non-comparable super-type,\nbut the collection is intended to only hold comparable sub-types. Even if this is the case,\nit's better to narrow the collection element type or declare the super-type as `Comparable` because the mentioned approach is error-prone.\n\n\nThe inspection also reports cases when the collection element is a type parameter which is not declared as `extends Comparable`.\nYou can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility).\n\n\nNew in 2018.3" + "text": "Reports comments that contain Java code. Usually, code that is commented out gets outdated very quickly and becomes misleading. As most projects use some kind of version control system, it is better to delete commented out code completely and use the VCS history instead. New in 2020.3", + "markdown": "Reports comments that contain Java code.\n\nUsually, code that is commented out gets outdated very quickly and becomes misleading.\nAs most projects use some kind of version control system,\nit is better to delete commented out code completely and use the VCS history instead.\n\nNew in 2020.3" }, "defaultConfiguration": { "enabled": true, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "SortedCollectionWithNonComparableKeys", - "cweIds": [ - 697 - ], - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "CommentedOutCode", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Code maturity", + "index": 36, "toolComponent": { "name": "QDJVMC" } @@ -9403,28 +9400,31 @@ ] }, { - "id": "CommentedOutCode", + "id": "SortedCollectionWithNonComparableKeys", "shortDescription": { - "text": "Commented out code" + "text": "Sorted collection with non-comparable elements" }, "fullDescription": { - "text": "Reports comments that contain Java code. Usually, code that is commented out gets outdated very quickly and becomes misleading. As most projects use some kind of version control system, it is better to delete commented out code completely and use the VCS history instead. New in 2020.3", - "markdown": "Reports comments that contain Java code.\n\nUsually, code that is commented out gets outdated very quickly and becomes misleading.\nAs most projects use some kind of version control system,\nit is better to delete commented out code completely and use the VCS history instead.\n\nNew in 2020.3" + "text": "Reports construction of sorted collections, for example 'TreeSet', that rely on natural ordering, whose element type doesn't implement the 'Comparable' interface. It's unlikely that such a collection will work properly. A false positive is possible if the collection element type is a non-comparable super-type, but the collection is intended to only hold comparable sub-types. Even if this is the case, it's better to narrow the collection element type or declare the super-type as 'Comparable' because the mentioned approach is error-prone. The inspection also reports cases when the collection element is a type parameter which is not declared as 'extends Comparable'. You can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility). New in 2018.3", + "markdown": "Reports construction of sorted collections, for example `TreeSet`, that rely on natural ordering, whose element type doesn't implement the `Comparable` interface.\n\nIt's unlikely that such a collection will work properly.\n\n\nA false positive is possible if the collection element type is a non-comparable super-type,\nbut the collection is intended to only hold comparable sub-types. Even if this is the case,\nit's better to narrow the collection element type or declare the super-type as `Comparable` because the mentioned approach is error-prone.\n\n\nThe inspection also reports cases when the collection element is a type parameter which is not declared as `extends Comparable`.\nYou can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility).\n\n\nNew in 2018.3" }, "defaultConfiguration": { "enabled": true, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "CommentedOutCode", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "SortedCollectionWithNonComparableKeys", + "cweIds": [ + 697 + ], + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 36, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -9699,39 +9699,6 @@ } ] }, - { - "id": "ParameterHidingMemberVariable", - "shortDescription": { - "text": "Parameter hides field" - }, - "fullDescription": { - "text": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended. A quick-fix is suggested to rename the parameter. Example: 'class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }' You can configure the following options for this inspection: Ignore for property setters - ignore parameters of simple setters. Ignore superclass fields not visible from subclass - ignore 'private' fields in a superclass, which are not visible from the method. Ignore for constructors - ignore parameters of constructors. Ignore for abstract methods - ignore parameters of abstract methods. Ignore for static method parameters hiding instance fields - ignore parameters of 'static' methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing.", - "markdown": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended.\n\nA quick-fix is suggested to rename the parameter.\n\n**Example:**\n\n\n class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }\n \n\nYou can configure the following options for this inspection:\n\n1. **Ignore for property setters** - ignore parameters of simple setters.\n2. **Ignore superclass fields not visible from subclass** - ignore `private` fields in a superclass, which are not visible from the method.\n3. **Ignore for constructors** - ignore parameters of constructors.\n4. **Ignore for abstract methods** - ignore parameters of abstract methods.\n5. **Ignore for static method parameters hiding instance fields** - ignore parameters of `static` methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ParameterHidesMemberVariable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Visibility", - "index": 62, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "LambdaBodyCanBeCodeBlock", "shortDescription": { @@ -9765,6 +9732,39 @@ } ] }, + { + "id": "ParameterHidingMemberVariable", + "shortDescription": { + "text": "Parameter hides field" + }, + "fullDescription": { + "text": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended. A quick-fix is suggested to rename the parameter. Example: 'class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }' You can configure the following options for this inspection: Ignore for property setters - ignore parameters of simple setters. Ignore superclass fields not visible from subclass - ignore 'private' fields in a superclass, which are not visible from the method. Ignore for constructors - ignore parameters of constructors. Ignore for abstract methods - ignore parameters of abstract methods. Ignore for static method parameters hiding instance fields - ignore parameters of 'static' methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing.", + "markdown": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended.\n\nA quick-fix is suggested to rename the parameter.\n\n**Example:**\n\n\n class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }\n \n\nYou can configure the following options for this inspection:\n\n1. **Ignore for property setters** - ignore parameters of simple setters.\n2. **Ignore superclass fields not visible from subclass** - ignore `private` fields in a superclass, which are not visible from the method.\n3. **Ignore for constructors** - ignore parameters of constructors.\n4. **Ignore for abstract methods** - ignore parameters of abstract methods.\n5. **Ignore for static method parameters hiding instance fields** - ignore parameters of `static` methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ParameterHidesMemberVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 62, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "CustomSecurityManager", "shortDescription": { @@ -9856,7 +9856,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -10257,7 +10257,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -10356,7 +10356,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -10525,7 +10525,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -10627,7 +10627,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -10660,7 +10660,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -10672,19 +10672,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" } @@ -10692,8 +10692,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 10, + "id": "Java/Threading issues", + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -10705,19 +10705,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" } @@ -10725,8 +10725,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "Java/Declaration redundancy", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -10895,7 +10895,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -10961,7 +10961,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -10973,22 +10973,19 @@ ] }, { - "id": "RedundantOperationOnEmptyContainer", + "id": "OptionalIsPresent", "shortDescription": { - "text": "Redundant operation on empty container" + "text": "Non functional style 'Optional.isPresent()' usage" }, "fullDescription": { - "text": "Reports redundant operations on empty collections, maps or arrays. Iterating, removing elements, sorting, and some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug. Example: 'if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }' New in 2019.1", - "markdown": "Reports redundant operations on empty collections, maps or arrays.\n\n\nIterating, removing elements, sorting,\nand some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug.\n\n**Example:**\n\n\n if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }\n\nNew in 2019.1" + "text": "Reports 'Optional' expressions used as 'if' or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read. Example: 'if (str.isPresent()) str.get().trim();' After the quick-fix is applied: 'str.ifPresent(String::trim);' This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.", + "markdown": "Reports `Optional` expressions used as `if` or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read.\n\nExample:\n\n\n if (str.isPresent()) str.get().trim();\n\nAfter the quick-fix is applied:\n\n\n str.ifPresent(String::trim);\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "RedundantOperationOnEmptyContainer", - "cweIds": [ - 561 - ], + "suppressToolId": "OptionalIsPresent", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -10996,8 +10993,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -11009,19 +11006,22 @@ ] }, { - "id": "OptionalIsPresent", + "id": "RedundantOperationOnEmptyContainer", "shortDescription": { - "text": "Non functional style 'Optional.isPresent()' usage" + "text": "Redundant operation on empty container" }, "fullDescription": { - "text": "Reports 'Optional' expressions used as 'if' or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read. Example: 'if (str.isPresent()) str.get().trim();' After the quick-fix is applied: 'str.ifPresent(String::trim);' This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.", - "markdown": "Reports `Optional` expressions used as `if` or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read.\n\nExample:\n\n\n if (str.isPresent()) str.get().trim();\n\nAfter the quick-fix is applied:\n\n\n str.ifPresent(String::trim);\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8." + "text": "Reports redundant operations on empty collections, maps or arrays. Iterating, removing elements, sorting, and some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug. Example: 'if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }' New in 2019.1", + "markdown": "Reports redundant operations on empty collections, maps or arrays.\n\n\nIterating, removing elements, sorting,\nand some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug.\n\n**Example:**\n\n\n if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }\n\nNew in 2019.1" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "OptionalIsPresent", + "suppressToolId": "RedundantOperationOnEmptyContainer", + "cweIds": [ + 561 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11029,8 +11029,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -11264,7 +11264,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -11363,7 +11363,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -11429,7 +11429,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -11531,7 +11531,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -11840,25 +11840,19 @@ ] }, { - "id": "LoadLibraryWithNonConstantString", + "id": "SimplifiableAssertion", "shortDescription": { - "text": "Call to 'System.loadLibrary()' with non-constant string" + "text": "Simplifiable assertion" }, "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 any 'assert' calls that can be replaced with simpler and equivalent calls. Example → Replacement 'assertEquals(true, x());' 'assertTrue(x());' 'assertTrue(y() != null);' 'assertNotNull(y());' 'assertTrue(z == z());' 'assertSame(z, z());' 'assertTrue(a.equals(a()));' 'assertEquals(a, a());' 'assertTrue(false);' 'fail();'", + "markdown": "Reports any `assert` calls that can be replaced with simpler and equivalent calls.\n\n| Example | → | Replacement |\n|----------------------------------|---|-------------------------|\n| `assertEquals(`**true**`, x());` | | `assertTrue(x());` |\n| `assertTrue(y() != null);` | | `assertNotNull(y());` |\n| `assertTrue(z == z());` | | `assertSame(z, z());` |\n| `assertTrue(a.equals(a()));` | | `assertEquals(a, a());` |\n| `assertTrue(`**false**`);` | | `fail();` |" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "LoadLibraryWithNonConstantString", - "cweIds": [ - 114, - 494, - 676, - 829 - ], + "suppressToolId": "SimplifiableAssertion", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11866,8 +11860,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 25, + "id": "Java/Test frameworks", + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -11879,19 +11873,19 @@ ] }, { - "id": "SimplifiableAssertion", + "id": "InterfaceMethodClashesWithObject", "shortDescription": { - "text": "Simplifiable assertion" + "text": "Interface method clashes with method in 'Object'" }, "fullDescription": { - "text": "Reports any 'assert' calls that can be replaced with simpler and equivalent calls. Example → Replacement 'assertEquals(true, x());' 'assertTrue(x());' 'assertTrue(y() != null);' 'assertNotNull(y());' 'assertTrue(z == z());' 'assertSame(z, z());' 'assertTrue(a.equals(a()));' 'assertEquals(a, a());' 'assertTrue(false);' 'fail();'", - "markdown": "Reports any `assert` calls that can be replaced with simpler and equivalent calls.\n\n| Example | → | Replacement |\n|----------------------------------|---|-------------------------|\n| `assertEquals(`**true**`, x());` | | `assertTrue(x());` |\n| `assertTrue(y() != null);` | | `assertNotNull(y());` |\n| `assertTrue(z == z());` | | `assertSame(z, z());` |\n| `assertTrue(a.equals(a()));` | | `assertEquals(a, a());` |\n| `assertTrue(`**false**`);` | | `fail();` |" + "text": "Reports interface methods that clash with the protected methods 'clone()' and 'finalize()' from the 'java.lang.Object' class. In an interface, it is possible to declare these methods with a return type that is incompatible with the 'java.lang.Object' methods. A class that implements such an interface will not be compilable. When the interface is functional, it remains possible to create a lambda from it, but this is not recommended. Example: '// Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }'", + "markdown": "Reports interface methods that clash with the **protected** methods `clone()` and `finalize()` from the `java.lang.Object` class.\n\nIn an interface, it is possible to declare these methods with a return type that is incompatible with the `java.lang.Object` methods.\nA class that implements such an interface will not be compilable.\nWhen the interface is functional, it remains possible to create a lambda from it, but this is not recommended.\n\nExample:\n\n\n // Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }\n" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SimplifiableAssertion", + "suppressToolId": "InterfaceMethodClashesWithObject", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11899,8 +11893,8 @@ "relationships": [ { "target": { - "id": "Java/Test frameworks", - "index": 83, + "id": "Java/Abstraction issues", + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -11912,19 +11906,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" } @@ -11932,8 +11932,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 53, + "id": "Java/Security", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -12296,7 +12296,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -12333,7 +12333,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -12366,7 +12366,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -12465,7 +12465,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -12774,52 +12774,19 @@ ] }, { - "id": "ClassOnlyUsedInOnePackage", + "id": "SuppressionAnnotation", "shortDescription": { - "text": "Class only used from one other package" + "text": "Inspection suppression annotation" }, "fullDescription": { - "text": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports 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": "ClassOnlyUsedInOnePackage", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Packaging issues", - "index": 28, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryToStringCall", - "shortDescription": { - "text": "Unnecessary call to 'toString()'" - }, - "fullDescription": { - "text": "Reports calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null.", - "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods, and the explicit call to `toString()` is not needed.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryToStringCall", + "suppressToolId": "SuppressionAnnotation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -12827,8 +12794,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "JVM languages", + "index": 1, "toolComponent": { "name": "QDJVMC" } @@ -12840,19 +12807,19 @@ ] }, { - "id": "SuppressionAnnotation", + "id": "ClassOnlyUsedInOnePackage", "shortDescription": { - "text": "Inspection suppression annotation" + "text": "Class only used from one other package" }, "fullDescription": { - "text": "Reports comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\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" + "text": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SuppressionAnnotation", + "suppressToolId": "ClassOnlyUsedInOnePackage", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -12860,8 +12827,8 @@ "relationships": [ { "target": { - "id": "JVM languages", - "index": 1, + "id": "Java/Packaging issues", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -12873,19 +12840,19 @@ ] }, { - "id": "SynchronizeOnNonFinalField", + "id": "UnnecessaryToStringCall", "shortDescription": { - "text": "Synchronization on a non-final field" + "text": "Unnecessary call to 'toString()'" }, "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 calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null.", + "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods, and the explicit call to `toString()` is not needed.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SynchronizeOnNonFinalField", + "suppressToolId": "UnnecessaryToStringCall", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -12893,8 +12860,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -12938,6 +12905,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": { @@ -12963,7 +12963,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -12999,7 +12999,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13068,7 +13068,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13080,19 +13080,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" } @@ -13100,8 +13100,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 22, + "id": "Java/Assignment issues", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -13113,19 +13113,19 @@ ] }, { - "id": "AssignmentToSuperclassField", + "id": "NumericOverflow", "shortDescription": { - "text": "Constructor assigns value to field defined in superclass" + "text": "Numeric overflow" }, "fullDescription": { - "text": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor. It is considered preferable to initialize the fields of a superclass in its own constructor and delegate to that constructor in a subclass. This will also allow declaring a field 'final' if it isn't changed after the construction. Example: 'class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }' To avoid the problem, declare a superclass constructor: 'class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }'", - "markdown": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor.\n\nIt is considered preferable to initialize the fields of a superclass in its own constructor and\ndelegate to that constructor in a subclass. This will also allow declaring a field `final`\nif it isn't changed after the construction.\n\n**Example:**\n\n\n class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }\n\nTo avoid the problem, declare a superclass constructor:\n\n\n class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }\n" + "text": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction . Examples: 'float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;'", + "markdown": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction .\n\n**Examples:**\n\n\n float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "AssignmentToSuperclassField", + "suppressToolId": "NumericOverflow", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13133,8 +13133,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 54, + "id": "Java/Numeric issues", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -13167,7 +13167,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13299,7 +13299,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -13365,7 +13365,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13402,7 +13402,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13501,7 +13501,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -13513,28 +13513,28 @@ ] }, { - "id": "ConfusingElse", + "id": "InnerClassReferencedViaSubclass", "shortDescription": { - "text": "Redundant 'else'" + "text": "Inner class referenced via subclass" }, "fullDescription": { - "text": "Reports redundant 'else' keywords in 'if'—'else' statements and statement chains. The 'else' keyword is redundant when all previous branches end with a 'return', 'throw', 'break', or 'continue' statement. In this case, the statements from the 'else' branch can be placed after the 'if' statement, and the 'else' keyword can be removed. Example: 'if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }' After the quick-fix is applied: 'if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);' Disable the Report when there are no more statements after the 'if' statement option to ignore cases where the 'if'—'else' statement is the last statement in a code block.", - "markdown": "Reports redundant `else` keywords in `if`---`else` statements and statement chains.\n\n\nThe `else` keyword is redundant when all previous branches end with a\n`return`, `throw`, `break`, or `continue` statement. In this case,\nthe statements from the `else` branch can be placed after the `if` statement, and the\n`else` keyword can be removed.\n\n**Example:**\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }\n\nAfter the quick-fix is applied:\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);\n\nDisable the **Report when there are no more statements after the 'if' statement** option to ignore cases where the `if`---`else` statement is the last statement in a code block." + "text": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }' After the quick-fix is applied: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }'", + "markdown": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }\n" }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "ConfusingElseBranch", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "InnerClassReferencedViaSubclass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 21, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13546,28 +13546,28 @@ ] }, { - "id": "InnerClassReferencedViaSubclass", + "id": "ConfusingElse", "shortDescription": { - "text": "Inner class referenced via subclass" + "text": "Redundant 'else'" }, "fullDescription": { - "text": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }' After the quick-fix is applied: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }'", - "markdown": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }\n" + "text": "Reports redundant 'else' keywords in 'if'—'else' statements and statement chains. The 'else' keyword is redundant when all previous branches end with a 'return', 'throw', 'break', or 'continue' statement. In this case, the statements from the 'else' branch can be placed after the 'if' statement, and the 'else' keyword can be removed. Example: 'if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }' After the quick-fix is applied: 'if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);' Disable the Report when there are no more statements after the 'if' statement option to ignore cases where the 'if'—'else' statement is the last statement in a code block.", + "markdown": "Reports redundant `else` keywords in `if`---`else` statements and statement chains.\n\n\nThe `else` keyword is redundant when all previous branches end with a\n`return`, `throw`, `break`, or `continue` statement. In this case,\nthe statements from the `else` branch can be placed after the `if` statement, and the\n`else` keyword can be removed.\n\n**Example:**\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }\n\nAfter the quick-fix is applied:\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);\n\nDisable the **Report when there are no more statements after the 'if' statement** option to ignore cases where the `if`---`else` statement is the last statement in a code block." }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "InnerClassReferencedViaSubclass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ConfusingElseBranch", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Control flow issues", + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -13579,19 +13579,19 @@ ] }, { - "id": "ChannelResource", + "id": "ScheduledThreadPoolExecutorWithZeroCoreThreads", "shortDescription": { - "text": "'Channel' opened but not safely closed" + "text": "'ScheduledThreadPoolExecutor' with zero core threads" }, "fullDescription": { - "text": "Reports 'Channel' resources that are not safely closed, including any instances created by calling 'getChannel()' on a file or socket resource. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }' Use the following options to configure the inspection: Whether a 'Channel' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a 'Channel' in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.", - "markdown": "Reports `Channel` resources that are not safely closed, including any instances created by calling `getChannel()` on a file or socket resource.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `Channel` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a `Channel` in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument." + "text": "Reports any 'java.util.concurrent.ScheduledThreadPoolExecutor' instances in which 'corePoolSize' is set to zero via the 'setCorePoolSize' method or the object constructor. A 'ScheduledThreadPoolExecutor' with zero core threads will run nothing. Example: 'void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }'", + "markdown": "Reports any `java.util.concurrent.ScheduledThreadPoolExecutor` instances in which `corePoolSize` is set to zero via the `setCorePoolSize` method or the object constructor.\n\n\nA `ScheduledThreadPoolExecutor` with zero core threads will run nothing.\n\n**Example:**\n\n\n void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ChannelOpenedButNotSafelyClosed", + "suppressToolId": "ScheduledThreadPoolExecutorWithZeroCoreThreads", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13599,8 +13599,8 @@ "relationships": [ { "target": { - "id": "Java/Resource management", - "index": 87, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13612,19 +13612,19 @@ ] }, { - "id": "ScheduledThreadPoolExecutorWithZeroCoreThreads", + "id": "ChannelResource", "shortDescription": { - "text": "'ScheduledThreadPoolExecutor' with zero core threads" + "text": "'Channel' opened but not safely closed" }, "fullDescription": { - "text": "Reports any 'java.util.concurrent.ScheduledThreadPoolExecutor' instances in which 'corePoolSize' is set to zero via the 'setCorePoolSize' method or the object constructor. A 'ScheduledThreadPoolExecutor' with zero core threads will run nothing. Example: 'void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }'", - "markdown": "Reports any `java.util.concurrent.ScheduledThreadPoolExecutor` instances in which `corePoolSize` is set to zero via the `setCorePoolSize` method or the object constructor.\n\n\nA `ScheduledThreadPoolExecutor` with zero core threads will run nothing.\n\n**Example:**\n\n\n void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }\n" + "text": "Reports 'Channel' resources that are not safely closed, including any instances created by calling 'getChannel()' on a file or socket resource. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }' Use the following options to configure the inspection: Whether a 'Channel' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a 'Channel' in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.", + "markdown": "Reports `Channel` resources that are not safely closed, including any instances created by calling `getChannel()` on a file or socket resource.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `Channel` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a `Channel` in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ScheduledThreadPoolExecutorWithZeroCoreThreads", + "suppressToolId": "ChannelOpenedButNotSafelyClosed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13632,8 +13632,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Resource management", + "index": 87, "toolComponent": { "name": "QDJVMC" } @@ -13897,7 +13897,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14029,7 +14029,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -14227,7 +14227,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -14239,19 +14239,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" } @@ -14259,8 +14262,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 22, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14272,22 +14275,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" } @@ -14295,8 +14295,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Numeric issues", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -14329,7 +14329,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14692,7 +14692,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14770,19 +14770,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" } @@ -14790,8 +14790,8 @@ "relationships": [ { "target": { - "id": "Java/Class metrics", - "index": 81, + "id": "Java/Memory", + "index": 105, "toolComponent": { "name": "QDJVMC" } @@ -14803,19 +14803,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" } @@ -14823,8 +14823,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 105, + "id": "Java/Class metrics", + "index": 81, "toolComponent": { "name": "QDJVMC" } @@ -14861,7 +14861,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14906,19 +14906,19 @@ ] }, { - "id": "SetReplaceableByEnumSet", + "id": "Java9UndeclaredServiceUsage", "shortDescription": { - "text": "'Set' can be replaced with 'EnumSet'" + "text": "Usage of service not declared in 'module-info'" }, "fullDescription": { - "text": "Reports instantiations of 'java.util.Set' objects whose content types are enumerated classes. Such 'Set' objects can be replaced with 'java.util.EnumSet' objects. 'EnumSet' implementations can be much more efficient compared to other sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to 'EnumSet.noneOf()'. This quick-fix is not available when the type of the variable is a sub-class of 'Set'. Example: 'enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();' After the quick-fix is applied: 'enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);'", - "markdown": "Reports instantiations of `java.util.Set` objects whose content types are enumerated classes. Such `Set` objects can be replaced with `java.util.EnumSet` objects.\n\n\n`EnumSet` implementations can be much more efficient compared to\nother sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to\n`EnumSet.noneOf()`. This quick-fix is not available when the type of the variable is a sub-class of `Set`.\n\n**Example:**\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();\n\nAfter the quick-fix is applied:\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);\n" + "text": "Reports situations in which a service is loaded with 'java.util.ServiceLoader' but it isn't declared with the 'uses' clause in the 'module-info.java' file and suggests inserting it. This inspection depends on the Java feature 'Modules' which is available since Java 9. New in 2018.1", + "markdown": "Reports situations in which a service is loaded with `java.util.ServiceLoader` but it isn't declared with the `uses` clause in the `module-info.java` file and suggests inserting it.\n\nThis inspection depends on the Java feature 'Modules' which is available since Java 9.\n\nNew in 2018.1" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SetReplaceableByEnumSet", + "suppressToolId": "Java9UndeclaredServiceUsage", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -14926,8 +14926,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Visibility", + "index": 62, "toolComponent": { "name": "QDJVMC" } @@ -14939,19 +14939,19 @@ ] }, { - "id": "Java9UndeclaredServiceUsage", + "id": "SetReplaceableByEnumSet", "shortDescription": { - "text": "Usage of service not declared in 'module-info'" + "text": "'Set' can be replaced with 'EnumSet'" }, "fullDescription": { - "text": "Reports situations in which a service is loaded with 'java.util.ServiceLoader' but it isn't declared with the 'uses' clause in the 'module-info.java' file and suggests inserting it. This inspection depends on the Java feature 'Modules' which is available since Java 9. New in 2018.1", - "markdown": "Reports situations in which a service is loaded with `java.util.ServiceLoader` but it isn't declared with the `uses` clause in the `module-info.java` file and suggests inserting it.\n\nThis inspection depends on the Java feature 'Modules' which is available since Java 9.\n\nNew in 2018.1" + "text": "Reports instantiations of 'java.util.Set' objects whose content types are enumerated classes. Such 'Set' objects can be replaced with 'java.util.EnumSet' objects. 'EnumSet' implementations can be much more efficient compared to other sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to 'EnumSet.noneOf()'. This quick-fix is not available when the type of the variable is a sub-class of 'Set'. Example: 'enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();' After the quick-fix is applied: 'enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);'", + "markdown": "Reports instantiations of `java.util.Set` objects whose content types are enumerated classes. Such `Set` objects can be replaced with `java.util.EnumSet` objects.\n\n\n`EnumSet` implementations can be much more efficient compared to\nother sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to\n`EnumSet.noneOf()`. This quick-fix is not available when the type of the variable is a sub-class of `Set`.\n\n**Example:**\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();\n\nAfter the quick-fix is applied:\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "Java9UndeclaredServiceUsage", + "suppressToolId": "SetReplaceableByEnumSet", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -14959,8 +14959,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 62, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -15194,7 +15194,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -15510,21 +15510,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" @@ -15533,8 +15534,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 25, + "id": "Java/Probable bugs/Nullability problems", + "index": 108, "toolComponent": { "name": "QDJVMC" } @@ -15546,22 +15547,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" @@ -15570,8 +15570,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs/Nullability problems", - "index": 108, + "id": "Java/Security", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -15673,7 +15673,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -15739,7 +15739,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -15982,19 +15982,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" } @@ -16002,8 +16002,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 10, + "id": "Java/Data flow", + "index": 41, "toolComponent": { "name": "QDJVMC" } @@ -16015,19 +16015,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" } @@ -16035,8 +16035,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 41, + "id": "Java/Declaration redundancy", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -16102,7 +16102,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -16135,7 +16135,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -16201,7 +16201,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -16237,7 +16237,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -16270,7 +16270,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -16282,19 +16282,19 @@ ] }, { - "id": "UnqualifiedMethodAccess", + "id": "InstanceofIncompatibleInterface", "shortDescription": { - "text": "Instance method call not qualified with 'this'" + "text": "'instanceof' with incompatible type" }, "fullDescription": { - "text": "Reports calls to non-'static' methods on the same instance that are not qualified with 'this'. Example: 'class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }' After the quick-fix is applied: 'class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }'", - "markdown": "Reports calls to non-`static` methods on the same instance that are not qualified with `this`.\n\n**Example:**\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }\n" + "text": "Reports 'instanceof' expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the 'instanceof' expression, nor has subclasses that do. Although it could be intended for e.g. library code, such a construct is likely erroneous, because no instance of any class declared in the project could pass this 'instanceof' test. Example: 'class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }'", + "markdown": "Reports `instanceof` expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the `instanceof` expression, nor has subclasses that do.\n\n\nAlthough it could be intended for e.g. library code, such a construct is likely erroneous,\nbecause no instance of any class declared in the project could pass this `instanceof` test.\n\n**Example:**\n\n\n class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnqualifiedMethodAccess", + "suppressToolId": "InstanceofIncompatibleInterface", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -16302,8 +16302,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -16315,19 +16315,19 @@ ] }, { - "id": "InstanceofIncompatibleInterface", + "id": "UnqualifiedMethodAccess", "shortDescription": { - "text": "'instanceof' with incompatible type" + "text": "Instance method call not qualified with 'this'" }, "fullDescription": { - "text": "Reports 'instanceof' expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the 'instanceof' expression, nor has subclasses that do. Although it could be intended for e.g. library code, such a construct is likely erroneous, because no instance of any class declared in the project could pass this 'instanceof' test. Example: 'class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }'", - "markdown": "Reports `instanceof` expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the `instanceof` expression, nor has subclasses that do.\n\n\nAlthough it could be intended for e.g. library code, such a construct is likely erroneous,\nbecause no instance of any class declared in the project could pass this `instanceof` test.\n\n**Example:**\n\n\n class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }\n" + "text": "Reports calls to non-'static' methods on the same instance that are not qualified with 'this'. Example: 'class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }' After the quick-fix is applied: 'class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }'", + "markdown": "Reports calls to non-`static` methods on the same instance that are not qualified with `this`.\n\n**Example:**\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InstanceofIncompatibleInterface", + "suppressToolId": "UnqualifiedMethodAccess", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -16335,8 +16335,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -16480,19 +16480,19 @@ ] }, { - "id": "NonPublicClone", + "id": "IfCanBeSwitch", "shortDescription": { - "text": "'clone()' method not 'public'" + "text": "'if' can be replaced with 'switch'" }, "fullDescription": { - "text": "Reports 'clone()' methods that are 'protected' and not 'public'. When overriding the 'clone()' method from 'java.lang.Object', it is expected to make the method 'public', so that it is accessible from non-subclasses outside the package.", - "markdown": "Reports `clone()` methods that are `protected` and not `public`.\n\nWhen overriding the `clone()` method from `java.lang.Object`, it is expected to make the method `public`,\nso that it is accessible from non-subclasses outside the package." + "text": "Reports 'if' statements that can be replaced with 'switch' statements. The replacement result is usually shorter and clearer. Example: 'void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }' After the quick-fix is applied: 'void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }' This inspection only reports if the language level of the project or module is 7 or higher. Use the Minimum number of 'if' condition branches field to specify the minimum number of 'if' condition branches for an 'if' statement to have to be reported. Note that the terminal 'else' branch (without 'if') is not counted. Use the Suggest switch on numbers option to enable the suggestion of 'switch' statements on primitive and boxed numbers and characters. Use the Suggest switch on enums option to enable the suggestion of 'switch' statements on 'enum' constants. Use the Only suggest on null-safe expressions option to suggest 'switch' statements that can't introduce a 'NullPointerException' only.", + "markdown": "Reports `if` statements that can be replaced with `switch` statements.\n\nThe replacement result is usually shorter and clearer.\n\n**Example:**\n\n\n void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }\n \nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nUse the **Minimum number of 'if' condition branches** field to specify the minimum number of `if` condition branches\nfor an `if` statement to have to be reported. Note that the terminal `else` branch (without `if`) is not counted.\n\n\nUse the **Suggest switch on numbers** option to enable the suggestion of `switch` statements on\nprimitive and boxed numbers and characters.\n\n\nUse the **Suggest switch on enums** option to enable the suggestion of `switch` statements on\n`enum` constants.\n\n\nUse the **Only suggest on null-safe expressions** option to suggest `switch` statements that can't introduce a `NullPointerException` only." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonPublicClone", + "suppressToolId": "IfCanBeSwitch", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -16500,8 +16500,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 73, + "id": "Java/Java language level migration aids", + "index": 43, "toolComponent": { "name": "QDJVMC" } @@ -16513,19 +16513,19 @@ ] }, { - "id": "IfCanBeSwitch", + "id": "NonPublicClone", "shortDescription": { - "text": "'if' can be replaced with 'switch'" + "text": "'clone()' method not 'public'" }, "fullDescription": { - "text": "Reports 'if' statements that can be replaced with 'switch' statements. The replacement result is usually shorter and clearer. Example: 'void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }' After the quick-fix is applied: 'void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }' This inspection only reports if the language level of the project or module is 7 or higher. Use the Minimum number of 'if' condition branches field to specify the minimum number of 'if' condition branches for an 'if' statement to have to be reported. Note that the terminal 'else' branch (without 'if') is not counted. Use the Suggest switch on numbers option to enable the suggestion of 'switch' statements on primitive and boxed numbers and characters. Use the Suggest switch on enums option to enable the suggestion of 'switch' statements on 'enum' constants. Use the Only suggest on null-safe expressions option to suggest 'switch' statements that can't introduce a 'NullPointerException' only.", - "markdown": "Reports `if` statements that can be replaced with `switch` statements.\n\nThe replacement result is usually shorter and clearer.\n\n**Example:**\n\n\n void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }\n \nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nUse the **Minimum number of 'if' condition branches** field to specify the minimum number of `if` condition branches\nfor an `if` statement to have to be reported. Note that the terminal `else` branch (without `if`) is not counted.\n\n\nUse the **Suggest switch on numbers** option to enable the suggestion of `switch` statements on\nprimitive and boxed numbers and characters.\n\n\nUse the **Suggest switch on enums** option to enable the suggestion of `switch` statements on\n`enum` constants.\n\n\nUse the **Only suggest on null-safe expressions** option to suggest `switch` statements that can't introduce a `NullPointerException` only." + "text": "Reports 'clone()' methods that are 'protected' and not 'public'. When overriding the 'clone()' method from 'java.lang.Object', it is expected to make the method 'public', so that it is accessible from non-subclasses outside the package.", + "markdown": "Reports `clone()` methods that are `protected` and not `public`.\n\nWhen overriding the `clone()` method from `java.lang.Object`, it is expected to make the method `public`,\nso that it is accessible from non-subclasses outside the package." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "IfCanBeSwitch", + "suppressToolId": "NonPublicClone", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -16533,8 +16533,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids", - "index": 43, + "id": "Java/Cloning issues", + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -16571,7 +16571,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -16673,7 +16673,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -16775,7 +16775,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -17207,7 +17207,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -17351,22 +17351,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" } @@ -17374,8 +17371,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/JavaBeans issues", + "index": 91, "toolComponent": { "name": "QDJVMC" } @@ -17387,19 +17384,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" } @@ -17407,8 +17407,8 @@ "relationships": [ { "target": { - "id": "Java/JavaBeans issues", - "index": 91, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -17705,7 +17705,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -18047,19 +18047,19 @@ ] }, { - "id": "ExternalizableWithoutPublicNoArgConstructor", + "id": "StaticGuardedByInstance", "shortDescription": { - "text": "'Externalizable' class without 'public' no-arg constructor" + "text": "Static member guarded by instance field or this" }, "fullDescription": { - "text": "Reports 'Externalizable' classes without a public no-argument constructor. When an 'Externalizable' object is reconstructed, an instance is created using the public no-arg constructor before the 'readExternal' method called. If a public no-arg constructor is not available, a 'java.io.InvalidClassException' will be thrown at runtime.", - "markdown": "Reports `Externalizable` classes without a public no-argument constructor.\n\nWhen an `Externalizable` object is reconstructed, an instance is created using the public\nno-arg constructor before the `readExternal` method called. If a public\nno-arg constructor is not available, a `java.io.InvalidClassException` will be\nthrown at runtime." + "text": "Reports '@GuardedBy' annotations on 'static' fields or methods in which the guard is either a non-static field or 'this'. Guarding a static element with a non-static element may result in excessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", + "markdown": "Reports `@GuardedBy` annotations on `static` fields or methods in which the guard is either a non-static field or `this`.\n\nGuarding a static element with a non-static element may result in\nexcessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ExternalizableWithoutPublicNoArgConstructor", + "suppressToolId": "StaticGuardedByInstance", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -18067,8 +18067,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 14, + "id": "Java/Concurrency annotation issues", + "index": 64, "toolComponent": { "name": "QDJVMC" } @@ -18080,19 +18080,19 @@ ] }, { - "id": "StaticGuardedByInstance", + "id": "ExternalizableWithoutPublicNoArgConstructor", "shortDescription": { - "text": "Static member guarded by instance field or this" + "text": "'Externalizable' class without 'public' no-arg constructor" }, "fullDescription": { - "text": "Reports '@GuardedBy' annotations on 'static' fields or methods in which the guard is either a non-static field or 'this'. Guarding a static element with a non-static element may result in excessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", - "markdown": "Reports `@GuardedBy` annotations on `static` fields or methods in which the guard is either a non-static field or `this`.\n\nGuarding a static element with a non-static element may result in\nexcessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" + "text": "Reports 'Externalizable' classes without a public no-argument constructor. When an 'Externalizable' object is reconstructed, an instance is created using the public no-arg constructor before the 'readExternal' method called. If a public no-arg constructor is not available, a 'java.io.InvalidClassException' will be thrown at runtime.", + "markdown": "Reports `Externalizable` classes without a public no-argument constructor.\n\nWhen an `Externalizable` object is reconstructed, an instance is created using the public\nno-arg constructor before the `readExternal` method called. If a public\nno-arg constructor is not available, a `java.io.InvalidClassException` will be\nthrown at runtime." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "StaticGuardedByInstance", + "suppressToolId": "ExternalizableWithoutPublicNoArgConstructor", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -18100,8 +18100,8 @@ "relationships": [ { "target": { - "id": "Java/Concurrency annotation issues", - "index": 64, + "id": "Java/Serialization issues", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -18212,19 +18212,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" } @@ -18232,8 +18232,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 13, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -18269,7 +18269,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -18281,19 +18281,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" } @@ -18301,8 +18301,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Class structure", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -18314,19 +18314,19 @@ ] }, { - "id": "TrivialFunctionalExpressionUsage", + "id": "EnumClass", "shortDescription": { - "text": "Trivial usage of functional expression" + "text": "Enumerated class" }, "fullDescription": { - "text": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation. Example: 'boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }' When the quick-fix is applied, the method call changes to: 'boolean contains(List names, String name) {\n return names.contains(name);\n }'", - "markdown": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n" + "text": "Reports enum classes. Such statements are not supported in Java 1.4 and earlier JVM.", + "markdown": "Reports **enum** classes. Such statements are not supported in Java 1.4 and earlier JVM." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "TrivialFunctionalExpressionUsage", + "suppressToolId": "EnumClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -18334,8 +18334,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 10, + "id": "Java/Java language level issues", + "index": 94, "toolComponent": { "name": "QDJVMC" } @@ -18347,19 +18347,19 @@ ] }, { - "id": "EnumClass", + "id": "TrivialFunctionalExpressionUsage", "shortDescription": { - "text": "Enumerated class" + "text": "Trivial usage of functional expression" }, "fullDescription": { - "text": "Reports enum classes. Such statements are not supported in Java 1.4 and earlier JVM.", - "markdown": "Reports **enum** classes. Such statements are not supported in Java 1.4 and earlier JVM." + "text": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation. Example: 'boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }' When the quick-fix is applied, the method call changes to: 'boolean contains(List names, String name) {\n return names.contains(name);\n }'", + "markdown": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "EnumClass", + "suppressToolId": "TrivialFunctionalExpressionUsage", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -18367,8 +18367,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level issues", - "index": 94, + "id": "Java/Declaration redundancy", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -18536,7 +18536,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -18602,7 +18602,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -18668,7 +18668,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -18833,7 +18833,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -18899,7 +18899,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -19076,19 +19076,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" } @@ -19096,8 +19096,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Initialization", + "index": 23, "toolComponent": { "name": "QDJVMC" } @@ -19109,19 +19109,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" } @@ -19129,8 +19129,8 @@ "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 23, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -19163,7 +19163,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -19460,7 +19460,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -19493,7 +19493,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -19658,7 +19658,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -19703,19 +19703,19 @@ ] }, { - "id": "MethodOverloadsParentMethod", + "id": "IncrementDecrementUsedAsExpression", "shortDescription": { - "text": "Possibly unintended overload of method from superclass" + "text": "Result of '++' or '--' used" }, "fullDescription": { - "text": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type. In this case, the method in a subclass will be overloading the method from the superclass instead of overriding it. If it is unintended, it may result in latent bugs. Example: 'public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }' Use the option to choose whether the inspection should also report cases where parameter types are not compatible.", - "markdown": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type.\n\n\nIn this case, the method in a subclass will be overloading the method from the superclass\ninstead of overriding it. If it is unintended, it may result in latent bugs.\n\n**Example:**\n\n\n public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }\n\n\nUse the option to choose whether the inspection should also report cases where parameter types are not compatible." + "text": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing. The quick-fix extracts the increment or decrement operation to a separate expression statement. Example: 'int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }' After the quick-fix is applied: 'int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;'", + "markdown": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing.\n\nThe quick-fix extracts the increment or decrement operation to a separate expression statement.\n\n**Example:**\n\n\n int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }\n\nAfter the quick-fix is applied:\n\n\n int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MethodOverloadsMethodOfSuperclass", + "suppressToolId": "ValueOfIncrementOrDecrementUsed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19723,8 +19723,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 62, + "id": "Java/Assignment issues", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -19736,19 +19736,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" } @@ -19756,8 +19756,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 54, + "id": "Java/Packaging issues", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -19769,19 +19769,19 @@ ] }, { - "id": "DisjointPackage", + "id": "MethodOverloadsParentMethod", "shortDescription": { - "text": "Package with disjoint dependency graph" + "text": "Possibly unintended overload of method from superclass" }, "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 instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type. In this case, the method in a subclass will be overloading the method from the superclass instead of overriding it. If it is unintended, it may result in latent bugs. Example: 'public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }' Use the option to choose whether the inspection should also report cases where parameter types are not compatible.", + "markdown": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type.\n\n\nIn this case, the method in a subclass will be overloading the method from the superclass\ninstead of overriding it. If it is unintended, it may result in latent bugs.\n\n**Example:**\n\n\n public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }\n\n\nUse the option to choose whether the inspection should also report cases where parameter types are not compatible." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "DisjointPackage", + "suppressToolId": "MethodOverloadsMethodOfSuperclass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19789,8 +19789,8 @@ "relationships": [ { "target": { - "id": "Java/Packaging issues", - "index": 28, + "id": "Java/Visibility", + "index": 62, "toolComponent": { "name": "QDJVMC" } @@ -19802,19 +19802,19 @@ ] }, { - "id": "MethodMayBeSynchronized", + "id": "UpperCaseFieldNameNotConstant", "shortDescription": { - "text": "Method with single 'synchronized' block can be replaced with 'synchronized' method" + "text": "Non-constant field with upper-case name" }, "fullDescription": { - "text": "Reports methods whose body contains a single 'synchronized' statement. A lock expression for this 'synchronized' statement must be equal to 'this' for instance methods or '[ClassName].class' for static methods. To improve readability of such methods, you can remove the 'synchronized' wrapper and mark the method as 'synchronized'. Example: 'public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }' After the quick-fix is applied: 'public synchronized int generateInt(int x) {\n return 1;\n }'", - "markdown": "Reports methods whose body contains a single `synchronized` statement. A lock expression for this `synchronized` statement must be equal to `this` for instance methods or `[ClassName].class` for static methods.\n\n\nTo improve readability of such methods,\nyou can remove the `synchronized` wrapper and mark the method as `synchronized`.\n\n**Example:**\n\n\n public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public synchronized int generateInt(int x) {\n return 1;\n }\n" + "text": "Reports non-'static' non-'final' fields whose names are all in upper case. Such fields may cause confusion by breaking a common naming convention and are often used by mistake. Example: 'public static int THE_ANSWER = 42; //a warning here: final modifier is missing' A quick-fix that renames such fields is available only in the editor.", + "markdown": "Reports non-`static` non-`final` fields whose names are all in upper case.\n\nSuch fields may cause confusion by breaking a common naming convention and\nare often used by mistake.\n\n**Example:**\n\n\n public static int THE_ANSWER = 42; //a warning here: final modifier is missing\n\nA quick-fix that renames such fields is available only in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MethodMayBeSynchronized", + "suppressToolId": "NonConstantFieldWithUpperCaseName", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19822,8 +19822,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "Java/Naming conventions", + "index": 50, "toolComponent": { "name": "QDJVMC" } @@ -19835,19 +19835,19 @@ ] }, { - "id": "UpperCaseFieldNameNotConstant", + "id": "MethodMayBeSynchronized", "shortDescription": { - "text": "Non-constant field with upper-case name" + "text": "Method with single 'synchronized' block can be replaced with 'synchronized' method" }, "fullDescription": { - "text": "Reports non-'static' non-'final' fields whose names are all in upper case. Such fields may cause confusion by breaking a common naming convention and are often used by mistake. Example: 'public static int THE_ANSWER = 42; //a warning here: final modifier is missing' A quick-fix that renames such fields is available only in the editor.", - "markdown": "Reports non-`static` non-`final` fields whose names are all in upper case.\n\nSuch fields may cause confusion by breaking a common naming convention and\nare often used by mistake.\n\n**Example:**\n\n\n public static int THE_ANSWER = 42; //a warning here: final modifier is missing\n\nA quick-fix that renames such fields is available only in the editor." + "text": "Reports methods whose body contains a single 'synchronized' statement. A lock expression for this 'synchronized' statement must be equal to 'this' for instance methods or '[ClassName].class' for static methods. To improve readability of such methods, you can remove the 'synchronized' wrapper and mark the method as 'synchronized'. Example: 'public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }' After the quick-fix is applied: 'public synchronized int generateInt(int x) {\n return 1;\n }'", + "markdown": "Reports methods whose body contains a single `synchronized` statement. A lock expression for this `synchronized` statement must be equal to `this` for instance methods or `[ClassName].class` for static methods.\n\n\nTo improve readability of such methods,\nyou can remove the `synchronized` wrapper and mark the method as `synchronized`.\n\n**Example:**\n\n\n public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public synchronized int generateInt(int x) {\n return 1;\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonConstantFieldWithUpperCaseName", + "suppressToolId": "MethodMayBeSynchronized", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19855,8 +19855,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions", - "index": 50, + "id": "Java/Threading issues", + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -19958,7 +19958,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -20093,7 +20093,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -20258,7 +20258,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -20324,7 +20324,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -20456,7 +20456,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -20558,7 +20558,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -20570,19 +20570,19 @@ ] }, { - "id": "NonFinalUtilityClass", + "id": "Singleton", "shortDescription": { - "text": "Utility class is not 'final'" + "text": "Singleton" }, "fullDescription": { - "text": "Reports utility classes that aren't 'final' or 'abstract'. Utility classes have all fields and methods declared as 'static'. Making them 'final' prevents them from being accidentally subclassed. Example: 'public class UtilityClass {\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n public static void foo() {}\n }'", - "markdown": "Reports utility classes that aren't `final` or `abstract`.\n\nUtility classes have all fields and methods declared as `static`.\nMaking them `final` prevents them from being accidentally subclassed.\n\n**Example:**\n\n\n public class UtilityClass {\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n public static void foo() {}\n }\n" + "text": "Reports singleton classes. Singleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing, and their presence may indicate a lack of object-oriented design. Example: 'class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }'", + "markdown": "Reports singleton classes.\n\nSingleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing,\nand their presence may indicate a lack of object-oriented design.\n\n**Example:**\n\n\n class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalUtilityClass", + "suppressToolId": "Singleton", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20603,19 +20603,19 @@ ] }, { - "id": "Singleton", + "id": "NonFinalUtilityClass", "shortDescription": { - "text": "Singleton" + "text": "Utility class is not 'final'" }, "fullDescription": { - "text": "Reports singleton classes. Singleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing, and their presence may indicate a lack of object-oriented design. Example: 'class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }'", - "markdown": "Reports singleton classes.\n\nSingleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing,\nand their presence may indicate a lack of object-oriented design.\n\n**Example:**\n\n\n class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }\n" + "text": "Reports utility classes that aren't 'final' or 'abstract'. Utility classes have all fields and methods declared as 'static'. Making them 'final' prevents them from being accidentally subclassed. Example: 'public class UtilityClass {\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n public static void foo() {}\n }'", + "markdown": "Reports utility classes that aren't `final` or `abstract`.\n\nUtility classes have all fields and methods declared as `static`.\nMaking them `final` prevents them from being accidentally subclassed.\n\n**Example:**\n\n\n public class UtilityClass {\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n public static void foo() {}\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "Singleton", + "suppressToolId": "NonFinalUtilityClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20690,7 +20690,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -20822,7 +20822,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -20991,7 +20991,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21024,7 +21024,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21090,7 +21090,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -21123,7 +21123,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -21456,7 +21456,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21534,19 +21534,19 @@ ] }, { - "id": "StringTokenizerDelimiter", + "id": "MaskedAssertion", "shortDescription": { - "text": "Duplicated delimiters in 'StringTokenizer'" + "text": "Assertion is suppressed by 'catch'" }, "fullDescription": { - "text": "Reports 'StringTokenizer()' constructor calls or 'nextToken()' method calls that contain duplicate characters in the delimiter argument. Example: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }' After the quick-fix is applied: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }'", - "markdown": "Reports `StringTokenizer()` constructor calls or `nextToken()` method calls that contain duplicate characters in the delimiter argument.\n\n**Example:**\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n" + "text": "Reports 'assert' statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown 'AssertionError' will be caught and silently ignored. Example 1: 'void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 2: '@Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 3: '@Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' New in 2020.3", + "markdown": "Reports `assert` statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown `AssertionError` will be caught and silently ignored.\n\n**Example 1:**\n\n\n void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 2:**\n\n\n @Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 3:**\n\n\n @Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\nNew in 2020.3" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "StringTokenizerDelimiter", + "suppressToolId": "MaskedAssertion", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21554,8 +21554,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Test frameworks", + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -21567,19 +21567,19 @@ ] }, { - "id": "MaskedAssertion", + "id": "StringTokenizerDelimiter", "shortDescription": { - "text": "Assertion is suppressed by 'catch'" + "text": "Duplicated delimiters in 'StringTokenizer'" }, "fullDescription": { - "text": "Reports 'assert' statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown 'AssertionError' will be caught and silently ignored. Example 1: 'void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 2: '@Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 3: '@Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' New in 2020.3", - "markdown": "Reports `assert` statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown `AssertionError` will be caught and silently ignored.\n\n**Example 1:**\n\n\n void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 2:**\n\n\n @Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 3:**\n\n\n @Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\nNew in 2020.3" + "text": "Reports 'StringTokenizer()' constructor calls or 'nextToken()' method calls that contain duplicate characters in the delimiter argument. Example: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }' After the quick-fix is applied: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }'", + "markdown": "Reports `StringTokenizer()` constructor calls or `nextToken()` method calls that contain duplicate characters in the delimiter argument.\n\n**Example:**\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "MaskedAssertion", + "suppressToolId": "StringTokenizerDelimiter", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21587,8 +21587,8 @@ "relationships": [ { "target": { - "id": "Java/Test frameworks", - "index": 83, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21621,7 +21621,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -21765,19 +21765,19 @@ ] }, { - "id": "AutoBoxing", + "id": "ExtendsThrowable", "shortDescription": { - "text": "Auto-boxing" + "text": "Class directly extends 'Throwable'" }, "fullDescription": { - "text": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance. Example: 'Integer x = 42;' The quick-fix makes the conversion explicit: 'Integer x = Integer.valueOf(42);' AutoBoxing appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions.", - "markdown": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance.\n\n**Example:**\n\n Integer x = 42;\n\nThe quick-fix makes the conversion explicit:\n\n Integer x = Integer.valueOf(42);\n\n\n*AutoBoxing* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions." + "text": "Reports classes that directly extend 'java.lang.Throwable'. Extending 'java.lang.Throwable' directly is generally considered bad practice. It is usually enough to extend 'java.lang.RuntimeException', 'java.lang.Exception', or - in special cases - 'java.lang.Error'. Example: 'class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable''", + "markdown": "Reports classes that directly extend `java.lang.Throwable`.\n\nExtending `java.lang.Throwable` directly is generally considered bad practice.\nIt is usually enough to extend `java.lang.RuntimeException`, `java.lang.Exception`, or - in special\ncases - `java.lang.Error`.\n\n**Example:**\n\n\n class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "AutoBoxing", + "suppressToolId": "ExtendsThrowable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21785,8 +21785,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Error handling", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -21798,19 +21798,19 @@ ] }, { - "id": "ExtendsThrowable", + "id": "AutoBoxing", "shortDescription": { - "text": "Class directly extends 'Throwable'" + "text": "Auto-boxing" }, "fullDescription": { - "text": "Reports classes that directly extend 'java.lang.Throwable'. Extending 'java.lang.Throwable' directly is generally considered bad practice. It is usually enough to extend 'java.lang.RuntimeException', 'java.lang.Exception', or - in special cases - 'java.lang.Error'. Example: 'class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable''", - "markdown": "Reports classes that directly extend `java.lang.Throwable`.\n\nExtending `java.lang.Throwable` directly is generally considered bad practice.\nIt is usually enough to extend `java.lang.RuntimeException`, `java.lang.Exception`, or - in special\ncases - `java.lang.Error`.\n\n**Example:**\n\n\n class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'\n" + "text": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance. Example: 'Integer x = 42;' The quick-fix makes the conversion explicit: 'Integer x = Integer.valueOf(42);' AutoBoxing appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions.", + "markdown": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance.\n\n**Example:**\n\n Integer x = 42;\n\nThe quick-fix makes the conversion explicit:\n\n Integer x = Integer.valueOf(42);\n\n\n*AutoBoxing* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ExtendsThrowable", + "suppressToolId": "AutoBoxing", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21818,8 +21818,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 9, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -21897,19 +21897,19 @@ ] }, { - "id": "CloneCallsConstructors", + "id": "UnnecessaryModuleDependencyInspection", "shortDescription": { - "text": "'clone()' instantiates objects with constructor" + "text": "Unnecessary module dependency" }, "fullDescription": { - "text": "Reports calls to object constructors inside 'clone()' methods. It is considered good practice to call 'clone()' to instantiate objects inside of a 'clone()' method instead of creating them directly to support later subclassing. This inspection will not report 'clone()' methods declared as 'final' or 'clone()' methods on 'final' classes.", - "markdown": "Reports calls to object constructors inside `clone()` methods.\n\nIt is considered good practice to call `clone()` to instantiate objects inside of a `clone()` method\ninstead of creating them directly to support later subclassing.\nThis inspection will not report\n`clone()` methods declared as `final`\nor `clone()` methods on `final` classes." + "text": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies.", + "markdown": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CloneCallsConstructors", + "suppressToolId": "UnnecessaryModuleDependencyInspection", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21917,8 +21917,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 73, + "id": "Java/Declaration redundancy", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -21930,19 +21930,19 @@ ] }, { - "id": "UnnecessaryModuleDependencyInspection", + "id": "CloneCallsConstructors", "shortDescription": { - "text": "Unnecessary module dependency" + "text": "'clone()' instantiates objects with constructor" }, "fullDescription": { - "text": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies.", - "markdown": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies." + "text": "Reports calls to object constructors inside 'clone()' methods. It is considered good practice to call 'clone()' to instantiate objects inside of a 'clone()' method instead of creating them directly to support later subclassing. This inspection will not report 'clone()' methods declared as 'final' or 'clone()' methods on 'final' classes.", + "markdown": "Reports calls to object constructors inside `clone()` methods.\n\nIt is considered good practice to call `clone()` to instantiate objects inside of a `clone()` method\ninstead of creating them directly to support later subclassing.\nThis inspection will not report\n`clone()` methods declared as `final`\nor `clone()` methods on `final` classes." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryModuleDependencyInspection", + "suppressToolId": "CloneCallsConstructors", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21950,8 +21950,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 10, + "id": "Java/Cloning issues", + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -22215,7 +22215,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -22326,28 +22326,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": 1, "toolComponent": { "name": "QDJVMC" } @@ -22359,28 +22359,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": 1, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -22491,19 +22491,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" } @@ -22511,8 +22511,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 29, + "id": "Java/Compiler issues", + "index": 102, "toolComponent": { "name": "QDJVMC" } @@ -22524,19 +22524,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" } @@ -22544,8 +22544,8 @@ "relationships": [ { "target": { - "id": "Java/Compiler issues", - "index": 102, + "id": "Java/Verbose or redundant code constructs", + "index": 29, "toolComponent": { "name": "QDJVMC" } @@ -22589,7 +22589,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -22655,7 +22655,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -22832,19 +22832,19 @@ ] }, { - "id": "ImplicitCallToSuper", + "id": "MissingDeprecatedAnnotation", "shortDescription": { - "text": "Implicit call to 'super()'" + "text": "Missing '@Deprecated' annotation" }, "fullDescription": { - "text": "Reports constructors that do not begin with a call to \"super\" constructor or another constructor of the same class. Such constructors can be thought of as implicitly beginning with a call to 'super()'. Some coding standards prefer that such calls to 'super()' be made explicitly. Example: 'class Foo {\n Foo() {}\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n super();\n }\n }' Use the inspection settings to ignore classes extending directly from 'Object'. For instance: 'class Foo {\n Foo() {} // Not reported\n }\n\n class Bar extends Foo {\n Bar() {} // Implicit call to 'super()'\n }'", - "markdown": "Reports constructors that do not begin with a call to \"super\" constructor or another constructor of the same class.\n\nSuch constructors can be thought of as implicitly beginning with a\ncall to `super()`. Some coding standards prefer that such calls to\n`super()` be made explicitly.\n\n**Example:**\n\n\n class Foo {\n Foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\n\nUse the inspection settings to ignore classes extending directly from `Object`.\nFor instance:\n\n\n class Foo {\n Foo() {} // Not reported\n }\n\n class Bar extends Foo {\n Bar() {} // Implicit call to 'super()'\n }\n" + "text": "Reports module declarations, classes, fields, or methods that have the '@deprecated' Javadoc tag but do not have the '@java.lang.Deprecated' annotation. Example: '/**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }' After the quick-fix is applied: '/**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }' This inspection reports only if the language level of the project or module is 5 or higher. Use the checkbox below to report members annotated with '@Deprecated' without an explanation in a Javadoc '@deprecated' tag. This inspection depends on the Java feature 'Annotations' which is available since Java 5.", + "markdown": "Reports module declarations, classes, fields, or methods that have the `@deprecated` Javadoc tag but do not have the `@java.lang.Deprecated` annotation.\n\n**Example:**\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }\n\nAfter the quick-fix is applied:\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }\n\nThis inspection reports only if the language level of the project or module is 5 or higher.\n\n\nUse the checkbox below to report members annotated with `@Deprecated` without\nan explanation in a Javadoc `@deprecated` tag.\n\nThis inspection depends on the Java feature 'Annotations' which is available since Java 5." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ImplicitCallToSuper", + "suppressToolId": "MissingDeprecatedAnnotation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22852,8 +22852,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Javadoc", + "index": 48, "toolComponent": { "name": "QDJVMC" } @@ -22865,19 +22865,19 @@ ] }, { - "id": "MissingDeprecatedAnnotation", + "id": "ImplicitCallToSuper", "shortDescription": { - "text": "Missing '@Deprecated' annotation" + "text": "Implicit call to 'super()'" }, "fullDescription": { - "text": "Reports module declarations, classes, fields, or methods that have the '@deprecated' Javadoc tag but do not have the '@java.lang.Deprecated' annotation. Example: '/**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }' After the quick-fix is applied: '/**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }' This inspection reports only if the language level of the project or module is 5 or higher. Use the checkbox below to report members annotated with '@Deprecated' without an explanation in a Javadoc '@deprecated' tag. This inspection depends on the Java feature 'Annotations' which is available since Java 5.", - "markdown": "Reports module declarations, classes, fields, or methods that have the `@deprecated` Javadoc tag but do not have the `@java.lang.Deprecated` annotation.\n\n**Example:**\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }\n\nAfter the quick-fix is applied:\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }\n\nThis inspection reports only if the language level of the project or module is 5 or higher.\n\n\nUse the checkbox below to report members annotated with `@Deprecated` without\nan explanation in a Javadoc `@deprecated` tag.\n\nThis inspection depends on the Java feature 'Annotations' which is available since Java 5." + "text": "Reports constructors that do not begin with a call to \"super\" constructor or another constructor of the same class. Such constructors can be thought of as implicitly beginning with a call to 'super()'. Some coding standards prefer that such calls to 'super()' be made explicitly. Example: 'class Foo {\n Foo() {}\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n super();\n }\n }' Use the inspection settings to ignore classes extending directly from 'Object'. For instance: 'class Foo {\n Foo() {} // Not reported\n }\n\n class Bar extends Foo {\n Bar() {} // Implicit call to 'super()'\n }'", + "markdown": "Reports constructors that do not begin with a call to \"super\" constructor or another constructor of the same class.\n\nSuch constructors can be thought of as implicitly beginning with a\ncall to `super()`. Some coding standards prefer that such calls to\n`super()` be made explicitly.\n\n**Example:**\n\n\n class Foo {\n Foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\n\nUse the inspection settings to ignore classes extending directly from `Object`.\nFor instance:\n\n\n class Foo {\n Foo() {} // Not reported\n }\n\n class Bar extends Foo {\n Bar() {} // Implicit call to 'super()'\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MissingDeprecatedAnnotation", + "suppressToolId": "ImplicitCallToSuper", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22885,8 +22885,8 @@ "relationships": [ { "target": { - "id": "Java/Javadoc", - "index": 48, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -22985,7 +22985,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -23150,7 +23150,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -23282,7 +23282,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -23381,7 +23381,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -23417,7 +23417,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -23894,19 +23894,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" } @@ -23914,8 +23914,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 21, + "id": "Java/Error handling", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -23927,19 +23927,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" } @@ -23947,8 +23947,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 9, + "id": "Java/Control flow issues", + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -23993,19 +23993,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" } @@ -24013,8 +24013,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -24026,19 +24026,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" } @@ -24046,8 +24046,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Threading issues", + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -24092,19 +24092,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" } @@ -24112,8 +24112,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 105, + "id": "Java/Code style issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -24125,19 +24125,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" } @@ -24145,8 +24145,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 8, + "id": "Java/Memory", + "index": 105, "toolComponent": { "name": "QDJVMC" } @@ -24257,19 +24257,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" } @@ -24277,8 +24277,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Error handling", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -24290,19 +24290,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" } @@ -24310,8 +24310,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 9, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -24389,19 +24389,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" } @@ -24409,8 +24409,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Error handling", + "index": 9, "toolComponent": { "name": "QDJVMC" } @@ -24422,19 +24422,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" } @@ -24442,8 +24442,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 9, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -24476,7 +24476,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -24620,19 +24620,19 @@ ] }, { - "id": "UtilityClassWithoutPrivateConstructor", + "id": "ExtendsUtilityClass", "shortDescription": { - "text": "Utility class without 'private' constructor" + "text": "Class extends utility class" }, "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." + "text": "Reports classes that extend a utility class. A utility class is a non-empty class in which all fields and methods are static. Extending a utility class also allows for inadvertent object instantiation of the utility class, because the constructor cannot be made private in order to allow extension. Configure the inspection: Use the Ignore if overriding class is a utility class option to ignore any classes that override a utility class but are also utility classes themselves.", + "markdown": "Reports classes that extend a utility class.\n\n\nA utility class is a non-empty class in which all fields and methods are static.\nExtending a utility class also allows for inadvertent object instantiation of the\nutility class, because the constructor cannot be made private in order to allow extension.\n\n\nConfigure the inspection:\n\n* Use the **Ignore if overriding class is a utility class** option to ignore any classes that override a utility class but are also utility classes themselves." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UtilityClassWithoutPrivateConstructor", + "suppressToolId": "ExtendsUtilityClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24640,8 +24640,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 13, + "id": "Java/Inheritance issues", + "index": 97, "toolComponent": { "name": "QDJVMC" } @@ -24653,19 +24653,19 @@ ] }, { - "id": "ExtendsUtilityClass", + "id": "UtilityClassWithoutPrivateConstructor", "shortDescription": { - "text": "Class extends utility class" + "text": "Utility class without 'private' constructor" }, "fullDescription": { - "text": "Reports classes that extend a utility class. A utility class is a non-empty class in which all fields and methods are static. Extending a utility class also allows for inadvertent object instantiation of the utility class, because the constructor cannot be made private in order to allow extension. Configure the inspection: Use the Ignore if overriding class is a utility class option to ignore any classes that override a utility class but are also utility classes themselves.", - "markdown": "Reports classes that extend a utility class.\n\n\nA utility class is a non-empty class in which all fields and methods are static.\nExtending a utility class also allows for inadvertent object instantiation of the\nutility class, because the constructor cannot be made private in order to allow extension.\n\n\nConfigure the inspection:\n\n* Use the **Ignore if overriding class is a utility class** option to ignore any classes that override a utility class but are also utility classes themselves." + "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": "ExtendsUtilityClass", + "suppressToolId": "UtilityClassWithoutPrivateConstructor", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24673,8 +24673,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 97, + "id": "Java/Class structure", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -24905,7 +24905,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -24971,7 +24971,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -25073,7 +25073,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -25278,7 +25278,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -25344,7 +25344,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -25587,19 +25587,19 @@ ] }, { - "id": "ClassIndependentOfModule", + "id": "SystemRunFinalizersOnExit", "shortDescription": { - "text": "Class independent of its module" + "text": "Call to 'System.runFinalizersOnExit()'" }, "fullDescription": { - "text": "Reports classes that: do not depend on any other class in their module are not a dependency for any other class in their module Such classes are an indication of ad-hoc or incoherent modularisation strategies, and may often profitably be moved. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports classes that:\n\n* do not depend on any other class in their module\n* are not a dependency for any other class in their module\n\nSuch classes are an indication of ad-hoc or incoherent modularisation strategies,\nand may often profitably be moved.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports calls to 'System.runFinalizersOnExit()'. This call is one of the most dangerous in the Java language. It is inherently non-thread-safe, may result in data corruption, a deadlock, and may affect parts of the program far removed from its call point. It is deprecated and was removed in JDK 11, and its use is strongly discouraged. This inspection only reports if the language level of the project or module is 10 or lower.", + "markdown": "Reports calls to `System.runFinalizersOnExit()`.\n\n\nThis call is one of the most dangerous in the Java language. It is inherently non-thread-safe,\nmay result in data corruption, a deadlock, and may affect parts of the program far removed from its call point.\nIt is deprecated and was removed in JDK 11, and its use is strongly discouraged.\n\nThis inspection only reports if the language level of the project or module is 10 or lower." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassIndependentOfModule", + "suppressToolId": "CallToSystemRunFinalizersOnExit", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25607,8 +25607,8 @@ "relationships": [ { "target": { - "id": "Java/Modularization issues", - "index": 47, + "id": "Java/Threading issues", + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -25620,19 +25620,19 @@ ] }, { - "id": "SystemRunFinalizersOnExit", + "id": "ClassIndependentOfModule", "shortDescription": { - "text": "Call to 'System.runFinalizersOnExit()'" + "text": "Class independent of its module" }, "fullDescription": { - "text": "Reports calls to 'System.runFinalizersOnExit()'. This call is one of the most dangerous in the Java language. It is inherently non-thread-safe, may result in data corruption, a deadlock, and may affect parts of the program far removed from its call point. It is deprecated and was removed in JDK 11, and its use is strongly discouraged. This inspection only reports if the language level of the project or module is 10 or lower.", - "markdown": "Reports calls to `System.runFinalizersOnExit()`.\n\n\nThis call is one of the most dangerous in the Java language. It is inherently non-thread-safe,\nmay result in data corruption, a deadlock, and may affect parts of the program far removed from its call point.\nIt is deprecated and was removed in JDK 11, and its use is strongly discouraged.\n\nThis inspection only reports if the language level of the project or module is 10 or lower." + "text": "Reports classes that: do not depend on any other class in their module are not a dependency for any other class in their module Such classes are an indication of ad-hoc or incoherent modularisation strategies, and may often profitably be moved. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that:\n\n* do not depend on any other class in their module\n* are not a dependency for any other class in their module\n\nSuch classes are an indication of ad-hoc or incoherent modularisation strategies,\nand may often profitably be moved.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CallToSystemRunFinalizersOnExit", + "suppressToolId": "ClassIndependentOfModule", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25640,8 +25640,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "Java/Modularization issues", + "index": 47, "toolComponent": { "name": "QDJVMC" } @@ -25653,19 +25653,19 @@ ] }, { - "id": "ReplaceInefficientStreamCount", + "id": "ParameterTypePreventsOverriding", "shortDescription": { - "text": "Inefficient Stream API call chains ending with count()" + "text": "Parameter type prevents overriding" }, "fullDescription": { - "text": "Reports Stream API call chains ending with the 'count()' operation that could be optimized. The following call chains are replaced by this inspection: 'Collection.stream().count()' → 'Collection.size()'. In Java 8 'Collection.stream().count()' actually iterates over the collection elements to count them, while 'Collection.size()' is much faster for most of the collections. 'Stream.flatMap(Collection::stream).count()' → 'Stream.mapToLong(Collection::size).sum()'. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up. 'Stream.filter(o -> ...).count() > 0' → 'Stream.anyMatch(o -> ...)'. Unlike the original call, 'anyMatch()' may stop the computation as soon as a matching element is found. 'Stream.filter(o -> ...).count() == 0' → 'Stream.noneMatch(o -> ...)'. Similar to the above. Note that if the replacement involves a short-circuiting operation like 'anyMatch()', there could be a visible behavior change, if the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls. This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.", - "markdown": "Reports Stream API call chains ending with the `count()` operation that could be optimized.\n\n\nThe following call chains are replaced by this inspection:\n\n* `Collection.stream().count()` → `Collection.size()`. In Java 8 `Collection.stream().count()` actually iterates over the collection elements to count them, while `Collection.size()` is much faster for most of the collections.\n* `Stream.flatMap(Collection::stream).count()` → `Stream.mapToLong(Collection::size).sum()`. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up.\n* `Stream.filter(o -> ...).count() > 0` → `Stream.anyMatch(o -> ...)`. Unlike the original call, `anyMatch()` may stop the computation as soon as a matching element is found.\n* `Stream.filter(o -> ...).count() == 0` → `Stream.noneMatch(o -> ...)`. Similar to the above.\n\n\nNote that if the replacement involves a short-circuiting operation like `anyMatch()`, there could be a visible behavior change,\nif the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls.\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8." + "text": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method. Example: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n}' After the quick-fix is applied: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n}'", + "markdown": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method.\n\n**Example:**\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ReplaceInefficientStreamCount", + "suppressToolId": "ParameterTypePreventsOverriding", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25673,8 +25673,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Inheritance issues", + "index": 97, "toolComponent": { "name": "QDJVMC" } @@ -25686,19 +25686,19 @@ ] }, { - "id": "ParameterTypePreventsOverriding", + "id": "ReplaceInefficientStreamCount", "shortDescription": { - "text": "Parameter type prevents overriding" + "text": "Inefficient Stream API call chains ending with count()" }, "fullDescription": { - "text": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method. Example: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n}' After the quick-fix is applied: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n}'", - "markdown": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method.\n\n**Example:**\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n }\n" + "text": "Reports Stream API call chains ending with the 'count()' operation that could be optimized. The following call chains are replaced by this inspection: 'Collection.stream().count()' → 'Collection.size()'. In Java 8 'Collection.stream().count()' actually iterates over the collection elements to count them, while 'Collection.size()' is much faster for most of the collections. 'Stream.flatMap(Collection::stream).count()' → 'Stream.mapToLong(Collection::size).sum()'. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up. 'Stream.filter(o -> ...).count() > 0' → 'Stream.anyMatch(o -> ...)'. Unlike the original call, 'anyMatch()' may stop the computation as soon as a matching element is found. 'Stream.filter(o -> ...).count() == 0' → 'Stream.noneMatch(o -> ...)'. Similar to the above. Note that if the replacement involves a short-circuiting operation like 'anyMatch()', there could be a visible behavior change, if the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls. This inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8.", + "markdown": "Reports Stream API call chains ending with the `count()` operation that could be optimized.\n\n\nThe following call chains are replaced by this inspection:\n\n* `Collection.stream().count()` → `Collection.size()`. In Java 8 `Collection.stream().count()` actually iterates over the collection elements to count them, while `Collection.size()` is much faster for most of the collections.\n* `Stream.flatMap(Collection::stream).count()` → `Stream.mapToLong(Collection::size).sum()`. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up.\n* `Stream.filter(o -> ...).count() > 0` → `Stream.anyMatch(o -> ...)`. Unlike the original call, `anyMatch()` may stop the computation as soon as a matching element is found.\n* `Stream.filter(o -> ...).count() == 0` → `Stream.noneMatch(o -> ...)`. Similar to the above.\n\n\nNote that if the replacement involves a short-circuiting operation like `anyMatch()`, there could be a visible behavior change,\nif the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls.\n\nThis inspection depends on the Java feature 'Stream and Optional API' which is available since Java 8." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ParameterTypePreventsOverriding", + "suppressToolId": "ReplaceInefficientStreamCount", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25706,8 +25706,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 97, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -25875,7 +25875,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -26076,7 +26076,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -26212,7 +26212,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -26245,7 +26245,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -26311,7 +26311,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -26509,7 +26509,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -26674,7 +26674,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -26785,19 +26785,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" } @@ -26805,8 +26805,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 21, + "id": "Java/Naming conventions/Class", + "index": 51, "toolComponent": { "name": "QDJVMC" } @@ -26818,19 +26818,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" } @@ -26838,8 +26838,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions/Class", - "index": 51, + "id": "Java/Control flow issues", + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -26971,7 +26971,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27037,7 +27037,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27148,19 +27148,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" } @@ -27168,8 +27168,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 14, + "id": "Java/Compiler issues", + "index": 102, "toolComponent": { "name": "QDJVMC" } @@ -27181,19 +27181,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" } @@ -27201,8 +27201,8 @@ "relationships": [ { "target": { - "id": "Java/Compiler issues", - "index": 102, + "id": "Java/Serialization issues", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -27235,7 +27235,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -27433,7 +27433,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -27469,7 +27469,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27739,7 +27739,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27784,19 +27784,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" } @@ -27804,8 +27804,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 11, + "id": "Java/Internationalization", + "index": 6, "toolComponent": { "name": "QDJVMC" } @@ -27817,19 +27817,19 @@ ] }, { - "id": "StringTokenizer", + "id": "UnnecessaryUnicodeEscape", "shortDescription": { - "text": "Use of 'StringTokenizer'" + "text": "Unnecessary unicode escape sequence" }, "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 unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab). Example: 'String s = \"\\u0062\";'", + "markdown": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab).\n\n**Example:**\n\n String s = \"\\u0062\";\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "UseOfStringTokenizer", + "suppressToolId": "UnnecessaryUnicodeEscape", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27850,19 +27850,19 @@ ] }, { - "id": "UnnecessaryUnicodeEscape", + "id": "PrimitiveArrayArgumentToVariableArgMethod", "shortDescription": { - "text": "Unnecessary unicode escape sequence" + "text": "Confusing primitive array argument to varargs method" }, "fullDescription": { - "text": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab). Example: 'String s = \"\\u0062\";'", - "markdown": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab).\n\n**Example:**\n\n String s = \"\\u0062\";\n" + "text": "Reports 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": true, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryUnicodeEscape", + "suppressToolId": "PrimitiveArrayArgumentToVarargsMethod", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27870,8 +27870,8 @@ "relationships": [ { "target": { - "id": "Java/Internationalization", - "index": 6, + "id": "Java/Probable bugs", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27916,19 +27916,19 @@ ] }, { - "id": "AccessToNonThreadSafeStaticFieldFromInstance", + "id": "BigDecimalEquals", "shortDescription": { - "text": "Non-thread-safe 'static' field access" + "text": "'equals()' called on 'BigDecimal'" }, "fullDescription": { - "text": "Reports access to 'static' fields that are of a non-thread-safe type. When a 'static' field is accessed from an instance method or a non-synchronized block, multiple threads can access that field. This can lead to unspecified side effects, like exceptions and incorrect results. Example: 'class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }' You can specify which types should be considered not thread-safe. Only fields with these exact types or initialized with these exact types are reported, because there may exist thread-safe subclasses of these types.", - "markdown": "Reports access to `static` fields that are of a non-thread-safe type.\n\n\nWhen a `static` field is accessed from an instance method or a non-synchronized block,\nmultiple threads can access that field.\nThis can lead to unspecified side effects, like exceptions and incorrect results.\n\n**Example:**\n\n\n class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }\n\n\nYou can specify which types should be considered not thread-safe.\nOnly fields with these exact types or initialized with these exact types are reported,\nbecause there may exist thread-safe subclasses of these types." + "text": "Reports 'equals()' calls that compare two 'java.math.BigDecimal' numbers. This is normally a mistake, as two 'java.math.BigDecimal' numbers are only equal if they are equal in both value and scale. Example: 'if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false' After the quick-fix is applied: 'if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true'", + "markdown": "Reports `equals()` calls that compare two `java.math.BigDecimal` numbers. This is normally a mistake, as two `java.math.BigDecimal` numbers are only equal if they are equal in both value and scale.\n\n**Example:**\n\n\n if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false\n\nAfter the quick-fix is applied:\n\n\n if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "AccessToNonThreadSafeStaticField", + "suppressToolId": "BigDecimalEquals", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27936,8 +27936,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "Java/Numeric issues", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -27949,19 +27949,19 @@ ] }, { - "id": "BigDecimalEquals", + "id": "AccessToNonThreadSafeStaticFieldFromInstance", "shortDescription": { - "text": "'equals()' called on 'BigDecimal'" + "text": "Non-thread-safe 'static' field access" }, "fullDescription": { - "text": "Reports 'equals()' calls that compare two 'java.math.BigDecimal' numbers. This is normally a mistake, as two 'java.math.BigDecimal' numbers are only equal if they are equal in both value and scale. Example: 'if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false' After the quick-fix is applied: 'if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true'", - "markdown": "Reports `equals()` calls that compare two `java.math.BigDecimal` numbers. This is normally a mistake, as two `java.math.BigDecimal` numbers are only equal if they are equal in both value and scale.\n\n**Example:**\n\n\n if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false\n\nAfter the quick-fix is applied:\n\n\n if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true\n" + "text": "Reports access to 'static' fields that are of a non-thread-safe type. When a 'static' field is accessed from an instance method or a non-synchronized block, multiple threads can access that field. This can lead to unspecified side effects, like exceptions and incorrect results. Example: 'class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }' You can specify which types should be considered not thread-safe. Only fields with these exact types or initialized with these exact types are reported, because there may exist thread-safe subclasses of these types.", + "markdown": "Reports access to `static` fields that are of a non-thread-safe type.\n\n\nWhen a `static` field is accessed from an instance method or a non-synchronized block,\nmultiple threads can access that field.\nThis can lead to unspecified side effects, like exceptions and incorrect results.\n\n**Example:**\n\n\n class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }\n\n\nYou can specify which types should be considered not thread-safe.\nOnly fields with these exact types or initialized with these exact types are reported,\nbecause there may exist thread-safe subclasses of these types." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "BigDecimalEquals", + "suppressToolId": "AccessToNonThreadSafeStaticField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27969,8 +27969,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 22, + "id": "Java/Threading issues", + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -28069,7 +28069,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -28201,7 +28201,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -28642,19 +28642,19 @@ ] }, { - "id": "ThrowablePrintStackTrace", + "id": "StringBufferMustHaveInitialCapacity", "shortDescription": { - "text": "Call to 'printStackTrace()'" + "text": "'StringBuilder' without initial capacity" }, "fullDescription": { - "text": "Reports calls to 'Throwable.printStackTrace()' without arguments. Such statements are often used for temporary debugging and should be either removed from the production code or replaced with a more robust logging facility.", - "markdown": "Reports calls to `Throwable.printStackTrace()` without arguments.\n\nSuch statements are often used for temporary debugging and should be either removed from the production code\nor replaced with a more robust logging facility." + "text": "Reports attempts to instantiate a new 'StringBuffer' or 'StringBuilder' object without specifying its initial capacity. If no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing to specify the initial capacity for 'StringBuffer' may result in performance issues if space needs to be reallocated and memory copied when the initial capacity is exceeded. Example: '// Capacity is not specified\n var sb = new StringBuilder();'", + "markdown": "Reports attempts to instantiate a new `StringBuffer` or `StringBuilder` object without specifying its initial capacity.\n\n\nIf no initial capacity is specified, a default capacity is used, which will rarely be optimal.\nFailing to specify the initial capacity for `StringBuffer` may result\nin performance issues if space needs to be reallocated and memory copied\nwhen the initial capacity is exceeded.\n\nExample:\n\n\n // Capacity is not specified\n var sb = new StringBuilder();\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CallToPrintStackTrace", + "suppressToolId": "StringBufferWithoutInitialCapacity", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28662,8 +28662,8 @@ "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 36, + "id": "Java/Performance", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -28675,19 +28675,19 @@ ] }, { - "id": "StringBufferMustHaveInitialCapacity", + "id": "ThrowablePrintStackTrace", "shortDescription": { - "text": "'StringBuilder' without initial capacity" + "text": "Call to 'printStackTrace()'" }, "fullDescription": { - "text": "Reports attempts to instantiate a new 'StringBuffer' or 'StringBuilder' object without specifying its initial capacity. If no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing to specify the initial capacity for 'StringBuffer' may result in performance issues if space needs to be reallocated and memory copied when the initial capacity is exceeded. Example: '// Capacity is not specified\n var sb = new StringBuilder();'", - "markdown": "Reports attempts to instantiate a new `StringBuffer` or `StringBuilder` object without specifying its initial capacity.\n\n\nIf no initial capacity is specified, a default capacity is used, which will rarely be optimal.\nFailing to specify the initial capacity for `StringBuffer` may result\nin performance issues if space needs to be reallocated and memory copied\nwhen the initial capacity is exceeded.\n\nExample:\n\n\n // Capacity is not specified\n var sb = new StringBuilder();\n" + "text": "Reports calls to 'Throwable.printStackTrace()' without arguments. Such statements are often used for temporary debugging and should be either removed from the production code or replaced with a more robust logging facility.", + "markdown": "Reports calls to `Throwable.printStackTrace()` without arguments.\n\nSuch statements are often used for temporary debugging and should be either removed from the production code\nor replaced with a more robust logging facility." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "StringBufferWithoutInitialCapacity", + "suppressToolId": "CallToPrintStackTrace", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28695,8 +28695,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 7, + "id": "Java/Code maturity", + "index": 36, "toolComponent": { "name": "QDJVMC" } @@ -28708,19 +28708,19 @@ ] }, { - "id": "ThreeNegationsPerMethod", + "id": "ThreadWithDefaultRunMethod", "shortDescription": { - "text": "Method with more than three negations" + "text": "Instantiating a 'Thread' with default 'run()' method" }, "fullDescription": { - "text": "Reports methods with three or more negations. Such methods may be confusing. Example: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }' Without negations, the method becomes easier to understand: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }' Configure the inspection: Use the Ignore negations in 'equals()' methods option to disable the inspection within 'equals()' methods. Use the Ignore negations in 'assert' statements to disable the inspection within 'assert' statements.", - "markdown": "Reports methods with three or more negations. Such methods may be confusing.\n\n**Example:**\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }\n\nWithout negations, the method becomes easier to understand:\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }\n\nConfigure the inspection:\n\n* Use the **Ignore negations in 'equals()' methods** option to disable the inspection within `equals()` methods.\n* Use the **Ignore negations in 'assert' statements** to disable the inspection within `assert` statements." + "text": "Reports instantiations of 'Thread' or an inheritor without specifying a 'Runnable' parameter or overriding the 'run()' method. Such threads do nothing useful. Example: 'new Thread().start();'", + "markdown": "Reports instantiations of `Thread` or an inheritor without specifying a `Runnable` parameter or overriding the `run()` method. Such threads do nothing useful.\n\n**Example:**\n\n\n new Thread().start();\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "MethodWithMoreThanThreeNegations", + "suppressToolId": "InstantiatingAThreadWithDefaultRunMethod", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28728,8 +28728,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 86, + "id": "Java/Threading issues", + "index": 20, "toolComponent": { "name": "QDJVMC" } @@ -28741,19 +28741,19 @@ ] }, { - "id": "ThreadWithDefaultRunMethod", + "id": "ThreeNegationsPerMethod", "shortDescription": { - "text": "Instantiating a 'Thread' with default 'run()' method" + "text": "Method with more than three negations" }, "fullDescription": { - "text": "Reports instantiations of 'Thread' or an inheritor without specifying a 'Runnable' parameter or overriding the 'run()' method. Such threads do nothing useful. Example: 'new Thread().start();'", - "markdown": "Reports instantiations of `Thread` or an inheritor without specifying a `Runnable` parameter or overriding the `run()` method. Such threads do nothing useful.\n\n**Example:**\n\n\n new Thread().start();\n" + "text": "Reports methods with three or more negations. Such methods may be confusing. Example: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }' Without negations, the method becomes easier to understand: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }' Configure the inspection: Use the Ignore negations in 'equals()' methods option to disable the inspection within 'equals()' methods. Use the Ignore negations in 'assert' statements to disable the inspection within 'assert' statements.", + "markdown": "Reports methods with three or more negations. Such methods may be confusing.\n\n**Example:**\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }\n\nWithout negations, the method becomes easier to understand:\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }\n\nConfigure the inspection:\n\n* Use the **Ignore negations in 'equals()' methods** option to disable the inspection within `equals()` methods.\n* Use the **Ignore negations in 'assert' statements** to disable the inspection within `assert` statements." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InstantiatingAThreadWithDefaultRunMethod", + "suppressToolId": "MethodWithMoreThanThreeNegations", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28761,8 +28761,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 20, + "id": "Java/Method metrics", + "index": 86, "toolComponent": { "name": "QDJVMC" } @@ -28774,19 +28774,19 @@ ] }, { - "id": "TestOnlyProblems", + "id": "Java8MapApi", "shortDescription": { - "text": "Test-only usage in production code" + "text": "Simplifiable 'Map' operations" }, "fullDescription": { - "text": "Reports '@TestOnly'- and '@VisibleForTesting'-annotated methods and classes that are used in production code. Also reports usage of applying '@TestOnly' '@VisibleForTesting' to the same element. The problems are not reported if such method or class is referenced from: Code under the Test Sources folder A test class (JUnit/TestNG) Another '@TestOnly'-annotated method Example (in production code): '@TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }'", - "markdown": "Reports `@TestOnly`- and `@VisibleForTesting`-annotated methods and classes that are used in production code. Also reports usage of applying `@TestOnly` `@VisibleForTesting` to the same element.\n\nThe problems are not reported if such method or class is referenced from:\n\n* Code under the **Test Sources** folder\n* A test class (JUnit/TestNG)\n* Another `@TestOnly`-annotated method\n\n**Example (in production code):**\n\n\n @TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }\n" + "text": "Reports common usage patterns of 'java.util.Map' and suggests replacing them with: 'getOrDefault()', 'computeIfAbsent()', 'putIfAbsent()', 'merge()', or 'replaceAll()'. Example: 'map.containsKey(key) ? map.get(key) : \"default\";' After the quick-fix is applied: 'map.getOrDefault(key, \"default\");' Example: 'List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }' After the quick-fix is applied: 'map.computeIfAbsent(key, localKey -> new ArrayList<>());' Example: 'Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);' After the quick-fix is applied: 'map.merge(key, 1, (localKey, localValue) -> localValue + 1);' Example: 'for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }' After the quick-fix is applied: 'map.replaceAll((localKey, localValue) -> transform(localValue));' Note that the replacement with 'computeIfAbsent()' or 'merge()' might work incorrectly for some 'Map' implementations if the code extracted to the lambda expression modifies the same 'Map'. By default, the warning doesn't appear if this code might have side effects. If necessary, enable the Suggest replacement even if lambda may have side effects option to always show the warning. Also, due to different handling of the 'null' value in old methods like 'put()' and newer methods like 'computeIfAbsent()' or 'merge()', semantics might change if storing the 'null' value into given 'Map' is important. The inspection won't suggest the replacement when the value is statically known to be nullable, but for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning and adding an explanatory comment. This inspection depends on the Java feature 'Lambda methods in collections' which is available since Java 8.", + "markdown": "Reports common usage patterns of `java.util.Map` and suggests replacing them with: `getOrDefault()`, `computeIfAbsent()`, `putIfAbsent()`, `merge()`, or `replaceAll()`.\n\nExample:\n\n\n map.containsKey(key) ? map.get(key) : \"default\";\n\nAfter the quick-fix is applied:\n\n\n map.getOrDefault(key, \"default\");\n\nExample:\n\n\n List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }\n\nAfter the quick-fix is applied:\n\n\n map.computeIfAbsent(key, localKey -> new ArrayList<>());\n\nExample:\n\n\n Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);\n\nAfter the quick-fix is applied:\n\n\n map.merge(key, 1, (localKey, localValue) -> localValue + 1);\n\nExample:\n\n\n for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }\n\nAfter the quick-fix is applied:\n\n\n map.replaceAll((localKey, localValue) -> transform(localValue));\n\nNote that the replacement with `computeIfAbsent()` or `merge()` might work incorrectly for some `Map`\nimplementations if the code extracted to the lambda expression modifies the same `Map`. By default,\nthe warning doesn't appear if this code might have side effects. If necessary, enable the\n**Suggest replacement even if lambda may have side effects** option to always show the warning.\n\nAlso, due to different handling of the `null` value in old methods like `put()` and newer methods like\n`computeIfAbsent()` or `merge()`, semantics might change if storing the `null` value into given\n`Map` is important. The inspection won't suggest the replacement when the value is statically known to be nullable,\nbut for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning\nand adding an explanatory comment.\n\nThis inspection depends on the Java feature 'Lambda methods in collections' which is available since Java 8." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "TestOnlyProblems", + "suppressToolId": "Java8MapApi", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28794,8 +28794,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Test frameworks", - "index": 79, + "id": "Java/Java language level migration aids/Java 8", + "index": 78, "toolComponent": { "name": "QDJVMC" } @@ -28807,19 +28807,19 @@ ] }, { - "id": "Java8MapApi", + "id": "TestOnlyProblems", "shortDescription": { - "text": "Simplifiable 'Map' operations" + "text": "Test-only usage in production code" }, "fullDescription": { - "text": "Reports common usage patterns of 'java.util.Map' and suggests replacing them with: 'getOrDefault()', 'computeIfAbsent()', 'putIfAbsent()', 'merge()', or 'replaceAll()'. Example: 'map.containsKey(key) ? map.get(key) : \"default\";' After the quick-fix is applied: 'map.getOrDefault(key, \"default\");' Example: 'List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }' After the quick-fix is applied: 'map.computeIfAbsent(key, localKey -> new ArrayList<>());' Example: 'Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);' After the quick-fix is applied: 'map.merge(key, 1, (localKey, localValue) -> localValue + 1);' Example: 'for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }' After the quick-fix is applied: 'map.replaceAll((localKey, localValue) -> transform(localValue));' Note that the replacement with 'computeIfAbsent()' or 'merge()' might work incorrectly for some 'Map' implementations if the code extracted to the lambda expression modifies the same 'Map'. By default, the warning doesn't appear if this code might have side effects. If necessary, enable the Suggest replacement even if lambda may have side effects option to always show the warning. Also, due to different handling of the 'null' value in old methods like 'put()' and newer methods like 'computeIfAbsent()' or 'merge()', semantics might change if storing the 'null' value into given 'Map' is important. The inspection won't suggest the replacement when the value is statically known to be nullable, but for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning and adding an explanatory comment. This inspection depends on the Java feature 'Lambda methods in collections' which is available since Java 8.", - "markdown": "Reports common usage patterns of `java.util.Map` and suggests replacing them with: `getOrDefault()`, `computeIfAbsent()`, `putIfAbsent()`, `merge()`, or `replaceAll()`.\n\nExample:\n\n\n map.containsKey(key) ? map.get(key) : \"default\";\n\nAfter the quick-fix is applied:\n\n\n map.getOrDefault(key, \"default\");\n\nExample:\n\n\n List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }\n\nAfter the quick-fix is applied:\n\n\n map.computeIfAbsent(key, localKey -> new ArrayList<>());\n\nExample:\n\n\n Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);\n\nAfter the quick-fix is applied:\n\n\n map.merge(key, 1, (localKey, localValue) -> localValue + 1);\n\nExample:\n\n\n for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }\n\nAfter the quick-fix is applied:\n\n\n map.replaceAll((localKey, localValue) -> transform(localValue));\n\nNote that the replacement with `computeIfAbsent()` or `merge()` might work incorrectly for some `Map`\nimplementations if the code extracted to the lambda expression modifies the same `Map`. By default,\nthe warning doesn't appear if this code might have side effects. If necessary, enable the\n**Suggest replacement even if lambda may have side effects** option to always show the warning.\n\nAlso, due to different handling of the `null` value in old methods like `put()` and newer methods like\n`computeIfAbsent()` or `merge()`, semantics might change if storing the `null` value into given\n`Map` is important. The inspection won't suggest the replacement when the value is statically known to be nullable,\nbut for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning\nand adding an explanatory comment.\n\nThis inspection depends on the Java feature 'Lambda methods in collections' which is available since Java 8." + "text": "Reports '@TestOnly'- and '@VisibleForTesting'-annotated methods and classes that are used in production code. Also reports usage of applying '@TestOnly' '@VisibleForTesting' to the same element. The problems are not reported if such method or class is referenced from: Code under the Test Sources folder A test class (JUnit/TestNG) Another '@TestOnly'-annotated method Example (in production code): '@TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }'", + "markdown": "Reports `@TestOnly`- and `@VisibleForTesting`-annotated methods and classes that are used in production code. Also reports usage of applying `@TestOnly` `@VisibleForTesting` to the same element.\n\nThe problems are not reported if such method or class is referenced from:\n\n* Code under the **Test Sources** folder\n* A test class (JUnit/TestNG)\n* Another `@TestOnly`-annotated method\n\n**Example (in production code):**\n\n\n @TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "Java8MapApi", + "suppressToolId": "TestOnlyProblems", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28827,8 +28827,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 8", - "index": 78, + "id": "JVM languages/Test frameworks", + "index": 79, "toolComponent": { "name": "QDJVMC" } @@ -28861,7 +28861,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -28930,7 +28930,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -28963,7 +28963,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29128,7 +29128,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -29297,7 +29297,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29400,7 +29400,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29433,7 +29433,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29598,7 +29598,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -29610,28 +29610,28 @@ ] }, { - "id": "SequencedCollectionMethodCanBeUsed", + "id": "PublicField", "shortDescription": { - "text": "SequencedCollection method can be used" + "text": "'public' field" }, "fullDescription": { - "text": "Reports collection API method calls that can be simplified using 'SequencedCollection' methods. The following conversions are supported: 'list.add(0, element)' → 'list.addFirst(element);' 'list.get(0)' → 'list.getFirst();' 'list.get(list.size() - 1)' → 'list.getLast();' 'list.remove(0)' → 'list.removeFirst();' 'list.remove(list.size() - 1)' → 'list.removeLast();' 'collection.iterator().next()' → 'collection.getFirst();' This inspection depends on the Java feature 'Sequenced Collections' which is available since Java 21. New in 2023.3", - "markdown": "Reports collection API method calls that can be simplified using `SequencedCollection` methods.\n\nThe following conversions are supported:\n\n* `list.add(0, element)` → `list.addFirst(element);`\n* `list.get(0)` → `list.getFirst();`\n* `list.get(list.size() - 1)` → `list.getLast();`\n* `list.remove(0)` → `list.removeFirst();`\n* `list.remove(list.size() - 1)` → `list.removeLast();`\n* `collection.iterator().next()` → `collection.getFirst();`\n\nThis inspection depends on the Java feature 'Sequenced Collections' which is available since Java 21.\n\nNew in 2023.3" + "text": "Reports 'public' fields. Constants (fields marked with 'static' and 'final') are not reported. Example: 'class Main {\n public String name;\n }' After the quick-fix is applied: 'class Main {\n private String name;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n }' Configure the inspection: Use the Ignore If Annotated By list to specify annotations to ignore. The inspection will ignore fields with any of these annotations. Use the Ignore 'public final' fields of an enum option to ignore 'public final' fields of the 'enum' type.", + "markdown": "Reports `public` fields. Constants (fields marked with `static` and `final`) are not reported.\n\n**Example:**\n\n\n class Main {\n public String name;\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private String name;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n }\n\nConfigure the inspection:\n\n* Use the **Ignore If Annotated By** list to specify annotations to ignore. The inspection will ignore fields with any of these annotations.\n* Use the **Ignore 'public final' fields of an enum** option to ignore `public final` fields of the `enum` type." }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "SequencedCollectionMethodCanBeUsed", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "PublicField", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 21", - "index": 116, + "id": "Java/Encapsulation", + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -29643,28 +29643,28 @@ ] }, { - "id": "PublicField", + "id": "SequencedCollectionMethodCanBeUsed", "shortDescription": { - "text": "'public' field" + "text": "SequencedCollection method can be used" }, "fullDescription": { - "text": "Reports 'public' fields. Constants (fields marked with 'static' and 'final') are not reported. Example: 'class Main {\n public String name;\n }' After the quick-fix is applied: 'class Main {\n private String name;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n }' Configure the inspection: Use the Ignore If Annotated By list to specify annotations to ignore. The inspection will ignore fields with any of these annotations. Use the Ignore 'public final' fields of an enum option to ignore 'public final' fields of the 'enum' type.", - "markdown": "Reports `public` fields. Constants (fields marked with `static` and `final`) are not reported.\n\n**Example:**\n\n\n class Main {\n public String name;\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private String name;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n }\n\nConfigure the inspection:\n\n* Use the **Ignore If Annotated By** list to specify annotations to ignore. The inspection will ignore fields with any of these annotations.\n* Use the **Ignore 'public final' fields of an enum** option to ignore `public final` fields of the `enum` type." + "text": "Reports collection API method calls that can be simplified using 'SequencedCollection' methods. The following conversions are supported: 'list.add(0, element)' → 'list.addFirst(element);' 'list.get(0)' → 'list.getFirst();' 'list.get(list.size() - 1)' → 'list.getLast();' 'list.remove(0)' → 'list.removeFirst();' 'list.remove(list.size() - 1)' → 'list.removeLast();' 'collection.iterator().next()' → 'collection.getFirst();' This inspection depends on the Java feature 'Sequenced Collections' which is available since Java 21. New in 2023.3", + "markdown": "Reports collection API method calls that can be simplified using `SequencedCollection` methods.\n\nThe following conversions are supported:\n\n* `list.add(0, element)` → `list.addFirst(element);`\n* `list.get(0)` → `list.getFirst();`\n* `list.get(list.size() - 1)` → `list.getLast();`\n* `list.remove(0)` → `list.removeFirst();`\n* `list.remove(list.size() - 1)` → `list.removeLast();`\n* `collection.iterator().next()` → `collection.getFirst();`\n\nThis inspection depends on the Java feature 'Sequenced Collections' which is available since Java 21.\n\nNew in 2023.3" }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "PublicField", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "SequencedCollectionMethodCanBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Encapsulation", - "index": 82, + "id": "Java/Java language level migration aids/Java 21", + "index": 116, "toolComponent": { "name": "QDJVMC" } @@ -29832,7 +29832,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29876,39 +29876,6 @@ } ] }, - { - "id": "LambdaCanBeReplacedWithAnonymous", - "shortDescription": { - "text": "Lambda can be replaced with anonymous class" - }, - "fullDescription": { - "text": "Reports lambda expressions that can be replaced with anonymous classes. Expanding lambda expressions to anonymous classes may be useful if you need to implement other methods inside an anonymous class. Example: 's -> System.out.println(s)' After the quick-fix is applied: 'new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n}' This inspection depends on the Java feature 'Lambda expressions' which is available since Java 8.", - "markdown": "Reports lambda expressions that can be replaced with anonymous classes.\n\n\nExpanding lambda expressions to anonymous classes may be useful if you need to implement other\nmethods inside an anonymous class.\n\nExample:\n\n\n s -> System.out.println(s)\n\nAfter the quick-fix is applied:\n\n new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n }\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "LambdaCanBeReplacedWithAnonymous", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Code style issues", - "index": 8, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "RedundantCompareCall", "shortDescription": { @@ -29942,6 +29909,39 @@ } ] }, + { + "id": "LambdaCanBeReplacedWithAnonymous", + "shortDescription": { + "text": "Lambda can be replaced with anonymous class" + }, + "fullDescription": { + "text": "Reports lambda expressions that can be replaced with anonymous classes. Expanding lambda expressions to anonymous classes may be useful if you need to implement other methods inside an anonymous class. Example: 's -> System.out.println(s)' After the quick-fix is applied: 'new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n}' This inspection depends on the Java feature 'Lambda expressions' which is available since Java 8.", + "markdown": "Reports lambda expressions that can be replaced with anonymous classes.\n\n\nExpanding lambda expressions to anonymous classes may be useful if you need to implement other\nmethods inside an anonymous class.\n\nExample:\n\n\n s -> System.out.println(s)\n\nAfter the quick-fix is applied:\n\n new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n }\n\nThis inspection depends on the Java feature 'Lambda expressions' which is available since Java 8." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LambdaCanBeReplacedWithAnonymous", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "EmptyClass", "shortDescription": { @@ -30195,7 +30195,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -30265,7 +30265,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -30467,7 +30467,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -30863,7 +30863,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -30896,7 +30896,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 22, + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -31193,7 +31193,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -31205,19 +31205,19 @@ ] }, { - "id": "IteratorHasNextCallsIteratorNext", + "id": "EqualsAndHashcode", "shortDescription": { - "text": "'Iterator.hasNext()' which calls 'next()'" + "text": "'equals()' and 'hashCode()' not paired" }, "fullDescription": { - "text": "Reports implementations of 'Iterator.hasNext()' or 'ListIterator.hasPrevious()' that call 'Iterator.next()' or 'ListIterator.previous()' on the iterator instance. Such calls are almost certainly an error, as methods like 'hasNext()' should not modify the iterators state, while 'next()' should. Example: 'class MyIterator implements Iterator {\n public boolean hasNext() {\n return next() != null;\n }\n }'", - "markdown": "Reports implementations of `Iterator.hasNext()` or `ListIterator.hasPrevious()` that call `Iterator.next()` or `ListIterator.previous()` on the iterator instance. Such calls are almost certainly an error, as methods like `hasNext()` should not modify the iterators state, while `next()` should.\n\n**Example:**\n\n\n class MyIterator implements Iterator {\n public boolean hasNext() {\n return next() != null;\n }\n }\n" + "text": "Reports classes that override the 'equals()' method but do not override the 'hashCode()' method or vice versa, which can potentially lead to problems when the class is added to a 'Collection' or a 'HashMap'. The quick-fix generates the default implementation for an absent method. Example: 'class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n}' After the quick-fix is applied: 'class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof StringHolder)) return false;\n\n StringHolder holder = (StringHolder)o;\n\n if (s != null ? !s.equals(holder.s) : holder.s != null) return false;\n\n return true;\n }\n}'", + "markdown": "Reports classes that override the `equals()` method but do not override the `hashCode()` method or vice versa, which can potentially lead to problems when the class is added to a `Collection` or a `HashMap`.\n\nThe quick-fix generates the default implementation for an absent method.\n\nExample:\n\n\n class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof StringHolder)) return false;\n\n StringHolder holder = (StringHolder)o;\n\n if (s != null ? !s.equals(holder.s) : holder.s != null) return false;\n\n return true;\n }\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "IteratorHasNextCallsIteratorNext", + "suppressToolId": "EqualsAndHashcode", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31226,7 +31226,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -31238,19 +31238,19 @@ ] }, { - "id": "EqualsAndHashcode", + "id": "IteratorHasNextCallsIteratorNext", "shortDescription": { - "text": "'equals()' and 'hashCode()' not paired" + "text": "'Iterator.hasNext()' which calls 'next()'" }, "fullDescription": { - "text": "Reports classes that override the 'equals()' method but do not override the 'hashCode()' method or vice versa, which can potentially lead to problems when the class is added to a 'Collection' or a 'HashMap'. The quick-fix generates the default implementation for an absent method. Example: 'class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n}' After the quick-fix is applied: 'class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof StringHolder)) return false;\n\n StringHolder holder = (StringHolder)o;\n\n if (s != null ? !s.equals(holder.s) : holder.s != null) return false;\n\n return true;\n }\n}'", - "markdown": "Reports classes that override the `equals()` method but do not override the `hashCode()` method or vice versa, which can potentially lead to problems when the class is added to a `Collection` or a `HashMap`.\n\nThe quick-fix generates the default implementation for an absent method.\n\nExample:\n\n\n class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof StringHolder)) return false;\n\n StringHolder holder = (StringHolder)o;\n\n if (s != null ? !s.equals(holder.s) : holder.s != null) return false;\n\n return true;\n }\n }\n" + "text": "Reports implementations of 'Iterator.hasNext()' or 'ListIterator.hasPrevious()' that call 'Iterator.next()' or 'ListIterator.previous()' on the iterator instance. Such calls are almost certainly an error, as methods like 'hasNext()' should not modify the iterators state, while 'next()' should. Example: 'class MyIterator implements Iterator {\n public boolean hasNext() {\n return next() != null;\n }\n }'", + "markdown": "Reports implementations of `Iterator.hasNext()` or `ListIterator.hasPrevious()` that call `Iterator.next()` or `ListIterator.previous()` on the iterator instance. Such calls are almost certainly an error, as methods like `hasNext()` should not modify the iterators state, while `next()` should.\n\n**Example:**\n\n\n class MyIterator implements Iterator {\n public boolean hasNext() {\n return next() != null;\n }\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "EqualsAndHashcode", + "suppressToolId": "IteratorHasNextCallsIteratorNext", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31259,7 +31259,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -31328,7 +31328,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -31394,7 +31394,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -31460,7 +31460,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -31625,7 +31625,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -31637,19 +31637,19 @@ ] }, { - "id": "MethodWithMultipleLoops", + "id": "NegativelyNamedBooleanVariable", "shortDescription": { - "text": "Method with multiple loops" + "text": "Negatively named boolean variable" }, "fullDescription": { - "text": "Reports methods that contain more than one loop statement. Example: The method below will be reported because it contains two loops: 'void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }' The following method will also be reported because it contains a nested loop: 'void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }'", - "markdown": "Reports methods that contain more than one loop statement.\n\n**Example:**\n\nThe method below will be reported because it contains two loops:\n\n\n void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }\n\nThe following method will also be reported because it contains a nested loop:\n\n\n void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }\n" + "text": "Reports negatively named variables, for example: 'disabled', 'hidden', or 'isNotChanged'. Usually, inverting the 'boolean' value and removing the negation from the name makes the code easier to understand. Example: 'boolean disabled = false;'", + "markdown": "Reports negatively named variables, for example: `disabled`, `hidden`, or `isNotChanged`.\n\nUsually, inverting the `boolean` value and removing the negation from the name makes the code easier to understand.\n\nExample:\n\n\n boolean disabled = false;\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MethodWithMultipleLoops", + "suppressToolId": "NegativelyNamedBooleanVariable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31657,8 +31657,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 86, + "id": "Java/Data flow", + "index": 41, "toolComponent": { "name": "QDJVMC" } @@ -31694,7 +31694,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -31706,19 +31706,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" } @@ -31726,8 +31726,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 41, + "id": "Java/Method metrics", + "index": 86, "toolComponent": { "name": "QDJVMC" } @@ -32057,7 +32057,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -32126,7 +32126,7 @@ { "target": { "id": "Java/Probable bugs", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -32138,19 +32138,19 @@ ] }, { - "id": "ModuleWithTooFewClasses", + "id": "UseOfObsoleteDateTimeApi", "shortDescription": { - "text": "Module with too few classes" + "text": "Use of obsolete date-time API" }, "fullDescription": { - "text": "Reports modules that contain too few classes. Overly small modules may indicate a too fragmented design. Java, Kotlin and Groovy classes are counted. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Minimum number of classes field to specify the minimum number of classes a module may have.", - "markdown": "Reports modules that contain too few classes. Overly small modules may indicate a too fragmented design. Java, Kotlin and Groovy classes are counted.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Minimum number of classes** field to specify the minimum number of classes a module may have." + "text": "Reports usages of 'java.util.Date', 'java.util.Calendar', 'java.util.GregorianCalendar', 'java.util.TimeZone', and 'java.util.SimpleTimeZone'. While still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably not be used in new development.", + "markdown": "Reports usages of `java.util.Date`, `java.util.Calendar`, `java.util.GregorianCalendar`, `java.util.TimeZone`, and `java.util.SimpleTimeZone`.\n\nWhile still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably\nnot be used in new development." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ModuleWithTooFewClasses", + "suppressToolId": "UseOfObsoleteDateTimeApi", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32158,8 +32158,8 @@ "relationships": [ { "target": { - "id": "Java/Modularization issues", - "index": 47, + "id": "Java/Code maturity", + "index": 36, "toolComponent": { "name": "QDJVMC" } @@ -32171,19 +32171,19 @@ ] }, { - "id": "UseOfObsoleteDateTimeApi", + "id": "ModuleWithTooFewClasses", "shortDescription": { - "text": "Use of obsolete date-time API" + "text": "Module with too few classes" }, "fullDescription": { - "text": "Reports usages of 'java.util.Date', 'java.util.Calendar', 'java.util.GregorianCalendar', 'java.util.TimeZone', and 'java.util.SimpleTimeZone'. While still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably not be used in new development.", - "markdown": "Reports usages of `java.util.Date`, `java.util.Calendar`, `java.util.GregorianCalendar`, `java.util.TimeZone`, and `java.util.SimpleTimeZone`.\n\nWhile still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably\nnot be used in new development." + "text": "Reports modules that contain too few classes. Overly small modules may indicate a too fragmented design. Java, Kotlin and Groovy classes are counted. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Minimum number of classes field to specify the minimum number of classes a module may have.", + "markdown": "Reports modules that contain too few classes. Overly small modules may indicate a too fragmented design. Java, Kotlin and Groovy classes are counted.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Minimum number of classes** field to specify the minimum number of classes a module may have." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UseOfObsoleteDateTimeApi", + "suppressToolId": "ModuleWithTooFewClasses", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32191,8 +32191,8 @@ "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 36, + "id": "Java/Modularization issues", + "index": 47, "toolComponent": { "name": "QDJVMC" } @@ -32357,7 +32357,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -32435,19 +32435,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" } @@ -32455,8 +32455,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 9", - "index": 55, + "id": "Java/Imports", + "index": 17, "toolComponent": { "name": "QDJVMC" } @@ -32468,19 +32468,19 @@ ] }, { - "id": "StaticImport", + "id": "ReplaceNullCheck", "shortDescription": { - "text": "Static import" + "text": "Null check can be replaced with method call" }, "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 '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": false, "level": "warning", "parameters": { - "suppressToolId": "StaticImport", + "suppressToolId": "ReplaceNullCheck", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32488,8 +32488,8 @@ "relationships": [ { "target": { - "id": "Java/Imports", - "index": 17, + "id": "Java/Java language level migration aids/Java 9", + "index": 55, "toolComponent": { "name": "QDJVMC" } @@ -32555,7 +32555,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 21, + "index": 22, "toolComponent": { "name": "QDJVMC" } @@ -32732,7 +32732,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -33194,7 +33194,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -33470,21 +33470,21 @@ ] }, { - "id": "ReplaceStringFormatWithLiteral", + "id": "ReplaceNotNullAssertionWithElvisReturn", "shortDescription": { - "text": "'String.format' call can be replaced with string templates" + "text": "Not-null assertion can be replaced with 'return'" }, "fullDescription": { - "text": "Reports 'String.format' calls that can be replaced with string templates. Using string templates makes your code simpler. The quick-fix replaces the call with a string template. Example: 'fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }' After the quick-fix is applied: 'fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }'", - "markdown": "Reports `String.format` calls that can be replaced with string templates.\n\nUsing string templates makes your code simpler.\n\nThe quick-fix replaces the call with a string template.\n\n**Example:**\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }\n" + "text": "Reports not-null assertion ('!!') calls that can be replaced with the elvis operator and return ('?: return'). A not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of '!!' is good practice. The quick-fix replaces the not-null assertion with 'return' or 'return null'. Example: 'fun test(number: Int?) {\n val x = number!!\n }' After the quick-fix is applied: 'fun test(number: Int?) {\n val x = number ?: return\n }'", + "markdown": "Reports not-null assertion (`!!`) calls that can be replaced with the elvis operator and return (`?: return`).\n\nA not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of `!!` is good practice.\n\nThe quick-fix replaces the not-null assertion with `return` or `return null`.\n\n**Example:**\n\n\n fun test(number: Int?) {\n val x = number!!\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(number: Int?) {\n val x = number ?: return\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "suppressToolId": "ReplaceStringFormatWithLiteral", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "ReplaceNotNullAssertionWithElvisReturn", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ @@ -33503,21 +33503,21 @@ ] }, { - "id": "ReplaceNotNullAssertionWithElvisReturn", + "id": "ReplaceStringFormatWithLiteral", "shortDescription": { - "text": "Not-null assertion can be replaced with 'return'" + "text": "'String.format' call can be replaced with string templates" }, "fullDescription": { - "text": "Reports not-null assertion ('!!') calls that can be replaced with the elvis operator and return ('?: return'). A not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of '!!' is good practice. The quick-fix replaces the not-null assertion with 'return' or 'return null'. Example: 'fun test(number: Int?) {\n val x = number!!\n }' After the quick-fix is applied: 'fun test(number: Int?) {\n val x = number ?: return\n }'", - "markdown": "Reports not-null assertion (`!!`) calls that can be replaced with the elvis operator and return (`?: return`).\n\nA not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of `!!` is good practice.\n\nThe quick-fix replaces the not-null assertion with `return` or `return null`.\n\n**Example:**\n\n\n fun test(number: Int?) {\n val x = number!!\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(number: Int?) {\n val x = number ?: return\n }\n" + "text": "Reports 'String.format' calls that can be replaced with string templates. Using string templates makes your code simpler. The quick-fix replaces the call with a string template. Example: 'fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }' After the quick-fix is applied: 'fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }'", + "markdown": "Reports `String.format` calls that can be replaced with string templates.\n\nUsing string templates makes your code simpler.\n\nThe quick-fix replaces the call with a string template.\n\n**Example:**\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = String.format(\"%s_%s_%s\", id, date, id)\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val id = \"abc\"\n val date = \"123\"\n val s = \"${id}_${date}_$id\"\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "suppressToolId": "ReplaceNotNullAssertionWithElvisReturn", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "ReplaceStringFormatWithLiteral", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ @@ -33755,7 +33755,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -33854,7 +33854,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -34382,7 +34382,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -34448,7 +34448,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -34679,7 +34679,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -35768,7 +35768,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -36440,28 +36440,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" } @@ -36473,28 +36473,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" } @@ -37121,7 +37121,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -37166,19 +37166,19 @@ ] }, { - "id": "IfThenToElvis", + "id": "ObjectPrivatePropertyName", "shortDescription": { - "text": "If-Then foldable to '?:'" + "text": "Object private property naming convention" }, "fullDescription": { - "text": "Reports 'if-then' expressions that can be folded into elvis ('?:') expressions. Example: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo' The quick fix converts the 'if-then' expression into an elvis ('?:') expression: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"'", - "markdown": "Reports `if-then` expressions that can be folded into elvis (`?:`) expressions.\n\n**Example:**\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo\n\nThe quick fix converts the `if-then` expression into an elvis (`?:`) expression:\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"\n" + "text": "Reports properties that do not follow the naming conventions. The following properties are reported: Private properties in objects and companion objects You can specify the required pattern in the inspection options. Recommended naming conventions: it has to start with an underscore or an uppercase letter, use camel case. Example: 'class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }'", + "markdown": "Reports properties that do not follow the naming conventions.\n\nThe following properties are reported:\n\n* Private properties in objects and companion objects\n\nYou can specify the required pattern in the inspection options.\n\n[Recommended naming conventions](https://kotlinlang.org/docs/coding-conventions.html#naming-rules): it has to start with an underscore or an uppercase letter, use camel case.\n\n**Example:**\n\n\n class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }\n" }, "defaultConfiguration": { "enabled": true, "level": "note", "parameters": { - "suppressToolId": "IfThenToElvis", + "suppressToolId": "ObjectPrivatePropertyName", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -37186,8 +37186,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 3, + "id": "Kotlin/Naming conventions", + "index": 44, "toolComponent": { "name": "QDJVMC" } @@ -37199,19 +37199,19 @@ ] }, { - "id": "ObjectPrivatePropertyName", + "id": "IfThenToElvis", "shortDescription": { - "text": "Object private property naming convention" + "text": "If-Then foldable to '?:'" }, "fullDescription": { - "text": "Reports properties that do not follow the naming conventions. The following properties are reported: Private properties in objects and companion objects You can specify the required pattern in the inspection options. Recommended naming conventions: it has to start with an underscore or an uppercase letter, use camel case. Example: 'class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }'", - "markdown": "Reports properties that do not follow the naming conventions.\n\nThe following properties are reported:\n\n* Private properties in objects and companion objects\n\nYou can specify the required pattern in the inspection options.\n\n[Recommended naming conventions](https://kotlinlang.org/docs/coding-conventions.html#naming-rules): it has to start with an underscore or an uppercase letter, use camel case.\n\n**Example:**\n\n\n class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }\n" + "text": "Reports 'if-then' expressions that can be folded into elvis ('?:') expressions. Example: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo' The quick fix converts the 'if-then' expression into an elvis ('?:') expression: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"'", + "markdown": "Reports `if-then` expressions that can be folded into elvis (`?:`) expressions.\n\n**Example:**\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo\n\nThe quick fix converts the `if-then` expression into an elvis (`?:`) expression:\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"\n" }, "defaultConfiguration": { "enabled": true, "level": "note", "parameters": { - "suppressToolId": "ObjectPrivatePropertyName", + "suppressToolId": "IfThenToElvis", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -37219,8 +37219,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Naming conventions", - "index": 44, + "id": "Kotlin/Style issues", + "index": 3, "toolComponent": { "name": "QDJVMC" } @@ -38375,7 +38375,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -38672,7 +38672,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -39200,7 +39200,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -39563,7 +39563,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -39761,7 +39761,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -40025,7 +40025,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -40289,7 +40289,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -40520,7 +40520,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -40817,7 +40817,7 @@ { "target": { "id": "Kotlin/Migration", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -42161,19 +42161,19 @@ ] }, { - "id": "GroovyMethodParameterCount", + "id": "GrReassignedInClosureLocalVar", "shortDescription": { - "text": "Method with too many parameters" + "text": "Local variable is reassigned in closure or anonymous class" }, "fullDescription": { - "text": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection. Use the Maximum number of parameters: field to specify the maximum acceptable number of parameters a method might have.", - "markdown": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection.\n\n\nUse the **Maximum number of parameters:** field to specify the maximum acceptable number of parameters a method might have." + "text": "Reports local variables assigned to expression with different type inside of closure or anonymous class. Example: 'int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)' As a result, the 'integer' variable sum is reassigned to a 'String' expression.", + "markdown": "Reports local variables assigned to expression with different type inside of closure or anonymous class.\n\n**Example:**\n\n\n int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)\n\nAs a result, the `integer` variable **sum** is reassigned to a `String` expression." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovyMethodParameterCount", + "suppressToolId": "GrReassignedInClosureLocalVar", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42181,8 +42181,8 @@ "relationships": [ { "target": { - "id": "Groovy/Method metrics", - "index": 96, + "id": "Groovy/Potentially confusing code constructs", + "index": 75, "toolComponent": { "name": "QDJVMC" } @@ -42194,19 +42194,19 @@ ] }, { - "id": "GrReassignedInClosureLocalVar", + "id": "GroovyMethodParameterCount", "shortDescription": { - "text": "Local variable is reassigned in closure or anonymous class" + "text": "Method with too many parameters" }, "fullDescription": { - "text": "Reports local variables assigned to expression with different type inside of closure or anonymous class. Example: 'int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)' As a result, the 'integer' variable sum is reassigned to a 'String' expression.", - "markdown": "Reports local variables assigned to expression with different type inside of closure or anonymous class.\n\n**Example:**\n\n\n int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)\n\nAs a result, the `integer` variable **sum** is reassigned to a `String` expression." + "text": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection. Use the Maximum number of parameters: field to specify the maximum acceptable number of parameters a method might have.", + "markdown": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection.\n\n\nUse the **Maximum number of parameters:** field to specify the maximum acceptable number of parameters a method might have." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GrReassignedInClosureLocalVar", + "suppressToolId": "GroovyMethodParameterCount", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42214,8 +42214,8 @@ "relationships": [ { "target": { - "id": "Groovy/Potentially confusing code constructs", - "index": 75, + "id": "Groovy/Method metrics", + "index": 96, "toolComponent": { "name": "QDJVMC" } @@ -42260,19 +42260,19 @@ ] }, { - "id": "GroovyEmptyStatementBody", + "id": "GroovyLabeledStatement", "shortDescription": { - "text": "Statement with empty body" + "text": "Labeled statement inspection" }, "fullDescription": { - "text": "Reports 'if', 'while', 'do' or 'for' statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo. Example: 'if (condition) {}\nwhile(true){}'", - "markdown": "Reports `if`, `while`, `do` or `for` statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo.\n\n**Example:**\n\n\n if (condition) {}\n while(true){}\n\n" + "text": "Reports labels already used in parent workflow. Example: 'def list = [\"foo\"]\ncycle:\nfor (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n}'", + "markdown": "Reports labels already used in parent workflow.\n\n**Example:**\n\n\n def list = [\"foo\"]\n cycle:\n for (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n }\n\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovyEmptyStatementBody", + "suppressToolId": "GroovyLabeledStatement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42280,8 +42280,8 @@ "relationships": [ { "target": { - "id": "Groovy/Potentially confusing code constructs", - "index": 75, + "id": "Groovy/Probable bugs", + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -42293,19 +42293,19 @@ ] }, { - "id": "GroovyLabeledStatement", + "id": "GroovyEmptyStatementBody", "shortDescription": { - "text": "Labeled statement inspection" + "text": "Statement with empty body" }, "fullDescription": { - "text": "Reports labels already used in parent workflow. Example: 'def list = [\"foo\"]\ncycle:\nfor (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n}'", - "markdown": "Reports labels already used in parent workflow.\n\n**Example:**\n\n\n def list = [\"foo\"]\n cycle:\n for (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n }\n\n" + "text": "Reports 'if', 'while', 'do' or 'for' statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo. Example: 'if (condition) {}\nwhile(true){}'", + "markdown": "Reports `if`, `while`, `do` or `for` statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo.\n\n**Example:**\n\n\n if (condition) {}\n while(true){}\n\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovyLabeledStatement", + "suppressToolId": "GroovyEmptyStatementBody", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -42313,8 +42313,8 @@ "relationships": [ { "target": { - "id": "Groovy/Probable bugs", - "index": 38, + "id": "Groovy/Potentially confusing code constructs", + "index": 75, "toolComponent": { "name": "QDJVMC" } @@ -53437,7 +53437,7 @@ }, "invocations": [ { - "startTimeUtc": "2024-07-19T22:52:27.806179848Z", + "startTimeUtc": "2024-07-25T22:39:19.662518244Z", "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-19T22:56:34.675911279Z", + "timeUtc": "2024-07-25T22:43:28.127194953Z", "properties": { "qodanaKind": "sanityFailure" } @@ -53458,8 +53458,8 @@ "versionControlProvenance": [ { "repositoryUri": "https://github.com/cvette/intellij-neos.git", - "revisionId": "873aafcfd947b79b9a9d113402f285a0c5b7d5b5", - "branch": "dependabot/gradle/org.jetbrains.kotlinx.kover-0.8.3", + "revisionId": "834cf38886d64323fe645e93c089818e8d366fbb", + "branch": "dependabot/gradle/io.sentry-sentry-7.12.1", "properties": { "repoUrl": "https://github.com/cvette/intellij-neos.git", "lastAuthorName": "dependabot[bot]", @@ -65813,10 +65813,10 @@ } ], "automationDetails": { - "id": "Intellij Neos/qodana/2024-07-19", - "guid": "e76aa67d-9beb-4ac1-919b-bb24992cb7e9", + "id": "Intellij Neos/qodana/2024-07-25", + "guid": "826fc552-ccad-418d-abf8-4dc0498c7d36", "properties": { - "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/10015268241" + "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/10102494817" } }, "newlineSequences": [ @@ -65825,59 +65825,6 @@ ], "properties": { "qodana.sanity.results": [ - { - "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": 46, - "startColumn": 36, - "charOffset": 1851, - "charLength": 18, - "snippet": { - "text": "FusionMetaProperty" - }, - "sourceLanguage": "JAVA" - }, - "contextRegion": { - "startLine": 44, - "startColumn": 1, - "charOffset": 1767, - "charLength": 225, - "snippet": { - "text": " && getChildren().length == 2) {\n\n PsiElement element = ((FusionMetaProperty) getLastChild()).getMetaPropertyName();\n return element != null && element.getText().equals(\"class\");\n }" - }, - "sourceLanguage": "JAVA" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "Intellij_Neos.main", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "2ddd37f3fbf8366d", - "equalIndicator/v1": "1096c5da920fb9ac040bc4281a36ca55dc7d4ce2f1de5eb76cb8baf9caa9af4c" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, { "ruleId": "QodanaJavaSanity", "kind": "fail", @@ -66360,33 +66307,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionMetaProperty", - "markdown": "Unresolved reference FusionMetaProperty" + "text": "Unresolved reference FusionNamespaceDeclaration", + "markdown": "Unresolved reference FusionNamespaceDeclaration" }, "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/stubs/FusionNamespaceDeclarationStub.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 43, - "startColumn": 46, - "charOffset": 1748, - "charLength": 18, + "startLine": 22, + "startColumn": 43, + "charOffset": 879, + "charLength": 26, "snippet": { - "text": "FusionMetaProperty" + "text": "FusionNamespaceDeclaration" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 41, + "startLine": 20, "startColumn": 1, - "charOffset": 1603, - "charLength": 212, + "charOffset": 803, + "charLength": 265, "snippet": { - "text": " public boolean isPrototypeClassProperty() {\n if (getPrototypeSignatureList().size() == 1\n && getLastChild() instanceof FusionMetaProperty\n && getChildren().length == 2) {\n" + "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" } @@ -66400,8 +66347,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "9de6d996fdf85565", - "equalIndicator/v1": "775754fe84c06053ddf40ca2584949269b316b2f7247cb42d84a1fc1510525b8" + "equalIndicator/v2": "fa6676aa64ef0ad0", + "equalIndicator/v1": "73fb333f26f9084dcb187e5949ed237ac6f29d9c2c62bf12238cd220ee8cec5f" }, "properties": { "ideaSeverity": "ERROR", @@ -66572,33 +66519,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionNamespaceDeclarationImpl", - "markdown": "Unresolved reference FusionNamespaceDeclarationImpl" + "text": "Unresolved reference FusionPrototypeInstance", + "markdown": "Unresolved reference FusionPrototypeInstance" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", + "uri": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 44, - "startColumn": 24, - "charOffset": 1865, - "charLength": 30, + "startLine": 107, + "startColumn": 35, + "charOffset": 3783, + "charLength": 23, "snippet": { - "text": "FusionNamespaceDeclarationImpl" + "text": "FusionPrototypeInstance" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 42, + "startLine": 105, "startColumn": 1, - "charOffset": 1724, - "charLength": 195, + "charOffset": 3637, + "charLength": 295, "snippet": { - "text": " @Override\n public FusionNamespaceDeclaration createPsi(@NotNull FusionNamespaceDeclarationStub stub) {\n return new FusionNamespaceDeclarationImpl(stub, this);\n }\n" + "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 +66559,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "fcf20026e3de62bf", - "equalIndicator/v1": "bd344c9f95d2eae8fa7431d35bbacc2eeefdbef50ce8f275f9b99baa6fc0eb07" + "equalIndicator/v2": "c7ca10b2ce6f366f", + "equalIndicator/v1": "bfe3f74a00d4e1bd98f560359662253c75c8e8de42a84227e42ce80fe3f74c39" }, "properties": { "ideaSeverity": "ERROR", @@ -66625,33 +66572,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionPrototypeInstance", - "markdown": "Unresolved reference FusionPrototypeInstance" + "text": "Unresolved reference FusionPrototypeSignature", + "markdown": "Unresolved reference FusionPrototypeSignature" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 107, - "startColumn": 35, - "charOffset": 3783, - "charLength": 23, + "startLine": 56, + "startColumn": 52, + "charOffset": 2185, + "charLength": 24, "snippet": { - "text": "FusionPrototypeInstance" + "text": "FusionPrototypeSignature" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 105, + "startLine": 54, "startColumn": 1, - "charOffset": 3637, - "charLength": 295, + "charOffset": 2037, + "charLength": 292, "snippet": { - "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;" + "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" } @@ -66665,8 +66612,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "c7ca10b2ce6f366f", - "equalIndicator/v1": "bfe3f74a00d4e1bd98f560359662253c75c8e8de42a84227e42ce80fe3f74c39" + "equalIndicator/v2": "15d2558f272e202d", + "equalIndicator/v1": "c8fd52b4a4098108f0e9ebeb08c1ff458107160ca1e57b6fb3a23bc267ec0b99" }, "properties": { "ideaSeverity": "ERROR", @@ -66784,33 +66731,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionType", - "markdown": "Unresolved reference FusionType" + "text": "Unresolved reference FusionPath", + "markdown": "Unresolved reference FusionPath" }, "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/psi/impl/ext/FusionPathImplMixin.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 23, - "startColumn": 43, - "charOffset": 925, + "startLine": 26, + "startColumn": 80, + "charOffset": 1113, "charLength": 10, "snippet": { - "text": "FusionType" + "text": "FusionPath" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 21, + "startLine": 24, "startColumn": 1, - "charOffset": 811, - "charLength": 258, + "charOffset": 991, + "charLength": 217, "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": "import org.jetbrains.annotations.NotNull;\n\npublic abstract class FusionPathImplMixin extends FusionElementImpl implements FusionPath {\n public FusionPathImplMixin(@NotNull ASTNode astNode) {\n super(astNode);" }, "sourceLanguage": "JAVA" } @@ -66824,8 +66771,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "c64d6a32b1177f59", - "equalIndicator/v1": "dfb17773c53ec0e26a4c6879295215d10b9aa9c45c6f93eb1e8a61045a77a8ec" + "equalIndicator/v2": "52515624c098f456", + "equalIndicator/v1": "dd89448a7e42bdc725913790f1d3b58e1ebc28c74807cf22b4efed5fe91f2604" }, "properties": { "ideaSeverity": "ERROR", @@ -66837,33 +66784,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference FusionNamespaceDeclaration", - "markdown": "Unresolved reference FusionNamespaceDeclaration" + "text": "Unresolved reference FusionType", + "markdown": "Unresolved reference FusionType" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/psi/impl/ext/FusionTypeImplMixin.java", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 40, - "startColumn": 73, - "charOffset": 1626, - "charLength": 26, + "startLine": 23, + "startColumn": 43, + "charOffset": 925, + "charLength": 10, "snippet": { - "text": "FusionNamespaceDeclaration" + "text": "FusionType" }, "sourceLanguage": "JAVA" }, "contextRegion": { - "startLine": 38, + "startLine": 21, "startColumn": 1, - "charOffset": 1547, - "charLength": 194, + "charOffset": 811, + "charLength": 258, "snippet": { - "text": " }\n\n public static FusionStubElementType TYPE = new FusionStubElementType<>(\"FUSION_NAMESPACE_DECLARATION\") {\n\n @Override" + "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" } @@ -66877,8 +66824,8 @@ } ], "partialFingerprints": { - "equalIndicator/v2": "5e1c5878f2def127", - "equalIndicator/v1": "eb855ddb3f03cef5149ab03074b75dc3af8092956701d41f154f3090fcb98938" + "equalIndicator/v2": "c64d6a32b1177f59", + "equalIndicator/v1": "dfb17773c53ec0e26a4c6879295215d10b9aa9c45c6f93eb1e8a61045a77a8ec" }, "properties": { "ideaSeverity": "ERROR", @@ -66937,6 +66884,59 @@ "ideaSeverity": "ERROR", "qodanaSeverity": "Critical" } + }, + { + "ruleId": "QodanaJavaSanity", + "kind": "fail", + "level": "error", + "message": { + "text": "Unresolved reference FusionNamespaceDeclarationImpl", + "markdown": "Unresolved reference FusionNamespaceDeclarationImpl" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 23, + "startColumn": 48, + "charOffset": 954, + "charLength": 30, + "snippet": { + "text": "FusionNamespaceDeclarationImpl" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 21, + "startColumn": 1, + "charOffset": 804, + "charLength": 306, + "snippet": { + "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" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "Intellij_Neos.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "250dfbc9fd840a31", + "equalIndicator/v1": "f4e86814ccf2a2f6344dd68e5c9945a11bd7e990c3112215ef46654b967d3eb1" + }, + "properties": { + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" + } } ], "configProfile": "recommended", diff --git a/results/sanity.json b/results/sanity.json index bf8c6d7..b62701c 100644 --- a/results/sanity.json +++ b/results/sanity.json @@ -1,35 +1,4 @@ {"version":"3","listProblem":[{ - "tool": "Code Inspection", - "category": "General", - "type": "Java sanity", - "tags": [ - "Sanity" - ], - "severity": "Critical", - "comment": "Unresolved reference FusionMetaProperty", - "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": 46, - "offset": 36, - "length": 18, - "code": { - "startLine": 44, - "length": 18, - "offset": 84, - "surroundingCode": " && getChildren().length == 2) {\n\n PsiElement element = ((FusionMetaProperty) getLastChild()).getMetaPropertyName();\n return element != null && element.getText().equals(\"class\");\n }" - } - } - ], - "attributes": { - "module": "Intellij_Neos.main", - "inspectionName": "QodanaJavaSanity" - }, - "hash": "1096c5da920fb9ac040bc4281a36ca55dc7d4ce2f1de5eb76cb8baf9caa9af4c" -},{ "tool": "Code Inspection", "category": "General", "type": "Java sanity", @@ -316,21 +285,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionMetaProperty", + "comment": "Unresolved reference FusionNamespaceDeclaration", "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/stubs/FusionNamespaceDeclarationStub.java", "language": "JAVA", - "line": 43, - "offset": 46, - "length": 18, + "line": 22, + "offset": 43, + "length": 26, "code": { - "startLine": 41, - "length": 18, - "offset": 145, - "surroundingCode": " public boolean isPrototypeClassProperty() {\n if (getPrototypeSignatureList().size() == 1\n && getLastChild() instanceof FusionMetaProperty\n && getChildren().length == 2) {\n" + "startLine": 20, + "length": 26, + "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;" } } ], @@ -338,7 +307,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "775754fe84c06053ddf40ca2584949269b316b2f7247cb42d84a1fc1510525b8" + "hash": "73fb333f26f9084dcb187e5949ed237ac6f29d9c2c62bf12238cd220ee8cec5f" },{ "tool": "Code Inspection", "category": "General", @@ -440,21 +409,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionNamespaceDeclarationImpl", + "comment": "Unresolved reference FusionPrototypeInstance", "detailsInfo": "Reports unresolved references in Java code.", "sources": [ { "type": "file", - "path": "src/main/java/de/vette/idea/neos/lang/fusion/stubs/FusionNamespaceDeclarationStub.java", + "path": "src/main/java/de/vette/idea/neos/util/NeosUtil.java", "language": "JAVA", - "line": 44, - "offset": 24, - "length": 30, + "line": 107, + "offset": 35, + "length": 23, "code": { - "startLine": 42, - "length": 30, - "offset": 141, - "surroundingCode": " @Override\n public FusionNamespaceDeclaration createPsi(@NotNull FusionNamespaceDeclarationStub stub) {\n return new FusionNamespaceDeclarationImpl(stub, this);\n }\n" + "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 +431,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "bd344c9f95d2eae8fa7431d35bbacc2eeefdbef50ce8f275f9b99baa6fc0eb07" + "hash": "bfe3f74a00d4e1bd98f560359662253c75c8e8de42a84227e42ce80fe3f74c39" },{ "tool": "Code Inspection", "category": "General", @@ -471,21 +440,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionPrototypeInstance", + "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/psi/impl/ext/FusionPathImplMixin.java", "language": "JAVA", - "line": 107, - "offset": 35, - "length": 23, + "line": 56, + "offset": 52, + "length": 24, "code": { - "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;" + "startLine": 54, + "length": 24, + "offset": 148, + "surroundingCode": " public String getName() {\n if (getFirstChild() instanceof FusionPrototypeSignature) {\n FusionPrototypeSignature signature = ((FusionPrototypeSignature) getFirstChild());\n if (signature.getType() != null) {\n return signature.getType().getText();" } } ], @@ -493,7 +462,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "bfe3f74a00d4e1bd98f560359662253c75c8e8de42a84227e42ce80fe3f74c39" + "hash": "c8fd52b4a4098108f0e9ebeb08c1ff458107160ca1e57b6fb3a23bc267ec0b99" },{ "tool": "Code Inspection", "category": "General", @@ -564,21 +533,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionType", + "comment": "Unresolved reference FusionPath", "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/lang/fusion/psi/impl/ext/FusionPathImplMixin.java", "language": "JAVA", - "line": 23, - "offset": 43, + "line": 26, + "offset": 80, "length": 10, "code": { - "startLine": 21, + "startLine": 24, "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;" + "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);" } } ], @@ -586,7 +555,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "dfb17773c53ec0e26a4c6879295215d10b9aa9c45c6f93eb1e8a61045a77a8ec" + "hash": "dd89448a7e42bdc725913790f1d3b58e1ebc28c74807cf22b4efed5fe91f2604" },{ "tool": "Code Inspection", "category": "General", @@ -595,21 +564,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference FusionNamespaceDeclaration", + "comment": "Unresolved reference FusionType", "detailsInfo": "Reports unresolved references in Java code.", "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/FusionTypeImplMixin.java", "language": "JAVA", - "line": 40, - "offset": 73, - "length": 26, + "line": 23, + "offset": 43, + "length": 10, "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": 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;" } } ], @@ -617,7 +586,7 @@ "module": "Intellij_Neos.main", "inspectionName": "QodanaJavaSanity" }, - "hash": "eb855ddb3f03cef5149ab03074b75dc3af8092956701d41f154f3090fcb98938" + "hash": "dfb17773c53ec0e26a4c6879295215d10b9aa9c45c6f93eb1e8a61045a77a8ec" },{ "tool": "Code Inspection", "category": "General", @@ -649,4 +618,35 @@ "inspectionName": "QodanaJavaSanity" }, "hash": "f1562135ae41368b60faae3b774883aea299f439399ca545540510f682330925" +},{ + "tool": "Code Inspection", + "category": "General", + "type": "Java sanity", + "tags": [ + "Sanity" + ], + "severity": "Critical", + "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": 23, + "offset": 48, + "length": 30, + "code": { + "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;" + } + } + ], + "attributes": { + "module": "Intellij_Neos.main", + "inspectionName": "QodanaJavaSanity" + }, + "hash": "f4e86814ccf2a2f6344dd68e5c9945a11bd7e990c3112215ef46654b967d3eb1" }]} \ No newline at end of file