diff --git a/results/descriptions/Code_Inspection.json b/results/descriptions/Code_Inspection.json index 07ad20c..bcd1a61 100644 --- a/results/descriptions/Code_Inspection.json +++ b/results/descriptions/Code_Inspection.json @@ -1203,18 +1203,18 @@ "enabled": false, "description": "Reports non-final fields that are accessed in both `synchronized` and non-`synchronized` contexts. `volatile` fields as well as accesses in constructors and initializers are ignored by this inspection.\n\n\nSuch \"partially synchronized\" access is often the result of a coding oversight\nand may lead to unexpectedly inconsistent data structures.\n\n**Example:**\n\n\n public class Program {\n Console console; // warning: Field 'console' is accessed in both synchronized and unsynchronized contexts\n\n public synchronized void execute() {\n console.print(\"running\");\n }\n\n public void check() {\n console.check();\n }\n }\n\n\nUse the option to specify if simple getters and setters are counted as accesses too." }, - { - "shortName": "WaitCalledOnCondition", - "displayName": "'wait()' called on 'java.util.concurrent.locks.Condition' object", - "enabled": false, - "description": "Reports calls to `wait()` made on a `java.util.concurrent.locks.Condition` object. This is probably a programming error, and some variant of the `await()` method was intended instead.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }\n\nGood code would look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n" - }, { "shortName": "NonSynchronizedMethodOverridesSynchronizedMethod", "displayName": "Unsynchronized method overrides 'synchronized' method", "enabled": false, "description": "Reports non-`synchronized` methods overriding `synchronized` methods.\n\n\nThe overridden method will not be automatically synchronized if the superclass method\nis declared as `synchronized`. This may result in unexpected race conditions when using the subclass.\n\n**Example:**\n\n\n class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n } \n" }, + { + "shortName": "WaitCalledOnCondition", + "displayName": "'wait()' called on 'java.util.concurrent.locks.Condition' object", + "enabled": false, + "description": "Reports calls to `wait()` made on a `java.util.concurrent.locks.Condition` object. This is probably a programming error, and some variant of the `await()` method was intended instead.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }\n\nGood code would look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n" + }, { "shortName": "WaitNotifyNotInSynchronizedContext", "displayName": "'wait()' or 'notify()' is not in synchronized context", @@ -1658,18 +1658,18 @@ "enabled": false, "description": "Reports method and constructor calls that implicitly use the platform default charset. Such calls can produce different results on systems that use a different default charset and may result in unexpected behaviour.\n\n**Example:**\n\n void foo(byte[] bytes) {\n String s = new String(bytes);\n }\n\nYou can use a quick-fix that specifies the explicit UTF-8 charset if the corresponding overloaded method is available.\nAfter the quick-fix is applied:\n\n void foo(byte[] bytes) {\n String s = new String(bytes, StandardCharsets.UTF_8);\n }\n" }, - { - "shortName": "UnnecessaryUnicodeEscape", - "displayName": "Unnecessary unicode escape sequence", - "enabled": true, - "description": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab).\n\n**Example:**\n\n String s = \"\\u0062\";\n" - }, { "shortName": "StringTokenizer", "displayName": "Use of 'StringTokenizer'", "enabled": false, "description": "Reports usages of the `StringTokenizer` class. Excessive use of `StringTokenizer` is incorrect in an internationalized environment." }, + { + "shortName": "UnnecessaryUnicodeEscape", + "displayName": "Unnecessary unicode escape sequence", + "enabled": true, + "description": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab).\n\n**Example:**\n\n String s = \"\\u0062\";\n" + }, { "shortName": "NumericToString", "displayName": "Call to 'Number.toString()'", @@ -2013,197 +2013,6 @@ } ] }, - { - "name": "Class structure", - "inspections": [ - { - "shortName": "ConstantDeclaredInAbstractClass", - "displayName": "Constant declared in 'abstract' class", - "enabled": false, - "description": "Reports constants (`public static final` fields) declared in abstract classes.\n\nSome coding standards require declaring constants in interfaces instead." - }, - { - "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": "NonFinalFieldInEnum", - "displayName": "Non-final field in 'enum'", - "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": "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": "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": "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": "ParameterCanBeLocal", - "displayName": "Value passed as parameter never read", - "enabled": true, - "description": "Reports redundant method parameters that can be replaced with local variables.\n\nIf all local usages of a parameter are preceded by assignments to that parameter, the\nparameter can be removed and its usages replaced with local variables.\nIt makes no sense to have such a parameter, as values that are passed to it are overwritten.\nUsually, the problem appears as a result of refactoring.\n\nExample:\n\n\n void test(int p) {\n p = 1;\n System.out.print(p);\n }\n\nAfter the quick-fix is applied:\n\n\n void test() {\n int p = 1;\n System.out.print(p);\n }\n" - }, - { - "shortName": "NoopMethodInAbstractClass", - "displayName": "No-op method in 'abstract' class", - "enabled": false, - "description": "Reports no-op (for \"no operation\") methods in `abstract` classes.\n\nIt is usually a better\ndesign to make such methods `abstract` themselves so that classes inheriting these\nmethods provide their implementations.\n\n**Example:**\n\n\n abstract class Test {\n protected void doTest() {\n }\n }\n" - }, - { - "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": "UtilityClassCanBeEnum", - "displayName": "Utility class can be 'enum'", - "enabled": false, - "description": "Reports utility classes that can be converted to enums.\n\nSome coding style guidelines require implementing utility classes as enums\nto avoid code coverage issues in `private` constructors.\n\n**Example:**\n\n\n class StringUtils {\n public static final String EMPTY = \"\";\n }\n\nAfter the quick-fix is applied:\n\n\n enum StringUtils {\n ;\n public static final String EMPTY = \"\";\n }\n" - }, - { - "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": "FinalClass", - "displayName": "Class is closed to inheritance", - "enabled": false, - "description": "Reports classes that are declared `final`. Final classes that extend a `sealed` class or interface are not reported. Such classes can't be inherited and may indicate a lack of object-oriented design. Some coding standards discourage `final` classes.\n\n**Example:**\n\n\n public final class Main {\n }\n\nAfter the quick-fix is applied:\n\n\n public class Main {\n }\n" - }, - { - "shortName": "UtilityClassWithoutPrivateConstructor", - "displayName": "Utility class without 'private' constructor", - "enabled": false, - "description": "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." - }, - { - "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": "FieldCanBeLocal", - "displayName": "Field can be local", - "enabled": true, - "description": "Reports redundant class fields that can be replaced with local variables.\n\nIf all local usages of a field are preceded by assignments to that field, the\nfield can be removed, and its usages can be replaced with local variables." - }, - { - "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 inner class can be replaced with inner class", - "enabled": false, - "description": "Reports anonymous inner classes.\n\nIn some cases, replacing anonymous inner classes with inner classes can lead to more readable and maintainable code.\nAlso, some code standards discourage anonymous inner classes." - }, - { - "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 void test() {\n class Local { // local class\n }\n new Local();\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": "EmptyClass", - "displayName": "Empty class", - "enabled": false, - "description": "Reports empty classes and empty Java files.\n\nA class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes are sometimes left over\nafter significant changes or refactorings.\n\n**Example:**\n\n\n class Example {\n List getList() {\n return new ArrayList<>() {\n\n };\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n List getList() {\n return new ArrayList<>();\n }\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if annotated by** option to specify special annotations. The inspection will ignore the classes marked with these annotations.\n*\n Use the **Ignore class if it is a parametrization of a super type** option to ignore classes that parameterize a superclass. For example:\n\n class MyList extends ArrayList {}\n\n* Use the **Ignore subclasses of java.lang.Throwable** to ignore classes that extend `java.lang.Throwable`.\n* Use the **Comments count as content** option to ignore classes that contain comments." - }, - { - "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." - }, - { - "shortName": "FinalPrivateMethod", - "displayName": "'private' method declared 'final'", - "enabled": true, - "description": "Reports methods that are marked with both `final` and `private` keywords.\n\nSince `private` methods cannot be meaningfully overridden because of their visibility, declaring them\n`final` is redundant." - }, - { - "shortName": "FinalStaticMethod", - "displayName": "'static' method declared 'final'", - "enabled": true, - "description": "Reports static methods that are marked as `final`.\n\nSuch code might indicate an error or an incorrect assumption about the effect of the `final` keyword.\nStatic methods are not subject to runtime polymorphism, so the only purpose of the `final` keyword used with static methods\nis to ensure the method will not be hidden in a subclass." - }, - { - "shortName": "MethodReturnAlwaysConstant", - "displayName": "Method returns per-class constant", - "enabled": false, - "description": "Reports methods that only return a constant, which may differ for various inheritors.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." - }, - { - "shortName": "PublicConstructor", - "displayName": "'public' constructor can be replaced with factory method", - "enabled": false, - "description": "Reports `public` constructors.\n\nSome coding standards discourage the use of `public` constructors and recommend\n`static` factory methods instead.\nThis way the implementation can be swapped out without affecting the call sites.\n\n**Example:**\n\n\n class Test {\n private String name;\n\n public Test(String name) {\n this.name = name;\n }\n\n public void test() {\n System.out.println(name);\n }\n\n public static void main(String[] args) {\n new Test(\"str\").test();\n }\n }\n\nAfter quick-fix is applied:\n\n\n class Test {\n private String name;\n\n private Test(String name) {\n this.name = name;\n }\n\n public static Test getInstance(String name) {\n return new Test(name);\n }\n\n public void test() {\n System.out.println(name);\n }\n\n public static void main(String[] args) {\n getInstance(\"str\").test();\n }\n }\n" - }, - { - "shortName": "ConstantDeclaredInInterface", - "displayName": "Constant declared in interface", - "enabled": false, - "description": "Reports constants (`public static final` fields) declared in interfaces.\n\nSome coding standards require declaring constants in abstract classes instead." - } - ] - }, { "name": "Code style issues", "inspections": [ @@ -2690,42 +2499,233 @@ ] }, { - "name": "Probable bugs", + "name": "Class structure", "inspections": [ { - "shortName": "SubtractionInCompareTo", - "displayName": "Subtraction in 'compareTo()'", + "shortName": "ConstantDeclaredInAbstractClass", + "displayName": "Constant declared in 'abstract' class", "enabled": false, - "description": "Reports subtraction in `compareTo()` methods and methods implementing `java.util.Comparator.compare()`.\n\n\nWhile it is a common idiom to\nuse the results of integer subtraction as the result of a `compareTo()`\nmethod, this construct may cause subtle and difficult bugs in cases of integer overflow.\nComparing the integer values directly and returning `-1`, `0`, or `1` is a better practice in most cases.\n\n\nSubtraction on floating point values that is immediately cast to integral type is also reported because precision loss is possible due to\nrounding.\n\n\nThe inspection doesn't report when it's statically determined that value ranges are limited, and overflow never occurs.\nAdditionally, subtraction on `int` numbers greater than or equal to `0` will never overflow.\nTherefore, this inspection tries not to warn in those cases.\n\n\nMethods that always return zero or greater can be marked with the\n`javax.annotation.Nonnegative` annotation or specified in this inspection's options.\n\n**Example:**\n\n\n class DoubleHolder implements Comparable {\n double d;\n public int compareTo(DoubleHolder that) {\n return (int)(this.d - that.d);\n }\n }\n\nA no-warning example because `String.length()` is known to be non-negative:\n\n\n class A implements Comparable {\n final String s = \"\";\n public int compareTo(A a) {\n return s.length() - a.s.length();\n }\n }\n\n\nUse the options to list methods that are safe to use inside a subtraction.\nMethods are safe when they return an `int` value that is always greater than or equal to `0`." + "description": "Reports constants (`public static final` fields) declared in abstract classes.\n\nSome coding standards require declaring constants in interfaces instead." }, { - "shortName": "UnsupportedChronoFieldUnitCall", - "displayName": "Call methods with unsupported 'java.time.temporal.ChronoUnit' and 'java.time.temporal.ChronoField'", - "enabled": true, - "description": "Reports `java.time` method calls (`get()`, `getLong()`, `with()`, `plus()`, `minus()`) with unsupported `java.time.temporal.ChronoField` or `java.time.temporal.ChronoUnit` enum constants as arguments. Such calls will throw a `UnsupportedTemporalTypeException` at runtime.\n\nExample:\n\n\n LocalTime localTime = LocalTime.now();\n int year = localTime.get(ChronoField.YEAR);\n\nNew in 2023.2" + "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": "NumberEquality", - "displayName": "Number comparison using '==', instead of 'equals()'", + "shortName": "NonFinalFieldInEnum", + "displayName": "Non-final field in 'enum'", "enabled": true, - "description": "Reports code that uses **==** or **!=** instead of `equals()` to test for `Number` equality.\n\n\nWith auto-boxing, it is easy\nto make the mistake of comparing two instances of a wrapper type instead of two primitives, for example `Integer` instead of\n`int`.\n\n**Example:**\n\n void foo(Integer a, Integer b) {\n final boolean bool = a == b;\n }\n\nIf `a` 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 void foo(Integer a, Integer b) {\n final boolean bool = a.equals(b);\n }\n" + "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": "MathRandomCastToInt", - "displayName": "'Math.random()' cast to 'int'", - "enabled": true, - "description": "Reports calls to `Math.random()` which are immediately cast to `int`.\n\nCasting a `double` between `0.0` (inclusive) and\n`1.0` (exclusive) to `int` will always round down to zero. The value\nshould first be multiplied by some factor before casting it to an `int` to\nget a value between zero (inclusive) and the multiplication factor (exclusive).\nAnother possible solution is to use the `nextInt()` method of\n`java.util.Random`.\n\n**Example:**\n\n int r = (int)Math.random() * 10;\n\nAfter the quick fix is applied:\n\n int r = (int)(Math.random() * 10);\n" + "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": "InconsistentTextBlockIndent", - "displayName": "Inconsistent whitespace indentation in text block", - "enabled": true, - "description": "Reports text blocks that are indented using both spaces and tabs. Such cases produce unexpected results since spaces and tabs are treated equally by the text block processing.\n\nIn the following example, spaces and tabs are visualized as `·` and `␉` respectively,\nand a tab is equal to 4 spaces in the editor.\n\n**Example:**\n\n\n String colors = \"\"\"\n ········red\n ␉ ␉ green\n ········blue\"\"\";\n\nAfter printing such a string, the result will be:\n\n\n ······red\n green\n ······blue\n\nAfter the compiler removes an equal amount of spaces or tabs from the beginning of each line,\nsome lines remain with leading spaces.\n\nThis inspection only reports if the configured language level is 15 or higher.\n\nNew in 2021.1" + "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": "MismatchedStringCase", - "displayName": "Mismatched case in 'String' operation", - "enabled": true, + "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": "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": "ParameterCanBeLocal", + "displayName": "Value passed as parameter never read", + "enabled": true, + "description": "Reports redundant method parameters that can be replaced with local variables.\n\nIf all local usages of a parameter are preceded by assignments to that parameter, the\nparameter can be removed and its usages replaced with local variables.\nIt makes no sense to have such a parameter, as values that are passed to it are overwritten.\nUsually, the problem appears as a result of refactoring.\n\nExample:\n\n\n void test(int p) {\n p = 1;\n System.out.print(p);\n }\n\nAfter the quick-fix is applied:\n\n\n void test() {\n int p = 1;\n System.out.print(p);\n }\n" + }, + { + "shortName": "NoopMethodInAbstractClass", + "displayName": "No-op method in 'abstract' class", + "enabled": false, + "description": "Reports no-op (for \"no operation\") methods in `abstract` classes.\n\nIt is usually a better\ndesign to make such methods `abstract` themselves so that classes inheriting these\nmethods provide their implementations.\n\n**Example:**\n\n\n abstract class Test {\n protected void doTest() {\n }\n }\n" + }, + { + "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": "UtilityClassCanBeEnum", + "displayName": "Utility class can be 'enum'", + "enabled": false, + "description": "Reports utility classes that can be converted to enums.\n\nSome coding style guidelines require implementing utility classes as enums\nto avoid code coverage issues in `private` constructors.\n\n**Example:**\n\n\n class StringUtils {\n public static final String EMPTY = \"\";\n }\n\nAfter the quick-fix is applied:\n\n\n enum StringUtils {\n ;\n public static final String EMPTY = \"\";\n }\n" + }, + { + "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": "FinalClass", + "displayName": "Class is closed to inheritance", + "enabled": false, + "description": "Reports classes that are declared `final`. Final classes that extend a `sealed` class or interface are not reported. Such classes can't be inherited and may indicate a lack of object-oriented design. Some coding standards discourage `final` classes.\n\n**Example:**\n\n\n public final class Main {\n }\n\nAfter the quick-fix is applied:\n\n\n public class Main {\n }\n" + }, + { + "shortName": "UtilityClassWithoutPrivateConstructor", + "displayName": "Utility class without 'private' constructor", + "enabled": false, + "description": "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." + }, + { + "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": "FieldCanBeLocal", + "displayName": "Field can be local", + "enabled": true, + "description": "Reports redundant class fields that can be replaced with local variables.\n\nIf all local usages of a field are preceded by assignments to that field, the\nfield can be removed, and its usages can be replaced with local variables." + }, + { + "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 inner class can be replaced with inner class", + "enabled": false, + "description": "Reports anonymous inner classes.\n\nIn some cases, replacing anonymous inner classes with inner classes can lead to more readable and maintainable code.\nAlso, some code standards discourage anonymous inner classes." + }, + { + "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 void test() {\n class Local { // local class\n }\n new Local();\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": "EmptyClass", + "displayName": "Empty class", + "enabled": false, + "description": "Reports empty classes and empty Java files.\n\nA class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes are sometimes left over\nafter significant changes or refactorings.\n\n**Example:**\n\n\n class Example {\n List getList() {\n return new ArrayList<>() {\n\n };\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n List getList() {\n return new ArrayList<>();\n }\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if annotated by** option to specify special annotations. The inspection will ignore the classes marked with these annotations.\n*\n Use the **Ignore class if it is a parametrization of a super type** option to ignore classes that parameterize a superclass. For example:\n\n class MyList extends ArrayList {}\n\n* Use the **Ignore subclasses of java.lang.Throwable** to ignore classes that extend `java.lang.Throwable`.\n* Use the **Comments count as content** option to ignore classes that contain comments." + }, + { + "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." + }, + { + "shortName": "FinalPrivateMethod", + "displayName": "'private' method declared 'final'", + "enabled": true, + "description": "Reports methods that are marked with both `final` and `private` keywords.\n\nSince `private` methods cannot be meaningfully overridden because of their visibility, declaring them\n`final` is redundant." + }, + { + "shortName": "FinalStaticMethod", + "displayName": "'static' method declared 'final'", + "enabled": true, + "description": "Reports static methods that are marked as `final`.\n\nSuch code might indicate an error or an incorrect assumption about the effect of the `final` keyword.\nStatic methods are not subject to runtime polymorphism, so the only purpose of the `final` keyword used with static methods\nis to ensure the method will not be hidden in a subclass." + }, + { + "shortName": "MethodReturnAlwaysConstant", + "displayName": "Method returns per-class constant", + "enabled": false, + "description": "Reports methods that only return a constant, which may differ for various inheritors.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + }, + { + "shortName": "PublicConstructor", + "displayName": "'public' constructor can be replaced with factory method", + "enabled": false, + "description": "Reports `public` constructors.\n\nSome coding standards discourage the use of `public` constructors and recommend\n`static` factory methods instead.\nThis way the implementation can be swapped out without affecting the call sites.\n\n**Example:**\n\n\n class Test {\n private String name;\n\n public Test(String name) {\n this.name = name;\n }\n\n public void test() {\n System.out.println(name);\n }\n\n public static void main(String[] args) {\n new Test(\"str\").test();\n }\n }\n\nAfter quick-fix is applied:\n\n\n class Test {\n private String name;\n\n private Test(String name) {\n this.name = name;\n }\n\n public static Test getInstance(String name) {\n return new Test(name);\n }\n\n public void test() {\n System.out.println(name);\n }\n\n public static void main(String[] args) {\n getInstance(\"str\").test();\n }\n }\n" + }, + { + "shortName": "ConstantDeclaredInInterface", + "displayName": "Constant declared in interface", + "enabled": false, + "description": "Reports constants (`public static final` fields) declared in interfaces.\n\nSome coding standards require declaring constants in abstract classes instead." + } + ] + }, + { + "name": "Probable bugs", + "inspections": [ + { + "shortName": "SubtractionInCompareTo", + "displayName": "Subtraction in 'compareTo()'", + "enabled": false, + "description": "Reports subtraction in `compareTo()` methods and methods implementing `java.util.Comparator.compare()`.\n\n\nWhile it is a common idiom to\nuse the results of integer subtraction as the result of a `compareTo()`\nmethod, this construct may cause subtle and difficult bugs in cases of integer overflow.\nComparing the integer values directly and returning `-1`, `0`, or `1` is a better practice in most cases.\n\n\nSubtraction on floating point values that is immediately cast to integral type is also reported because precision loss is possible due to\nrounding.\n\n\nThe inspection doesn't report when it's statically determined that value ranges are limited, and overflow never occurs.\nAdditionally, subtraction on `int` numbers greater than or equal to `0` will never overflow.\nTherefore, this inspection tries not to warn in those cases.\n\n\nMethods that always return zero or greater can be marked with the\n`javax.annotation.Nonnegative` annotation or specified in this inspection's options.\n\n**Example:**\n\n\n class DoubleHolder implements Comparable {\n double d;\n public int compareTo(DoubleHolder that) {\n return (int)(this.d - that.d);\n }\n }\n\nA no-warning example because `String.length()` is known to be non-negative:\n\n\n class A implements Comparable {\n final String s = \"\";\n public int compareTo(A a) {\n return s.length() - a.s.length();\n }\n }\n\n\nUse the options to list methods that are safe to use inside a subtraction.\nMethods are safe when they return an `int` value that is always greater than or equal to `0`." + }, + { + "shortName": "UnsupportedChronoFieldUnitCall", + "displayName": "Call methods with unsupported 'java.time.temporal.ChronoUnit' and 'java.time.temporal.ChronoField'", + "enabled": true, + "description": "Reports `java.time` method calls (`get()`, `getLong()`, `with()`, `plus()`, `minus()`) with unsupported `java.time.temporal.ChronoField` or `java.time.temporal.ChronoUnit` enum constants as arguments. Such calls will throw a `UnsupportedTemporalTypeException` at runtime.\n\nExample:\n\n\n LocalTime localTime = LocalTime.now();\n int year = localTime.get(ChronoField.YEAR);\n\nNew in 2023.2" + }, + { + "shortName": "NumberEquality", + "displayName": "Number comparison using '==', instead of 'equals()'", + "enabled": true, + "description": "Reports code that uses **==** or **!=** instead of `equals()` to test for `Number` equality.\n\n\nWith auto-boxing, it is easy\nto make the mistake of comparing two instances of a wrapper type instead of two primitives, for example `Integer` instead of\n`int`.\n\n**Example:**\n\n void foo(Integer a, Integer b) {\n final boolean bool = a == b;\n }\n\nIf `a` 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 void foo(Integer a, Integer b) {\n final boolean bool = a.equals(b);\n }\n" + }, + { + "shortName": "MathRandomCastToInt", + "displayName": "'Math.random()' cast to 'int'", + "enabled": true, + "description": "Reports calls to `Math.random()` which are immediately cast to `int`.\n\nCasting a `double` between `0.0` (inclusive) and\n`1.0` (exclusive) to `int` will always round down to zero. The value\nshould first be multiplied by some factor before casting it to an `int` to\nget a value between zero (inclusive) and the multiplication factor (exclusive).\nAnother possible solution is to use the `nextInt()` method of\n`java.util.Random`.\n\n**Example:**\n\n int r = (int)Math.random() * 10;\n\nAfter the quick fix is applied:\n\n int r = (int)(Math.random() * 10);\n" + }, + { + "shortName": "InconsistentTextBlockIndent", + "displayName": "Inconsistent whitespace indentation in text block", + "enabled": true, + "description": "Reports text blocks that are indented using both spaces and tabs. Such cases produce unexpected results since spaces and tabs are treated equally by the text block processing.\n\nIn the following example, spaces and tabs are visualized as `·` and `␉` respectively,\nand a tab is equal to 4 spaces in the editor.\n\n**Example:**\n\n\n String colors = \"\"\"\n ········red\n ␉ ␉ green\n ········blue\"\"\";\n\nAfter printing such a string, the result will be:\n\n\n ······red\n green\n ······blue\n\nAfter the compiler removes an equal amount of spaces or tabs from the beginning of each line,\nsome lines remain with leading spaces.\n\nThis inspection only reports if the configured language level is 15 or higher.\n\nNew in 2021.1" + }, + { + "shortName": "MismatchedStringCase", + "displayName": "Mismatched case in 'String' operation", + "enabled": true, "description": "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" }, { @@ -2734,18 +2734,18 @@ "enabled": true, "description": "Reports calls to `StringBuffer` and `StringBuilder` constructors with `char` as the argument. In this case, `char` is silently cast to an integer and interpreted as the initial capacity of the buffer.\n\n**Example:**\n\n\n new StringBuilder('(').append(\"1\").append(')');\n\nAfter the quick-fix is applied:\n\n\n new StringBuilder(\"(\").append(\"1\").append(')');\n" }, - { - "shortName": "ResultOfObjectAllocationIgnored", - "displayName": "Result of object allocation ignored", - "enabled": false, - "description": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." - }, { "shortName": "ClassGetClass", "displayName": "Suspicious 'Class.getClass()' call", "enabled": true, "description": "Reports `getClass()` methods that are called on a `java.lang.Class` instance.\n\nThis is usually a mistake as the result is always equivalent to `Class.class`.\nIf it's a mistake, then it's better to remove the `getClass()` call and use the qualifier directly.\nIf the behavior is intended, then it's better to write `Class.class` explicitly to avoid confusion.\n\nExample:\n\n\n void test(Class clazz) {\n String name = clazz.getClass().getName();\n }\n\nAfter one of the possible quick-fixes is applied:\n\n\n void test(Class clazz) {\n String name = clazz.getName();\n }\n\nNew in 2018.2" }, + { + "shortName": "ResultOfObjectAllocationIgnored", + "displayName": "Result of object allocation ignored", + "enabled": false, + "description": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection." + }, { "shortName": "MisspelledEquals", "displayName": "'equal()' instead of 'equals()'", @@ -3106,12 +3106,6 @@ "enabled": true, "description": "Reports suspicious indentation of statements after a control statement without braces.\n\n\nSuch indentation can make it look like the statement is inside the control statement,\nwhen in fact it will be executed unconditionally after the control statement.\n\n**Example:**\n\n\n class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }\n" }, - { - "shortName": "SuspiciousDateFormat", - "displayName": "Suspicious date format pattern", - "enabled": true, - "description": "Reports date format patterns that are likely used by mistake.\n\nThe following patterns are reported:\n\n* Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December.\n* Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended.\n* Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended.\n* Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended.\n* Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended.\n\n\nExamples: \n\n`new SimpleDateFormat(\"YYYY-MM-dd\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"yyyy-MM-DD\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"HH:MM\")`: likely `\"HH:mm\"` was intended.\n\nNew in 2020.1" - }, { "shortName": "MagicConstant", "displayName": "Magic constant", @@ -3124,6 +3118,12 @@ "enabled": false, "description": "Reports calls to `java.lang.Class.newInstance()`.\n\n\nThis method propagates exceptions thrown by\nthe no-arguments constructor, including checked exceptions. Usages of this method\neffectively bypass the compile-time exception checking that would\notherwise be performed by the compiler.\n\n\nA quick-fix is suggested to replace the call with a call to the\n`java.lang.reflect.Constructor.newInstance()` method, which\navoids this problem by wrapping any exception thrown by the constructor in a\n(checked) `java.lang.reflect.InvocationTargetException`.\n\n**Example:**\n\n\n clazz.newInstance()\n\nAfter the quick-fix is applied:\n\n\n clazz.getConstructor().newInstance();\n" }, + { + "shortName": "SuspiciousDateFormat", + "displayName": "Suspicious date format pattern", + "enabled": true, + "description": "Reports date format patterns that are likely used by mistake.\n\nThe following patterns are reported:\n\n* Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December.\n* Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended.\n* Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended.\n* Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended.\n* Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended.\n\n\nExamples: \n\n`new SimpleDateFormat(\"YYYY-MM-dd\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"yyyy-MM-DD\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"HH:MM\")`: likely `\"HH:mm\"` was intended.\n\nNew in 2020.1" + }, { "shortName": "StaticFieldReferenceOnSubclass", "displayName": "Static field referenced via subclass", @@ -3220,18 +3220,18 @@ "enabled": true, "description": "Reports `if`, `while`, `do`, `for`, and `switch` statements with empty bodies.\n\nWhile occasionally intended, such code is confusing and is often the result of a typo.\n\nThis inspection is disabled in JSP files." }, - { - "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": "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": "CastConflictsWithInstanceof", "displayName": "Cast conflicts with 'instanceof'", @@ -3733,31 +3733,186 @@ ] }, { - "name": "Error handling", + "name": "Declaration redundancy", "inspections": [ { - "shortName": "UncheckedExceptionClass", - "displayName": "Unchecked 'Exception' class", + "shortName": "UnusedReturnValue", + "displayName": "Method can be made 'void'", "enabled": false, - "description": "Reports subclasses of `java.lang.RuntimeException`.\n\nSome coding standards require that all user-defined exception classes are checked.\n\n**Example:**\n\n\n class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException'\n" + "description": "Reports methods whose return values are never used when called. The return type of such methods can be made `void`.\n\nMethods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\nThe quick-fix updates the method signature and removes `return` statements from inside the method.\n\n**Example:**\n\n\n // reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }\n\nAfter the quick-fix is applied to both methods:\n\n\n protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...\n\n\n**NOTE:** Some methods might not be reported during in-editor highlighting due to performance reasons.\nTo see all results, run the inspection using **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**\\>\n\nUse the **Ignore chainable methods** option to ignore unused return values from chainable calls.\n\nUse the **Maximal reported method visibility** option to control the maximum visibility of methods to be reported." }, { - "shortName": "TooBroadCatch", - "displayName": "Overly broad 'catch' block", + "shortName": "unused", + "displayName": "Unused declaration", "enabled": false, - "description": "Reports `catch` blocks with parameters that are more generic than the exception thrown by the corresponding `try` block.\n\n**Example:**\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }\n\nConfigure the inspection:\n\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad." + "description": "Reports classes, methods, or fields that are not used or unreachable from the entry points.\n\nAn entry point can be a main method, tests, classes from outside the specified scope, classes accessible from\n`module-info.java`, and so on. It is possible to configure custom entry points by using name patterns or annotations.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nIn this example, `Department` explicitly references `Organization` but if `Department` class itself is unused, then inspection will report both classes.\n\n\nThe inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local\nvariables that are declared but not used.\n\n\n**Note:** Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is\nchecked only when its name rarely occurs in the project.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the visibility settings below to configure members to be reported. For example, configuring report `private` methods only means\nthat `public` methods of `private` inner class will be reported but `protected` methods of top level class\nwill be ignored.\n\n\nUse the **entry points** tab to configure entry points to be considered during the inspection run.\n\nYou can add entry points manually when inspection results are ready.\n\nIf your code uses unsupported frameworks, there are several options:\n\n* If the framework relies on annotations, use the **Annotations...** button to configure the framework's annotations.\n* If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.\n\nThis way the annotated code accessible by the framework internals will be treated as used." }, { - "shortName": "UnnecessaryInitCause", - "displayName": "Unnecessary call to 'Throwable.initCause()'", + "shortName": "ProtectedMemberInFinalClass", + "displayName": "'protected' member in 'final' class", "enabled": true, - "description": "Reports calls to `Throwable.initCause()` where an exception constructor also takes a `Throwable cause` argument.\n\nIn this case, the `initCause()` call can be removed and its argument can be added to the call to the exception's constructor.\n\n**Example:**\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }\n\nA quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied:\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }\n \n" - }, - { - "shortName": "CheckedExceptionClass", - "displayName": "Checked exception class", - "enabled": false, - "description": "Reports checked exception classes (that is, subclasses of `java.lang.Exception` that are not subclasses of `java.lang.RuntimeException`).\n\nSome coding standards suppress checked user-defined exception classes.\n\n**Example:**\n\n\n class IllegalMoveException extends Exception {}\n" + "description": "Reports `protected` members in `final`classes.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." + }, + { + "shortName": "EmptyInitializer", + "displayName": "Empty class initializer", + "enabled": true, + "description": "Reports empty class initializer blocks." + }, + { + "shortName": "UnusedLibrary", + "displayName": "Unused library", + "enabled": false, + "description": "Reports libraries attached to the specified inspection scope that are not used directly in code." + }, + { + "shortName": "TrivialFunctionalExpressionUsage", + "displayName": "Trivial usage of functional expression", + "enabled": true, + "description": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n" + }, + { + "shortName": "RedundantLambdaParameterType", + "displayName": "Redundant lambda parameter types", + "enabled": false, + "description": "Reports lambda formal parameter types that are redundant because they can be inferred from the context.\n\n**Example:**\n\n\n Map map = ...\n map.forEach((String s, Integer i) -> log.info(s + \"=\" + i));\n\nThe quick-fix removes the parameter types from the lambda.\n\n\n Map map = ...\n map.forEach((s, i) -> log.info(s + \"=\" + i));\n" + }, + { + "shortName": "AccessStaticViaInstance", + "displayName": "Access static member via instance reference", + "enabled": true, + "description": "Reports references to `static` methods and fields via a class instance rather than the class itself.\n\nEven though referring to static members via instance variables is allowed by The Java Language Specification,\nthis makes the code confusing as the reader may think that the result of the method depends on the instance.\n\nThe quick-fix replaces the instance variable with the class name.\n\nExample:\n\n\n String s1 = s.valueOf(0);\n\nAfter the quick-fix is applied:\n\n\n String s = String.valueOf(0);\n" + }, + { + "shortName": "UnnecessaryModuleDependencyInspection", + "displayName": "Unnecessary module dependency", + "enabled": false, + "description": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies." + }, + { + "shortName": "CanBeFinal", + "displayName": "Declaration can have 'final' modifier", + "enabled": false, + "description": "Reports fields, methods, or classes that may have the `final` modifier added to their declarations.\n\nFinal classes can't be extended, final methods can't be overridden, and final fields can't be reassigned.\n\n**Example:**\n\n\n public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }\n\nUse the **Report classes** and **Report methods** options to define which declarations are to be reported." + }, + { + "shortName": "EmptyMethod", + "displayName": "Empty method", + "enabled": false, + "description": "Reports empty methods that can be removed.\n\nMethods are considered empty if they are empty themselves and if they are overridden or\nimplemented by empty methods only. Note that methods containing only comments and the `super()` call with own parameters are\nalso considered empty.\n\nThe inspection ignores methods with special annotations, for example, the `javax.ejb.Init` and `javax.ejb.Remove` EJB annotations .\n\nThe quick-fix safely removes unnecessary methods.\n\nConfigure the inspection:\n\n* Use the **Comments and javadoc count as content** option to select whether methods with comments should be treated as non-empty.\n* Use the **Additional special annotations** option to configure additional annotations that should be ignored by this inspection." + }, + { + "shortName": "RedundantExplicitClose", + "displayName": "Redundant 'close()'", + "enabled": true, + "description": "Reports unnecessary calls to `close()` at the end of a try-with-resources block and suggests removing them.\n\n**Example**:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n ac.close();\n }\n\nAfter the quick-fix is applied:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n }\n\nNew in 2018.1" + }, + { + "shortName": "RedundantThrows", + "displayName": "Redundant 'throws' clause", + "enabled": false, + "description": "Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and overriding methods.\n\nThe inspection ignores methods related to serialization, for example the methods `readObject()` and `writeObject()`.\n\n**Example:**\n\n\n void method() throws InterruptedException {\n System.out.println();\n }\n\nThe quick-fix removes unnecessary exceptions from the declaration and normalizes redundant `try`-`catch` statements:\n\n\n void method() {\n System.out.println();\n }\n\n\n**Note:** Some exceptions may not be reported during in-editor highlighting for performance reasons.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the **Ignore exceptions thrown by entry point methods** option to not report exceptions thrown by\nfor example `main()` methods.\nEntry point methods can be configured in the settings of the\n[Java \\| Declaration redundancy \\| Unused declaration](settings://Errors?Unused%20Declaration%20entry%20point) inspection." + }, + { + "shortName": "DuplicateThrows", + "displayName": "Duplicate throws", + "enabled": true, + "description": "Reports duplicate exceptions in a method `throws` list.\n\nExample:\n\n\n void f() throws Exception, Exception {}\n\nAfter the quick-fix is applied:\n\n\n void f() throws Exception {}\n\n\nUse the **Ignore exceptions subclassing others** option to ignore exceptions subclassing other exceptions." + }, + { + "shortName": "UnusedLabel", + "displayName": "Unused label", + "enabled": true, + "description": "Reports labels that are not targets of any `break` or `continue` statements.\n\n**Example:**\n\n\n label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nAfter the quick-fix is applied, the label is removed:\n\n\n for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n" + }, + { + "shortName": "DefaultAnnotationParam", + "displayName": "Default annotation parameter value", + "enabled": true, + "description": "Reports annotation parameters that are assigned to their `default` value.\n\nExample:\n\n\n @interface Test {\n Class expected() default Throwable.class;\n }\n\n @Test(expected = Throwable.class)\n void testSmth() {}\n\nAfter the quick-fix is applied:\n\n\n @Test()\n void testSmth() {}\n" + }, + { + "shortName": "SameParameterValue", + "displayName": "Method parameter always has the same value", + "enabled": false, + "description": "Reports method parameters that always have the same constant value.\n\nExample:\n\n\n static void printPoint(int x, int y) { // x is always 0\n System.out.println(x + \", \" + y);\n }\n\n public static void main(String[] args) {\n printPoint(0, 1);\n printPoint(0, 2);\n }\n\nThe quick-fix inlines the constant value. This may simplify the method implementation.\n\n\nUse the **Ignore when a quick-fix can not be provided** option to suppress the inspections when:\n\n* the parameter is modified inside the method\n* the parameter value that is being passed is a reference to an inaccessible field (Java ony)\n* the parameter is a vararg (Java only)\n\n\nUse the **Maximal method visibility** option to control the maximum visibility of methods to be reported.\n\n\nUse the **Minimal method usage count to report parameter** field to specify the minimal number of method usages with the same parameter value." + }, + { + "shortName": "SameReturnValue", + "displayName": "Method always returns the same value", + "enabled": false, + "description": "Reports methods and method hierarchies that always return the same constant.\n\n\nThe inspection works differently in batch-mode\n(from **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**)\nand on-the-fly in the editor:\n\n* In batch-mode, the inspection reports methods and method hierarchies that always return the same constant.\n* In the editor, the inspection only reports methods that have more than one `return` statement, do not have super methods, and cannot be overridden. If a method overrides or implements a method, a contract may require it to return a specific constant, but at the same time, we may want to have several exit points. If a method can be overridden, it is possible that a different value will be returned in subclasses.\n\n**Example:**\n\n\n class X {\n // Warn only in batch-mode:\n int xxx() { // Method 'xxx()' and all its overriding methods always return '0'\n return 0;\n }\n }\n\n class Y extends X {\n @Override\n int xxx() {\n return 0;\n }\n\n // Warn only in batch-mode:\n int yyy() { // Method 'yyy()' always returns '0'\n return 0;\n }\n\n // Warn both in batch-mode and on-the-fly:\n final int zzz(boolean flag) { // Method 'zzz()' always returns '0'\n if (Math.random() > 0.5) {\n return 0;\n }\n return 0;\n }\n }\n" + }, + { + "shortName": "RedundantRecordConstructor", + "displayName": "Redundant record constructor", + "enabled": true, + "description": "Reports redundant constructors declared inside Java records.\n\n**Example 1:**\n\n\n record Point(int x, int y) {\n public Point {} // could be removed\n }\n \n record Point(int x, int y) {\n public Point(int x, int y) { // could be removed\n this.x = x;\n this.y = y;\n }\n }\n\nThe quick-fix removes the redundant constructors.\n\n**Example 2:**\n\n\n // could be converted to compact constructor\n record Range(int from, int to) {\n public Range(int from, int to) {\n if (from > to) throw new IllegalArgumentException();\n this.from = from;\n this.to = to;\n }\n }\n\nThe quick-fix converts this code into a compact constructor.\n\nThis inspection only reports if the language level of the project or module is 16 or higher.\n\nNew in 2020.1" + }, + { + "shortName": "WeakerAccess", + "displayName": "Declaration access can be weaker", + "enabled": false, + "description": "Reports fields, methods or classes that may have their access modifier narrowed down.\n\nExample:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }\n\nAfter the quick-fix is applied:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }\n\nUse the inspection's options to define the rules for the modifier change suggestions." + }, + { + "shortName": "FinalMethodInFinalClass", + "displayName": "'final' method in 'final' class", + "enabled": true, + "description": "Reports `final` methods in `final` classes.\n\nSince `final` classes cannot be inherited, marking a method as `final`\nmay be unnecessary and confusing.\n\n**Example:**\n\n record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." + }, + { + "shortName": "Java9RedundantRequiresStatement", + "displayName": "Redundant 'requires' directive in module-info", + "enabled": false, + "description": "Reports redundant `requires` directives in Java Platform Module System `module-info.java` files. A `requires` directive is redundant when a module `A` requires a module `B`, but the code in module `A` doesn't import any packages or classes from `B`. Furthermore, all modules have an implicitly declared dependence on the `java.base` module, therefore a `requires java.base;` directive is always redundant.\n\n\nThe quick-fix deletes the redundant `requires` directive.\nIf the deleted dependency re-exported modules that are actually used, the fix adds a `requires` directives for these modules.\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2017.1" + }, + { + "shortName": "SillyAssignment", + "displayName": "Variable is assigned to itself", + "enabled": true, + "description": "Reports assignments of a variable to itself.\n\n**Example:**\n\n\n a = a;\n\nThe quick-fix removes the assigment." + }, + { + "shortName": "FunctionalExpressionCanBeFolded", + "displayName": "Functional expression can be folded", + "enabled": true, + "description": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation.\n\nExample:\n\n\n SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());\n\nAfter the quick-fix is applied:\n\n\n SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);\n\nThis inspection reports only if the language level of the project or module is 8 or higher." + }, + { + "shortName": "GroovyUnusedDeclaration", + "displayName": "Unused declaration", + "enabled": false, + "description": "Reports unused classes, methods and fields.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nHere `Department` explicitly references `Organization` but if `Department` class itself is unused,\nthen inspection would report both classes.\n\n\nThe inspection also reports parameters, which are not used by their methods and all method implementations/overriders, as well as local\nvariables, which are declared but not used.\n\nFor more information, see the same inspection in Java." + } + ] + }, + { + "name": "Error handling", + "inspections": [ + { + "shortName": "UncheckedExceptionClass", + "displayName": "Unchecked 'Exception' class", + "enabled": false, + "description": "Reports subclasses of `java.lang.RuntimeException`.\n\nSome coding standards require that all user-defined exception classes are checked.\n\n**Example:**\n\n\n class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException'\n" + }, + { + "shortName": "TooBroadCatch", + "displayName": "Overly broad 'catch' block", + "enabled": false, + "description": "Reports `catch` blocks with parameters that are more generic than the exception thrown by the corresponding `try` block.\n\n**Example:**\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }\n\nConfigure the inspection:\n\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad." + }, + { + "shortName": "UnnecessaryInitCause", + "displayName": "Unnecessary call to 'Throwable.initCause()'", + "enabled": true, + "description": "Reports calls to `Throwable.initCause()` where an exception constructor also takes a `Throwable cause` argument.\n\nIn this case, the `initCause()` call can be removed and its argument can be added to the call to the exception's constructor.\n\n**Example:**\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }\n\nA quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied:\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }\n \n" + }, + { + "shortName": "CheckedExceptionClass", + "displayName": "Checked exception class", + "enabled": false, + "description": "Reports checked exception classes (that is, subclasses of `java.lang.Exception` that are not subclasses of `java.lang.RuntimeException`).\n\nSome coding standards suppress checked user-defined exception classes.\n\n**Example:**\n\n\n class IllegalMoveException extends Exception {}\n" }, { "shortName": "ExceptionFromCatchWhichDoesntWrap", @@ -3947,161 +4102,6 @@ } ] }, - { - "name": "Declaration redundancy", - "inspections": [ - { - "shortName": "UnusedReturnValue", - "displayName": "Method can be made 'void'", - "enabled": false, - "description": "Reports methods whose return values are never used when called. The return type of such methods can be made `void`.\n\nMethods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\nThe quick-fix updates the method signature and removes `return` statements from inside the method.\n\n**Example:**\n\n\n // reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }\n\nAfter the quick-fix is applied to both methods:\n\n\n protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...\n\n\n**NOTE:** Some methods might not be reported during in-editor highlighting due to performance reasons.\nTo see all results, run the inspection using **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**\\>\n\nUse the **Ignore chainable methods** option to ignore unused return values from chainable calls.\n\nUse the **Maximal reported method visibility** option to control the maximum visibility of methods to be reported." - }, - { - "shortName": "unused", - "displayName": "Unused declaration", - "enabled": false, - "description": "Reports classes, methods, or fields that are not used or unreachable from the entry points.\n\nAn entry point can be a main method, tests, classes from outside the specified scope, classes accessible from\n`module-info.java`, and so on. It is possible to configure custom entry points by using name patterns or annotations.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nIn this example, `Department` explicitly references `Organization` but if `Department` class itself is unused, then inspection will report both classes.\n\n\nThe inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local\nvariables that are declared but not used.\n\n\n**Note:** Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is\nchecked only when its name rarely occurs in the project.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the visibility settings below to configure members to be reported. For example, configuring report `private` methods only means\nthat `public` methods of `private` inner class will be reported but `protected` methods of top level class\nwill be ignored.\n\n\nUse the **entry points** tab to configure entry points to be considered during the inspection run.\n\nYou can add entry points manually when inspection results are ready.\n\nIf your code uses unsupported frameworks, there are several options:\n\n* If the framework relies on annotations, use the **Annotations...** button to configure the framework's annotations.\n* If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.\n\nThis way the annotated code accessible by the framework internals will be treated as used." - }, - { - "shortName": "ProtectedMemberInFinalClass", - "displayName": "'protected' member in 'final' class", - "enabled": true, - "description": "Reports `protected` members in `final`classes.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." - }, - { - "shortName": "EmptyInitializer", - "displayName": "Empty class initializer", - "enabled": true, - "description": "Reports empty class initializer blocks." - }, - { - "shortName": "UnusedLibrary", - "displayName": "Unused library", - "enabled": false, - "description": "Reports libraries attached to the specified inspection scope that are not used directly in code." - }, - { - "shortName": "TrivialFunctionalExpressionUsage", - "displayName": "Trivial usage of functional expression", - "enabled": true, - "description": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n" - }, - { - "shortName": "RedundantLambdaParameterType", - "displayName": "Redundant lambda parameter types", - "enabled": false, - "description": "Reports lambda formal parameter types that are redundant because they can be inferred from the context.\n\n**Example:**\n\n\n Map map = ...\n map.forEach((String s, Integer i) -> log.info(s + \"=\" + i));\n\nThe quick-fix removes the parameter types from the lambda.\n\n\n Map map = ...\n map.forEach((s, i) -> log.info(s + \"=\" + i));\n" - }, - { - "shortName": "AccessStaticViaInstance", - "displayName": "Access static member via instance reference", - "enabled": true, - "description": "Reports references to `static` methods and fields via a class instance rather than the class itself.\n\nEven though referring to static members via instance variables is allowed by The Java Language Specification,\nthis makes the code confusing as the reader may think that the result of the method depends on the instance.\n\nThe quick-fix replaces the instance variable with the class name.\n\nExample:\n\n\n String s1 = s.valueOf(0);\n\nAfter the quick-fix is applied:\n\n\n String s = String.valueOf(0);\n" - }, - { - "shortName": "UnnecessaryModuleDependencyInspection", - "displayName": "Unnecessary module dependency", - "enabled": false, - "description": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies." - }, - { - "shortName": "CanBeFinal", - "displayName": "Declaration can have 'final' modifier", - "enabled": false, - "description": "Reports fields, methods, or classes that may have the `final` modifier added to their declarations.\n\nFinal classes can't be extended, final methods can't be overridden, and final fields can't be reassigned.\n\n**Example:**\n\n\n public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }\n\nUse the **Report classes** and **Report methods** options to define which declarations are to be reported." - }, - { - "shortName": "EmptyMethod", - "displayName": "Empty method", - "enabled": false, - "description": "Reports empty methods that can be removed.\n\nMethods are considered empty if they are empty themselves and if they are overridden or\nimplemented by empty methods only. Note that methods containing only comments and the `super()` call with own parameters are\nalso considered empty.\n\nThe inspection ignores methods with special annotations, for example, the `javax.ejb.Init` and `javax.ejb.Remove` EJB annotations .\n\nThe quick-fix safely removes unnecessary methods.\n\nConfigure the inspection:\n\n* Use the **Comments and javadoc count as content** option to select whether methods with comments should be treated as non-empty.\n* Use the **Additional special annotations** option to configure additional annotations that should be ignored by this inspection." - }, - { - "shortName": "RedundantExplicitClose", - "displayName": "Redundant 'close()'", - "enabled": true, - "description": "Reports unnecessary calls to `close()` at the end of a try-with-resources block and suggests removing them.\n\n**Example**:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n ac.close();\n }\n\nAfter the quick-fix is applied:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n }\n\nNew in 2018.1" - }, - { - "shortName": "RedundantThrows", - "displayName": "Redundant 'throws' clause", - "enabled": false, - "description": "Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and overriding methods.\n\nThe inspection ignores methods related to serialization, for example the methods `readObject()` and `writeObject()`.\n\n**Example:**\n\n\n void method() throws InterruptedException {\n System.out.println();\n }\n\nThe quick-fix removes unnecessary exceptions from the declaration and normalizes redundant `try`-`catch` statements:\n\n\n void method() {\n System.out.println();\n }\n\n\n**Note:** Some exceptions may not be reported during in-editor highlighting for performance reasons.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the **Ignore exceptions thrown by entry point methods** option to not report exceptions thrown by\nfor example `main()` methods.\nEntry point methods can be configured in the settings of the\n[Java \\| Declaration redundancy \\| Unused declaration](settings://Errors?Unused%20Declaration%20entry%20point) inspection." - }, - { - "shortName": "DuplicateThrows", - "displayName": "Duplicate throws", - "enabled": true, - "description": "Reports duplicate exceptions in a method `throws` list.\n\nExample:\n\n\n void f() throws Exception, Exception {}\n\nAfter the quick-fix is applied:\n\n\n void f() throws Exception {}\n\n\nUse the **Ignore exceptions subclassing others** option to ignore exceptions subclassing other exceptions." - }, - { - "shortName": "UnusedLabel", - "displayName": "Unused label", - "enabled": true, - "description": "Reports labels that are not targets of any `break` or `continue` statements.\n\n**Example:**\n\n\n label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nAfter the quick-fix is applied, the label is removed:\n\n\n for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n" - }, - { - "shortName": "DefaultAnnotationParam", - "displayName": "Default annotation parameter value", - "enabled": true, - "description": "Reports annotation parameters that are assigned to their `default` value.\n\nExample:\n\n\n @interface Test {\n Class expected() default Throwable.class;\n }\n\n @Test(expected = Throwable.class)\n void testSmth() {}\n\nAfter the quick-fix is applied:\n\n\n @Test()\n void testSmth() {}\n" - }, - { - "shortName": "SameParameterValue", - "displayName": "Method parameter always has the same value", - "enabled": false, - "description": "Reports method parameters that always have the same constant value.\n\nExample:\n\n\n static void printPoint(int x, int y) { // x is always 0\n System.out.println(x + \", \" + y);\n }\n\n public static void main(String[] args) {\n printPoint(0, 1);\n printPoint(0, 2);\n }\n\nThe quick-fix inlines the constant value. This may simplify the method implementation.\n\n\nUse the **Ignore when a quick-fix can not be provided** option to suppress the inspections when:\n\n* the parameter is modified inside the method\n* the parameter value that is being passed is a reference to an inaccessible field (Java ony)\n* the parameter is a vararg (Java only)\n\n\nUse the **Maximal method visibility** option to control the maximum visibility of methods to be reported.\n\n\nUse the **Minimal method usage count to report parameter** field to specify the minimal number of method usages with the same parameter value." - }, - { - "shortName": "SameReturnValue", - "displayName": "Method always returns the same value", - "enabled": false, - "description": "Reports methods and method hierarchies that always return the same constant.\n\n\nThe inspection works differently in batch-mode\n(from **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**)\nand on-the-fly in the editor:\n\n* In batch-mode, the inspection reports methods and method hierarchies that always return the same constant.\n* In the editor, the inspection only reports methods that have more than one `return` statement, do not have super methods, and cannot be overridden. If a method overrides or implements a method, a contract may require it to return a specific constant, but at the same time, we may want to have several exit points. If a method can be overridden, it is possible that a different value will be returned in subclasses.\n\n**Example:**\n\n\n class X {\n // Warn only in batch-mode:\n int xxx() { // Method 'xxx()' and all its overriding methods always return '0'\n return 0;\n }\n }\n\n class Y extends X {\n @Override\n int xxx() {\n return 0;\n }\n\n // Warn only in batch-mode:\n int yyy() { // Method 'yyy()' always returns '0'\n return 0;\n }\n\n // Warn both in batch-mode and on-the-fly:\n final int zzz(boolean flag) { // Method 'zzz()' always returns '0'\n if (Math.random() > 0.5) {\n return 0;\n }\n return 0;\n }\n }\n" - }, - { - "shortName": "RedundantRecordConstructor", - "displayName": "Redundant record constructor", - "enabled": true, - "description": "Reports redundant constructors declared inside Java records.\n\n**Example 1:**\n\n\n record Point(int x, int y) {\n public Point {} // could be removed\n }\n \n record Point(int x, int y) {\n public Point(int x, int y) { // could be removed\n this.x = x;\n this.y = y;\n }\n }\n\nThe quick-fix removes the redundant constructors.\n\n**Example 2:**\n\n\n // could be converted to compact constructor\n record Range(int from, int to) {\n public Range(int from, int to) {\n if (from > to) throw new IllegalArgumentException();\n this.from = from;\n this.to = to;\n }\n }\n\nThe quick-fix converts this code into a compact constructor.\n\nThis inspection only reports if the language level of the project or module is 16 or higher.\n\nNew in 2020.1" - }, - { - "shortName": "WeakerAccess", - "displayName": "Declaration access can be weaker", - "enabled": false, - "description": "Reports fields, methods or classes that may have their access modifier narrowed down.\n\nExample:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }\n\nAfter the quick-fix is applied:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }\n\nUse the inspection's options to define the rules for the modifier change suggestions." - }, - { - "shortName": "FinalMethodInFinalClass", - "displayName": "'final' method in 'final' class", - "enabled": true, - "description": "Reports `final` methods in `final` classes.\n\nSince `final` classes cannot be inherited, marking a method as `final`\nmay be unnecessary and confusing.\n\n**Example:**\n\n record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." - }, - { - "shortName": "Java9RedundantRequiresStatement", - "displayName": "Redundant 'requires' directive in module-info", - "enabled": false, - "description": "Reports redundant `requires` directives in Java Platform Module System `module-info.java` files. A `requires` directive is redundant when a module `A` requires a module `B`, but the code in module `A` doesn't import any packages or classes from `B`. Furthermore, all modules have an implicitly declared dependence on the `java.base` module, therefore a `requires java.base;` directive is always redundant.\n\n\nThe quick-fix deletes the redundant `requires` directive.\nIf the deleted dependency re-exported modules that are actually used, the fix adds a `requires` directives for these modules.\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2017.1" - }, - { - "shortName": "SillyAssignment", - "displayName": "Variable is assigned to itself", - "enabled": true, - "description": "Reports assignments of a variable to itself.\n\n**Example:**\n\n\n a = a;\n\nThe quick-fix removes the assigment." - }, - { - "shortName": "FunctionalExpressionCanBeFolded", - "displayName": "Functional expression can be folded", - "enabled": true, - "description": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation.\n\nExample:\n\n\n SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());\n\nAfter the quick-fix is applied:\n\n\n SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);\n\nThis inspection reports only if the language level of the project or module is 8 or higher." - }, - { - "shortName": "GroovyUnusedDeclaration", - "displayName": "Unused declaration", - "enabled": false, - "description": "Reports unused classes, methods and fields.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nHere `Department` explicitly references `Organization` but if `Department` class itself is unused,\nthen inspection would report both classes.\n\n\nThe inspection also reports parameters, which are not used by their methods and all method implementations/overriders, as well as local\nvariables, which are declared but not used.\n\nFor more information, see the same inspection in Java." - } - ] - }, { "name": "Migration", "inspections": [ @@ -4678,67 +4678,240 @@ "shortName": "ImplicitSubclassInspection", "displayName": "Final declaration can't be overridden at runtime", "enabled": true, - "description": "Reports cases when your code prevents a class from being subclassed by some framework (for example, Spring or Hibernate) at runtime.\n\nTypical examples of necessary but impossible subclassing:\n\n* `final` classes marked with framework-specific annotations (for example, Spring `@Configuration`)\n* `final`, `static` or `private` methods marked with framework-specific annotations (for example, Spring `@Transactional`)\n* methods marked with framework-specific annotations inside `final` classes\n\nThe list of reported cases depends on the frameworks used." + "description": "Reports cases when your code prevents a class from being subclassed by some framework (for example, Spring or Hibernate) at runtime.\n\nTypical examples of necessary but impossible subclassing:\n\n* `final` classes marked with framework-specific annotations (for example, Spring `@Configuration`)\n* `final`, `static` or `private` methods marked with framework-specific annotations (for example, Spring `@Transactional`)\n* methods marked with framework-specific annotations inside `final` classes\n\nThe list of reported cases depends on the frameworks used." + }, + { + "shortName": "ParameterTypePreventsOverriding", + "displayName": "Parameter type prevents overriding", + "enabled": false, + "description": "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" + }, + { + "shortName": "NonProtectedConstructorInAbstractClass", + "displayName": "Public constructor in abstract class", + "enabled": false, + "description": "Reports `public` constructors of `abstract` classes.\n\n\nConstructors of `abstract` classes can only be called from the constructors of\ntheir subclasses, declaring them `public` may be confusing.\n\nThe quick-fix makes such constructors protected.\n\n**Example:**\n\n\n public abstract class Foo {\n public Foo () { // warning: has 'public' modifier\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public abstract class Foo {\n protected Foo () {\n /* ... */\n }\n }\n\nConfigure the inspection:\n\nUse the **Ignore for non-public classes** option below to ignore `public` constructors in non-public classes." + }, + { + "shortName": "RedundantImplements", + "displayName": "Redundant interface declaration", + "enabled": false, + "description": "Reports interfaces in a class' `implements` list or an interface's `extends` list that are already implemented by a superclass or extended by a superinterface. Such declarations are unnecessary and may be safely removed.\n\n**Example:**\n\n\n class X implements One, Two {\n }\n interface One {}\n interface Two extends One {}\n\nAfter the quick-fix is applied:\n\n\n class X implements Two {\n }\n interface One {}\n interface Two extends One {}\n\n\nUse the options to not report on `Serializable` or `Externalizable`\nin an `extends` or `implements` list." + }, + { + "shortName": "FrequentlyUsedInheritorInspection", + "displayName": "Class may extend a commonly used base class", + "enabled": false, + "description": "Reports classes or interfaces that can be replaced with an implementation or extension of a more specific commonly used class or interface.\n\nFor this inspection to work, a superclass needs to be in project source files and the project needs to use the IntelliJ IDEA build system.\n\n**Example:**\n\n\n class MyInheritor implements A {} // B suggested on the A reference\n\n interface A {}\n\n abstract class B implements A {}\n\n abstract class C1 extends B {}\n abstract class C2 extends B {}\n abstract class C3 extends B {}\n abstract class C4 extends B {}\n abstract class C5 extends B {}\n\nBy default, this inspection doesn't highlight issues in the editor but only provides a quick-fix.\n\nNew in 2017.2" + }, + { + "shortName": "AbstractClassExtendsConcreteClass", + "displayName": "Abstract class extends concrete class", + "enabled": false, + "description": "Reports `abstract` classes that extend concrete classes." + }, + { + "shortName": "AbstractMethodOverridesAbstractMethod", + "displayName": "Abstract method overrides abstract method", + "enabled": false, + "description": "Reports `abstract` methods that override `abstract` methods.\n\nSuch methods don't make sense because any concrete child class will have to implement the abstract method anyway.\n\n\nMethods whose return types, exception declarations, annotations, or modifiers differ from the overridden method are not reported by this inspection.\n\n\nConfigure the inspection:\n\n* Use the **Ignore methods with different Javadoc than their super methods** option to ignore any abstract methods whose JavaDoc comment differs from their super method." + }, + { + "shortName": "AbstractMethodWithMissingImplementations", + "displayName": "Abstract method with missing implementations", + "enabled": false, + "description": "Reports `abstract` methods that are not implemented in every concrete subclass.\n\n\nThis results in a compile-time error on the subclasses;\nthe inspection reports the problem at the point of the abstract method, allowing faster detection of the problem." + }, + { + "shortName": "AbstractClassWithoutAbstractMethods", + "displayName": "Abstract class without 'abstract' methods", + "enabled": false, + "description": "Reports `abstract` classes that have no `abstract` methods. In most cases it does not make sense to have an `abstract` class without any `abstract` methods, and the `abstract` modifier can be removed from the class. If the class was declared `abstract` to prevent instantiation, it is often a better option to use a `private` constructor to prevent instantiation instead.\n\n**Example:**\n\n\n abstract class Example {\n public String getName() {\n return \"IntelliJ IDEA\";\n }\n }\n\nUse the option to ignore utility classes." + }, + { + "shortName": "AbstractClassNeverImplemented", + "displayName": "Abstract class which has no concrete subclass", + "enabled": false, + "description": "Reports `abstract` classes that have no concrete subclasses." + }, + { + "shortName": "StaticInheritance", + "displayName": "Static inheritance", + "enabled": false, + "description": "Reports interfaces that are implemented only to provide access to constants. This kind of inheritance is often confusing and may hide important dependency information." + } + ] + }, + { + "name": "Numeric issues", + "inspections": [ + { + "shortName": "RemoveLiteralUnderscores", + "displayName": "Underscores in numeric literal", + "enabled": false, + "description": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level.\n\nThe quick-fix removes underscores from numeric literals. For example `1_000_000` will be converted to `1000000`.\n\n\n*Numeric literals with underscores* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2020.2" + }, + { + "shortName": "BadOddness", + "displayName": "Suspicious oddness check", + "enabled": false, + "description": "Reports odd-even checks of the following form: `x % 2 == 1`. Such checks fail when used with negative odd values. Consider using `x % 2 != 0` or `(x & 1) == 1` instead." + }, + { + "shortName": "ComparisonOfShortAndChar", + "displayName": "Comparison of 'short' and 'char' values", + "enabled": false, + "description": "Reports equality comparisons between `short` and `char` values.\n\nSuch comparisons may cause subtle bugs because while both values are 2-byte long, `short` values are\nsigned, and `char` values are unsigned.\n\n**Example:**\n\n\n if (Character.MAX_VALUE == shortValue()) {} //never can be true\n" + }, + { + "shortName": "InsertLiteralUnderscores", + "displayName": "Unreadable numeric literal", + "enabled": false, + "description": "Reports long numeric literals without underscores and suggests adding them. Underscores make such literals easier to read.\n\nExample:\n\n\n 1000000\n\nAfter the quick-fix is applied:\n\n\n 1_000_000\n\nThis inspection only reports if the language level of the project of module is 7 or higher.\n\nNew in 2020.2" + }, + { + "shortName": "DivideByZero", + "displayName": "Division by zero", + "enabled": true, + "description": "Reports division by zero or remainder by zero. Such expressions will produce an `Infinity`, `-Infinity` or `NaN` result for doubles or floats, and will throw an `ArithmeticException` for integers.\n\nWhen the expression has a `NaN` result, the fix suggests replacing the division expression with the `NaN` constant." + }, + { + "shortName": "ComparisonToNaN", + "displayName": "Comparison to 'Double.NaN' or 'Float.NaN'", + "enabled": true, + "description": "Reports any comparisons to `Double.NaN` or `Float.NaN`. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the `Double.isNaN()` or `Float.isNaN()` methods instead.\n\n**Example:**\n\n\n if (x == Double.NaN) {...}\n\nAfter the quick-fix is applied:\n\n\n if (Double.isNaN(x)) {...}\n" + }, + { + "shortName": "ConfusingFloatingPointLiteral", + "displayName": "Confusing floating-point literal", + "enabled": false, + "description": "Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point.\n\nSuch literals may be confusing, and violate several coding standards.\n\n**Example:**\n\n double d = .03;\n\nAfter the quick-fix is applied:\n\n double d = 0.03;\n\n\nUse the **Ignore floating point literals in scientific notation** option to ignore floating point numbers in scientific notation." + }, + { + "shortName": "UnaryPlus", + "displayName": "Unary plus", + "enabled": true, + "description": "Reports usages of the `+` unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in `+++`) or with the equal operator (like in `=+`).\n\n**Example:**\n\n\n void unaryPlus(int i) {\n int x = + +i;\n }\n\nThe following quick fixes are suggested:\n\n* Remove `+` operators before the `i` variable:\n\n\n void unaryPlus(int i) {\n int x = i;\n }\n\n* Replace `+` operators with the prefix increment operator:\n\n\n void unaryPlus(int i) {\n int x = ++i;\n }\n\n\nUse the checkbox below to report unary pluses that are used together with a binary or another unary expression.\nIt means the inspection will not report situations when a unary plus expression is used in array\ninitializer expressions or as a method argument." + }, + { + "shortName": "OctalAndDecimalIntegersMixed", + "displayName": "Octal and decimal integers in same array", + "enabled": false, + "description": "Reports mixed octal and decimal integer literals in a single array initializer. This situation might happen when you copy a list of numbers into an array initializer. Some numbers in the array might be zero-padded and the compiler will interpret them as octal.\n\n**Example:**\n\n int[] elapsed = {1, 13, 052};\n\nAfter the quick-fix that removes a leading zero is applied:\n\n int[] elapsed = {1, 13, 52};\n\nIf it is an octal number (for example, after a variable inline), then you can use another quick-fix that converts octal to decimal:\n`int[] elapsed = {1, 13, 42};`" + }, + { + "shortName": "UnnecessaryUnaryMinus", + "displayName": "Unnecessary unary minus", + "enabled": true, + "description": "Reports unnecessary unary minuses. Such expressions might be hard to understand and might contain errors.\n\n**For example:**\n\n void unaryMinus(int i) {\n int x = - -i;\n }\n\nThe following quick fixes are suggested here:\n\n* Remove `-` operators before the `i` variable:\n\n void unaryMinus(int i) {\n int x = i;\n }\n\n* Replace `-` operators with the prefix decrement operator:\n\n void unaryMinus(int i) {\n int x = --i;\n }\n\n**Another example:**\n\n void unaryMinus(int i) {\n i += - 8;\n }\n\nAfter the quick-fix is applied:\n\n void unaryMinus(int i) {\n i -= 8;\n }\n" + }, + { + "shortName": "LossyConversionCompoundAssignment", + "displayName": "Possibly lossy implicit cast in compound assignment", + "enabled": true, + "description": "Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable.\n\n\nDuring such compound assignments, an implicit cast occurs, potentially resulting in lossy conversions.\n\nExample:\n\n\n long c = 1;\n c += 1.2;\n\nAfter the quick-fix is applied:\n\n\n long c = 1;\n c += (long) 1.2;\n\nNew in 2023.2" + }, + { + "shortName": "CachedNumberConstructorCall", + "displayName": "Number constructor call with primitive argument", + "enabled": true, + "description": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9." + }, + { + "shortName": "PointlessArithmeticExpression", + "displayName": "Pointless arithmetic expression", + "enabled": true, + "description": "Reports pointless arithmetic expressions. Such expressions include adding or subtracting zero, multiplying by zero or one, and division by one.\n\nSuch expressions may be the result of automated refactorings and they are unlikely to be what the developer intended to do.\n\nThe quick-fix simplifies such expressions.\n\n**Example:**\n\n\n void f(int a) {\n int x = a - a;\n int y = a + 0;\n int res = x / x;\n }\n\nAfter the quick-fix is applied:\n\n\n void f(int a) {\n int x = 0;\n int y = a;\n int res = 1;\n }\n\n\nNote that in rare cases, the suggested replacement might not be completely equivalent to the original code\nfor all possible inputs. For example, the inspection suggests replacing `x / x` with `1`.\nHowever, if `x` is zero, the original code throws `ArithmeticException` or results in `NaN`.\nAlso, if `x` is `NaN`, then the result is also `NaN`. It's very unlikely that such behavior is intended." + }, + { + "shortName": "CharUsedInArithmeticContext", + "displayName": "'char' expression used in arithmetic context", + "enabled": false, + "description": "Reports expressions of the `char` type used in addition or subtraction expressions.\n\nSuch code is not necessarily an issue but may result in bugs (for example,\nif a string is expected).\n\n**Example:** `int a = 'a' + 42;`\n\nAfter the quick-fix is applied: `int a = (int) 'a' + 42;`\n\nFor the `String` context:\n\n int i1 = 1;\n int i2 = 2;\n System.out.println(i2 + '-' + i1 + \" = \" + (i2 - i1));\n\nAfter the quick-fix is applied:\n`System.out.println(i2 + \"-\" + i1 + \" = \" + (i2 - i1));`" + }, + { + "shortName": "UnpredictableBigDecimalConstructorCall", + "displayName": "Unpredictable 'BigDecimal' constructor call", + "enabled": true, + "description": "Reports calls to `BigDecimal` constructors that accept a `double` value. These constructors produce `BigDecimal` that is exactly equal to the supplied `double` value. However, because doubles are encoded in the IEEE 754 64-bit double-precision binary floating-point format, the exact value can be unexpected.\n\nFor example, `new BigDecimal(0.1)` yields a `BigDecimal` object. Its value is\n`0.1000000000000000055511151231257827021181583404541015625`\nwhich is the nearest number to 0.1 representable as a double.\nTo get `BigDecimal` that stores the same value as written in the source code,\nuse either `new BigDecimal(\"0.1\")` or `BigDecimal.valueOf(0.1)`.\n\n**Example:**\n\n\n class Constructor {\n void foo() {\n new BigDecimal(0.1);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Constructor {\n void foo() {\n new BigDecimal(\"0.1\");\n }\n }\n" + }, + { + "shortName": "IntegerDivisionInFloatingPointContext", + "displayName": "Integer division in floating-point context", + "enabled": true, + "description": "Reports integer divisions where the result is used as a floating-point number. Such division is often an error and may have unexpected results due to the truncation that happens in integer division.\n\n**Example:**\n\n\n float x = 3.0F + 3 * 2 / 5;\n\nAfter the quick-fix is applied:\n\n\n float x = 3.0F + ((float) (3 * 2)) /5;\n" + }, + { + "shortName": "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": "ParameterTypePreventsOverriding", - "displayName": "Parameter type prevents overriding", + "shortName": "ImplicitNumericConversion", + "displayName": "Implicit numeric conversion", "enabled": false, - "description": "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" + "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": "NonProtectedConstructorInAbstractClass", - "displayName": "Public constructor in abstract class", + "shortName": "BigDecimalEquals", + "displayName": "'equals()' called on 'BigDecimal'", "enabled": false, - "description": "Reports `public` constructors of `abstract` classes.\n\n\nConstructors of `abstract` classes can only be called from the constructors of\ntheir subclasses, declaring them `public` may be confusing.\n\nThe quick-fix makes such constructors protected.\n\n**Example:**\n\n\n public abstract class Foo {\n public Foo () { // warning: has 'public' modifier\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public abstract class Foo {\n protected Foo () {\n /* ... */\n }\n }\n\nConfigure the inspection:\n\nUse the **Ignore for non-public classes** option below to ignore `public` constructors in non-public classes." + "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": "RedundantImplements", - "displayName": "Redundant interface declaration", - "enabled": false, - "description": "Reports interfaces in a class' `implements` list or an interface's `extends` list that are already implemented by a superclass or extended by a superinterface. Such declarations are unnecessary and may be safely removed.\n\n**Example:**\n\n\n class X implements One, Two {\n }\n interface One {}\n interface Two extends One {}\n\nAfter the quick-fix is applied:\n\n\n class X implements Two {\n }\n interface One {}\n interface Two extends One {}\n\n\nUse the options to not report on `Serializable` or `Externalizable`\nin an `extends` or `implements` list." + "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": "FrequentlyUsedInheritorInspection", - "displayName": "Class may extend a commonly used base class", + "shortName": "ConstantMathCall", + "displayName": "Constant call to 'Math'", "enabled": false, - "description": "Reports classes or interfaces that can be replaced with an implementation or extension of a more specific commonly used class or interface.\n\nFor this inspection to work, a superclass needs to be in project source files and the project needs to use the IntelliJ IDEA build system.\n\n**Example:**\n\n\n class MyInheritor implements A {} // B suggested on the A reference\n\n interface A {}\n\n abstract class B implements A {}\n\n abstract class C1 extends B {}\n abstract class C2 extends B {}\n abstract class C3 extends B {}\n abstract class C4 extends B {}\n abstract class C5 extends B {}\n\nBy default, this inspection doesn't highlight issues in the editor but only provides a quick-fix.\n\nNew in 2017.2" + "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": "AbstractClassExtendsConcreteClass", - "displayName": "Abstract class extends concrete class", - "enabled": false, - "description": "Reports `abstract` classes that extend concrete classes." + "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": "AbstractMethodOverridesAbstractMethod", - "displayName": "Abstract method overrides abstract method", + "shortName": "NonReproducibleMathCall", + "displayName": "Non-reproducible call to 'Math'", "enabled": false, - "description": "Reports `abstract` methods that override `abstract` methods.\n\nSuch methods don't make sense because any concrete child class will have to implement the abstract method anyway.\n\n\nMethods whose return types, exception declarations, annotations, or modifiers differ from the overridden method are not reported by this inspection.\n\n\nConfigure the inspection:\n\n* Use the **Ignore methods with different Javadoc than their super methods** option to ignore any abstract methods whose JavaDoc comment differs from their super method." + "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": "AbstractMethodWithMissingImplementations", - "displayName": "Abstract method with missing implementations", + "shortName": "FloatingPointEquality", + "displayName": "Floating-point equality comparison", "enabled": false, - "description": "Reports `abstract` methods that are not implemented in every concrete subclass.\n\n\nThis results in a compile-time error on the subclasses;\nthe inspection reports the problem at the point of the abstract method, allowing faster detection of the problem." + "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": "AbstractClassWithoutAbstractMethods", - "displayName": "Abstract class without 'abstract' methods", + "shortName": "SuspiciousLiteralUnderscore", + "displayName": "Suspicious underscore in number literal", "enabled": false, - "description": "Reports `abstract` classes that have no `abstract` methods. In most cases it does not make sense to have an `abstract` class without any `abstract` methods, and the `abstract` modifier can be removed from the class. If the class was declared `abstract` to prevent instantiation, it is often a better option to use a `private` constructor to prevent instantiation instead.\n\n**Example:**\n\n\n abstract class Example {\n public String getName() {\n return \"IntelliJ IDEA\";\n }\n }\n\nUse the option to ignore utility classes." + "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": "AbstractClassNeverImplemented", - "displayName": "Abstract class which has no concrete subclass", - "enabled": false, - "description": "Reports `abstract` classes that have no concrete subclasses." + "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": "StaticInheritance", - "displayName": "Static inheritance", + "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 interfaces that are implemented only to provide access to constants. This kind of inheritance is often confusing and may hide important dependency information." + "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." } ] }, @@ -5040,285 +5213,112 @@ "description": "Reports `if` statements that contain `else` branches and whose conditions are negated.\n\nFlipping the order of the `if` and `else`\nbranches usually increases the clarity of such statements.\n\nThere is a fix that inverts the current `if` statement.\n\nExample:\n\n\n void m(Object o1, Object o2) {\n if (o1 != o2) {\n System.out.println(1);\n }\n else {\n System.out.println(2);\n }\n }\n\nAfter applying the quick-fix:\n\n\n void m(Object o1, Object o2) {\n if (o1 == o2) {\n System.out.println(2);\n } else {\n System.out.println(1);\n }\n }\n\nUse the **Ignore '!= null' comparisons** option to ignore comparisons of the `!= null` form.\n\nUse the **Ignore '!= 0' comparisons** option to ignore comparisons of the `!= 0` form." }, { - "shortName": "GroovyTrivialIf", - "displayName": "Redundant 'if' statement", - "enabled": false, - "description": "Reports `if` statements which can be simplified to single assignment or `return` statements.\n\n**Example:**\n\n\n if (foo())\n return true;\n else\n return false;\n\nAfter the quick-fix is applied:\n\n\n return foo();\n" - }, - { - "shortName": "GroovyFallthrough", - "displayName": "Fallthrough in 'switch' statement", - "enabled": false, - "description": "Reports *fallthrough* in switch statements. While occasionally useful, fallthrough is often unintended, and may lead to surprising bugs.\n\n**Example:**\n\n\n switch(n) {\n case 1:\n print 1\n case 2: // \"case 1\" fallthrough to \"case 2\". Statements from \"case 2\" will be executed immediately after \"case 1\".\n print 2\n break\n default:\n print \"Default\"\n }\n\n" - }, - { - "shortName": "GroovyIfStatementWithIdenticalBranches", - "displayName": "If statement with identical branches", - "enabled": false, - "description": "Reports `if` statements with identical \"then\" and `else` branches. Such statements are almost certainly programmer error.\n\n**Example:**\n\n\n if (condition) {\n print \"foo\"\n } else {\n print \"foo\"\n }\n\nAfter the quick-fix is applied:\n\n\n print \"foo\"\n\n" - }, - { - "shortName": "GroovyTrivialConditional", - "displayName": "Redundant conditional expression", - "enabled": false, - "description": "Reports ternary conditional operators of the form `x ? true : false` or similar, which can be trivially simplified.\n\n**Example:**\n\n\n foo() ? true : false\n\nAfter the quick-fix is applied:\n\n\n foo()\n" - }, - { - "shortName": "GrFinalVariableAccess", - "displayName": "Final variable access", - "enabled": false, - "description": "Reports uninitialized final fields, invalid assignments to final variables, and parameters and fields." - }, - { - "shortName": "GroovyBreak", - "displayName": "'break' statement", - "enabled": false, - "description": "Reports `break` statements outside of `switch` statements." - }, - { - "shortName": "GroovyConstantConditional", - "displayName": "Constant conditional expression", - "enabled": false, - "description": "Reports conditional expressions with boolean constant as a condition.\n\n**Example:**\n\n\n true ? result1 : result2\n false ? result1 : result2\n" - }, - { - "shortName": "GroovyContinue", - "displayName": "'continue' statement", - "enabled": false, - "description": "Reports `continue` statements." - }, - { - "shortName": "GroovySwitchStatementWithNoDefault", - "displayName": "Switch statement with no default case", - "enabled": false, - "description": "Reports `switch` statements that do not contain `default` labels.\n\n\nSome coding practices may insist on adding this label to all `switch` statements." - }, - { - "shortName": "GroovyUnnecessaryReturn", - "displayName": "Unnecessary 'return' statement", - "enabled": false, - "description": "Reports `return` statements at the end of constructors and methods returning\n`void`. These are unnecessary and may be safely removed.\n\n**Example:**\n\n\n void foo (String s){\n print(s)\n return\n }\n\nAfter the quick-fix is applied:\n\n\n void foo (String s){\n print(s)\n }\n\nFor more information, see the same inspection in Java." - }, - { - "shortName": "GroovyConditionalWithIdenticalBranches", - "displayName": "Ternary expression with identical branches", - "enabled": false, - "description": "Reports ternary expressions with identical \"then\" and \"else\" branches. Such expressions are almost certainly a programmer error.\n\nThe quick-fix replaces the expression with its \"then\" branch.\n\n**Example:**\n\n\n condition ? a.foo() : a.foo()\n\nAfter the quick-fix is applied:\n\n\n a.foo()\n" - }, - { - "shortName": "GroovyConditionalCanBeElvis", - "displayName": "Ternary expression can be replaced with elvis expression", - "enabled": false, - "description": "Reports ternary expressions which can be replaced by an elvis expression.\n\n**Example:**\n\n\n def notNull(o, defaultValue) {\n o != null ? o : defaultValue\n }\n\nAfter the quick-fix is applied:\n\n\n def notNull(o, defaultValue) {\n o ?: defaultValue\n }\n" - }, - { - "shortName": "GroovyConstantIfStatement", - "displayName": "Constant if statement", - "enabled": false, - "description": "Reports `if` statements with boolean constant as a condition.\n\n**Example:**\n\n\n if (true) {\n // ...\n }\n if (false) {\n // ...\n }\n" - }, - { - "shortName": "GroovyIfStatementWithTooManyBranches", - "displayName": "If statement with too many branches", - "enabled": false, - "description": "Reports `if` statements with too many branches. Such statements may be confusing, and are often the sign of inadequate levels of design abstraction.\n\n**Example:**\n\n\n if (a) {\n print \"foo\"\n } else if (b) {\n print \"bar\"\n } else if (c) {\n print \"baz\"\n } else if (d) {\n print \"Too many branches\"\n }\n\n\nUse the **Maximum number of branches** field to specify the maximum number of branches expected." - }, - { - "shortName": "GroovyConditionalCanBeConditionalCall", - "displayName": "Ternary expression can be replaced with safe call", - "enabled": false, - "description": "Reports ternary expressions which can be replaced by a safe call.\n\n**Example:**\n\n\n def charArray(String s) {\n s == null ? null : s.toCharArray()\n }\n\nAfter the quick-fix is applied:\n\n\n def charArray(String s) {\n s?.toCharArray()\n }\n" - }, - { - "shortName": "GroovyUnnecessaryContinue", - "displayName": "Unnecessary 'continue' statement", - "enabled": false, - "description": "Reports `continue` statements if they are last reachable statements in the loop.\nThese `continue` statements are unnecessary and can be safely removed.\n\n**Example:**\n\n\n for(int i in array) {\n println(i)\n continue\n }\n\nAfter the quick-fix is applied:\n\n\n for(int i in array) {\n println(i)\n }\n\nFor more information, see the same inspection in Java." - }, - { - "shortName": "GroovyLoopStatementThatDoesntLoop", - "displayName": "Loop statement that doesn't loop", - "enabled": false, - "description": "Reports `for` or `while` statements whose bodies are guaranteed to execute at most once. While such statements could be written intentionally, they are usually a symptom of error.\n\n**Example:**\n\n\n for (int i in 0..<10) {\n return\n }\n\n" - }, - { - "shortName": "GroovyReturnFromClosureCanBeImplicit", - "displayName": "'return' statement can be implicit", - "enabled": false, - "description": "Reports return statements at the end of closures which can be made implicit.\n\n\nGroovy closures implicitly return the value of the last statement in them.\n\n**Example:**\n\n\n def foo = {\n return 1\n }\n\nAfter the quick-fix is applied:\n\n\n def foo = {\n 1\n }\n" - } - ] - }, - { - "name": "Numeric issues", - "inspections": [ - { - "shortName": "RemoveLiteralUnderscores", - "displayName": "Underscores in numeric literal", - "enabled": false, - "description": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level.\n\nThe quick-fix removes underscores from numeric literals. For example `1_000_000` will be converted to `1000000`.\n\n\n*Numeric literals with underscores* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2020.2" - }, - { - "shortName": "BadOddness", - "displayName": "Suspicious oddness check", - "enabled": false, - "description": "Reports odd-even checks of the following form: `x % 2 == 1`. Such checks fail when used with negative odd values. Consider using `x % 2 != 0` or `(x & 1) == 1` instead." - }, - { - "shortName": "ComparisonOfShortAndChar", - "displayName": "Comparison of 'short' and 'char' values", - "enabled": false, - "description": "Reports equality comparisons between `short` and `char` values.\n\nSuch comparisons may cause subtle bugs because while both values are 2-byte long, `short` values are\nsigned, and `char` values are unsigned.\n\n**Example:**\n\n\n if (Character.MAX_VALUE == shortValue()) {} //never can be true\n" - }, - { - "shortName": "InsertLiteralUnderscores", - "displayName": "Unreadable numeric literal", - "enabled": false, - "description": "Reports long numeric literals without underscores and suggests adding them. Underscores make such literals easier to read.\n\nExample:\n\n\n 1000000\n\nAfter the quick-fix is applied:\n\n\n 1_000_000\n\nThis inspection only reports if the language level of the project of module is 7 or higher.\n\nNew in 2020.2" - }, - { - "shortName": "DivideByZero", - "displayName": "Division by zero", - "enabled": true, - "description": "Reports division by zero or remainder by zero. Such expressions will produce an `Infinity`, `-Infinity` or `NaN` result for doubles or floats, and will throw an `ArithmeticException` for integers.\n\nWhen the expression has a `NaN` result, the fix suggests replacing the division expression with the `NaN` constant." - }, - { - "shortName": "ComparisonToNaN", - "displayName": "Comparison to 'Double.NaN' or 'Float.NaN'", - "enabled": true, - "description": "Reports any comparisons to `Double.NaN` or `Float.NaN`. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the `Double.isNaN()` or `Float.isNaN()` methods instead.\n\n**Example:**\n\n\n if (x == Double.NaN) {...}\n\nAfter the quick-fix is applied:\n\n\n if (Double.isNaN(x)) {...}\n" - }, - { - "shortName": "ConfusingFloatingPointLiteral", - "displayName": "Confusing floating-point literal", - "enabled": false, - "description": "Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point.\n\nSuch literals may be confusing, and violate several coding standards.\n\n**Example:**\n\n double d = .03;\n\nAfter the quick-fix is applied:\n\n double d = 0.03;\n\n\nUse the **Ignore floating point literals in scientific notation** option to ignore floating point numbers in scientific notation." - }, - { - "shortName": "UnaryPlus", - "displayName": "Unary plus", - "enabled": true, - "description": "Reports usages of the `+` unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in `+++`) or with the equal operator (like in `=+`).\n\n**Example:**\n\n\n void unaryPlus(int i) {\n int x = + +i;\n }\n\nThe following quick fixes are suggested:\n\n* Remove `+` operators before the `i` variable:\n\n\n void unaryPlus(int i) {\n int x = i;\n }\n\n* Replace `+` operators with the prefix increment operator:\n\n\n void unaryPlus(int i) {\n int x = ++i;\n }\n\n\nUse the checkbox below to report unary pluses that are used together with a binary or another unary expression.\nIt means the inspection will not report situations when a unary plus expression is used in array\ninitializer expressions or as a method argument." - }, - { - "shortName": "OctalAndDecimalIntegersMixed", - "displayName": "Octal and decimal integers in same array", - "enabled": false, - "description": "Reports mixed octal and decimal integer literals in a single array initializer. This situation might happen when you copy a list of numbers into an array initializer. Some numbers in the array might be zero-padded and the compiler will interpret them as octal.\n\n**Example:**\n\n int[] elapsed = {1, 13, 052};\n\nAfter the quick-fix that removes a leading zero is applied:\n\n int[] elapsed = {1, 13, 52};\n\nIf it is an octal number (for example, after a variable inline), then you can use another quick-fix that converts octal to decimal:\n`int[] elapsed = {1, 13, 42};`" - }, - { - "shortName": "UnnecessaryUnaryMinus", - "displayName": "Unnecessary unary minus", - "enabled": true, - "description": "Reports unnecessary unary minuses. Such expressions might be hard to understand and might contain errors.\n\n**For example:**\n\n void unaryMinus(int i) {\n int x = - -i;\n }\n\nThe following quick fixes are suggested here:\n\n* Remove `-` operators before the `i` variable:\n\n void unaryMinus(int i) {\n int x = i;\n }\n\n* Replace `-` operators with the prefix decrement operator:\n\n void unaryMinus(int i) {\n int x = --i;\n }\n\n**Another example:**\n\n void unaryMinus(int i) {\n i += - 8;\n }\n\nAfter the quick-fix is applied:\n\n void unaryMinus(int i) {\n i -= 8;\n }\n" - }, - { - "shortName": "LossyConversionCompoundAssignment", - "displayName": "Possibly lossy implicit cast in compound assignment", - "enabled": true, - "description": "Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable.\n\n\nDuring such compound assignments, an implicit cast occurs, potentially resulting in lossy conversions.\n\nExample:\n\n\n long c = 1;\n c += 1.2;\n\nAfter the quick-fix is applied:\n\n\n long c = 1;\n c += (long) 1.2;\n\nNew in 2023.2" - }, - { - "shortName": "CachedNumberConstructorCall", - "displayName": "Number constructor call with primitive argument", - "enabled": true, - "description": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9." + "shortName": "GroovyTrivialIf", + "displayName": "Redundant 'if' statement", + "enabled": false, + "description": "Reports `if` statements which can be simplified to single assignment or `return` statements.\n\n**Example:**\n\n\n if (foo())\n return true;\n else\n return false;\n\nAfter the quick-fix is applied:\n\n\n return foo();\n" }, { - "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": "GroovyFallthrough", + "displayName": "Fallthrough in 'switch' statement", + "enabled": false, + "description": "Reports *fallthrough* in switch statements. While occasionally useful, fallthrough is often unintended, and may lead to surprising bugs.\n\n**Example:**\n\n\n switch(n) {\n case 1:\n print 1\n case 2: // \"case 1\" fallthrough to \"case 2\". Statements from \"case 2\" will be executed immediately after \"case 1\".\n print 2\n break\n default:\n print \"Default\"\n }\n\n" }, { - "shortName": "CharUsedInArithmeticContext", - "displayName": "'char' expression used in arithmetic context", + "shortName": "GroovyIfStatementWithIdenticalBranches", + "displayName": "If statement with identical branches", "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));`" + "description": "Reports `if` statements with identical \"then\" and `else` branches. Such statements are almost certainly programmer error.\n\n**Example:**\n\n\n if (condition) {\n print \"foo\"\n } else {\n print \"foo\"\n }\n\nAfter the quick-fix is applied:\n\n\n print \"foo\"\n\n" }, { - "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": "GroovyTrivialConditional", + "displayName": "Redundant conditional expression", + "enabled": false, + "description": "Reports ternary conditional operators of the form `x ? true : false` or similar, which can be trivially simplified.\n\n**Example:**\n\n\n foo() ? true : false\n\nAfter the quick-fix is applied:\n\n\n foo()\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": "GrFinalVariableAccess", + "displayName": "Final variable access", + "enabled": false, + "description": "Reports uninitialized final fields, invalid assignments to final variables, and parameters and fields." }, { - "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": "GroovyBreak", + "displayName": "'break' statement", + "enabled": false, + "description": "Reports `break` statements outside of `switch` statements." }, { - "shortName": "ImplicitNumericConversion", - "displayName": "Implicit numeric conversion", + "shortName": "GroovyConstantConditional", + "displayName": "Constant conditional expression", "enabled": false, - "description": "Reports implicit conversion between numeric types.\n\nImplicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs.\n\n**Example:**\n\n\n double m(int i) {\n return i * 10;\n }\n\nAfter the quick-fix is applied:\n\n\n double m(int i) {\n return (double) (i * 10);\n }\n\nConfigure the inspection:\n\n* Use the **Ignore widening conversions** option to ignore implicit conversion that cannot result in data loss (for example, `int`-\\>`long`).\n* Use the **Ignore conversions from and to 'char'** option to ignore conversion from and to `char`. The inspection will still report conversion from and to floating-point numbers.\n* Use the **Ignore conversion from constants and literals** to make the inspection ignore conversion from literals and compile-time constants." + "description": "Reports conditional expressions with boolean constant as a condition.\n\n**Example:**\n\n\n true ? result1 : result2\n false ? result1 : result2\n" }, { - "shortName": "BigDecimalEquals", - "displayName": "'equals()' called on 'BigDecimal'", + "shortName": "GroovyContinue", + "displayName": "'continue' statement", "enabled": false, - "description": "Reports `equals()` calls that compare two `java.math.BigDecimal` numbers. This is normally a mistake, as two `java.math.BigDecimal` numbers are only equal if they are equal in both value and scale.\n\n**Example:**\n\n\n if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false\n\nAfter the quick-fix is applied:\n\n\n if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true\n" + "description": "Reports `continue` statements." }, { - "shortName": "OctalLiteral", - "displayName": "Octal integer", - "enabled": true, - "description": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals.\n\nExample:\n\n\n int i = 015;\n int j = 0_777;\n\nThis inspection has two different quick-fixes.\nAfter the **Convert octal literal to decimal literal** quick-fix is applied, the code changes to:\n\n\n int i = 13;\n int j = 511;\n\nAfter the **Remove leading zero to make decimal** quick-fix is applied, the code changes to:\n\n\n int i = 15;\n int j = 777;\n" + "shortName": "GroovySwitchStatementWithNoDefault", + "displayName": "Switch statement with no default case", + "enabled": false, + "description": "Reports `switch` statements that do not contain `default` labels.\n\n\nSome coding practices may insist on adding this label to all `switch` statements." }, { - "shortName": "ConstantMathCall", - "displayName": "Constant call to 'Math'", + "shortName": "GroovyUnnecessaryReturn", + "displayName": "Unnecessary 'return' statement", "enabled": false, - "description": "Reports calls to `java.lang.Math` or `java.lang.StrictMath` methods that can be replaced with simple compile-time constants.\n\n**Example:**\n\n double v = Math.sin(0.0);\n\nAfter the quick-fix is applied:\n\n double v = 0.0;\n" + "description": "Reports `return` statements at the end of constructors and methods returning\n`void`. These are unnecessary and may be safely removed.\n\n**Example:**\n\n\n void foo (String s){\n print(s)\n return\n }\n\nAfter the quick-fix is applied:\n\n\n void foo (String s){\n print(s)\n }\n\nFor more information, see the same inspection in Java." }, { - "shortName": "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": "GroovyConditionalWithIdenticalBranches", + "displayName": "Ternary expression with identical branches", + "enabled": false, + "description": "Reports ternary expressions with identical \"then\" and \"else\" branches. Such expressions are almost certainly a programmer error.\n\nThe quick-fix replaces the expression with its \"then\" branch.\n\n**Example:**\n\n\n condition ? a.foo() : a.foo()\n\nAfter the quick-fix is applied:\n\n\n a.foo()\n" }, { - "shortName": "NonReproducibleMathCall", - "displayName": "Non-reproducible call to 'Math'", + "shortName": "GroovyConditionalCanBeElvis", + "displayName": "Ternary expression can be replaced with elvis expression", "enabled": false, - "description": "Reports calls to `java.lang.Math` methods, which results are not guaranteed to be reproduced precisely.\n\nIn environments where reproducibility of results is required, `java.lang.StrictMath`\nshould be used instead." + "description": "Reports ternary expressions which can be replaced by an elvis expression.\n\n**Example:**\n\n\n def notNull(o, defaultValue) {\n o != null ? o : defaultValue\n }\n\nAfter the quick-fix is applied:\n\n\n def notNull(o, defaultValue) {\n o ?: defaultValue\n }\n" }, { - "shortName": "FloatingPointEquality", - "displayName": "Floating-point equality comparison", + "shortName": "GroovyConstantIfStatement", + "displayName": "Constant if statement", "enabled": false, - "description": "Reports floating-point values that are being compared using the `==` or `!=` operator.\n\nFloating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics.\n\nThis inspection ignores comparisons with zero and infinity literals.\n\n**Example:**\n\n\n void m(double d1, double d2) {\n if (d1 == d2) {}\n }\n" + "description": "Reports `if` statements with boolean constant as a condition.\n\n**Example:**\n\n\n if (true) {\n // ...\n }\n if (false) {\n // ...\n }\n" }, { - "shortName": "SuspiciousLiteralUnderscore", - "displayName": "Suspicious underscore in number literal", + "shortName": "GroovyIfStatementWithTooManyBranches", + "displayName": "If statement with too many branches", "enabled": false, - "description": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo.\n\nThis inspection will not warn on literals containing two consecutive underscores.\nIt is also allowed to omit underscores in the fractional part of `double` and `float` literals.\n\n**Example:** `int oneMillion = 1_000_0000;`" + "description": "Reports `if` statements with too many branches. Such statements may be confusing, and are often the sign of inadequate levels of design abstraction.\n\n**Example:**\n\n\n if (a) {\n print \"foo\"\n } else if (b) {\n print \"bar\"\n } else if (c) {\n print \"baz\"\n } else if (d) {\n print \"Too many branches\"\n }\n\n\nUse the **Maximum number of branches** field to specify the maximum number of branches expected." }, { - "shortName": "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": "GroovyConditionalCanBeConditionalCall", + "displayName": "Ternary expression can be replaced with safe call", + "enabled": false, + "description": "Reports ternary expressions which can be replaced by a safe call.\n\n**Example:**\n\n\n def charArray(String s) {\n s == null ? null : s.toCharArray()\n }\n\nAfter the quick-fix is applied:\n\n\n def charArray(String s) {\n s?.toCharArray()\n }\n" }, { - "shortName": "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": "GroovyUnnecessaryContinue", + "displayName": "Unnecessary 'continue' statement", + "enabled": false, + "description": "Reports `continue` statements if they are last reachable statements in the loop.\nThese `continue` statements are unnecessary and can be safely removed.\n\n**Example:**\n\n\n for(int i in array) {\n println(i)\n continue\n }\n\nAfter the quick-fix is applied:\n\n\n for(int i in array) {\n println(i)\n }\n\nFor more information, see the same inspection in Java." }, { - "shortName": "OverlyComplexArithmeticExpression", - "displayName": "Overly complex arithmetic expression", + "shortName": "GroovyLoopStatementThatDoesntLoop", + "displayName": "Loop statement that doesn't loop", "enabled": false, - "description": "Reports arithmetic expressions with the excessive number of terms. Such expressions might be hard to understand and might contain errors.\n\nParameters, field references, and other primary expressions are counted as a term.\n\n**Example:**\n\n int calc(int a, int b) {\n return a + a + a + b + b + b + b; // The line contains 7 terms and will be reported.\n }\n\nUse the field below to specify a number of terms allowed in arithmetic expressions." + "description": "Reports `for` or `while` statements whose bodies are guaranteed to execute at most once. While such statements could be written intentionally, they are usually a symptom of error.\n\n**Example:**\n\n\n for (int i in 0..<10) {\n return\n }\n\n" + }, + { + "shortName": "GroovyReturnFromClosureCanBeImplicit", + "displayName": "'return' statement can be implicit", + "enabled": false, + "description": "Reports return statements at the end of closures which can be made implicit.\n\n\nGroovy closures implicitly return the value of the last statement in them.\n\n**Example:**\n\n\n def foo = {\n return 1\n }\n\nAfter the quick-fix is applied:\n\n\n def foo = {\n 1\n }\n" } ] }, @@ -5565,6 +5565,71 @@ } ] }, + { + "name": "Properties files", + "inspections": [ + { + "shortName": "UnusedMessageFormatParameter", + "displayName": "Missing message format parameter", + "enabled": false, + "description": "Reports properties values that look like `java.text.MessageFormat` format strings but do not use some the parameters of the `{xx}` kind.\n\nExample:\n\n\n # parameter {0} is not used\n error.message=Something happened in line {1}\n \n" + }, + { + "shortName": "InconsistentResourceBundle", + "displayName": "Inconsistent resource bundle", + "enabled": false, + "description": "Reports problems in the properties files contained in the resource bundle.\n\n* **Report missing translations** \n\n Use this option to report properties contained in the parent properties file that are missing in inherited ones (unless it's a language dialect). \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n # Empty file\n \n Property `abc` will be reported as untranslated. \n\n* **Report inconsistent properties** \n\n Use this option to report properties contained in inherited properties file that are missing in the parent one (or in siblings if there is no parent). \n\n Example:\n\n\n # messages.properties\n # Empty file\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` translation is not available here for any language except French, and, thus, will be reported as missing in the (default) properties file `messages.properties`. \n\n* **Report properties overridden with the same value** \n\n Use this option to report properties copy-pasted into several properties files verbatim. \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` will be reported as unnecessarily inherited in the file `messages_fr.properties` . \n\n* **Report properties overridden with different placeholders** \n\n Use this option to check for placeholder consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n qwe={0}xxx{1}\n abc={0}yyy{1}\n\n # messages_fr.properties\n qwe={0}xxx{0}xxx{1}\n abc={0}yyy\n \n Property `abc` will be reported as a property containing message format placeholders not corresponding to `messages.properties`. \n\n* **Report properties overridden with different values endings** \n\n Use this option to check for ending consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n abc=xxxzzz\n\n # messages_fr.properties\n abc=xxx;\n \n Property `abc` will be reported as ending with special signs (`!` / `?` / `.` / `:` / `;`) whereas the parent value in `messages.properties` doesn't." + }, + { + "shortName": "SuspiciousLocalesLanguages", + "displayName": "Suspicious resource bundle locale languages", + "enabled": false, + "description": "Reports locales with language codes that are not supported by Java." + }, + { + "shortName": "UseEllipsisInPropertyInspection", + "displayName": "Three dot characters instead of the ellipsis", + "enabled": false, + "description": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files." + }, + { + "shortName": "AlphaUnsortedPropertiesFile", + "displayName": "Properties file or resource bundle is alphabetically unsorted", + "enabled": false, + "description": "Reports alphabetically unsorted resource bundles or .properties files." + }, + { + "shortName": "TrailingSpacesInProperty", + "displayName": "Trailing spaces in property", + "enabled": false, + "description": "Reports properties whose keys or values end with a whitespace." + }, + { + "shortName": "UnusedProperty", + "displayName": "Unused property", + "enabled": false, + "description": "Reports properties that are not referenced outside of the .properties file they are contained in." + }, + { + "shortName": "WrongPropertyKeyValueDelimiter", + "displayName": "Property key/value delimiter doesn't match code style settings", + "enabled": false, + "description": "Reports properties in which key or value delimiters do not match code style settings." + }, + { + "shortName": "DuplicatePropertyInspection", + "displayName": "Duplicate property", + "enabled": false, + "description": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values.\n\nExample:\n\n\n property1=value;\n property2=value;\n\nThe **Options** list allows selecting the area in which the inspection should search for duplicates." + }, + { + "shortName": "UnresolvedPropertyKey", + "displayName": "Invalid property key", + "enabled": true, + "description": "Reports invalid arguments that are passed to methods with parameters annotated as `@PropertyKey`.\n\nThese arguments should be valid property keys in corresponding properties files.\nAlso, the inspection verifies that the `resourceBundle`\nargument of the `@PropertyKey` annotation is an existing resource bundle.\n\n\nUse the quick-fix to create a new property or to select an existing one.\n\nExample:\n\n\n @PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";\n" + } + ] + }, { "name": "EditorConfig", "inspections": [ @@ -5701,111 +5766,46 @@ "description": "Reports key-value pairs that are not allowed in the current context." }, { - "shortName": "EditorConfigNoMatchingFiles", - "displayName": "No matching files", - "enabled": false, - "description": "Reports sections with wildcard patterns that do not match any files under the directory in which the `.editorconfig` file is located." - }, - { - "shortName": "EditorConfigWildcardRedundancy", - "displayName": "Redundant wildcard", - "enabled": false, - "description": "Reports wildcards that become redundant when the \"\\*\\*\" wildcard is used in the same section.\n\n\nThe \"\\*\\*\" wildcard defines a broader set of files than any other wildcard.\nThat is why, any other wildcard used in the same section has no affect and can be removed." - }, - { - "shortName": "EditorConfigHeaderUniqueness", - "displayName": "EditorConfig section is not unique", - "enabled": false, - "description": "Reports sections that define the same file pattern as other sections." - }, - { - "shortName": "EditorConfigValueCorrectness", - "displayName": "Invalid property value", - "enabled": false, - "description": "Reports property values that do not meet value restrictions. For example, some properties may be only \"true\" or \"false\", others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them." - }, - { - "shortName": "EditorConfigVerifyByCore", - "displayName": "Invalid .editorconfig file", - "enabled": false, - "description": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied." - }, - { - "shortName": "EditorConfigCharClassLetterRedundancy", - "displayName": "Duplicate character class letter", - "enabled": false, - "description": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example `[aa]`." - }, - { - "shortName": "EditorConfigUnusedDeclaration", - "displayName": "Unused declaration", - "enabled": false, - "description": "Reports unused declarations. Such declarations can be removed." - } - ] - }, - { - "name": "Properties files", - "inspections": [ - { - "shortName": "UnusedMessageFormatParameter", - "displayName": "Missing message format parameter", - "enabled": false, - "description": "Reports properties values that look like `java.text.MessageFormat` format strings but do not use some the parameters of the `{xx}` kind.\n\nExample:\n\n\n # parameter {0} is not used\n error.message=Something happened in line {1}\n \n" - }, - { - "shortName": "InconsistentResourceBundle", - "displayName": "Inconsistent resource bundle", - "enabled": false, - "description": "Reports problems in the properties files contained in the resource bundle.\n\n* **Report missing translations** \n\n Use this option to report properties contained in the parent properties file that are missing in inherited ones (unless it's a language dialect). \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n # Empty file\n \n Property `abc` will be reported as untranslated. \n\n* **Report inconsistent properties** \n\n Use this option to report properties contained in inherited properties file that are missing in the parent one (or in siblings if there is no parent). \n\n Example:\n\n\n # messages.properties\n # Empty file\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` translation is not available here for any language except French, and, thus, will be reported as missing in the (default) properties file `messages.properties`. \n\n* **Report properties overridden with the same value** \n\n Use this option to report properties copy-pasted into several properties files verbatim. \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` will be reported as unnecessarily inherited in the file `messages_fr.properties` . \n\n* **Report properties overridden with different placeholders** \n\n Use this option to check for placeholder consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n qwe={0}xxx{1}\n abc={0}yyy{1}\n\n # messages_fr.properties\n qwe={0}xxx{0}xxx{1}\n abc={0}yyy\n \n Property `abc` will be reported as a property containing message format placeholders not corresponding to `messages.properties`. \n\n* **Report properties overridden with different values endings** \n\n Use this option to check for ending consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n abc=xxxzzz\n\n # messages_fr.properties\n abc=xxx;\n \n Property `abc` will be reported as ending with special signs (`!` / `?` / `.` / `:` / `;`) whereas the parent value in `messages.properties` doesn't." - }, - { - "shortName": "SuspiciousLocalesLanguages", - "displayName": "Suspicious resource bundle locale languages", - "enabled": false, - "description": "Reports locales with language codes that are not supported by Java." - }, - { - "shortName": "UseEllipsisInPropertyInspection", - "displayName": "Three dot characters instead of the ellipsis", + "shortName": "EditorConfigNoMatchingFiles", + "displayName": "No matching files", "enabled": false, - "description": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files." + "description": "Reports sections with wildcard patterns that do not match any files under the directory in which the `.editorconfig` file is located." }, { - "shortName": "AlphaUnsortedPropertiesFile", - "displayName": "Properties file or resource bundle is alphabetically unsorted", + "shortName": "EditorConfigWildcardRedundancy", + "displayName": "Redundant wildcard", "enabled": false, - "description": "Reports alphabetically unsorted resource bundles or .properties files." + "description": "Reports wildcards that become redundant when the \"\\*\\*\" wildcard is used in the same section.\n\n\nThe \"\\*\\*\" wildcard defines a broader set of files than any other wildcard.\nThat is why, any other wildcard used in the same section has no affect and can be removed." }, { - "shortName": "TrailingSpacesInProperty", - "displayName": "Trailing spaces in property", + "shortName": "EditorConfigHeaderUniqueness", + "displayName": "EditorConfig section is not unique", "enabled": false, - "description": "Reports properties whose keys or values end with a whitespace." + "description": "Reports sections that define the same file pattern as other sections." }, { - "shortName": "UnusedProperty", - "displayName": "Unused property", + "shortName": "EditorConfigValueCorrectness", + "displayName": "Invalid property value", "enabled": false, - "description": "Reports properties that are not referenced outside of the .properties file they are contained in." + "description": "Reports property values that do not meet value restrictions. For example, some properties may be only \"true\" or \"false\", others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them." }, { - "shortName": "WrongPropertyKeyValueDelimiter", - "displayName": "Property key/value delimiter doesn't match code style settings", + "shortName": "EditorConfigVerifyByCore", + "displayName": "Invalid .editorconfig file", "enabled": false, - "description": "Reports properties in which key or value delimiters do not match code style settings." + "description": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied." }, { - "shortName": "DuplicatePropertyInspection", - "displayName": "Duplicate property", + "shortName": "EditorConfigCharClassLetterRedundancy", + "displayName": "Duplicate character class letter", "enabled": false, - "description": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values.\n\nExample:\n\n\n property1=value;\n property2=value;\n\nThe **Options** list allows selecting the area in which the inspection should search for duplicates." + "description": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example `[aa]`." }, { - "shortName": "UnresolvedPropertyKey", - "displayName": "Invalid property key", - "enabled": true, - "description": "Reports invalid arguments that are passed to methods with parameters annotated as `@PropertyKey`.\n\nThese arguments should be valid property keys in corresponding properties files.\nAlso, the inspection verifies that the `resourceBundle`\nargument of the `@PropertyKey` annotation is an existing resource bundle.\n\n\nUse the quick-fix to create a new property or to select an existing one.\n\nExample:\n\n\n @PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";\n" + "shortName": "EditorConfigUnusedDeclaration", + "displayName": "Unused declaration", + "enabled": false, + "description": "Reports unused declarations. Such declarations can be removed." } ] }, @@ -6432,18 +6432,18 @@ "enabled": true, "description": "Reports cases where the minimum or the maximum of two numbers can be calculated using a `Math.max()` or `Math.min()` call, instead of doing it manually.\n\n**Example:**\n\n\n public int min(int a, int b) {\n return b < a ? b : a;\n }\n\nAfter the quick-fix is applied:\n\n\n public int min(int a, int b) {\n return Math.min(a, b);\n }\n\n\nUse the **Disable for float and double** option to disable this inspection for `double` and `float` types.\nThis is useful because the quick-fix may slightly change the semantics for `float`/\n`double` types when handling `NaN`. Nevertheless, in most cases this will actually fix\na subtle bug where `NaN` is not taken into account.\n\nNew in 2019.2" }, - { - "shortName": "RedundantComparatorComparing", - "displayName": "Comparator method can be simplified", - "enabled": true, - "description": "Reports `Comparator` combinator constructs that can be simplified.\n\nExample:\n\n\n c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());\n\nAfter the quick-fixes are applied:\n\n\n c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());\n\nNew in 2018.1" - }, { "shortName": "RedundantEmbeddedExpression", "displayName": "Redundant embedded expression in string template", "enabled": true, "description": "Reports redundant embedded expressions in `STR` templates, such as trivial literals or empty expressions.\n\nExample:\n\n\n System.out.println(STR.\"Hello \\{\"world\"}\");\n\nAfter the quick-fix is applied:\n\n\n System.out.println(STR.\"Hello world\");\n\nThis inspection only reports if the language level of the project or module is 21 or higher.\n\nNew in 2023.3" }, + { + "shortName": "RedundantComparatorComparing", + "displayName": "Comparator method can be simplified", + "enabled": true, + "description": "Reports `Comparator` combinator constructs that can be simplified.\n\nExample:\n\n\n c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());\n\nAfter the quick-fixes are applied:\n\n\n c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());\n\nNew in 2018.1" + }, { "shortName": "ExcessiveRangeCheck", "displayName": "Excessive range check", @@ -6851,6 +6851,77 @@ } ] }, + { + "name": "Logging", + "inspections": [ + { + "shortName": "LoggingConditionDisagreesWithLogLevelStatement", + "displayName": "Log condition does not match logging call", + "enabled": false, + "description": "Reports *is log enabled for* conditions of `if` statements that do not match the log level of the contained logging call.\n\n\nFor example:\n\n\n if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }\n\nThis inspection understands the *java.util.logging* , *Log4j* , *Log4j2* , *Apache Commons Logging*\nand the *SLF4J* logging frameworks." + }, + { + "shortName": "LoggingPlaceholderCountMatchesArgumentCount", + "displayName": "Number of placeholders does not match number of arguments in logging call", + "enabled": true, + "description": "Reports SLF4J, Log4j2 and akka.event.LoggingAdapter logging calls, such as `logger.info(\"{}: {}\", key)` where the number of `{}` placeholders in the logger message doesn't match the number of other arguments to the logging call.\n\n\nUse the inspection option to specify which implementation SLF4J uses.\nIf **Check automatically** is chosen, then `org.apache.logging.slf4j.Log4jLogger` is searched in the classpath.\nIf this file is founded or **Yes** is chosen, then cases, when the last parameter with an exception type has a placeholder,\nwill not be reported for SLFJ4 API. \n\nFor example:\n\n\n //this case will not be reported with \"Yes\" option\n log.error(\"For id {}: {}\", \"1\", new RuntimeException());\n\nIn this case 'new RuntimeException()' will be printed using 'toString()', (its stacktrace will not be printed):\n\n\n For id 1: java.lang.RuntimeException\n\nOtherwise, it will be highlighted because the last placeholder is not used:\n\n\n For id 1: {}\n java.lang.RuntimeException: null\n\n**No** option can be used to always highlight such cases when a placeholder is used for an exception even if `org.apache.logging.slf4j.Log4jLogger` is used as a backend. \nThis option works only for SLF4J." + }, + { + "shortName": "LoggingStringTemplateAsArgument", + "displayName": "String template as argument to logging call", + "enabled": true, + "description": "Reports string templates that are used as arguments to **SLF4J** and **Log4j 2** logging methods. The method `org.apache.logging.log4j.Logger.log()` and its overloads are supported only for **all log levels** option. String templates are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")\n\n**After the quick-fix is applied (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)\n\n\nNote that the suggested replacement might not be equivalent to the original code, for example,\nwhen string templates contain method calls or assignment expressions.\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated.\n* Use the **Do not warn when only expressions with primitive types, their wrappers or String are included** option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance.\n\nNew in 2023.1" + }, + { + "shortName": "LogStatementGuardedByLogCondition", + "displayName": "Logging call not guarded by log condition", + "enabled": false, + "description": "Reports logging calls with non-constant arguments that are not surrounded by a guard condition. The evaluation of the arguments of a logging call can be expensive. Surrounding a logging call with a guard clause prevents that cost when logging is disabled for the level used by the logging statement. This is especially useful for the least serious level (trace, debug, finest) of logging calls, because those are most often disabled in a production environment.\n\n**Example:**\n\n\n public class Principal {\n void bad(Object object) {\n if (true) {\n LOG.debug(\"log log log \" + expensiveCalculation(object));\n }\n LOG.debug(\"some more logging \" + expensiveCalculation(1));\n }\n\n void good(Object) {\n if (LOG.isDebug()) {\n LOG.debug(\"value: \" + expensiveCalculation(object));\n }\n }\n }\n\n\nConfigure the inspection:\n\n* Use the **Logger class name** field to specify the logger class name used.\n*\n Use the table to specify the logging methods this inspection should warn on, with the corresponding log condition text.\n\n* Use the **Flag all unguarded logging calls** option to have the inspection flag all unguarded log calls, not only those with non-constant arguments." + }, + { + "shortName": "NonStaticFinalLogger", + "displayName": "Non-constant logger", + "enabled": false, + "description": "Reports logger fields that are not declared `static` and/or `final`. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application.\n\nA quick-fix is provided to change the logger modifiers to `static final`.\n\n**Example:**\n\n\n public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }\n\nAfter the quick-fix is applied:\n\n\n public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }\n\n\nConfigure the inspection:\n\n* Use the **Logger class name** table to specify logger class names. The inspection will report the fields that are not `static` and `final` and are of the type equal to one of the specified class names." + }, + { + "shortName": "PublicMethodWithoutLogging", + "displayName": "'public' method without logging", + "enabled": false, + "description": "Reports any public methods that do not contain a logging statement. This inspection does not report simple getters and setters.\n\nFor example:\n\n\n public class Crucial {\n private static finalLogger LOG = LoggerFactory.getLogger(Crucial.class);\n public void doImportantStuff() {\n // warning on this method\n }\n\n public void doOtherStuff() {\n LOG.info(\"do other stuff\");\n }\n }\n\n\nUse the table below to specify Logger class names.\nPublic methods that do not use instance methods of the specified classes will be reported by this inspection." + }, + { + "shortName": "ClassWithMultipleLoggers", + "displayName": "Class with multiple loggers", + "enabled": false, + "description": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application.\n\nFor example:\n\n\n public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }\n\n\nUse the table below to specify Logger class names.\nClasses which declare multiple fields that have the type of one of the specified classes will be reported by this inspection." + }, + { + "shortName": "LoggerInitializedWithForeignClass", + "displayName": "Logger initialized with foreign class", + "enabled": false, + "description": "Reports `Logger` instances that are initialized with a `class` literal from a different class than the `Logger` is contained in. This can easily happen when copy-pasting some code from another class and may result in logging events under an unexpected category and cause filters to be applied incorrectly.\n\nA quick-fix is provided to replace the foreign class literal with one from the surrounding class.\n\n**Example:**\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n // ... other fields and methods\n }\n\nAfter the quick-fix is applied:\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Paramount.class);\n\n // ... other fields and methods\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the logger factory classes and logger factory methods recognized by this inspection.\n* Use the **Ignore loggers initialized with a superclass** option to ignore loggers that are initialized with a superclass of the class containing the logger.\n* Use the **Ignore loggers in non-public classes** to only warn on loggers in `public` classes." + }, + { + "shortName": "ClassWithoutLogger", + "displayName": "Class without logger", + "enabled": false, + "description": "Reports classes which do not have a declared logger.\n\nEnsuring that every class has a dedicated logger is an important step in providing a unified logging\nimplementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection.\n\nFor example:\n\n\n public class NoLoggerDeclared {\n\n int calculateNthDigitOfPi(int n) {\n // todo\n return 1;\n }\n }\n\n\nUse the table in the **Options** section to specify logger class names.\nClasses which do not declare a field with the type of one of the specified classes will be reported by this inspection." + }, + { + "shortName": "StringConcatenationArgumentToLogCall", + "displayName": "Non-constant string concatenation as argument to logging call", + "enabled": false, + "description": "Reports non-constant string concatenations that are used as arguments to **SLF4J** and **Log4j 2** logging methods. Non-constant concatenations are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example:**\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld(\" + i + \", \" + s + \", \" + b + \")\");\n // todo\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld({}, {}, {})\", i, s, b);\n // todo\n }\n }\n\n\nConfigure the inspection:\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be enabled even in production, and the arguments will always be evaluated." + }, + { + "shortName": "KotlinLoggerInitializedWithForeignClass", + "displayName": "Logger initialized with foreign class", + "enabled": false, + "description": "Reports `Logger` instances initialized with a class literal other than the class the `Logger` resides in.\n\n\nThis can happen when copy-pasting from another class.\nIt may result in logging events under an unexpected category and incorrect filtering.\n\n\nUse the inspection options to specify the logger factory classes and methods recognized by this inspection.\n\n**Example:**\n\n\n class AnotherService\n class MyService {\n private val logger = LoggerFactory.getLogger(AnotherService::class.java)\n }\n\nAfter the quick-fix is applied:\n\n\n class MyService {\n private val logger = LoggerFactory.getLogger(MyService::class.java)\n }\n" + } + ] + }, { "name": "Javadoc", "inspections": [ @@ -6952,77 +7023,6 @@ } ] }, - { - "name": "Logging", - "inspections": [ - { - "shortName": "LoggingConditionDisagreesWithLogLevelStatement", - "displayName": "Log condition does not match logging call", - "enabled": false, - "description": "Reports *is log enabled for* conditions of `if` statements that do not match the log level of the contained logging call.\n\n\nFor example:\n\n\n if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }\n\nThis inspection understands the *java.util.logging* , *Log4j* , *Log4j2* , *Apache Commons Logging*\nand the *SLF4J* logging frameworks." - }, - { - "shortName": "LoggingPlaceholderCountMatchesArgumentCount", - "displayName": "Number of placeholders does not match number of arguments in logging call", - "enabled": true, - "description": "Reports SLF4J, Log4j2 and akka.event.LoggingAdapter logging calls, such as `logger.info(\"{}: {}\", key)` where the number of `{}` placeholders in the logger message doesn't match the number of other arguments to the logging call.\n\n\nUse the inspection option to specify which implementation SLF4J uses.\nIf **Check automatically** is chosen, then `org.apache.logging.slf4j.Log4jLogger` is searched in the classpath.\nIf this file is founded or **Yes** is chosen, then cases, when the last parameter with an exception type has a placeholder,\nwill not be reported for SLFJ4 API. \n\nFor example:\n\n\n //this case will not be reported with \"Yes\" option\n log.error(\"For id {}: {}\", \"1\", new RuntimeException());\n\nIn this case 'new RuntimeException()' will be printed using 'toString()', (its stacktrace will not be printed):\n\n\n For id 1: java.lang.RuntimeException\n\nOtherwise, it will be highlighted because the last placeholder is not used:\n\n\n For id 1: {}\n java.lang.RuntimeException: null\n\n**No** option can be used to always highlight such cases when a placeholder is used for an exception even if `org.apache.logging.slf4j.Log4jLogger` is used as a backend. \nThis option works only for SLF4J." - }, - { - "shortName": "LoggingStringTemplateAsArgument", - "displayName": "String template as argument to logging call", - "enabled": true, - "description": "Reports string templates that are used as arguments to **SLF4J** and **Log4j 2** logging methods. The method `org.apache.logging.log4j.Logger.log()` and its overloads are supported only for **all log levels** option. String templates are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")\n\n**After the quick-fix is applied (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)\n\n\nNote that the suggested replacement might not be equivalent to the original code, for example,\nwhen string templates contain method calls or assignment expressions.\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated.\n* Use the **Do not warn when only expressions with primitive types, their wrappers or String are included** option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance.\n\nNew in 2023.1" - }, - { - "shortName": "LogStatementGuardedByLogCondition", - "displayName": "Logging call not guarded by log condition", - "enabled": false, - "description": "Reports logging calls with non-constant arguments that are not surrounded by a guard condition. The evaluation of the arguments of a logging call can be expensive. Surrounding a logging call with a guard clause prevents that cost when logging is disabled for the level used by the logging statement. This is especially useful for the least serious level (trace, debug, finest) of logging calls, because those are most often disabled in a production environment.\n\n**Example:**\n\n\n public class Principal {\n void bad(Object object) {\n if (true) {\n LOG.debug(\"log log log \" + expensiveCalculation(object));\n }\n LOG.debug(\"some more logging \" + expensiveCalculation(1));\n }\n\n void good(Object) {\n if (LOG.isDebug()) {\n LOG.debug(\"value: \" + expensiveCalculation(object));\n }\n }\n }\n\n\nConfigure the inspection:\n\n* Use the **Logger class name** field to specify the logger class name used.\n*\n Use the table to specify the logging methods this inspection should warn on, with the corresponding log condition text.\n\n* Use the **Flag all unguarded logging calls** option to have the inspection flag all unguarded log calls, not only those with non-constant arguments." - }, - { - "shortName": "NonStaticFinalLogger", - "displayName": "Non-constant logger", - "enabled": false, - "description": "Reports logger fields that are not declared `static` and/or `final`. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application.\n\nA quick-fix is provided to change the logger modifiers to `static final`.\n\n**Example:**\n\n\n public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }\n\nAfter the quick-fix is applied:\n\n\n public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }\n\n\nConfigure the inspection:\n\n* Use the **Logger class name** table to specify logger class names. The inspection will report the fields that are not `static` and `final` and are of the type equal to one of the specified class names." - }, - { - "shortName": "PublicMethodWithoutLogging", - "displayName": "'public' method without logging", - "enabled": false, - "description": "Reports any public methods that do not contain a logging statement. This inspection does not report simple getters and setters.\n\nFor example:\n\n\n public class Crucial {\n private static finalLogger LOG = LoggerFactory.getLogger(Crucial.class);\n public void doImportantStuff() {\n // warning on this method\n }\n\n public void doOtherStuff() {\n LOG.info(\"do other stuff\");\n }\n }\n\n\nUse the table below to specify Logger class names.\nPublic methods that do not use instance methods of the specified classes will be reported by this inspection." - }, - { - "shortName": "ClassWithMultipleLoggers", - "displayName": "Class with multiple loggers", - "enabled": false, - "description": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application.\n\nFor example:\n\n\n public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }\n\n\nUse the table below to specify Logger class names.\nClasses which declare multiple fields that have the type of one of the specified classes will be reported by this inspection." - }, - { - "shortName": "LoggerInitializedWithForeignClass", - "displayName": "Logger initialized with foreign class", - "enabled": false, - "description": "Reports `Logger` instances that are initialized with a `class` literal from a different class than the `Logger` is contained in. This can easily happen when copy-pasting some code from another class and may result in logging events under an unexpected category and cause filters to be applied incorrectly.\n\nA quick-fix is provided to replace the foreign class literal with one from the surrounding class.\n\n**Example:**\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n // ... other fields and methods\n }\n\nAfter the quick-fix is applied:\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Paramount.class);\n\n // ... other fields and methods\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the logger factory classes and logger factory methods recognized by this inspection.\n* Use the **Ignore loggers initialized with a superclass** option to ignore loggers that are initialized with a superclass of the class containing the logger.\n* Use the **Ignore loggers in non-public classes** to only warn on loggers in `public` classes." - }, - { - "shortName": "ClassWithoutLogger", - "displayName": "Class without logger", - "enabled": false, - "description": "Reports classes which do not have a declared logger.\n\nEnsuring that every class has a dedicated logger is an important step in providing a unified logging\nimplementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection.\n\nFor example:\n\n\n public class NoLoggerDeclared {\n\n int calculateNthDigitOfPi(int n) {\n // todo\n return 1;\n }\n }\n\n\nUse the table in the **Options** section to specify logger class names.\nClasses which do not declare a field with the type of one of the specified classes will be reported by this inspection." - }, - { - "shortName": "StringConcatenationArgumentToLogCall", - "displayName": "Non-constant string concatenation as argument to logging call", - "enabled": false, - "description": "Reports non-constant string concatenations that are used as arguments to **SLF4J** and **Log4j 2** logging methods. Non-constant concatenations are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example:**\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld(\" + i + \", \" + s + \", \" + b + \")\");\n // todo\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld({}, {}, {})\", i, s, b);\n // todo\n }\n }\n\n\nConfigure the inspection:\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be enabled even in production, and the arguments will always be evaluated." - }, - { - "shortName": "KotlinLoggerInitializedWithForeignClass", - "displayName": "Logger initialized with foreign class", - "enabled": false, - "description": "Reports `Logger` instances initialized with a class literal other than the class the `Logger` resides in.\n\n\nThis can happen when copy-pasting from another class.\nIt may result in logging events under an unexpected category and incorrect filtering.\n\n\nUse the inspection options to specify the logger factory classes and methods recognized by this inspection.\n\n**Example:**\n\n\n class AnotherService\n class MyService {\n private val logger = LoggerFactory.getLogger(AnotherService::class.java)\n }\n\nAfter the quick-fix is applied:\n\n\n class MyService {\n private val logger = LoggerFactory.getLogger(MyService::class.java)\n }\n" - } - ] - }, { "name": "Resource management", "inspections": [ @@ -7353,29 +7353,6 @@ } ] }, - { - "name": "Workspace model", - "inspections": [ - { - "shortName": "WorkspaceEntityMutableField", - "displayName": "Unsupported 'var' field in entity", - "enabled": false, - "description": "Detects unsupported `var` fields in the inheritors of `WorkspaceEntity` interface\n\n\nInterface implementing `WorkspaceEntity` have to have only `val` fields because it's immutable.\nImplementation of `WorkspaceEntity.Builder` will be generated for the mutation" - }, - { - "shortName": "WorkspaceImplObsolete", - "displayName": "Obsolete version of entity implementation", - "enabled": false, - "description": "Reports existence of the obsolete implementation for the entity.\n\n\nVerifies that existing implementation for entities has the same API version as described at `com.intellij.platform.workspace.storage.CodeGeneratorVersions` from dependencies.\n\n\nSuggests regenerating implementation for the whole entities in the current module." - }, - { - "shortName": "WorkspaceImplAbsent", - "displayName": "Absent entity implementation", - "enabled": false, - "description": "Reports absent of implementation for the entity.\n\n\nVerifies that each entity in the project has the implementation.\n\n\nSuggests generation implementation for the whole entities in the current module." - } - ] - }, { "name": "Visibility", "inspections": [ @@ -7483,6 +7460,29 @@ } ] }, + { + "name": "Workspace model", + "inspections": [ + { + "shortName": "WorkspaceEntityMutableField", + "displayName": "Unsupported 'var' field in entity", + "enabled": false, + "description": "Detects unsupported `var` fields in the inheritors of `WorkspaceEntity` interface\n\n\nInterface implementing `WorkspaceEntity` have to have only `val` fields because it's immutable.\nImplementation of `WorkspaceEntity.Builder` will be generated for the mutation" + }, + { + "shortName": "WorkspaceImplObsolete", + "displayName": "Obsolete version of entity implementation", + "enabled": false, + "description": "Reports existence of the obsolete implementation for the entity.\n\n\nVerifies that existing implementation for entities has the same API version as described at `com.intellij.platform.workspace.storage.CodeGeneratorVersions` from dependencies.\n\n\nSuggests regenerating implementation for the whole entities in the current module." + }, + { + "shortName": "WorkspaceImplAbsent", + "displayName": "Absent entity implementation", + "enabled": false, + "description": "Reports absent of implementation for the entity.\n\n\nVerifies that each entity in the project has the implementation.\n\n\nSuggests generation implementation for the whole entities in the current module." + } + ] + }, { "name": "Lombok", "inspections": [ @@ -9216,18 +9216,18 @@ "enabled": false, "description": "Reports methods whose number of statements exceeds the specified maximum.\n\nMethods with too many statements may be confusing and are a good sign that refactoring is necessary.\n\nThe following statements are not counted:\n\n* empty statements (semicolons)\n* block statements\n* `for` loop initialization statements, that is, `int i = ...` within a `for(int i = ...;...)` statement\n* `for` loop update statements, that is, `i += 2` within a `for(int i = ...;...; i += 2)` statement\n\nUse the **Maximum statements per method** field to specify the maximum allowed number of statements in a method." }, - { - "shortName": "OverlyLongLambda", - "displayName": "Overly long lambda expression", - "enabled": false, - "description": "Reports lambda expressions whose number of statements exceeds the specified maximum.\n\nLambda expressions that are too long may be confusing, and it is often better to extract the statements into a separate method.\n\n\nThe following statements are not counted:\n\n* empty statements (semicolons)\n* block statements\n* `for` loop initialization statements, that is, `int i = ...` within a `for(int i = ...;...)` statement\n* `for` loop update statements, that is, `i += 2` within a `for(int i = ...;...; i += 2)` statement\n\nUse the **Non-comment source statements limit** field to specify the maximum allowed number of statements in a lambda expression." - }, { "shortName": "ParametersPerMethod", "displayName": "Method with too many parameters", "enabled": false, "description": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary.\n\nMethods that have super methods are not reported.\n\nUse the **Parameter limit** field to specify the maximum allowed number of parameters for a method." }, + { + "shortName": "OverlyLongLambda", + "displayName": "Overly long lambda expression", + "enabled": false, + "description": "Reports lambda expressions whose number of statements exceeds the specified maximum.\n\nLambda expressions that are too long may be confusing, and it is often better to extract the statements into a separate method.\n\n\nThe following statements are not counted:\n\n* empty statements (semicolons)\n* block statements\n* `for` loop initialization statements, that is, `int i = ...` within a `for(int i = ...;...)` statement\n* `for` loop update statements, that is, `i += 2` within a `for(int i = ...;...; i += 2)` statement\n\nUse the **Non-comment source statements limit** field to specify the maximum allowed number of statements in a lambda expression." + }, { "shortName": "MethodCoupling", "displayName": "Overly coupled method", diff --git a/results/metaInformation.json b/results/metaInformation.json index bd5cace..31f7ef6 100644 --- a/results/metaInformation.json +++ b/results/metaInformation.json @@ -8,12 +8,12 @@ "vcs": { "sarifIdea": { "repositoryUri": "https://github.com/cvette/intellij-neos.git", - "revisionId": "e16bb7633abe2287d7ad5fd47fc0539fee8f5afc", + "revisionId": "7fbfd9180ed7e9ee2e15525219b4108d4d090796", "branch": "refs/heads/main" } }, "deviceId": "200820300000000-beff-b97d-1142-74f9c0f3468c", - "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/8590961841", + "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/8591072885", "repoUrl": "https://github.com/cvette/intellij-neos" } } \ No newline at end of file diff --git a/results/qodana.sarif.json b/results/qodana.sarif.json index 22cb27a..3e7a70e 100644 --- a/results/qodana.sarif.json +++ b/results/qodana.sarif.json @@ -139,8 +139,8 @@ ] }, { - "id": "Java/Class structure", - "name": "Class structure", + "id": "Java/Code style issues", + "name": "Code style issues", "relationships": [ { "target": { @@ -157,8 +157,8 @@ ] }, { - "id": "Java/Code style issues", - "name": "Code style issues", + "id": "Java/Class structure", + "name": "Class structure", "relationships": [ { "target": { @@ -193,8 +193,8 @@ ] }, { - "id": "Java/Error handling", - "name": "Error handling", + "id": "Java/Declaration redundancy", + "name": "Declaration redundancy", "relationships": [ { "target": { @@ -211,8 +211,8 @@ ] }, { - "id": "Java/Declaration redundancy", - "name": "Declaration redundancy", + "id": "Java/Error handling", + "name": "Error handling", "relationships": [ { "target": { @@ -381,8 +381,8 @@ ] }, { - "id": "Java/Control flow issues", - "name": "Control flow issues", + "id": "Java/Numeric issues", + "name": "Numeric issues", "relationships": [ { "target": { @@ -399,8 +399,8 @@ ] }, { - "id": "Java/Numeric issues", - "name": "Numeric issues", + "id": "Java/Control flow issues", + "name": "Control flow issues", "relationships": [ { "target": { @@ -456,14 +456,14 @@ } ] }, - { - "id": "EditorConfig", - "name": "EditorConfig" - }, { "id": "Properties files", "name": "Properties files" }, + { + "id": "EditorConfig", + "name": "EditorConfig" + }, { "id": "Java/JavaBeans issues", "name": "JavaBeans issues", @@ -639,13 +639,13 @@ "name": "General" }, { - "id": "Java/Javadoc", - "name": "Javadoc", + "id": "JVM languages/Logging", + "name": "Logging", "relationships": [ { "target": { - "id": "Java", - "index": 6, + "id": "JVM languages", + "index": 2, "toolComponent": { "name": "QDJVMC" } @@ -657,13 +657,13 @@ ] }, { - "id": "JVM languages/Logging", - "name": "Logging", + "id": "Java/Javadoc", + "name": "Javadoc", "relationships": [ { "target": { - "id": "JVM languages", - "index": 2, + "id": "Java", + "index": 6, "toolComponent": { "name": "QDJVMC" } @@ -837,13 +837,13 @@ ] }, { - "id": "Plugin DevKit/Workspace model", - "name": "Workspace model", + "id": "Java/Visibility", + "name": "Visibility", "relationships": [ { "target": { - "id": "Plugin DevKit", - "index": 41, + "id": "Java", + "index": 6, "toolComponent": { "name": "QDJVMC" } @@ -855,13 +855,13 @@ ] }, { - "id": "Java/Visibility", - "name": "Visibility", + "id": "Plugin DevKit/Workspace model", + "name": "Workspace model", "relationships": [ { "target": { - "id": "Java", - "index": 6, + "id": "Plugin DevKit", + "index": 41, "toolComponent": { "name": "QDJVMC" } @@ -1111,13 +1111,13 @@ ] }, { - "id": "Groovy/Control flow issues", - "name": "Control flow issues", + "id": "Java/Memory", + "name": "Memory", "relationships": [ { "target": { - "id": "Groovy", - "index": 19, + "id": "Java", + "index": 6, "toolComponent": { "name": "QDJVMC" } @@ -1129,13 +1129,13 @@ ] }, { - "id": "Java/Memory", - "name": "Memory", + "id": "Groovy/Control flow issues", + "name": "Control flow issues", "relationships": [ { "target": { - "id": "Java", - "index": 6, + "id": "Groovy", + "index": 19, "toolComponent": { "name": "QDJVMC" } @@ -1601,7 +1601,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -2625,19 +2625,19 @@ ] }, { - "id": "ConstantDeclaredInAbstractClass", + "id": "UnnecessaryQualifierForThis", "shortDescription": { - "text": "Constant declared in 'abstract' class" + "text": "Unnecessary qualifier for 'this' or 'super'" }, "fullDescription": { - "text": "Reports constants ('public static final' fields) declared in abstract classes. Some coding standards require declaring constants in interfaces instead.", - "markdown": "Reports constants (`public static final` fields) declared in abstract classes.\n\nSome coding standards require declaring constants in interfaces instead." + "text": "Reports unnecessary qualification of 'this' or 'super'. Using a qualifier on 'this' or 'super' to disambiguate a code reference may easily become unnecessary via automatic refactorings and should be deleted for clarity. Example: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n Bar.super.foo();\n }\n }' After the quick-fix is applied: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }'", + "markdown": "Reports unnecessary qualification of `this` or `super`.\n\n\nUsing a qualifier on `this` or `super` to\ndisambiguate a code reference may easily become unnecessary via automatic refactorings and should be deleted for clarity.\n\n**Example:**\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n Bar.super.foo();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ConstantDeclaredInAbstractClass", + "suppressToolId": "UnnecessaryQualifierForThis", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -2645,7 +2645,7 @@ "relationships": [ { "target": { - "id": "Java/Class structure", + "id": "Java/Code style issues", "index": 11, "toolComponent": { "name": "QDJVMC" @@ -2658,19 +2658,19 @@ ] }, { - "id": "UnnecessaryQualifierForThis", + "id": "ConstantDeclaredInAbstractClass", "shortDescription": { - "text": "Unnecessary qualifier for 'this' or 'super'" + "text": "Constant declared in 'abstract' class" }, "fullDescription": { - "text": "Reports unnecessary qualification of 'this' or 'super'. Using a qualifier on 'this' or 'super' to disambiguate a code reference may easily become unnecessary via automatic refactorings and should be deleted for clarity. Example: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n Bar.super.foo();\n }\n }' After the quick-fix is applied: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }'", - "markdown": "Reports unnecessary qualification of `this` or `super`.\n\n\nUsing a qualifier on `this` or `super` to\ndisambiguate a code reference may easily become unnecessary via automatic refactorings and should be deleted for clarity.\n\n**Example:**\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n Bar.super.foo();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }\n" + "text": "Reports constants ('public static final' fields) declared in abstract classes. Some coding standards require declaring constants in interfaces instead.", + "markdown": "Reports constants (`public static final` fields) declared in abstract classes.\n\nSome coding standards require declaring constants in interfaces instead." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryQualifierForThis", + "suppressToolId": "ConstantDeclaredInAbstractClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -2678,7 +2678,7 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", + "id": "Java/Class structure", "index": 12, "toolComponent": { "name": "QDJVMC" @@ -2727,19 +2727,19 @@ ] }, { - "id": "UncheckedExceptionClass", + "id": "UnusedReturnValue", "shortDescription": { - "text": "Unchecked 'Exception' class" + "text": "Method can be made 'void'" }, "fullDescription": { - "text": "Reports subclasses of 'java.lang.RuntimeException'. Some coding standards require that all user-defined exception classes are checked. Example: 'class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException''", - "markdown": "Reports subclasses of `java.lang.RuntimeException`.\n\nSome coding standards require that all user-defined exception classes are checked.\n\n**Example:**\n\n\n class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException'\n" + "text": "Reports methods whose return values are never used when called. The return type of such methods can be made 'void'. Methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation will not be reported. The quick-fix updates the method signature and removes 'return' statements from inside the method. Example: '// reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }' After the quick-fix is applied to both methods: 'protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...' NOTE: Some methods might not be reported during in-editor highlighting due to performance reasons. To see all results, run the inspection using Code | Inspect Code or Code | Analyze Code | Run Inspection by Name> Use the Ignore chainable methods option to ignore unused return values from chainable calls. Use the Maximal reported method visibility option to control the maximum visibility of methods to be reported.", + "markdown": "Reports methods whose return values are never used when called. The return type of such methods can be made `void`.\n\nMethods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\nThe quick-fix updates the method signature and removes `return` statements from inside the method.\n\n**Example:**\n\n\n // reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }\n\nAfter the quick-fix is applied to both methods:\n\n\n protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...\n\n\n**NOTE:** Some methods might not be reported during in-editor highlighting due to performance reasons.\nTo see all results, run the inspection using **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**\\>\n\nUse the **Ignore chainable methods** option to ignore unused return values from chainable calls.\n\nUse the **Maximal reported method visibility** option to control the maximum visibility of methods to be reported." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UncheckedExceptionClass", + "suppressToolId": "UnusedReturnValue", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -2747,7 +2747,7 @@ "relationships": [ { "target": { - "id": "Java/Error handling", + "id": "Java/Declaration redundancy", "index": 14, "toolComponent": { "name": "QDJVMC" @@ -2760,19 +2760,19 @@ ] }, { - "id": "UnusedReturnValue", + "id": "UncheckedExceptionClass", "shortDescription": { - "text": "Method can be made 'void'" + "text": "Unchecked 'Exception' class" }, "fullDescription": { - "text": "Reports methods whose return values are never used when called. The return type of such methods can be made 'void'. Methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation will not be reported. The quick-fix updates the method signature and removes 'return' statements from inside the method. Example: '// reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }' After the quick-fix is applied to both methods: 'protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...' NOTE: Some methods might not be reported during in-editor highlighting due to performance reasons. To see all results, run the inspection using Code | Inspect Code or Code | Analyze Code | Run Inspection by Name> Use the Ignore chainable methods option to ignore unused return values from chainable calls. Use the Maximal reported method visibility option to control the maximum visibility of methods to be reported.", - "markdown": "Reports methods whose return values are never used when called. The return type of such methods can be made `void`.\n\nMethods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\nThe quick-fix updates the method signature and removes `return` statements from inside the method.\n\n**Example:**\n\n\n // reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }\n\nAfter the quick-fix is applied to both methods:\n\n\n protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...\n\n\n**NOTE:** Some methods might not be reported during in-editor highlighting due to performance reasons.\nTo see all results, run the inspection using **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**\\>\n\nUse the **Ignore chainable methods** option to ignore unused return values from chainable calls.\n\nUse the **Maximal reported method visibility** option to control the maximum visibility of methods to be reported." + "text": "Reports subclasses of 'java.lang.RuntimeException'. Some coding standards require that all user-defined exception classes are checked. Example: 'class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException''", + "markdown": "Reports subclasses of `java.lang.RuntimeException`.\n\nSome coding standards require that all user-defined exception classes are checked.\n\n**Example:**\n\n\n class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException'\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnusedReturnValue", + "suppressToolId": "UncheckedExceptionClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -2780,7 +2780,7 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", + "id": "Java/Error handling", "index": 15, "toolComponent": { "name": "QDJVMC" @@ -2814,7 +2814,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -2952,7 +2952,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -3129,27 +3129,27 @@ ] }, { - "id": "NegatedEqualityExpression", + "id": "RemoveLiteralUnderscores", "shortDescription": { - "text": "Negated equality expression" + "text": "Underscores in numeric literal" }, "fullDescription": { - "text": "Reports equality expressions which are negated by a prefix expression. Such expressions can be simplified using the '!=' operator. Example: '!(i == 1)' After the quick-fix is applied: 'i != 1'", - "markdown": "Reports equality expressions which are negated by a prefix expression.\n\nSuch expressions can be simplified using the `!=` operator.\n\nExample:\n\n\n !(i == 1)\n\nAfter the quick-fix is applied:\n\n\n i != 1\n" + "text": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level. The quick-fix removes underscores from numeric literals. For example '1_000_000' will be converted to '1000000'. Numeric literals with underscores appeared in Java 7. This inspection can help to downgrade for backward compatibility with earlier Java versions. New in 2020.2", + "markdown": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level.\n\nThe quick-fix removes underscores from numeric literals. For example `1_000_000` will be converted to `1000000`.\n\n\n*Numeric literals with underscores* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2020.2" }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "NegatedEqualityExpression", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "RemoveLiteralUnderscores", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Control flow issues", + "id": "Java/Numeric issues", "index": 26, "toolComponent": { "name": "QDJVMC" @@ -3162,27 +3162,27 @@ ] }, { - "id": "RemoveLiteralUnderscores", + "id": "NegatedEqualityExpression", "shortDescription": { - "text": "Underscores in numeric literal" + "text": "Negated equality expression" }, "fullDescription": { - "text": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level. The quick-fix removes underscores from numeric literals. For example '1_000_000' will be converted to '1000000'. Numeric literals with underscores appeared in Java 7. This inspection can help to downgrade for backward compatibility with earlier Java versions. New in 2020.2", - "markdown": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level.\n\nThe quick-fix removes underscores from numeric literals. For example `1_000_000` will be converted to `1000000`.\n\n\n*Numeric literals with underscores* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nNew in 2020.2" + "text": "Reports equality expressions which are negated by a prefix expression. Such expressions can be simplified using the '!=' operator. Example: '!(i == 1)' After the quick-fix is applied: 'i != 1'", + "markdown": "Reports equality expressions which are negated by a prefix expression.\n\nSuch expressions can be simplified using the `!=` operator.\n\nExample:\n\n\n !(i == 1)\n\nAfter the quick-fix is applied:\n\n\n i != 1\n" }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "RemoveLiteralUnderscores", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "NegatedEqualityExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Numeric issues", + "id": "Java/Control flow issues", "index": 27, "toolComponent": { "name": "QDJVMC" @@ -3265,19 +3265,19 @@ ] }, { - "id": "StringConcatenationInLoops", + "id": "unused", "shortDescription": { - "text": "String concatenation in loop" + "text": "Unused declaration" }, "fullDescription": { - "text": "Reports String concatenation in loops. As every String concatenation copies the whole string, usually it is preferable to replace it with explicit calls to 'StringBuilder.append()' or 'StringBuffer.append()'. Example: 'String str = \"\";\n for(int i=0; i<10; i++) {\n str += i;\n }' After the quick-fix is applied: 'String str = \"\";\n StringBuilder strBuilder = new StringBuilder(str);\n for(int i = 0; i<10; i++) {\n strBuilder.append(i);\n }\n str = strBuilder.toString();' Sometimes, the quick-fixes allow you to convert a 'String' variable to a 'StringBuilder' or introduce a new 'StringBuilder'. Be careful if the original code specially handles the 'null' value, as the replacement may change semantics. If 'null' is possible, null-safe fixes that generate necessary null-checks are suggested. Also, it's not guaranteed that the automatic replacement will always be more performant.", - "markdown": "Reports String concatenation in loops.\n\n\nAs every String concatenation copies the whole\nstring, usually it is preferable to replace it with explicit calls to `StringBuilder.append()` or\n`StringBuffer.append()`.\n\n**Example:**\n\n\n String str = \"\";\n for(int i=0; i<10; i++) {\n str += i;\n }\n\nAfter the quick-fix is applied:\n\n\n String str = \"\";\n StringBuilder strBuilder = new StringBuilder(str);\n for(int i = 0; i<10; i++) {\n strBuilder.append(i);\n }\n str = strBuilder.toString();\n\n\nSometimes, the quick-fixes allow you to convert a `String` variable to a `StringBuilder` or\nintroduce a new `StringBuilder`. Be careful if the original code specially handles the `null` value, as the\nreplacement may change semantics. If `null` is possible, null-safe fixes that generate\nnecessary null-checks are suggested. Also, it's not guaranteed that the automatic replacement will always be more performant." + "text": "Reports classes, methods, or fields that are not used or unreachable from the entry points. An entry point can be a main method, tests, classes from outside the specified scope, classes accessible from 'module-info.java', and so on. It is possible to configure custom entry points by using name patterns or annotations. Example: 'public class Department {\n private Organization myOrganization;\n }' In this example, 'Department' explicitly references 'Organization' but if 'Department' class itself is unused, then inspection will report both classes. The inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local variables that are declared but not used. Note: Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is checked only when its name rarely occurs in the project. To see all results, run the inspection by selecting Code | Inspect Code or Code | Analyze Code | Run Inspection by Name from the main menu. Use the visibility settings below to configure members to be reported. For example, configuring report 'private' methods only means that 'public' methods of 'private' inner class will be reported but 'protected' methods of top level class will be ignored. Use the entry points tab to configure entry points to be considered during the inspection run. You can add entry points manually when inspection results are ready. If your code uses unsupported frameworks, there are several options: If the framework relies on annotations, use the Annotations... button to configure the framework's annotations. If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework. This way the annotated code accessible by the framework internals will be treated as used.", + "markdown": "Reports classes, methods, or fields that are not used or unreachable from the entry points.\n\nAn entry point can be a main method, tests, classes from outside the specified scope, classes accessible from\n`module-info.java`, and so on. It is possible to configure custom entry points by using name patterns or annotations.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nIn this example, `Department` explicitly references `Organization` but if `Department` class itself is unused, then inspection will report both classes.\n\n\nThe inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local\nvariables that are declared but not used.\n\n\n**Note:** Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is\nchecked only when its name rarely occurs in the project.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the visibility settings below to configure members to be reported. For example, configuring report `private` methods only means\nthat `public` methods of `private` inner class will be reported but `protected` methods of top level class\nwill be ignored.\n\n\nUse the **entry points** tab to configure entry points to be considered during the inspection run.\n\nYou can add entry points manually when inspection results are ready.\n\nIf your code uses unsupported frameworks, there are several options:\n\n* If the framework relies on annotations, use the **Annotations...** button to configure the framework's annotations.\n* If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.\n\nThis way the annotated code accessible by the framework internals will be treated as used." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "StringConcatenationInLoop", + "suppressToolId": "unused", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -3285,8 +3285,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Declaration redundancy", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -3298,19 +3298,19 @@ ] }, { - "id": "unused", + "id": "StringConcatenationInLoops", "shortDescription": { - "text": "Unused declaration" + "text": "String concatenation in loop" }, "fullDescription": { - "text": "Reports classes, methods, or fields that are not used or unreachable from the entry points. An entry point can be a main method, tests, classes from outside the specified scope, classes accessible from 'module-info.java', and so on. It is possible to configure custom entry points by using name patterns or annotations. Example: 'public class Department {\n private Organization myOrganization;\n }' In this example, 'Department' explicitly references 'Organization' but if 'Department' class itself is unused, then inspection will report both classes. The inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local variables that are declared but not used. Note: Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is checked only when its name rarely occurs in the project. To see all results, run the inspection by selecting Code | Inspect Code or Code | Analyze Code | Run Inspection by Name from the main menu. Use the visibility settings below to configure members to be reported. For example, configuring report 'private' methods only means that 'public' methods of 'private' inner class will be reported but 'protected' methods of top level class will be ignored. Use the entry points tab to configure entry points to be considered during the inspection run. You can add entry points manually when inspection results are ready. If your code uses unsupported frameworks, there are several options: If the framework relies on annotations, use the Annotations... button to configure the framework's annotations. If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework. This way the annotated code accessible by the framework internals will be treated as used.", - "markdown": "Reports classes, methods, or fields that are not used or unreachable from the entry points.\n\nAn entry point can be a main method, tests, classes from outside the specified scope, classes accessible from\n`module-info.java`, and so on. It is possible to configure custom entry points by using name patterns or annotations.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nIn this example, `Department` explicitly references `Organization` but if `Department` class itself is unused, then inspection will report both classes.\n\n\nThe inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local\nvariables that are declared but not used.\n\n\n**Note:** Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is\nchecked only when its name rarely occurs in the project.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the visibility settings below to configure members to be reported. For example, configuring report `private` methods only means\nthat `public` methods of `private` inner class will be reported but `protected` methods of top level class\nwill be ignored.\n\n\nUse the **entry points** tab to configure entry points to be considered during the inspection run.\n\nYou can add entry points manually when inspection results are ready.\n\nIf your code uses unsupported frameworks, there are several options:\n\n* If the framework relies on annotations, use the **Annotations...** button to configure the framework's annotations.\n* If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.\n\nThis way the annotated code accessible by the framework internals will be treated as used." + "text": "Reports String concatenation in loops. As every String concatenation copies the whole string, usually it is preferable to replace it with explicit calls to 'StringBuilder.append()' or 'StringBuffer.append()'. Example: 'String str = \"\";\n for(int i=0; i<10; i++) {\n str += i;\n }' After the quick-fix is applied: 'String str = \"\";\n StringBuilder strBuilder = new StringBuilder(str);\n for(int i = 0; i<10; i++) {\n strBuilder.append(i);\n }\n str = strBuilder.toString();' Sometimes, the quick-fixes allow you to convert a 'String' variable to a 'StringBuilder' or introduce a new 'StringBuilder'. Be careful if the original code specially handles the 'null' value, as the replacement may change semantics. If 'null' is possible, null-safe fixes that generate necessary null-checks are suggested. Also, it's not guaranteed that the automatic replacement will always be more performant.", + "markdown": "Reports String concatenation in loops.\n\n\nAs every String concatenation copies the whole\nstring, usually it is preferable to replace it with explicit calls to `StringBuilder.append()` or\n`StringBuffer.append()`.\n\n**Example:**\n\n\n String str = \"\";\n for(int i=0; i<10; i++) {\n str += i;\n }\n\nAfter the quick-fix is applied:\n\n\n String str = \"\";\n StringBuilder strBuilder = new StringBuilder(str);\n for(int i = 0; i<10; i++) {\n strBuilder.append(i);\n }\n str = strBuilder.toString();\n\n\nSometimes, the quick-fixes allow you to convert a `String` variable to a `StringBuilder` or\nintroduce a new `StringBuilder`. Be careful if the original code specially handles the `null` value, as the\nreplacement may change semantics. If `null` is possible, null-safe fixes that generate\nnecessary null-checks are suggested. Also, it's not guaranteed that the automatic replacement will always be more performant." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "unused", + "suppressToolId": "StringConcatenationInLoop", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -3318,8 +3318,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -3400,19 +3400,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" } @@ -3420,8 +3423,8 @@ "relationships": [ { "target": { - "id": "Java/JavaBeans issues", - "index": 33, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -3433,22 +3436,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" } @@ -3456,8 +3456,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/JavaBeans issues", + "index": 33, "toolComponent": { "name": "QDJVMC" } @@ -3490,7 +3490,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -3523,7 +3523,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -3633,6 +3633,39 @@ } ] }, + { + "id": "NonSynchronizedMethodOverridesSynchronizedMethod", + "shortDescription": { + "text": "Unsynchronized method overrides 'synchronized' method" + }, + "fullDescription": { + "text": "Reports non-'synchronized' methods overriding 'synchronized' methods. The overridden method will not be automatically synchronized if the superclass method is declared as 'synchronized'. This may result in unexpected race conditions when using the subclass. Example: 'class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n }'", + "markdown": "Reports non-`synchronized` methods overriding `synchronized` methods.\n\n\nThe overridden method will not be automatically synchronized if the superclass method\nis declared as `synchronized`. This may result in unexpected race conditions when using the subclass.\n\n**Example:**\n\n\n class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n } \n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonSynchronizedMethodOverridesSynchronizedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "SingleClassImport", "shortDescription": { @@ -3700,19 +3733,19 @@ ] }, { - "id": "NonSynchronizedMethodOverridesSynchronizedMethod", + "id": "ProtectedMemberInFinalClass", "shortDescription": { - "text": "Unsynchronized method overrides 'synchronized' method" + "text": "'protected' member in 'final' class" }, "fullDescription": { - "text": "Reports non-'synchronized' methods overriding 'synchronized' methods. The overridden method will not be automatically synchronized if the superclass method is declared as 'synchronized'. This may result in unexpected race conditions when using the subclass. Example: 'class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n }'", - "markdown": "Reports non-`synchronized` methods overriding `synchronized` methods.\n\n\nThe overridden method will not be automatically synchronized if the superclass method\nis declared as `synchronized`. This may result in unexpected race conditions when using the subclass.\n\n**Example:**\n\n\n class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n } \n" + "text": "Reports 'protected' members in 'final'classes. Since 'final' classes cannot be inherited, marking the method as 'protected' may be confusing. It is better to declare such members as 'private' or package-visible instead. Example: 'record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly.", + "markdown": "Reports `protected` members in `final`classes.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "NonSynchronizedMethodOverridesSynchronizedMethod", + "suppressToolId": "ProtectedMemberInFinalClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -3720,8 +3753,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Declaration redundancy", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -3754,39 +3787,6 @@ { "target": { "id": "Java/Error handling", - "index": 14, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ProtectedMemberInFinalClass", - "shortDescription": { - "text": "'protected' member in 'final' class" - }, - "fullDescription": { - "text": "Reports 'protected' members in 'final'classes. Since 'final' classes cannot be inherited, marking the method as 'protected' may be confusing. It is better to declare such members as 'private' or package-visible instead. Example: 'record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly.", - "markdown": "Reports `protected` members in `final`classes.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "ProtectedMemberInFinalClass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Declaration redundancy", "index": 15, "toolComponent": { "name": "QDJVMC" @@ -3799,19 +3799,19 @@ ] }, { - "id": "DanglingJavadoc", + "id": "BadOddness", "shortDescription": { - "text": "Dangling Javadoc comment" + "text": "Suspicious oddness check" }, "fullDescription": { - "text": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates. Example: 'class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' A quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied: 'class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' Use the Ignore file header comment in JavaDoc format option to ignore comments at the beginning of Java files. These are usually copyright messages.", - "markdown": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates.\n\n**Example:**\n\n\n class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nA quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied:\n\n\n class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nUse the **Ignore file header comment in JavaDoc format** option to ignore comments at the beginning of Java files.\nThese are usually copyright messages." + "text": "Reports odd-even checks of the following form: 'x % 2 == 1'. Such checks fail when used with negative odd values. Consider using 'x % 2 != 0' or '(x & 1) == 1' instead.", + "markdown": "Reports odd-even checks of the following form: `x % 2 == 1`. Such checks fail when used with negative odd values. Consider using `x % 2 != 0` or `(x & 1) == 1` instead." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "DanglingJavadoc", + "suppressToolId": "BadOddness", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -3819,8 +3819,8 @@ "relationships": [ { "target": { - "id": "Java/Javadoc", - "index": 45, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -3832,19 +3832,19 @@ ] }, { - "id": "BadOddness", + "id": "LoggingConditionDisagreesWithLogLevelStatement", "shortDescription": { - "text": "Suspicious oddness check" + "text": "Log condition does not match logging call" }, "fullDescription": { - "text": "Reports odd-even checks of the following form: 'x % 2 == 1'. Such checks fail when used with negative odd values. Consider using 'x % 2 != 0' or '(x & 1) == 1' instead.", - "markdown": "Reports odd-even checks of the following form: `x % 2 == 1`. Such checks fail when used with negative odd values. Consider using `x % 2 != 0` or `(x & 1) == 1` instead." + "text": "Reports is log enabled for conditions of 'if' statements that do not match the log level of the contained logging call. For example: 'if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }' This inspection understands the java.util.logging, Log4j, Log4j2, Apache Commons Logging and the SLF4J logging frameworks.", + "markdown": "Reports *is log enabled for* conditions of `if` statements that do not match the log level of the contained logging call.\n\n\nFor example:\n\n\n if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }\n\nThis inspection understands the *java.util.logging* , *Log4j* , *Log4j2* , *Apache Commons Logging*\nand the *SLF4J* logging frameworks." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "BadOddness", + "suppressToolId": "LoggingConditionDisagreesWithLogLevelStatement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -3852,8 +3852,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 27, + "id": "JVM languages/Logging", + "index": 45, "toolComponent": { "name": "QDJVMC" } @@ -3865,19 +3865,19 @@ ] }, { - "id": "LoggingConditionDisagreesWithLogLevelStatement", + "id": "DanglingJavadoc", "shortDescription": { - "text": "Log condition does not match logging call" + "text": "Dangling Javadoc comment" }, "fullDescription": { - "text": "Reports is log enabled for conditions of 'if' statements that do not match the log level of the contained logging call. For example: 'if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }' This inspection understands the java.util.logging, Log4j, Log4j2, Apache Commons Logging and the SLF4J logging frameworks.", - "markdown": "Reports *is log enabled for* conditions of `if` statements that do not match the log level of the contained logging call.\n\n\nFor example:\n\n\n if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }\n\nThis inspection understands the *java.util.logging* , *Log4j* , *Log4j2* , *Apache Commons Logging*\nand the *SLF4J* logging frameworks." + "text": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates. Example: 'class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' A quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied: 'class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' Use the Ignore file header comment in JavaDoc format option to ignore comments at the beginning of Java files. These are usually copyright messages.", + "markdown": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates.\n\n**Example:**\n\n\n class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nA quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied:\n\n\n class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nUse the **Ignore file header comment in JavaDoc format** option to ignore comments at the beginning of Java files.\nThese are usually copyright messages." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "LoggingConditionDisagreesWithLogLevelStatement", + "suppressToolId": "DanglingJavadoc", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -3885,7 +3885,7 @@ "relationships": [ { "target": { - "id": "JVM languages/Logging", + "id": "Java/Javadoc", "index": 46, "toolComponent": { "name": "QDJVMC" @@ -3952,7 +3952,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -3985,7 +3985,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -4018,7 +4018,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -4030,19 +4030,19 @@ ] }, { - "id": "SystemOutErr", + "id": "WaitNotifyNotInSynchronizedContext", "shortDescription": { - "text": "Use of 'System.out' or 'System.err'" + "text": "'wait()' or 'notify()' is not in synchronized context" }, "fullDescription": { - "text": "Reports usages of 'System.out' or 'System.err'. Such statements are often used for temporary debugging and should be either removed from the production code, or replaced by a more robust logging facility.", - "markdown": "Reports usages of `System.out` or `System.err`.\n\nSuch statements are often used for temporary debugging and should be either removed from the production code, or replaced by a more robust\nlogging facility." + "text": "Reports calls to 'wait()', 'notify()', and 'notifyAll()' that are not made inside a corresponding synchronized statement or synchronized method. Calling these methods on an object without holding a lock on that object causes 'IllegalMonitorStateException'. Such a construct is not necessarily an error, as the necessary lock may be acquired before the containing method is called, but it's worth looking at. Example: 'class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }'", + "markdown": "Reports calls to `wait()`, `notify()`, and `notifyAll()` that are not made inside a corresponding synchronized statement or synchronized method.\n\n\nCalling these methods on an object\nwithout holding a lock on that object causes `IllegalMonitorStateException`.\nSuch a construct is not necessarily an error, as the necessary lock may be acquired before\nthe containing method is called, but it's worth looking at.\n\n**Example:**\n\n\n class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UseOfSystemOutOrSystemErr", + "suppressToolId": "WaitNotifyWhileNotSynced", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -4050,8 +4050,8 @@ "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 50, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -4063,19 +4063,19 @@ ] }, { - "id": "WaitNotifyNotInSynchronizedContext", + "id": "SystemOutErr", "shortDescription": { - "text": "'wait()' or 'notify()' is not in synchronized context" + "text": "Use of 'System.out' or 'System.err'" }, "fullDescription": { - "text": "Reports calls to 'wait()', 'notify()', and 'notifyAll()' that are not made inside a corresponding synchronized statement or synchronized method. Calling these methods on an object without holding a lock on that object causes 'IllegalMonitorStateException'. Such a construct is not necessarily an error, as the necessary lock may be acquired before the containing method is called, but it's worth looking at. Example: 'class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }'", - "markdown": "Reports calls to `wait()`, `notify()`, and `notifyAll()` that are not made inside a corresponding synchronized statement or synchronized method.\n\n\nCalling these methods on an object\nwithout holding a lock on that object causes `IllegalMonitorStateException`.\nSuch a construct is not necessarily an error, as the necessary lock may be acquired before\nthe containing method is called, but it's worth looking at.\n\n**Example:**\n\n\n class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }\n" + "text": "Reports usages of 'System.out' or 'System.err'. Such statements are often used for temporary debugging and should be either removed from the production code, or replaced by a more robust logging facility.", + "markdown": "Reports usages of `System.out` or `System.err`.\n\nSuch statements are often used for temporary debugging and should be either removed from the production code, or replaced by a more robust\nlogging facility." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "WaitNotifyWhileNotSynced", + "suppressToolId": "UseOfSystemOutOrSystemErr", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -4083,8 +4083,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Code maturity", + "index": 50, "toolComponent": { "name": "QDJVMC" } @@ -4129,19 +4129,19 @@ ] }, { - "id": "DynamicRegexReplaceableByCompiledPattern", + "id": "CheckedExceptionClass", "shortDescription": { - "text": "Dynamic regular expression could be replaced by compiled 'Pattern'" + "text": "Checked exception class" }, "fullDescription": { - "text": "Reports calls to the regular expression methods (such as 'matches()' or 'split()') of 'java.lang.String' using constant arguments. Such calls may be profitably replaced with a 'private static final Pattern' field so that the regular expression does not have to be compiled each time it is used. Example: 'text.replaceAll(\"abc\", replacement);' After the quick-fix is applied: 'private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));'", - "markdown": "Reports calls to the regular expression methods (such as `matches()` or `split()`) of `java.lang.String` using constant arguments.\n\n\nSuch calls may be profitably replaced with a `private static final Pattern` field\nso that the regular expression does not have to be compiled each time it is used.\n\n**Example:**\n\n\n text.replaceAll(\"abc\", replacement);\n\nAfter the quick-fix is applied:\n\n\n private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));\n" + "text": "Reports checked exception classes (that is, subclasses of 'java.lang.Exception' that are not subclasses of 'java.lang.RuntimeException'). Some coding standards suppress checked user-defined exception classes. Example: 'class IllegalMoveException extends Exception {}'", + "markdown": "Reports checked exception classes (that is, subclasses of `java.lang.Exception` that are not subclasses of `java.lang.RuntimeException`).\n\nSome coding standards suppress checked user-defined exception classes.\n\n**Example:**\n\n\n class IllegalMoveException extends Exception {}\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "DynamicRegexReplaceableByCompiledPattern", + "suppressToolId": "CheckedExceptionClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -4149,8 +4149,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Error handling", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -4162,19 +4162,19 @@ ] }, { - "id": "CheckedExceptionClass", + "id": "DynamicRegexReplaceableByCompiledPattern", "shortDescription": { - "text": "Checked exception class" + "text": "Dynamic regular expression could be replaced by compiled 'Pattern'" }, "fullDescription": { - "text": "Reports checked exception classes (that is, subclasses of 'java.lang.Exception' that are not subclasses of 'java.lang.RuntimeException'). Some coding standards suppress checked user-defined exception classes. Example: 'class IllegalMoveException extends Exception {}'", - "markdown": "Reports checked exception classes (that is, subclasses of `java.lang.Exception` that are not subclasses of `java.lang.RuntimeException`).\n\nSome coding standards suppress checked user-defined exception classes.\n\n**Example:**\n\n\n class IllegalMoveException extends Exception {}\n" + "text": "Reports calls to the regular expression methods (such as 'matches()' or 'split()') of 'java.lang.String' using constant arguments. Such calls may be profitably replaced with a 'private static final Pattern' field so that the regular expression does not have to be compiled each time it is used. Example: 'text.replaceAll(\"abc\", replacement);' After the quick-fix is applied: 'private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));'", + "markdown": "Reports calls to the regular expression methods (such as `matches()` or `split()`) of `java.lang.String` using constant arguments.\n\n\nSuch calls may be profitably replaced with a `private static final Pattern` field\nso that the regular expression does not have to be compiled each time it is used.\n\n**Example:**\n\n\n text.replaceAll(\"abc\", replacement);\n\nAfter the quick-fix is applied:\n\n\n private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CheckedExceptionClass", + "suppressToolId": "DynamicRegexReplaceableByCompiledPattern", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -4182,8 +4182,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -4216,7 +4216,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -4315,7 +4315,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -4348,7 +4348,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -4451,7 +4451,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -4587,106 +4587,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ResultOfObjectAllocationIgnored", - "shortDescription": { - "text": "Result of object allocation ignored" - }, - "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." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ResultOfObjectAllocationIgnored", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Probable bugs", - "index": 13, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "StaticGuardedByInstance", - "shortDescription": { - "text": "Static member guarded by instance field or this" - }, - "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`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "StaticGuardedByInstance", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Concurrency annotation issues", - "index": 61, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ExternalizableWithoutPublicNoArgConstructor", - "shortDescription": { - "text": "'Externalizable' class without 'public' no-arg constructor" - }, - "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." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "ExternalizableWithoutPublicNoArgConstructor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Serialization issues", - "index": 18, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -4730,6 +4631,105 @@ } ] }, + { + "id": "ExternalizableWithoutPublicNoArgConstructor", + "shortDescription": { + "text": "'Externalizable' class without 'public' no-arg constructor" + }, + "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." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ExternalizableWithoutPublicNoArgConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ResultOfObjectAllocationIgnored", + "shortDescription": { + "text": "Result of object allocation ignored" + }, + "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." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ResultOfObjectAllocationIgnored", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticGuardedByInstance", + "shortDescription": { + "text": "Static member guarded by instance field or this" + }, + "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`" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticGuardedByInstance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Concurrency annotation issues", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "UnusedLibrary", "shortDescription": { @@ -4752,7 +4752,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -4884,7 +4884,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -4986,7 +4986,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -5085,7 +5085,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -5266,19 +5266,19 @@ ] }, { - "id": "ModuleWithTooManyClasses", + "id": "SimplifyOptionalCallChains", "shortDescription": { - "text": "Module with too many classes" + "text": "Optional call chain can be simplified" }, "fullDescription": { - "text": "Reports modules that contain too many classes. Overly large modules may indicate a lack of design clarity. 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 Maximum number of classes field to specify the maximum number of classes a module may have.", - "markdown": "Reports modules that contain too many classes. Overly large modules may indicate a lack of design clarity. 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 **Maximum number of classes** field to specify the maximum number of classes a module may have." + "text": "Reports Optional call chains that can be simplified. Here are several examples of possible simplifications: 'optional.map(x -> true).orElse(false)' → 'optional.isPresent()' 'optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)' → 'optional.map(String::trim)' 'optional.map(x -> (String)x).orElse(null)' → '(String) optional.orElse(null)' 'Optional.ofNullable(optional.orElse(null))' → 'optional' 'val = optional.orElse(null); val != null ? val : defaultExpr' → 'optional.orElse(defaultExpr)' 'val = optional.orElse(null); if(val != null) expr(val)' → 'optional.ifPresent(val -> expr(val))' New in 2017.2", + "markdown": "Reports **Optional** call chains that can be simplified. Here are several examples of possible simplifications:\n\n* `optional.map(x -> true).orElse(false)` → `optional.isPresent()`\n* `optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)` → `optional.map(String::trim)`\n* `optional.map(x -> (String)x).orElse(null)` → `(String) optional.orElse(null)`\n* `Optional.ofNullable(optional.orElse(null))` → `optional`\n* `val = optional.orElse(null); val != null ? val : defaultExpr ` → `optional.orElse(defaultExpr)`\n* `val = optional.orElse(null); if(val != null) expr(val) ` → `optional.ifPresent(val -> expr(val))`\n\nNew in 2017.2" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ModuleWithTooManyClasses", + "suppressToolId": "SimplifyOptionalCallChains", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -5286,8 +5286,8 @@ "relationships": [ { "target": { - "id": "Java/Modularization issues", - "index": 69, + "id": "Java/Verbose or redundant code constructs", + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -5299,19 +5299,19 @@ ] }, { - "id": "SimplifyOptionalCallChains", + "id": "ModuleWithTooManyClasses", "shortDescription": { - "text": "Optional call chain can be simplified" + "text": "Module with too many classes" }, "fullDescription": { - "text": "Reports Optional call chains that can be simplified. Here are several examples of possible simplifications: 'optional.map(x -> true).orElse(false)' → 'optional.isPresent()' 'optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)' → 'optional.map(String::trim)' 'optional.map(x -> (String)x).orElse(null)' → '(String) optional.orElse(null)' 'Optional.ofNullable(optional.orElse(null))' → 'optional' 'val = optional.orElse(null); val != null ? val : defaultExpr' → 'optional.orElse(defaultExpr)' 'val = optional.orElse(null); if(val != null) expr(val)' → 'optional.ifPresent(val -> expr(val))' New in 2017.2", - "markdown": "Reports **Optional** call chains that can be simplified. Here are several examples of possible simplifications:\n\n* `optional.map(x -> true).orElse(false)` → `optional.isPresent()`\n* `optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)` → `optional.map(String::trim)`\n* `optional.map(x -> (String)x).orElse(null)` → `(String) optional.orElse(null)`\n* `Optional.ofNullable(optional.orElse(null))` → `optional`\n* `val = optional.orElse(null); val != null ? val : defaultExpr ` → `optional.orElse(defaultExpr)`\n* `val = optional.orElse(null); if(val != null) expr(val) ` → `optional.ifPresent(val -> expr(val))`\n\nNew in 2017.2" + "text": "Reports modules that contain too many classes. Overly large modules may indicate a lack of design clarity. 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 Maximum number of classes field to specify the maximum number of classes a module may have.", + "markdown": "Reports modules that contain too many classes. Overly large modules may indicate a lack of design clarity. 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 **Maximum number of classes** field to specify the maximum number of classes a module may have." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SimplifyOptionalCallChains", + "suppressToolId": "ModuleWithTooManyClasses", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -5319,8 +5319,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 37, + "id": "Java/Modularization issues", + "index": 69, "toolComponent": { "name": "QDJVMC" } @@ -5353,7 +5353,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -5365,28 +5365,28 @@ ] }, { - "id": "RandomDoubleForRandomInteger", + "id": "JavadocHtmlLint", "shortDescription": { - "text": "Using 'Random.nextDouble()' to get random integer" + "text": "HTML problems in Javadoc (DocLint)" }, "fullDescription": { - "text": "Reports calls to 'java.util.Random.nextDouble()' that are used to create a positive integer number by multiplying the call by a factor and casting to an integer. For generating a random positive integer in a range, 'java.util.Random.nextInt(int)' is simpler and more efficient. Example: 'int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }'\n After the quick-fix is applied: 'int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }'", - "markdown": "Reports calls to `java.util.Random.nextDouble()` that are used to create a positive integer number by multiplying the call by a factor and casting to an integer.\n\n\nFor generating a random positive integer in a range,\n`java.util.Random.nextInt(int)` is simpler and more efficient.\n\n**Example:**\n\n\n int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }\n \nAfter the quick-fix is applied:\n\n\n int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }\n" + "text": "Reports the same HTML issues in the Javadoc comments that have been reported by DocLint since Java 8. The inspection detects the following issues: Self-closed, unclosed, unknown, misplaced, or empty tag Unknown or wrong attribute Misplaced text Example: '/**\n * Unknown tag: List\n * Unclosed tag: error\n * Misplaced text or tag:
  • one
  • ,
  • two
\n * Wrong or empty attribute:
\n * Self-closed tag:
\n * ...\n */\nvoid sample(){ }'", + "markdown": "Reports the same HTML issues in the Javadoc comments that have been reported by DocLint since Java 8.\n\nThe inspection detects the following issues:\n\n* Self-closed, unclosed, unknown, misplaced, or empty tag\n* Unknown or wrong attribute\n* Misplaced text\n\nExample:\n\n\n /**\n * Unknown tag: List\n * Unclosed tag: error\n * Misplaced text or tag:
  • one
  • ,
  • two
\n * Wrong or empty attribute: \n * Self-closed tag:
\n * ...\n */\n void sample(){ }\n" }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "error", "parameters": { - "suppressToolId": "UsingRandomNextDoubleForRandomInteger", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "JavadocHtmlLint", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Javadoc", + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -5398,28 +5398,28 @@ ] }, { - "id": "JavadocHtmlLint", + "id": "RandomDoubleForRandomInteger", "shortDescription": { - "text": "HTML problems in Javadoc (DocLint)" + "text": "Using 'Random.nextDouble()' to get random integer" }, "fullDescription": { - "text": "Reports the same HTML issues in the Javadoc comments that have been reported by DocLint since Java 8. The inspection detects the following issues: Self-closed, unclosed, unknown, misplaced, or empty tag Unknown or wrong attribute Misplaced text Example: '/**\n * Unknown tag: List\n * Unclosed tag: error\n * Misplaced text or tag:
  • one
  • ,
  • two
\n * Wrong or empty attribute: \n * Self-closed tag:
\n * ...\n */\nvoid sample(){ }'", - "markdown": "Reports the same HTML issues in the Javadoc comments that have been reported by DocLint since Java 8.\n\nThe inspection detects the following issues:\n\n* Self-closed, unclosed, unknown, misplaced, or empty tag\n* Unknown or wrong attribute\n* Misplaced text\n\nExample:\n\n\n /**\n * Unknown tag: List\n * Unclosed tag: error\n * Misplaced text or tag:
  • one
  • ,
  • two
\n * Wrong or empty attribute: \n * Self-closed tag:
\n * ...\n */\n void sample(){ }\n" + "text": "Reports calls to 'java.util.Random.nextDouble()' that are used to create a positive integer number by multiplying the call by a factor and casting to an integer. For generating a random positive integer in a range, 'java.util.Random.nextInt(int)' is simpler and more efficient. Example: 'int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }'\n After the quick-fix is applied: 'int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }'", + "markdown": "Reports calls to `java.util.Random.nextDouble()` that are used to create a positive integer number by multiplying the call by a factor and casting to an integer.\n\n\nFor generating a random positive integer in a range,\n`java.util.Random.nextInt(int)` is simpler and more efficient.\n\n**Example:**\n\n\n int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }\n \nAfter the quick-fix is applied:\n\n\n int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }\n" }, "defaultConfiguration": { "enabled": false, - "level": "error", + "level": "warning", "parameters": { - "suppressToolId": "JavadocHtmlLint", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "suppressToolId": "UsingRandomNextDoubleForRandomInteger", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Javadoc", - "index": 45, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -5554,7 +5554,7 @@ { "target": { "id": "Java/Memory", - "index": 73, + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -5620,7 +5620,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -5917,7 +5917,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -6049,7 +6049,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -6115,7 +6115,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -6148,7 +6148,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -6280,7 +6280,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -6313,7 +6313,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -6325,19 +6325,19 @@ ] }, { - "id": "InnerClassVariableHidesOuterClassVariable", + "id": "UnnecessaryContinue", "shortDescription": { - "text": "Inner class field hides outer class field" + "text": "Unnecessary 'continue' statement" }, "fullDescription": { - "text": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended. A quick-fix is suggested to rename the inner class field. Example: 'class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }' Use the option to choose whether this inspection should report all name clashes, or only clashes with fields that are visible from the inner class.", - "markdown": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended.\n\nA quick-fix is suggested to rename the inner class field.\n\n**Example:**\n\n\n class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }\n\n\nUse the option to choose whether this inspection should report all name clashes,\nor only clashes with fields that are visible from the inner class." + "text": "Reports 'continue' statements if they are the last reachable statements in the loop. These 'continue' statements are unnecessary and can be safely removed. Example: 'for (String element: elements) {\n System.out.println();\n continue;\n }' After the quick-fix is applied: 'for (String element: elements) {\n System.out.println();\n }' The inspection doesn't analyze JSP files. Use the Ignore in then branch of 'if' statement with 'else' branch option to ignore 'continue' statements when they are placed in a 'then' branch of a complete 'if'-'else' statement. Example: 'for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }'", + "markdown": "Reports `continue` statements if they are the last reachable statements in the loop. These `continue` statements are unnecessary and can be safely removed.\n\nExample:\n\n\n for (String element: elements) {\n System.out.println();\n continue;\n }\n\nAfter the quick-fix is applied:\n\n\n for (String element: elements) {\n System.out.println();\n }\n\nThe inspection doesn't analyze JSP files.\n\n\nUse the **Ignore in then branch of 'if' statement with 'else' branch** option to ignore\n`continue` statements when they are placed in a `then` branch of a complete\n`if`-`else` statement.\n\nExample:\n\n\n for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "InnerClassFieldHidesOuterClassField", + "suppressToolId": "UnnecessaryContinue", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -6345,8 +6345,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 57, + "id": "Java/Verbose or redundant code constructs", + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -6358,19 +6358,19 @@ ] }, { - "id": "UnnecessaryContinue", + "id": "InnerClassVariableHidesOuterClassVariable", "shortDescription": { - "text": "Unnecessary 'continue' statement" + "text": "Inner class field hides outer class field" }, "fullDescription": { - "text": "Reports 'continue' statements if they are the last reachable statements in the loop. These 'continue' statements are unnecessary and can be safely removed. Example: 'for (String element: elements) {\n System.out.println();\n continue;\n }' After the quick-fix is applied: 'for (String element: elements) {\n System.out.println();\n }' The inspection doesn't analyze JSP files. Use the Ignore in then branch of 'if' statement with 'else' branch option to ignore 'continue' statements when they are placed in a 'then' branch of a complete 'if'-'else' statement. Example: 'for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }'", - "markdown": "Reports `continue` statements if they are the last reachable statements in the loop. These `continue` statements are unnecessary and can be safely removed.\n\nExample:\n\n\n for (String element: elements) {\n System.out.println();\n continue;\n }\n\nAfter the quick-fix is applied:\n\n\n for (String element: elements) {\n System.out.println();\n }\n\nThe inspection doesn't analyze JSP files.\n\n\nUse the **Ignore in then branch of 'if' statement with 'else' branch** option to ignore\n`continue` statements when they are placed in a `then` branch of a complete\n`if`-`else` statement.\n\nExample:\n\n\n for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }\n" + "text": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended. A quick-fix is suggested to rename the inner class field. Example: 'class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }' Use the option to choose whether this inspection should report all name clashes, or only clashes with fields that are visible from the inner class.", + "markdown": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended.\n\nA quick-fix is suggested to rename the inner class field.\n\n**Example:**\n\n\n class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }\n\n\nUse the option to choose whether this inspection should report all name clashes,\nor only clashes with fields that are visible from the inner class." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryContinue", + "suppressToolId": "InnerClassFieldHidesOuterClassField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -6378,8 +6378,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 37, + "id": "Java/Visibility", + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -6412,7 +6412,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -6478,7 +6478,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -6511,7 +6511,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -6742,7 +6742,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -6808,7 +6808,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -6841,40 +6841,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ClassEscapesItsScope", - "shortDescription": { - "text": "Class is exposed outside of its visibility scope" - }, - "fullDescription": { - "text": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference. Example: 'public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }' Additionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages. However, if a member that is part of the exported API references a non-exported class in its signature, such a member cannot be used outside of the module. Configure the inspection: Use the Report non-exported classes exposed in module API (Java 9+) option to report module API members that expose non-exported classes. Note that the language level of the project or module needs to be 9 or higher for this option. Use the Report non-accessible classes exposed in public API option to report on public members that expose classes with a smaller visibility scope. Use the Report private classes exposed in package-local API option to report on package-local members that expose 'private' classes.", - "markdown": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference.\n\n**Example:**\n\n\n public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }\n\n\nAdditionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages.\nHowever, if a member that is part of the exported API references a non-exported class in its signature,\nsuch a member cannot be used outside of the module.\n\nConfigure the inspection:\n\n* Use the **Report non-exported classes exposed in module API (Java 9+)** option to report module API members that expose non-exported classes. \n Note that the language level of the project or module needs to be 9 or higher for this option.\n* Use the **Report non-accessible classes exposed in public API** option to report on public members that expose classes with a smaller visibility scope.\n* Use the **Report private classes exposed in package-local API** option to report on package-local members that expose `private` classes." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "ClassEscapesDefinedScope", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Visibility", - "index": 57, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -6907,7 +6874,7 @@ { "target": { "id": "Java/Memory", - "index": 73, + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -6919,19 +6886,19 @@ ] }, { - "id": "ClassNameSameAsAncestorName", + "id": "ClassEscapesItsScope", "shortDescription": { - "text": "Class name same as ancestor name" + "text": "Class is exposed outside of its visibility scope" }, "fullDescription": { - "text": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing. Example: 'package util;\n abstract class Iterable implements java.lang.Iterable {}' A quick-fix that renames such classes is available only in the editor.", - "markdown": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing.\n\n**Example:**\n\n\n package util;\n abstract class Iterable implements java.lang.Iterable {}\n\nA quick-fix that renames such classes is available only in the editor." + "text": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference. Example: 'public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }' Additionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages. However, if a member that is part of the exported API references a non-exported class in its signature, such a member cannot be used outside of the module. Configure the inspection: Use the Report non-exported classes exposed in module API (Java 9+) option to report module API members that expose non-exported classes. Note that the language level of the project or module needs to be 9 or higher for this option. Use the Report non-accessible classes exposed in public API option to report on public members that expose classes with a smaller visibility scope. Use the Report private classes exposed in package-local API option to report on package-local members that expose 'private' classes.", + "markdown": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference.\n\n**Example:**\n\n\n public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }\n\n\nAdditionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages.\nHowever, if a member that is part of the exported API references a non-exported class in its signature,\nsuch a member cannot be used outside of the module.\n\nConfigure the inspection:\n\n* Use the **Report non-exported classes exposed in module API (Java 9+)** option to report module API members that expose non-exported classes. \n Note that the language level of the project or module needs to be 9 or higher for this option.\n* Use the **Report non-accessible classes exposed in public API** option to report on public members that expose classes with a smaller visibility scope.\n* Use the **Report private classes exposed in package-local API** option to report on package-local members that expose `private` classes." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassNameSameAsAncestorName", + "suppressToolId": "ClassEscapesDefinedScope", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -6939,8 +6906,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions/Class", - "index": 71, + "id": "Java/Visibility", + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -6952,19 +6919,22 @@ ] }, { - "id": "RedundantMethodOverride", + "id": "EqualsUsesNonFinalVariable", "shortDescription": { - "text": "Method is identical to its super method" + "text": "Non-final field referenced in 'equals()'" }, "fullDescription": { - "text": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed. Use the first checkbox below to run the inspection for the methods that override library methods. Checking library methods may slow down the inspection. Use the second checkbox below to ignore methods that only delegate calls to their super methods.", - "markdown": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed.\n\n\nUse the first checkbox below to run the inspection for the methods that override library methods.\nChecking library methods may slow down the inspection.\n\n\nUse the second checkbox below to ignore methods that only delegate calls to their super methods." + "text": "Reports implementations of 'equals()' that access non-'final' variables. Such access may result in 'equals()' returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes. Example: 'public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }'", + "markdown": "Reports implementations of `equals()` that access non-`final` variables. Such access may result in `equals()` returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes.\n\n**Example:**\n\n\n public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }\n \n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "RedundantMethodOverride", + "suppressToolId": "NonFinalFieldReferenceInEquals", + "cweIds": [ + 697 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -6972,8 +6942,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 25, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -6985,22 +6955,19 @@ ] }, { - "id": "EqualsUsesNonFinalVariable", + "id": "ClassNameSameAsAncestorName", "shortDescription": { - "text": "Non-final field referenced in 'equals()'" + "text": "Class name same as ancestor name" }, "fullDescription": { - "text": "Reports implementations of 'equals()' that access non-'final' variables. Such access may result in 'equals()' returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes. Example: 'public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }'", - "markdown": "Reports implementations of `equals()` that access non-`final` variables. Such access may result in `equals()` returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes.\n\n**Example:**\n\n\n public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }\n \n" + "text": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing. Example: 'package util;\n abstract class Iterable implements java.lang.Iterable {}' A quick-fix that renames such classes is available only in the editor.", + "markdown": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing.\n\n**Example:**\n\n\n package util;\n abstract class Iterable implements java.lang.Iterable {}\n\nA quick-fix that renames such classes is available only in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalFieldReferenceInEquals", - "cweIds": [ - 697 - ], + "suppressToolId": "ClassNameSameAsAncestorName", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -7008,8 +6975,41 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Naming conventions/Class", + "index": 71, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantMethodOverride", + "shortDescription": { + "text": "Method is identical to its super method" + }, + "fullDescription": { + "text": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed. Use the first checkbox below to run the inspection for the methods that override library methods. Checking library methods may slow down the inspection. Use the second checkbox below to ignore methods that only delegate calls to their super methods.", + "markdown": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed.\n\n\nUse the first checkbox below to run the inspection for the methods that override library methods.\nChecking library methods may slow down the inspection.\n\n\nUse the second checkbox below to ignore methods that only delegate calls to their super methods." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantMethodOverride", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -7042,7 +7042,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -7108,7 +7108,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -7153,19 +7153,23 @@ ] }, { - "id": "NonFinalFieldInImmutable", + "id": "StringConcatenationInMessageFormatCall", "shortDescription": { - "text": "Non-final field in '@Immutable' class" + "text": "String concatenation as argument to 'MessageFormat.format()' call" }, "fullDescription": { - "text": "Reports any non-final field in a class with the '@Immutable' annotation. This violates the contract of the '@Immutable' annotation. Example: 'import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", - "markdown": "Reports any non-final field in a class with the `@Immutable` annotation. This violates the contract of the `@Immutable` annotation.\n\nExample:\n\n\n import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" + "text": "Reports non-constant string concatenations used as an argument to a call to 'MessageFormat.format()'. While occasionally intended, this is usually a misuse of the formatting method and may even cause unexpected exceptions if the variables used in the concatenated string contain special characters like '{'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }' Here, the 'userName' will be interpreted as a part of the format string, which may result in 'IllegalArgumentException' (for example, if 'userName' is '\"{\"'). This call should be probably replaced with 'MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)'.", + "markdown": "Reports non-constant string concatenations used as an argument to a call to `MessageFormat.format()`.\n\n\nWhile occasionally intended, this is usually a misuse of the formatting method\nand may even cause unexpected exceptions if the variables used in the concatenated string contain\nspecial characters like `{`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }\n\n\nHere, the `userName` will be interpreted as a part of the format string, which may result\nin `IllegalArgumentException` (for example, if `userName` is `\"{\"`).\nThis call should be probably replaced with `MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)`." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalFieldInImmutable", + "suppressToolId": "StringConcatenationInMessageFormatCall", + "cweIds": [ + 116, + 134 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -7173,8 +7177,8 @@ "relationships": [ { "target": { - "id": "Java/Concurrency annotation issues", - "index": 61, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -7186,23 +7190,19 @@ ] }, { - "id": "StringConcatenationInMessageFormatCall", + "id": "NonFinalFieldInImmutable", "shortDescription": { - "text": "String concatenation as argument to 'MessageFormat.format()' call" + "text": "Non-final field in '@Immutable' class" }, "fullDescription": { - "text": "Reports non-constant string concatenations used as an argument to a call to 'MessageFormat.format()'. While occasionally intended, this is usually a misuse of the formatting method and may even cause unexpected exceptions if the variables used in the concatenated string contain special characters like '{'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }' Here, the 'userName' will be interpreted as a part of the format string, which may result in 'IllegalArgumentException' (for example, if 'userName' is '\"{\"'). This call should be probably replaced with 'MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)'.", - "markdown": "Reports non-constant string concatenations used as an argument to a call to `MessageFormat.format()`.\n\n\nWhile occasionally intended, this is usually a misuse of the formatting method\nand may even cause unexpected exceptions if the variables used in the concatenated string contain\nspecial characters like `{`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }\n\n\nHere, the `userName` will be interpreted as a part of the format string, which may result\nin `IllegalArgumentException` (for example, if `userName` is `\"{\"`).\nThis call should be probably replaced with `MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)`." + "text": "Reports any non-final field in a class with the '@Immutable' annotation. This violates the contract of the '@Immutable' annotation. Example: 'import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy'", + "markdown": "Reports any non-final field in a class with the `@Immutable` annotation. This violates the contract of the `@Immutable` annotation.\n\nExample:\n\n\n import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "StringConcatenationInMessageFormatCall", - "cweIds": [ - 116, - 134 - ], + "suppressToolId": "NonFinalFieldInImmutable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -7210,8 +7210,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Concurrency annotation issues", + "index": 61, "toolComponent": { "name": "QDJVMC" } @@ -7244,7 +7244,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -7442,7 +7442,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -7508,7 +7508,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -7541,7 +7541,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -7619,19 +7619,19 @@ ] }, { - "id": "IncrementDecrementUsedAsExpression", + "id": "MethodOverloadsParentMethod", "shortDescription": { - "text": "Result of '++' or '--' used" + "text": "Possibly unintended overload of method from superclass" }, "fullDescription": { - "text": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing. The quick-fix extracts the increment or decrement operation to a separate expression statement. Example: 'int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }' After the quick-fix is applied: 'int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;'", - "markdown": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing.\n\nThe quick-fix extracts the increment or decrement operation to a separate expression statement.\n\n**Example:**\n\n\n int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }\n\nAfter the quick-fix is applied:\n\n\n int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;\n" + "text": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type. In this case, the method in a subclass will be overloading the method from the superclass instead of overriding it. If it is unintended, it may result in latent bugs. Example: 'public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }' Use the option to choose whether the inspection should also report cases where parameter types are not compatible.", + "markdown": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type.\n\n\nIn this case, the method in a subclass will be overloading the method from the superclass\ninstead of overriding it. If it is unintended, it may result in latent bugs.\n\n**Example:**\n\n\n public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }\n\n\nUse the option to choose whether the inspection should also report cases where parameter types are not compatible." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ValueOfIncrementOrDecrementUsed", + "suppressToolId": "MethodOverloadsMethodOfSuperclass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -7639,8 +7639,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 34, + "id": "Java/Visibility", + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -7652,19 +7652,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" } @@ -7672,8 +7672,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 57, + "id": "Java/Assignment issues", + "index": 34, "toolComponent": { "name": "QDJVMC" } @@ -7685,19 +7685,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" } @@ -7705,8 +7705,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions", - "index": 51, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -7718,19 +7718,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" } @@ -7738,8 +7738,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Naming conventions", + "index": 51, "toolComponent": { "name": "QDJVMC" } @@ -7772,7 +7772,7 @@ { "target": { "id": "JVM languages/Logging", - "index": 46, + "index": 45, "toolComponent": { "name": "QDJVMC" } @@ -7907,7 +7907,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -7973,7 +7973,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -8207,7 +8207,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -8240,7 +8240,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -8273,7 +8273,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -8438,7 +8438,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -8570,7 +8570,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -8603,7 +8603,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -8669,7 +8669,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -8834,7 +8834,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -8936,7 +8936,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -8948,19 +8948,19 @@ ] }, { - "id": "NonFinalUtilityClass", + "id": "NonStaticFinalLogger", "shortDescription": { - "text": "Utility class is not 'final'" + "text": "Non-constant logger" }, "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 logger fields that are not declared 'static' and/or 'final'. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application. A quick-fix is provided to change the logger modifiers to 'static final'. Example: 'public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }' After the quick-fix is applied: 'public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }' Configure the inspection: Use the Logger class name table to specify logger class names. The inspection will report the fields that are not 'static' and 'final' and are of the type equal to one of the specified class names.", + "markdown": "Reports logger fields that are not declared `static` and/or `final`. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application.\n\nA quick-fix is provided to change the logger modifiers to `static final`.\n\n**Example:**\n\n\n public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }\n\nAfter the quick-fix is applied:\n\n\n public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }\n\n\nConfigure the inspection:\n\n* Use the **Logger class name** table to specify logger class names. The inspection will report the fields that are not `static` and `final` and are of the type equal to one of the specified class names." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonFinalUtilityClass", + "suppressToolId": "NonConstantLogger", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -8968,8 +8968,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 11, + "id": "Java/Logging", + "index": 68, "toolComponent": { "name": "QDJVMC" } @@ -8981,19 +8981,19 @@ ] }, { - "id": "NonStaticFinalLogger", + "id": "NonFinalUtilityClass", "shortDescription": { - "text": "Non-constant logger" + "text": "Utility class is not 'final'" }, "fullDescription": { - "text": "Reports logger fields that are not declared 'static' and/or 'final'. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application. A quick-fix is provided to change the logger modifiers to 'static final'. Example: 'public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }' After the quick-fix is applied: 'public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }' Configure the inspection: Use the Logger class name table to specify logger class names. The inspection will report the fields that are not 'static' and 'final' and are of the type equal to one of the specified class names.", - "markdown": "Reports logger fields that are not declared `static` and/or `final`. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application.\n\nA quick-fix is provided to change the logger modifiers to `static final`.\n\n**Example:**\n\n\n public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }\n\nAfter the quick-fix is applied:\n\n\n public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }\n\n\nConfigure the inspection:\n\n* Use the **Logger class name** table to specify logger class names. The inspection will report the fields that are not `static` and `final` and are of the type equal to one of the specified class names." + "text": "Reports utility classes that aren't 'final' or 'abstract'. Utility classes have all fields and methods declared as 'static'. Making them 'final' prevents them from being accidentally subclassed. Example: 'public class UtilityClass {\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n public static void foo() {}\n }'", + "markdown": "Reports utility classes that aren't `final` or `abstract`.\n\nUtility classes have all fields and methods declared as `static`.\nMaking them `final` prevents them from being accidentally subclassed.\n\n**Example:**\n\n\n public class UtilityClass {\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n public static void foo() {}\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonConstantLogger", + "suppressToolId": "NonFinalUtilityClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -9001,8 +9001,8 @@ "relationships": [ { "target": { - "id": "Java/Logging", - "index": 68, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -9035,7 +9035,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -9068,7 +9068,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -9101,7 +9101,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -9134,7 +9134,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -9167,7 +9167,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -9377,19 +9377,19 @@ ] }, { - "id": "UnnecessaryBoxing", + "id": "BadExceptionThrown", "shortDescription": { - "text": "Unnecessary boxing" + "text": "Prohibited exception thrown" }, "fullDescription": { - "text": "Reports explicit boxing, that is wrapping of primitive values in objects. Explicit manual boxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = new Integer(1);' → 'Integer i = Integer.valueOf(1);' 'int i = Integer.valueOf(1);' → 'int i = 1;' Use the Only report truly superfluously boxed expressions option to report only truly superfluous boxing, where a boxed value is immediately unboxed either implicitly or explicitly. In this case, the entire boxing-unboxing step can be removed. The inspection doesn't report simple explicit boxing. This inspection only reports if the language level of the project or module is 5 or higher.", - "markdown": "Reports explicit boxing, that is wrapping of primitive values in objects.\n\nExplicit manual boxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = new Integer(1);` → `Integer i = Integer.valueOf(1);`\n* `int i = Integer.valueOf(1);` → `int i = 1;`\n\n\nUse the **Only report truly superfluously boxed expressions** option to report only truly superfluous boxing,\nwhere a boxed value is immediately unboxed either implicitly or explicitly.\nIn this case, the entire boxing-unboxing step can be removed. The inspection doesn't report simple explicit boxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher." + "text": "Reports 'throw' statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as 'java.lang.Exception' or 'java.io.IOException'. Example: 'void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }' Use the Prohibited exceptions list to specify which exceptions should be reported.", + "markdown": "Reports `throw` statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as `java.lang.Exception` or `java.io.IOException`.\n\n**Example:**\n\n\n void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryBoxing", + "suppressToolId": "ProhibitedExceptionThrown", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -9397,8 +9397,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 5", - "index": 53, + "id": "Java/Error handling", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -9410,19 +9410,19 @@ ] }, { - "id": "BadExceptionThrown", + "id": "UnnecessaryBoxing", "shortDescription": { - "text": "Prohibited exception thrown" + "text": "Unnecessary boxing" }, "fullDescription": { - "text": "Reports 'throw' statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as 'java.lang.Exception' or 'java.io.IOException'. Example: 'void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }' Use the Prohibited exceptions list to specify which exceptions should be reported.", - "markdown": "Reports `throw` statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as `java.lang.Exception` or `java.io.IOException`.\n\n**Example:**\n\n\n void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported." + "text": "Reports explicit boxing, that is wrapping of primitive values in objects. Explicit manual boxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = new Integer(1);' → 'Integer i = Integer.valueOf(1);' 'int i = Integer.valueOf(1);' → 'int i = 1;' Use the Only report truly superfluously boxed expressions option to report only truly superfluous boxing, where a boxed value is immediately unboxed either implicitly or explicitly. In this case, the entire boxing-unboxing step can be removed. The inspection doesn't report simple explicit boxing. This inspection only reports if the language level of the project or module is 5 or higher.", + "markdown": "Reports explicit boxing, that is wrapping of primitive values in objects.\n\nExplicit manual boxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = new Integer(1);` → `Integer i = Integer.valueOf(1);`\n* `int i = Integer.valueOf(1);` → `int i = 1;`\n\n\nUse the **Only report truly superfluously boxed expressions** option to report only truly superfluous boxing,\nwhere a boxed value is immediately unboxed either implicitly or explicitly.\nIn this case, the entire boxing-unboxing step can be removed. The inspection doesn't report simple explicit boxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ProhibitedExceptionThrown", + "suppressToolId": "UnnecessaryBoxing", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -9430,8 +9430,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Java language level migration aids/Java 5", + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -9732,7 +9732,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -9781,19 +9781,19 @@ ] }, { - "id": "LoopConditionNotUpdatedInsideLoop", + "id": "UnnecessarilyQualifiedStaticUsage", "shortDescription": { - "text": "Loop variable not updated inside loop" + "text": "Unnecessarily qualified static access" }, "fullDescription": { - "text": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop. Such variables and parameters are usually used by mistake as they may cause an infinite loop if they are executed. Example: 'void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }' Configure the inspection: Use the Ignore possible non-local changes option to disable this inspection if the condition can be updated indirectly (e.g. via the called method or concurrently from another thread).", - "markdown": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop.\n\nSuch variables and parameters are usually used by mistake as they\nmay cause an infinite loop if they are executed.\n\nExample:\n\n\n void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore possible non-local changes** option to disable this inspection\nif the condition can be updated indirectly (e.g. via the called method or concurrently from another thread)." + "text": "Reports usages of static members qualified with the class name. Such qualification is unnecessary and may be safely removed. Example: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }' After the quick-fix is applied: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }' Use the inspection options to toggle the reporting for: Static fields access: 'void bar() { System.out.println(Foo.x); }' Calls to static methods: 'void bar() { Foo.foo(); }' Also, you can configure the inspection to only report static member usage in a static context. In this case, only 'static void baz() { Foo.foo(); }' will be reported.", + "markdown": "Reports usages of static members qualified with the class name.\n\n\nSuch qualification is unnecessary and may be safely removed.\n\n**Example:**\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }\n\n\nUse the inspection options to toggle the reporting for:\n\n* Static fields access: \n `void bar() { System.out.println(Foo.x); }`\n\n* Calls to static methods: \n `void bar() { Foo.foo(); }`\n\n\nAlso, you can configure the inspection to only report static member usage\nin a static context. In this case, only `static void baz() { Foo.foo(); }` will be reported." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "LoopConditionNotUpdatedInsideLoop", + "suppressToolId": "UnnecessarilyQualifiedStaticUsage", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -9801,8 +9801,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -9814,19 +9814,19 @@ ] }, { - "id": "UnnecessarilyQualifiedStaticUsage", + "id": "LoopConditionNotUpdatedInsideLoop", "shortDescription": { - "text": "Unnecessarily qualified static access" + "text": "Loop variable not updated inside loop" }, "fullDescription": { - "text": "Reports usages of static members qualified with the class name. Such qualification is unnecessary and may be safely removed. Example: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }' After the quick-fix is applied: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }' Use the inspection options to toggle the reporting for: Static fields access: 'void bar() { System.out.println(Foo.x); }' Calls to static methods: 'void bar() { Foo.foo(); }' Also, you can configure the inspection to only report static member usage in a static context. In this case, only 'static void baz() { Foo.foo(); }' will be reported.", - "markdown": "Reports usages of static members qualified with the class name.\n\n\nSuch qualification is unnecessary and may be safely removed.\n\n**Example:**\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }\n\n\nUse the inspection options to toggle the reporting for:\n\n* Static fields access: \n `void bar() { System.out.println(Foo.x); }`\n\n* Calls to static methods: \n `void bar() { Foo.foo(); }`\n\n\nAlso, you can configure the inspection to only report static member usage\nin a static context. In this case, only `static void baz() { Foo.foo(); }` will be reported." + "text": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop. Such variables and parameters are usually used by mistake as they may cause an infinite loop if they are executed. Example: 'void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }' Configure the inspection: Use the Ignore possible non-local changes option to disable this inspection if the condition can be updated indirectly (e.g. via the called method or concurrently from another thread).", + "markdown": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop.\n\nSuch variables and parameters are usually used by mistake as they\nmay cause an infinite loop if they are executed.\n\nExample:\n\n\n void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore possible non-local changes** option to disable this inspection\nif the condition can be updated indirectly (e.g. via the called method or concurrently from another thread)." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "UnnecessarilyQualifiedStaticUsage", + "suppressToolId": "LoopConditionNotUpdatedInsideLoop", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -9834,8 +9834,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -9847,19 +9847,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" } @@ -9867,8 +9867,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "JVM languages", + "index": 2, "toolComponent": { "name": "QDJVMC" } @@ -9880,19 +9880,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" } @@ -9900,8 +9900,8 @@ "relationships": [ { "target": { - "id": "JVM languages", - "index": 2, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -10000,7 +10000,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -10099,7 +10099,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -10330,7 +10330,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -10495,7 +10495,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -10660,7 +10660,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -10861,7 +10861,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -10873,19 +10873,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" } @@ -10893,8 +10893,8 @@ "relationships": [ { "target": { - "id": "Java/Test frameworks", - "index": 96, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -10906,19 +10906,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" } @@ -10926,8 +10926,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Test frameworks", + "index": 96, "toolComponent": { "name": "QDJVMC" } @@ -11071,19 +11071,19 @@ ] }, { - "id": "ThreadRun", + "id": "EscapedSpace", "shortDescription": { - "text": "Call to 'Thread.run()'" + "text": "Non-terminal use of '\\s' escape sequence" }, "fullDescription": { - "text": "Reports calls to 'run()' on 'java.lang.Thread' or any of its subclasses. While occasionally intended, this is usually a mistake, because 'run()' doesn't start a new thread. To execute the code in a separate thread, 'start()' should be used.", - "markdown": "Reports calls to `run()` on `java.lang.Thread` or any of its subclasses.\n\n\nWhile occasionally intended, this is usually a mistake, because `run()` doesn't start a new thread.\nTo execute the code in a separate thread, `start()` should be used." + "text": "Reports '\\s' escape sequences anywhere except at text-block line endings or within a series of several escaped spaces. Such usages can be confusing or a mistake, especially if the string is interpreted as a regular expression. The '\\s' escape sequence is intended to encode a space at the end of text-block lines where normal spaces are trimmed. In other locations, as well as in regular string or char literals, '\\s' is identical to an ordinary space character ('\" \"'). Example: 'if (str.matches(\"\\s+\")) {...}' Here it's likely that '\"\\\\s+\"' was intended (to match any whitespace character). If not, using 'str.matches(\" +\")' would be less confusing. A quick-fix is provided that replaces '\\s' escapes with space characters. This inspection reports only if the language level of the project or module is 15 or higher. New in 2022.3", + "markdown": "Reports `\\s` escape sequences anywhere except at text-block line endings or within a series of several escaped spaces. Such usages can be confusing or a mistake, especially if the string is interpreted as a regular expression. The `\\s` escape sequence is intended to encode a space at the end of text-block lines where normal spaces are trimmed. In other locations, as well as in regular string or char literals, `\\s` is identical to an ordinary space character (`\" \"`).\n\n**Example:**\n\n\n if (str.matches(\"\\s+\")) {...}\n\nHere it's likely that `\"\\\\s+\"` was intended (to match any whitespace character). If not, using `str.matches(\" +\")` would be less confusing.\n\n\nA quick-fix is provided that replaces `\\s` escapes with space characters.\n\nThis inspection reports only if the language level of the project or module is 15 or higher.\n\nNew in 2022.3" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "CallToThreadRun", + "suppressToolId": "EscapedSpace", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11091,8 +11091,8 @@ "relationships": [ { "target": { - "id": "JVM languages", - "index": 2, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -11104,19 +11104,19 @@ ] }, { - "id": "EscapedSpace", + "id": "ThreadRun", "shortDescription": { - "text": "Non-terminal use of '\\s' escape sequence" + "text": "Call to 'Thread.run()'" }, "fullDescription": { - "text": "Reports '\\s' escape sequences anywhere except at text-block line endings or within a series of several escaped spaces. Such usages can be confusing or a mistake, especially if the string is interpreted as a regular expression. The '\\s' escape sequence is intended to encode a space at the end of text-block lines where normal spaces are trimmed. In other locations, as well as in regular string or char literals, '\\s' is identical to an ordinary space character ('\" \"'). Example: 'if (str.matches(\"\\s+\")) {...}' Here it's likely that '\"\\\\s+\"' was intended (to match any whitespace character). If not, using 'str.matches(\" +\")' would be less confusing. A quick-fix is provided that replaces '\\s' escapes with space characters. This inspection reports only if the language level of the project or module is 15 or higher. New in 2022.3", - "markdown": "Reports `\\s` escape sequences anywhere except at text-block line endings or within a series of several escaped spaces. Such usages can be confusing or a mistake, especially if the string is interpreted as a regular expression. The `\\s` escape sequence is intended to encode a space at the end of text-block lines where normal spaces are trimmed. In other locations, as well as in regular string or char literals, `\\s` is identical to an ordinary space character (`\" \"`).\n\n**Example:**\n\n\n if (str.matches(\"\\s+\")) {...}\n\nHere it's likely that `\"\\\\s+\"` was intended (to match any whitespace character). If not, using `str.matches(\" +\")` would be less confusing.\n\n\nA quick-fix is provided that replaces `\\s` escapes with space characters.\n\nThis inspection reports only if the language level of the project or module is 15 or higher.\n\nNew in 2022.3" + "text": "Reports calls to 'run()' on 'java.lang.Thread' or any of its subclasses. While occasionally intended, this is usually a mistake, because 'run()' doesn't start a new thread. To execute the code in a separate thread, 'start()' should be used.", + "markdown": "Reports calls to `run()` on `java.lang.Thread` or any of its subclasses.\n\n\nWhile occasionally intended, this is usually a mistake, because `run()` doesn't start a new thread.\nTo execute the code in a separate thread, `start()` should be used." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "EscapedSpace", + "suppressToolId": "CallToThreadRun", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11124,8 +11124,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "JVM languages", + "index": 2, "toolComponent": { "name": "QDJVMC" } @@ -11137,19 +11137,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" } @@ -11157,8 +11157,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Error handling", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -11170,19 +11170,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" } @@ -11190,8 +11190,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -11257,7 +11257,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -11290,7 +11290,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -11459,7 +11459,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -11471,19 +11471,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" } @@ -11491,8 +11491,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "Java/Cloning issues", + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -11504,19 +11504,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" } @@ -11524,8 +11524,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 82, + "id": "Java/Declaration redundancy", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -11573,19 +11573,19 @@ ] }, { - "id": "ArraysAsListWithZeroOrOneArgument", + "id": "WaitNotInLoop", "shortDescription": { - "text": "Call to 'Arrays.asList()' with too few arguments" + "text": "'wait()' not called in loop" }, "fullDescription": { - "text": "Reports calls to 'Arrays.asList()' with at most one argument. Such calls could be replaced with 'Collections.singletonList()', 'Collections.emptyList()', or 'List.of()' on JDK 9 and later, which will save some memory. In particular, 'Collections.emptyList()' and 'List.of()' with no arguments always return a shared instance, while 'Arrays.asList()' with no arguments creates a new object every time it's called. Note: the lists returned by 'Collections.singletonList()' and 'List.of()' are immutable, while the list returned 'Arrays.asList()' allows calling the 'set()' method. This may break the code in rare cases. Example: 'List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");' After the quick-fix is applied: 'List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");'", - "markdown": "Reports calls to `Arrays.asList()` with at most one argument.\n\n\nSuch calls could be replaced\nwith `Collections.singletonList()`, `Collections.emptyList()`,\nor `List.of()` on JDK 9 and later, which will save some memory.\n\nIn particular, `Collections.emptyList()` and `List.of()` with no arguments\nalways return a shared instance,\nwhile `Arrays.asList()` with no arguments creates a new object every time it's called.\n\nNote: the lists returned by `Collections.singletonList()` and `List.of()` are immutable,\nwhile the list returned `Arrays.asList()` allows calling the `set()` method.\nThis may break the code in rare cases.\n\n**Example:**\n\n\n List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");\n\nAfter the quick-fix is applied:\n\n\n List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");\n" + "text": "Reports calls to 'wait()' that are not made inside a loop. 'wait()' is normally used to suspend a thread until some condition becomes true. As the thread could have been waken up for a different reason, the condition should be checked after the 'wait()' call returns. A loop is a simple way to achieve this. Example: 'class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n if (count >= 10) wait();\n ++count;\n }\n }' Good code should look like this: 'class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n while (count >= 10) wait();\n ++count;\n }\n }'", + "markdown": "Reports calls to `wait()` that are not made inside a loop.\n\n\n`wait()` is normally used to suspend a thread until some condition becomes true.\nAs the thread could have been waken up for a different reason,\nthe condition should be checked after the `wait()` call returns.\nA loop is a simple way to achieve this.\n\n**Example:**\n\n\n class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n if (count >= 10) wait();\n ++count;\n }\n }\n\nGood code should look like this:\n\n\n class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n while (count >= 10) wait();\n ++count;\n }\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ArraysAsListWithZeroOrOneArgument", + "suppressToolId": "WaitNotInLoop", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11593,8 +11593,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -11606,19 +11606,19 @@ ] }, { - "id": "WaitNotInLoop", + "id": "ArraysAsListWithZeroOrOneArgument", "shortDescription": { - "text": "'wait()' not called in loop" + "text": "Call to 'Arrays.asList()' with too few arguments" }, "fullDescription": { - "text": "Reports calls to 'wait()' that are not made inside a loop. 'wait()' is normally used to suspend a thread until some condition becomes true. As the thread could have been waken up for a different reason, the condition should be checked after the 'wait()' call returns. A loop is a simple way to achieve this. Example: 'class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n if (count >= 10) wait();\n ++count;\n }\n }' Good code should look like this: 'class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n while (count >= 10) wait();\n ++count;\n }\n }'", - "markdown": "Reports calls to `wait()` that are not made inside a loop.\n\n\n`wait()` is normally used to suspend a thread until some condition becomes true.\nAs the thread could have been waken up for a different reason,\nthe condition should be checked after the `wait()` call returns.\nA loop is a simple way to achieve this.\n\n**Example:**\n\n\n class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n if (count >= 10) wait();\n ++count;\n }\n }\n\nGood code should look like this:\n\n\n class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n while (count >= 10) wait();\n ++count;\n }\n }\n" + "text": "Reports calls to 'Arrays.asList()' with at most one argument. Such calls could be replaced with 'Collections.singletonList()', 'Collections.emptyList()', or 'List.of()' on JDK 9 and later, which will save some memory. In particular, 'Collections.emptyList()' and 'List.of()' with no arguments always return a shared instance, while 'Arrays.asList()' with no arguments creates a new object every time it's called. Note: the lists returned by 'Collections.singletonList()' and 'List.of()' are immutable, while the list returned 'Arrays.asList()' allows calling the 'set()' method. This may break the code in rare cases. Example: 'List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");' After the quick-fix is applied: 'List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");'", + "markdown": "Reports calls to `Arrays.asList()` with at most one argument.\n\n\nSuch calls could be replaced\nwith `Collections.singletonList()`, `Collections.emptyList()`,\nor `List.of()` on JDK 9 and later, which will save some memory.\n\nIn particular, `Collections.emptyList()` and `List.of()` with no arguments\nalways return a shared instance,\nwhile `Arrays.asList()` with no arguments creates a new object every time it's called.\n\nNote: the lists returned by `Collections.singletonList()` and `List.of()` are immutable,\nwhile the list returned `Arrays.asList()` allows calling the `set()` method.\nThis may break the code in rare cases.\n\n**Example:**\n\n\n List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");\n\nAfter the quick-fix is applied:\n\n\n List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "WaitNotInLoop", + "suppressToolId": "ArraysAsListWithZeroOrOneArgument", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -11626,8 +11626,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -11825,7 +11825,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -11858,7 +11858,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -12023,7 +12023,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -12155,7 +12155,40 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ChainedEquality", + "shortDescription": { + "text": "Chained equality comparisons" + }, + "fullDescription": { + "text": "Reports chained equality comparisons. Such comparisons may be confusing: 'a == b == c' means '(a == b) == c', but possibly 'a == b && a == c' is intended. Example: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }' You can use parentheses to make the comparison less confusing: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }'", + "markdown": "Reports chained equality comparisons.\n\nSuch comparisons may be confusing: `a == b == c` means `(a == b) == c`,\nbut possibly `a == b && a == c` is intended.\n\n**Example:**\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }\n\nYou can use parentheses to make the comparison less confusing:\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ChainedEqualityComparisons", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -12232,39 +12265,6 @@ } ] }, - { - "id": "ChainedEquality", - "shortDescription": { - "text": "Chained equality comparisons" - }, - "fullDescription": { - "text": "Reports chained equality comparisons. Such comparisons may be confusing: 'a == b == c' means '(a == b) == c', but possibly 'a == b && a == c' is intended. Example: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }' You can use parentheses to make the comparison less confusing: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }'", - "markdown": "Reports chained equality comparisons.\n\nSuch comparisons may be confusing: `a == b == c` means `(a == b) == c`,\nbut possibly `a == b && a == c` is intended.\n\n**Example:**\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }\n\nYou can use parentheses to make the comparison less confusing:\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ChainedEqualityComparisons", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Code style issues", - "index": 12, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "AbstractMethodOverridesConcreteMethod", "shortDescription": { @@ -12320,7 +12320,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -12353,7 +12353,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -12386,7 +12386,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -12464,28 +12464,28 @@ ] }, { - "id": "Since15", + "id": "EmptyMethod", "shortDescription": { - "text": "Usages of API which isn't available at the configured language level" + "text": "Empty method" }, "fullDescription": { - "text": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things: Highlight usage of generified classes when the language level is below Java 7. Highlight when default methods are not overridden and the language level is below Java 8. Highlight usage of API when the language level is lower than marked using the '@since' tag in the documentation. Use the Forbid API usages option to forbid usages of the API in respect to the project or custom language level.", - "markdown": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things:\n\n* Highlight usage of generified classes when the language level is below Java 7.\n* Highlight when default methods are not overridden and the language level is below Java 8.\n* Highlight usage of API when the language level is lower than marked using the `@since` tag in the documentation.\n\n\nUse the **Forbid API usages** option to forbid usages of the API in respect to the project or custom language level." + "text": "Reports empty methods that can be removed. Methods are considered empty if they are empty themselves and if they are overridden or implemented by empty methods only. Note that methods containing only comments and the 'super()' call with own parameters are also considered empty. The inspection ignores methods with special annotations, for example, the 'javax.ejb.Init' and 'javax.ejb.Remove' EJB annotations . The quick-fix safely removes unnecessary methods. Configure the inspection: Use the Comments and javadoc count as content option to select whether methods with comments should be treated as non-empty. Use the Additional special annotations option to configure additional annotations that should be ignored by this inspection.", + "markdown": "Reports empty methods that can be removed.\n\nMethods are considered empty if they are empty themselves and if they are overridden or\nimplemented by empty methods only. Note that methods containing only comments and the `super()` call with own parameters are\nalso considered empty.\n\nThe inspection ignores methods with special annotations, for example, the `javax.ejb.Init` and `javax.ejb.Remove` EJB annotations .\n\nThe quick-fix safely removes unnecessary methods.\n\nConfigure the inspection:\n\n* Use the **Comments and javadoc count as content** option to select whether methods with comments should be treated as non-empty.\n* Use the **Additional special annotations** option to configure additional annotations that should be ignored by this inspection." }, "defaultConfiguration": { "enabled": false, - "level": "error", + "level": "warning", "parameters": { - "suppressToolId": "Since15", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "suppressToolId": "EmptyMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "JVM languages", - "index": 2, + "id": "Java/Declaration redundancy", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -12497,28 +12497,28 @@ ] }, { - "id": "EmptyMethod", + "id": "Since15", "shortDescription": { - "text": "Empty method" + "text": "Usages of API which isn't available at the configured language level" }, "fullDescription": { - "text": "Reports empty methods that can be removed. Methods are considered empty if they are empty themselves and if they are overridden or implemented by empty methods only. Note that methods containing only comments and the 'super()' call with own parameters are also considered empty. The inspection ignores methods with special annotations, for example, the 'javax.ejb.Init' and 'javax.ejb.Remove' EJB annotations . The quick-fix safely removes unnecessary methods. Configure the inspection: Use the Comments and javadoc count as content option to select whether methods with comments should be treated as non-empty. Use the Additional special annotations option to configure additional annotations that should be ignored by this inspection.", - "markdown": "Reports empty methods that can be removed.\n\nMethods are considered empty if they are empty themselves and if they are overridden or\nimplemented by empty methods only. Note that methods containing only comments and the `super()` call with own parameters are\nalso considered empty.\n\nThe inspection ignores methods with special annotations, for example, the `javax.ejb.Init` and `javax.ejb.Remove` EJB annotations .\n\nThe quick-fix safely removes unnecessary methods.\n\nConfigure the inspection:\n\n* Use the **Comments and javadoc count as content** option to select whether methods with comments should be treated as non-empty.\n* Use the **Additional special annotations** option to configure additional annotations that should be ignored by this inspection." + "text": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things: Highlight usage of generified classes when the language level is below Java 7. Highlight when default methods are not overridden and the language level is below Java 8. Highlight usage of API when the language level is lower than marked using the '@since' tag in the documentation. Use the Forbid API usages option to forbid usages of the API in respect to the project or custom language level.", + "markdown": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things:\n\n* Highlight usage of generified classes when the language level is below Java 7.\n* Highlight when default methods are not overridden and the language level is below Java 8.\n* Highlight usage of API when the language level is lower than marked using the `@since` tag in the documentation.\n\n\nUse the **Forbid API usages** option to forbid usages of the API in respect to the project or custom language level." }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "error", "parameters": { - "suppressToolId": "EmptyMethod", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "Since15", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "JVM languages", + "index": 2, "toolComponent": { "name": "QDJVMC" } @@ -12551,7 +12551,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -12584,7 +12584,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -12728,28 +12728,28 @@ ] }, { - "id": "QuestionableName", + "id": "MultipleVariablesInDeclaration", "shortDescription": { - "text": "Questionable name" + "text": "Multiple variables in one declaration" }, "fullDescription": { - "text": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards. Example: 'int aa = 42;' Rename quick-fix is suggested only in the editor. Use the option to list names that should be reported.", - "markdown": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards.\n\n**Example:**\n\n\n int aa = 42;\n\nRename quick-fix is suggested only in the editor.\n\n\nUse the option to list names that should be reported." + "text": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable. Some coding standards prohibit such declarations. Example: 'int x = 1, y = 2;' After the quick-fix is applied: 'int x = 1;\n int y = 2;' Configure the inspection: Use the Ignore 'for' loop declarations option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example: 'for (int i = 0, max = list.size(); i > max; i++) {}' Use the Only warn on different array dimensions in a single declaration option to only warn when variables with different array dimensions are declared in a single declaration, for example: 'String s = \"\", array[];' New in 2019.2", + "markdown": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable.\n\nSome coding standards prohibit such declarations.\n\nExample:\n\n\n int x = 1, y = 2;\n\nAfter the quick-fix is applied:\n\n\n int x = 1;\n int y = 2;\n\nConfigure the inspection:\n\n* Use the **Ignore 'for' loop declarations** option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example:\n\n\n for (int i = 0, max = list.size(); i > max; i++) {}\n\n* Use the **Only warn on different array dimensions in a single declaration** option to only warn when variables with different array dimensions are declared in a single declaration, for example:\n\n\n String s = \"\", array[];\n\nNew in 2019.2" }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "QuestionableName", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "MultipleVariablesInDeclaration", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Naming conventions", - "index": 51, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -12761,28 +12761,28 @@ ] }, { - "id": "MultipleVariablesInDeclaration", + "id": "QuestionableName", "shortDescription": { - "text": "Multiple variables in one declaration" + "text": "Questionable name" }, "fullDescription": { - "text": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable. Some coding standards prohibit such declarations. Example: 'int x = 1, y = 2;' After the quick-fix is applied: 'int x = 1;\n int y = 2;' Configure the inspection: Use the Ignore 'for' loop declarations option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example: 'for (int i = 0, max = list.size(); i > max; i++) {}' Use the Only warn on different array dimensions in a single declaration option to only warn when variables with different array dimensions are declared in a single declaration, for example: 'String s = \"\", array[];' New in 2019.2", - "markdown": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable.\n\nSome coding standards prohibit such declarations.\n\nExample:\n\n\n int x = 1, y = 2;\n\nAfter the quick-fix is applied:\n\n\n int x = 1;\n int y = 2;\n\nConfigure the inspection:\n\n* Use the **Ignore 'for' loop declarations** option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example:\n\n\n for (int i = 0, max = list.size(); i > max; i++) {}\n\n* Use the **Only warn on different array dimensions in a single declaration** option to only warn when variables with different array dimensions are declared in a single declaration, for example:\n\n\n String s = \"\", array[];\n\nNew in 2019.2" + "text": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards. Example: 'int aa = 42;' Rename quick-fix is suggested only in the editor. Use the option to list names that should be reported.", + "markdown": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards.\n\n**Example:**\n\n\n int aa = 42;\n\nRename quick-fix is suggested only in the editor.\n\n\nUse the option to list names that should be reported." }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "MultipleVariablesInDeclaration", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "QuestionableName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Naming conventions", + "index": 51, "toolComponent": { "name": "QDJVMC" } @@ -12827,19 +12827,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" } @@ -12847,8 +12847,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 37, + "id": "Java/Compiler issues", + "index": 90, "toolComponent": { "name": "QDJVMC" } @@ -12860,19 +12860,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" } @@ -12880,8 +12880,8 @@ "relationships": [ { "target": { - "id": "Java/Compiler issues", - "index": 90, + "id": "Java/Verbose or redundant code constructs", + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -12958,7 +12958,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13024,7 +13024,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -13090,7 +13090,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -13156,7 +13156,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -13255,7 +13255,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -13267,19 +13267,19 @@ ] }, { - "id": "OverloadedMethodsWithSameNumberOfParameters", + "id": "OverridableMethodCallDuringObjectConstruction", "shortDescription": { - "text": "Overloaded methods with same number of parameters" + "text": "Overridable method called during object construction" }, "fullDescription": { - "text": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called. Example: 'class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }' Use the option to ignore overloaded methods whose parameter types are definitely incompatible.", - "markdown": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called.\n\n**Example:**\n\n\n class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }\n\n\nUse the option to ignore overloaded methods whose parameter types are definitely incompatible." + "text": "Reports calls to overridable methods of the current class during object construction. A method is called during object construction if it is inside a: Constructor Non-static instance initializer Non-static field initializer 'clone()' method 'readObject()' method 'readObjectNoData()' method Methods are overridable if they are not declared as 'final', 'static', or 'private'. Package-local methods are considered safe, even though they are overridable. Such calls may result in subtle bugs, as object initialization may happen before the method call. Example: 'class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n }' This inspection shares the functionality with the following inspections: Abstract method called during object construction Overridden method called during object construction Only one inspection should be enabled at once to prevent warning duplication.", + "markdown": "Reports calls to overridable methods of the current class during object construction.\n\nA method is called during object construction if it is inside a:\n\n* Constructor\n* Non-static instance initializer\n* Non-static field initializer\n* `clone()` method\n* `readObject()` method\n* `readObjectNoData()` method\n* Methods are overridable if they are not declared as `final`, `static`, or `private`. Package-local methods are considered safe, even though they are overridable. Such calls may result in subtle bugs, as object initialization may happen before the method call.\n* **Example:**\n\n\n class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n }\n\n* This inspection shares the functionality with the following inspections:\n * Abstract method called during object construction\n * Overridden method called during object construction\n* Only one inspection should be enabled at once to prevent warning duplication." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "OverloadedMethodsWithSameNumberOfParameters", + "suppressToolId": "OverridableMethodCallDuringObjectConstruction", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13287,8 +13287,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions/Method", - "index": 88, + "id": "Java/Initialization", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -13300,19 +13300,19 @@ ] }, { - "id": "OverridableMethodCallDuringObjectConstruction", + "id": "OverloadedMethodsWithSameNumberOfParameters", "shortDescription": { - "text": "Overridable method called during object construction" + "text": "Overloaded methods with same number of parameters" }, "fullDescription": { - "text": "Reports calls to overridable methods of the current class during object construction. A method is called during object construction if it is inside a: Constructor Non-static instance initializer Non-static field initializer 'clone()' method 'readObject()' method 'readObjectNoData()' method Methods are overridable if they are not declared as 'final', 'static', or 'private'. Package-local methods are considered safe, even though they are overridable. Such calls may result in subtle bugs, as object initialization may happen before the method call. Example: 'class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n }' This inspection shares the functionality with the following inspections: Abstract method called during object construction Overridden method called during object construction Only one inspection should be enabled at once to prevent warning duplication.", - "markdown": "Reports calls to overridable methods of the current class during object construction.\n\nA method is called during object construction if it is inside a:\n\n* Constructor\n* Non-static instance initializer\n* Non-static field initializer\n* `clone()` method\n* `readObject()` method\n* `readObjectNoData()` method\n* Methods are overridable if they are not declared as `final`, `static`, or `private`. Package-local methods are considered safe, even though they are overridable. Such calls may result in subtle bugs, as object initialization may happen before the method call.\n* **Example:**\n\n\n class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n }\n\n* This inspection shares the functionality with the following inspections:\n * Abstract method called during object construction\n * Overridden method called during object construction\n* Only one inspection should be enabled at once to prevent warning duplication." + "text": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called. Example: 'class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }' Use the option to ignore overloaded methods whose parameter types are definitely incompatible.", + "markdown": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called.\n\n**Example:**\n\n\n class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }\n\n\nUse the option to ignore overloaded methods whose parameter types are definitely incompatible." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "OverridableMethodCallDuringObjectConstruction", + "suppressToolId": "OverloadedMethodsWithSameNumberOfParameters", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13320,8 +13320,8 @@ "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 28, + "id": "Java/Naming conventions/Method", + "index": 88, "toolComponent": { "name": "QDJVMC" } @@ -13333,19 +13333,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.", + "markdown": "Reports module declarations, classes, fields, or methods that have the `@deprecated` Javadoc tag but do not have the `@java.lang.Deprecated` annotation.\n\n**Example:**\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }\n\nAfter the quick-fix is applied:\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }\n\nThis inspection reports only if the language level of the project or module is 5 or higher.\n\n\nUse the checkbox below to report members annotated with `@Deprecated` without\nan explanation in a Javadoc `@deprecated` tag." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ImplicitCallToSuper", + "suppressToolId": "MissingDeprecatedAnnotation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13353,8 +13353,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Javadoc", + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -13366,19 +13366,19 @@ ] }, { - "id": "MissingDeprecatedAnnotation", + "id": "ParametersPerMethod", "shortDescription": { - "text": "Missing '@Deprecated' annotation" + "text": "Method with too many parameters" }, "fullDescription": { - "text": "Reports module declarations, classes, fields, or methods that have the '@deprecated' Javadoc tag but do not have the '@java.lang.Deprecated' annotation. Example: '/**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }' After the quick-fix is applied: '/**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }' This inspection reports only if the language level of the project or module is 5 or higher. Use the checkbox below to report members annotated with '@Deprecated' without an explanation in a Javadoc '@deprecated' tag.", - "markdown": "Reports module declarations, classes, fields, or methods that have the `@deprecated` Javadoc tag but do not have the `@java.lang.Deprecated` annotation.\n\n**Example:**\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }\n\nAfter the quick-fix is applied:\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }\n\nThis inspection reports only if the language level of the project or module is 5 or higher.\n\n\nUse the checkbox below to report members annotated with `@Deprecated` without\nan explanation in a Javadoc `@deprecated` tag." + "text": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary. Methods that have super methods are not reported. Use the Parameter limit field to specify the maximum allowed number of parameters for a method.", + "markdown": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary.\n\nMethods that have super methods are not reported.\n\nUse the **Parameter limit** field to specify the maximum allowed number of parameters for a method." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MissingDeprecatedAnnotation", + "suppressToolId": "MethodWithTooManyParameters", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13386,8 +13386,8 @@ "relationships": [ { "target": { - "id": "Java/Javadoc", - "index": 45, + "id": "Java/Method metrics", + "index": 95, "toolComponent": { "name": "QDJVMC" } @@ -13432,19 +13432,19 @@ ] }, { - "id": "ParametersPerMethod", + "id": "ImplicitCallToSuper", "shortDescription": { - "text": "Method with too many parameters" + "text": "Implicit call to 'super()'" }, "fullDescription": { - "text": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary. Methods that have super methods are not reported. Use the Parameter limit field to specify the maximum allowed number of parameters for a method.", - "markdown": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary.\n\nMethods that have super methods are not reported.\n\nUse the **Parameter limit** field to specify the maximum allowed number of parameters for a method." + "text": "Reports 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": "MethodWithTooManyParameters", + "suppressToolId": "ImplicitCallToSuper", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -13452,8 +13452,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 95, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -13497,6 +13497,39 @@ } ] }, + { + "id": "CachedNumberConstructorCall", + "shortDescription": { + "text": "Number constructor call with primitive argument" + }, + "fullDescription": { + "text": "Reports instantiations of new 'Long', 'Integer', 'Short', or 'Byte' objects that have a primitive 'long', 'integer', 'short', or 'byte' argument. It is recommended that you use the static method 'valueOf()' introduced in Java 5. By default, this method caches objects for values between -128 and 127 inclusive. Example: 'Integer i = new Integer(1);\n Long l = new Long(1L);' After the quick-fix is applied, the code changes to: 'Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);' This inspection only reports if the language level of the project or module is 5 or higher Use the Ignore new number expressions with a String argument option to ignore calls to number constructors with a 'String' argument. Use the Report only when constructor is @Deprecated option to only report calls to deprecated constructors. 'Long', 'Integer', 'Short' and 'Byte' constructors are deprecated since JDK 9.", + "markdown": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CachedNumberConstructorCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "MustAlreadyBeRemovedApi", "shortDescription": { @@ -13530,39 +13563,6 @@ } ] }, - { - "id": "CachedNumberConstructorCall", - "shortDescription": { - "text": "Number constructor call with primitive argument" - }, - "fullDescription": { - "text": "Reports instantiations of new 'Long', 'Integer', 'Short', or 'Byte' objects that have a primitive 'long', 'integer', 'short', or 'byte' argument. It is recommended that you use the static method 'valueOf()' introduced in Java 5. By default, this method caches objects for values between -128 and 127 inclusive. Example: 'Integer i = new Integer(1);\n Long l = new Long(1L);' After the quick-fix is applied, the code changes to: 'Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);' This inspection only reports if the language level of the project or module is 5 or higher Use the Ignore new number expressions with a String argument option to ignore calls to number constructors with a 'String' argument. Use the Report only when constructor is @Deprecated option to only report calls to deprecated constructors. 'Long', 'Integer', 'Short' and 'Byte' constructors are deprecated since JDK 9.", - "markdown": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "CachedNumberConstructorCall", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Numeric issues", - "index": 27, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "CloneDeclaresCloneNotSupported", "shortDescription": { @@ -13618,7 +13618,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -13651,7 +13651,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -13915,7 +13915,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -13981,7 +13981,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14047,7 +14047,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -14092,19 +14092,19 @@ ] }, { - "id": "InstanceVariableUninitializedUse", + "id": "ClassWithTooManyTransitiveDependencies", "shortDescription": { - "text": "Instance field used before initialization" + "text": "Class with too many transitive dependencies" }, "fullDescription": { - "text": "Reports instance variables that are read before initialization. The inspection ignores equality checks with 'null'. Example: 'class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore if annotated by option to specify special annotations. The inspection will ignore fields annotated with one of these annotations. Use the Ignore primitive fields option to ignore uninitialized primitive fields.", - "markdown": "Reports instance variables that are read before initialization.\n\nThe inspection ignores equality checks with `null`.\n\n**Example:**\n\n\n class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection will ignore fields\nannotated with one of these annotations.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields." + "text": "Reports classes that are directly or indirectly dependent on too many other classes. Modifications to any dependency of such a class may require changing the class thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of transitive dependencies field to specify the maximum allowed number of direct or indirect dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that are directly or indirectly dependent on too many other classes.\n\nModifications to any dependency of such a class may require changing the class thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of transitive dependencies** field to specify the maximum allowed number of direct or indirect dependencies\nfor a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InstanceVariableUsedBeforeInitialized", + "suppressToolId": "ClassWithTooManyTransitiveDependencies", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -14112,8 +14112,8 @@ "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 28, + "id": "Java/Dependency issues", + "index": 89, "toolComponent": { "name": "QDJVMC" } @@ -14125,19 +14125,19 @@ ] }, { - "id": "UnnecessaryThis", + "id": "InstanceVariableUninitializedUse", "shortDescription": { - "text": "Unnecessary 'this' qualifier" + "text": "Instance field used before initialization" }, "fullDescription": { - "text": "Reports unnecessary 'this' qualifier. Using 'this' to disambiguate a code reference is discouraged by many coding styles and may easily become unnecessary via automatic refactorings. Example: 'class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }' After the quick-fix is applied: 'class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }' Use the inspection settings to ignore assignments to fields. For instance, 'this.x = 2;' won't be reported, but 'int y = this.x;' will be.", - "markdown": "Reports unnecessary `this` qualifier.\n\n\nUsing `this` to disambiguate a code reference is discouraged by many coding styles\nand may easily become unnecessary\nvia automatic refactorings.\n\n**Example:**\n\n\n class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }\n\n\nUse the inspection settings to ignore assignments to fields.\nFor instance, `this.x = 2;` won't be reported, but `int y = this.x;` will be." + "text": "Reports instance variables that are read before initialization. The inspection ignores equality checks with 'null'. Example: 'class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore if annotated by option to specify special annotations. The inspection will ignore fields annotated with one of these annotations. Use the Ignore primitive fields option to ignore uninitialized primitive fields.", + "markdown": "Reports instance variables that are read before initialization.\n\nThe inspection ignores equality checks with `null`.\n\n**Example:**\n\n\n class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection will ignore fields\nannotated with one of these annotations.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryThis", + "suppressToolId": "InstanceVariableUsedBeforeInitialized", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -14145,8 +14145,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Initialization", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -14158,19 +14158,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" } @@ -14178,8 +14178,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 89, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -14191,19 +14191,19 @@ ] }, { - "id": "LoopWithImplicitTerminationCondition", + "id": "ExplicitArrayFilling", "shortDescription": { - "text": "Loop with implicit termination condition" + "text": "Explicit array filling" }, "fullDescription": { - "text": "Reports any 'while', 'do-while', and 'for' loops that have the 'true' constant as their only condition. At the same time, such loops can be still terminated by a containing 'if' statement which can break out of the loop. Such an 'if' statement must be the first or the only statement in a 'while' or 'for' loop and the last or the only statement in a 'do-while' loop. Removing the 'if' statement and making its condition an explicit loop condition simplifies the loop.", - "markdown": "Reports any `while`, `do-while`, and `for` loops that have the `true` constant as their only condition. At the same time, such loops can be still terminated by a containing `if` statement which can break out of the loop.\n\nSuch an `if` statement must be the first or the only statement\nin a `while` or `for`\nloop and the last or the only statement in a `do-while` loop.\n\nRemoving the `if` statement and making its condition an explicit\nloop condition simplifies the loop." + "text": "Reports loops that can be replaced with 'Arrays.setAll()' or 'Arrays.fill()' calls. This inspection suggests replacing loops with 'Arrays.setAll()' if the language level of the project or module is 8 or higher. Replacing loops with 'Arrays.fill()' is possible with any language level. Example: 'for (int i=0; i list, int from, int to) {\n for (int i = from; i < to; i++) {\n list.remove(from);\n }\n }' After the quick-fix is applied: 'void removeRange(List list, int from, int to) {\n if (to > from) {\n list.subList(from, to).clear();\n }\n }' The quick-fix adds a range check automatically to prevent a possible 'IndexOutOfBoundsException' when the minimal value is bigger than the maximal value. It can be removed if such a situation is impossible in your code. New in 2018.2", + "markdown": "Reports `List.remove(index)` called in a loop that can be replaced with `List.subList().clear()`.\n\nThe replacement\nis more efficient for most `List` implementations when many elements are deleted.\n\nExample:\n\n\n void removeRange(List list, int from, int to) {\n for (int i = from; i < to; i++) {\n list.remove(from);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void removeRange(List list, int from, int to) {\n if (to > from) {\n list.subList(from, to).clear();\n }\n }\n\n\nThe quick-fix adds a range check automatically to prevent a possible `IndexOutOfBoundsException` when the minimal value is bigger\nthan the maximal value. It can be removed if such a situation is impossible in your code.\n\nNew in 2018.2" }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "AssignmentReplaceableWithOperatorAssignment", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "ListRemoveInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 34, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -14389,28 +14389,28 @@ ] }, { - "id": "ListRemoveInLoop", + "id": "ReplaceAssignmentWithOperatorAssignment", "shortDescription": { - "text": "'List.remove()' called in loop" + "text": "Assignment can be replaced with operator assignment" }, "fullDescription": { - "text": "Reports 'List.remove(index)' called in a loop that can be replaced with 'List.subList().clear()'. The replacement is more efficient for most 'List' implementations when many elements are deleted. Example: 'void removeRange(List list, int from, int to) {\n for (int i = from; i < to; i++) {\n list.remove(from);\n }\n }' After the quick-fix is applied: 'void removeRange(List list, int from, int to) {\n if (to > from) {\n list.subList(from, to).clear();\n }\n }' The quick-fix adds a range check automatically to prevent a possible 'IndexOutOfBoundsException' when the minimal value is bigger than the maximal value. It can be removed if such a situation is impossible in your code. New in 2018.2", - "markdown": "Reports `List.remove(index)` called in a loop that can be replaced with `List.subList().clear()`.\n\nThe replacement\nis more efficient for most `List` implementations when many elements are deleted.\n\nExample:\n\n\n void removeRange(List list, int from, int to) {\n for (int i = from; i < to; i++) {\n list.remove(from);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void removeRange(List list, int from, int to) {\n if (to > from) {\n list.subList(from, to).clear();\n }\n }\n\n\nThe quick-fix adds a range check automatically to prevent a possible `IndexOutOfBoundsException` when the minimal value is bigger\nthan the maximal value. It can be removed if such a situation is impossible in your code.\n\nNew in 2018.2" + "text": "Reports assignment operations which can be replaced by operator-assignment. Code using operator assignment is shorter and may be clearer. Example: 'x = x + 3;\n x = x / 3;' After the quick fix is applied: 'x += 3;\n x /= 3;' Use the Ignore conditional operators option to ignore '&&' and '||'. Replacing conditional operators with operator assignment would change the evaluation from lazy to eager, which may change the semantics of the expression. Use the Ignore obscure operators option to ignore '^' and '%', which are less known.", + "markdown": "Reports assignment operations which can be replaced by operator-assignment.\n\nCode using operator assignment is shorter and may be clearer.\n\n**Example:**\n\n x = x + 3;\n x = x / 3;\n\nAfter the quick fix is applied:\n\n x += 3;\n x /= 3;\n\n\nUse the **Ignore conditional operators** option to ignore `&&`\nand `||`. Replacing conditional operators with operator\nassignment would change the evaluation from lazy to eager, which may change the semantics of the expression.\n\n\nUse the **Ignore obscure operators** option to ignore `^` and `%`, which are less known." }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "ListRemoveInLoop", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "AssignmentReplaceableWithOperatorAssignment", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Assignment issues", + "index": 34, "toolComponent": { "name": "QDJVMC" } @@ -14443,7 +14443,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -14509,7 +14509,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -14575,7 +14575,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -14644,7 +14644,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -14812,7 +14812,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -14857,19 +14857,19 @@ ] }, { - "id": "TypeParameterExtendsFinalClass", + "id": "UtilityClassWithPublicConstructor", "shortDescription": { - "text": "Type parameter extends 'final' class" + "text": "Utility class with 'public' constructor" }, "fullDescription": { - "text": "Reports type parameters declared to extend a 'final' class. Suggests replacing the type parameter with the type of the specified 'final' class since 'final' classes cannot be extended. Example: 'void foo() {\n List list; // Warning: the Integer class is a final class\n }' After the quick-fix is applied: 'void foo() {\n List list;\n }'", - "markdown": "Reports type parameters declared to extend a `final` class.\n\nSuggests replacing the type parameter with the type of the specified `final` class since\n`final` classes cannot be extended.\n\n**Example:**\n\n\n void foo() {\n List list; // Warning: the Integer class is a final class\n }\n\nAfter the quick-fix is applied:\n\n\n void foo() {\n List list;\n }\n" + "text": "Reports utility classes with 'public' constructors. Utility classes have all fields and methods declared as 'static'. Creating a 'public' constructor in such classes is confusing and may cause accidental class instantiation. Example: 'public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }'", + "markdown": "Reports utility classes with `public` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating a `public`\nconstructor in such classes is confusing and may cause accidental class instantiation.\n\n**Example:**\n\n\n public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "TypeParameterExtendsFinalClass", + "suppressToolId": "UtilityClassWithPublicConstructor", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -14877,8 +14877,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 25, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -14890,19 +14890,19 @@ ] }, { - "id": "UtilityClassWithPublicConstructor", + "id": "TypeParameterExtendsFinalClass", "shortDescription": { - "text": "Utility class with 'public' constructor" + "text": "Type parameter extends 'final' class" }, "fullDescription": { - "text": "Reports utility classes with 'public' constructors. Utility classes have all fields and methods declared as 'static'. Creating a 'public' constructor in such classes is confusing and may cause accidental class instantiation. Example: 'public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }'", - "markdown": "Reports utility classes with `public` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating a `public`\nconstructor in such classes is confusing and may cause accidental class instantiation.\n\n**Example:**\n\n\n public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }\n" + "text": "Reports type parameters declared to extend a 'final' class. Suggests replacing the type parameter with the type of the specified 'final' class since 'final' classes cannot be extended. Example: 'void foo() {\n List list; // Warning: the Integer class is a final class\n }' After the quick-fix is applied: 'void foo() {\n List list;\n }'", + "markdown": "Reports type parameters declared to extend a `final` class.\n\nSuggests replacing the type parameter with the type of the specified `final` class since\n`final` classes cannot be extended.\n\n**Example:**\n\n\n void foo() {\n List list; // Warning: the Integer class is a final class\n }\n\nAfter the quick-fix is applied:\n\n\n void foo() {\n List list;\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UtilityClassWithPublicConstructor", + "suppressToolId": "TypeParameterExtendsFinalClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -14910,8 +14910,8 @@ "relationships": [ { "target": { - "id": "Java/Class structure", - "index": 11, + "id": "Java/Inheritance issues", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -14944,7 +14944,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -14989,19 +14989,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" } @@ -15009,8 +15009,8 @@ "relationships": [ { "target": { - "id": "Java/Concurrency annotation issues", - "index": 61, + "id": "Java/Data flow", + "index": 23, "toolComponent": { "name": "QDJVMC" } @@ -15022,19 +15022,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" } @@ -15042,8 +15042,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 23, + "id": "Java/Concurrency annotation issues", + "index": 61, "toolComponent": { "name": "QDJVMC" } @@ -15076,7 +15076,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -15175,7 +15175,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -15274,7 +15274,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -15340,7 +15340,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -15384,6 +15384,39 @@ } ] }, + { + "id": "PointlessBooleanExpression", + "shortDescription": { + "text": "Pointless boolean expression" + }, + "fullDescription": { + "text": "Reports unnecessary or overly complicated boolean expressions. Such expressions include '&&'-ing with 'true', '||'-ing with 'false', equality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified. Example: 'boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;' After the quick-fix is applied: 'boolean a = true;\n boolean b = x;\n boolean c = !x;' Configure the inspection: Use the Ignore named constants in determining pointless expressions option to ignore named constants when determining if an expression is pointless.", + "markdown": "Reports unnecessary or overly complicated boolean expressions.\n\nSuch expressions include `&&`-ing with `true`,\n`||`-ing with `false`,\nequality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified.\n\nExample:\n\n\n boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;\n\nAfter the quick-fix is applied:\n\n\n boolean a = true;\n boolean b = x;\n boolean c = !x;\n\n\nConfigure the inspection:\nUse the **Ignore named constants in determining pointless expressions** option to ignore named constants when determining if an expression is pointless." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PointlessBooleanExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 27, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "SuperTearDownInFinally", "shortDescription": { @@ -15418,19 +15451,19 @@ ] }, { - "id": "PointlessBooleanExpression", + "id": "ListenerMayUseAdapter", "shortDescription": { - "text": "Pointless boolean expression" + "text": "Class may extend adapter instead of implementing listener" }, "fullDescription": { - "text": "Reports unnecessary or overly complicated boolean expressions. Such expressions include '&&'-ing with 'true', '||'-ing with 'false', equality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified. Example: 'boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;' After the quick-fix is applied: 'boolean a = true;\n boolean b = x;\n boolean c = !x;' Configure the inspection: Use the Ignore named constants in determining pointless expressions option to ignore named constants when determining if an expression is pointless.", - "markdown": "Reports unnecessary or overly complicated boolean expressions.\n\nSuch expressions include `&&`-ing with `true`,\n`||`-ing with `false`,\nequality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified.\n\nExample:\n\n\n boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;\n\nAfter the quick-fix is applied:\n\n\n boolean a = true;\n boolean b = x;\n boolean c = !x;\n\n\nConfigure the inspection:\nUse the **Ignore named constants in determining pointless expressions** option to ignore named constants when determining if an expression is pointless." + "text": "Reports classes implementing listeners instead of extending corresponding adapters. A quick-fix is available to remove any redundant empty methods left after replacing a listener implementation with an adapter extension. Use the Only warn when empty implementing methods are found option to configure the inspection to warn even if no empty methods are found.", + "markdown": "Reports classes implementing listeners instead of extending corresponding adapters.\n\nA quick-fix is available to\nremove any redundant empty methods left after replacing a listener implementation with an adapter extension.\n\n\nUse the **Only warn when empty implementing methods are found** option to configure the inspection to warn even if no empty methods are found." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "PointlessBooleanExpression", + "suppressToolId": "ListenerMayUseAdapter", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -15438,8 +15471,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Class structure", + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -15472,39 +15505,6 @@ { "target": { "id": "Java/Code style issues", - "index": 12, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ListenerMayUseAdapter", - "shortDescription": { - "text": "Class may extend adapter instead of implementing listener" - }, - "fullDescription": { - "text": "Reports classes implementing listeners instead of extending corresponding adapters. A quick-fix is available to remove any redundant empty methods left after replacing a listener implementation with an adapter extension. Use the Only warn when empty implementing methods are found option to configure the inspection to warn even if no empty methods are found.", - "markdown": "Reports classes implementing listeners instead of extending corresponding adapters.\n\nA quick-fix is available to\nremove any redundant empty methods left after replacing a listener implementation with an adapter extension.\n\n\nUse the **Only warn when empty implementing methods are found** option to configure the inspection to warn even if no empty methods are found." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ListenerMayUseAdapter", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Class structure", "index": 11, "toolComponent": { "name": "QDJVMC" @@ -15604,7 +15604,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -15637,7 +15637,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -15670,7 +15670,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -15835,7 +15835,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -15847,19 +15847,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" } @@ -15867,8 +15867,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Memory", + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -15880,19 +15880,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" } @@ -15900,8 +15900,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 73, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -16202,7 +16202,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -16268,7 +16268,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -16466,7 +16466,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -16532,7 +16532,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -16598,7 +16598,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -16610,28 +16610,28 @@ ] }, { - "id": "UnclearBinaryExpression", + "id": "RedundantCompareToJavaTime", "shortDescription": { - "text": "Multiple operators with different precedence" + "text": "Expression with 'java.time' 'compareTo()' call can be simplified" }, "fullDescription": { - "text": "Reports binary, conditional, or 'instanceof' expressions that consist of different operators without parentheses. Such expressions can be less readable due to different precedence rules of operators. Example: 'int n = 3 + 9 * 8 + 1;' After quick-fix is applied: 'int n = 3 + (9 * 8) + 1;'", - "markdown": "Reports binary, conditional, or `instanceof` expressions that consist of different operators without parentheses. Such expressions can be less readable due to different precedence rules of operators.\n\nExample:\n\n\n int n = 3 + 9 * 8 + 1;\n\nAfter quick-fix is applied:\n\n\n int n = 3 + (9 * 8) + 1;\n" + "text": "Reports 'java.time' comparisons with 'compareTo()' calls that can be replaced with 'isAfter()', 'isBefore()' or 'isEqual()' calls. Example: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;' After the quick-fix is applied: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);' New in 2022.3", + "markdown": "Reports `java.time` comparisons with `compareTo()` calls that can be replaced with `isAfter()`, `isBefore()` or `isEqual()` calls.\n\nExample:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;\n\nAfter the quick-fix is applied:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);\n\nNew in 2022.3" }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "UnclearExpression", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "RedundantCompareToJavaTime", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Verbose or redundant code constructs", + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -16643,28 +16643,28 @@ ] }, { - "id": "RedundantCompareToJavaTime", + "id": "UnclearBinaryExpression", "shortDescription": { - "text": "Expression with 'java.time' 'compareTo()' call can be simplified" + "text": "Multiple operators with different precedence" }, "fullDescription": { - "text": "Reports 'java.time' comparisons with 'compareTo()' calls that can be replaced with 'isAfter()', 'isBefore()' or 'isEqual()' calls. Example: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;' After the quick-fix is applied: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);' New in 2022.3", - "markdown": "Reports `java.time` comparisons with `compareTo()` calls that can be replaced with `isAfter()`, `isBefore()` or `isEqual()` calls.\n\nExample:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;\n\nAfter the quick-fix is applied:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);\n\nNew in 2022.3" + "text": "Reports binary, conditional, or 'instanceof' expressions that consist of different operators without parentheses. Such expressions can be less readable due to different precedence rules of operators. Example: 'int n = 3 + 9 * 8 + 1;' After quick-fix is applied: 'int n = 3 + (9 * 8) + 1;'", + "markdown": "Reports binary, conditional, or `instanceof` expressions that consist of different operators without parentheses. Such expressions can be less readable due to different precedence rules of operators.\n\nExample:\n\n\n int n = 3 + 9 * 8 + 1;\n\nAfter quick-fix is applied:\n\n\n int n = 3 + (9 * 8) + 1;\n" }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "RedundantCompareToJavaTime", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "UnclearExpression", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 37, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -16730,7 +16730,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -16763,7 +16763,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -16895,7 +16895,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -17060,7 +17060,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -17072,19 +17072,19 @@ ] }, { - "id": "TailRecursion", + "id": "MethodRefCanBeReplacedWithLambda", "shortDescription": { - "text": "Tail recursion" + "text": "Method reference can be replaced with lambda" }, "fullDescription": { - "text": "Reports tail recursion, that is, when a method calls itself as its last action before returning. Tail recursion can always be replaced by looping, which will be considerably faster. Some JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different performance characteristics on different virtual machines. Example: 'int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }' After the quick-fix is applied: 'int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }'", - "markdown": "Reports tail recursion, that is, when a method calls itself as its last action before returning.\n\n\nTail recursion can always be replaced by looping, which will be considerably faster.\nSome JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different\nperformance characteristics on different virtual machines.\n\nExample:\n\n\n int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }\n" + "text": "Reports method references, like 'MyClass::myMethod' and 'myObject::myMethod', and suggests replacing them with an equivalent lambda expression. Lambda expressions can be easier to modify than method references. Example: 'System.out::println' After the quick-fix is applied: 's -> System.out.println(s)' By default, this inspection does not highlight the code in the editor, but only provides a quick-fix.", + "markdown": "Reports method references, like `MyClass::myMethod` and `myObject::myMethod`, and suggests replacing them with an equivalent lambda expression.\n\nLambda expressions can be easier to modify than method references.\n\nExample:\n\n\n System.out::println\n\nAfter the quick-fix is applied:\n\n\n s -> System.out.println(s)\n\nBy default, this inspection does not highlight the code in the editor, but only provides a quick-fix." }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "suppressToolId": "TailRecursion", + "suppressToolId": "MethodRefCanBeReplacedWithLambda", "ideaSeverity": "INFORMATION", "qodanaSeverity": "Info" } @@ -17092,8 +17092,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -17105,19 +17105,19 @@ ] }, { - "id": "MethodRefCanBeReplacedWithLambda", + "id": "TailRecursion", "shortDescription": { - "text": "Method reference can be replaced with lambda" + "text": "Tail recursion" }, "fullDescription": { - "text": "Reports method references, like 'MyClass::myMethod' and 'myObject::myMethod', and suggests replacing them with an equivalent lambda expression. Lambda expressions can be easier to modify than method references. Example: 'System.out::println' After the quick-fix is applied: 's -> System.out.println(s)' By default, this inspection does not highlight the code in the editor, but only provides a quick-fix.", - "markdown": "Reports method references, like `MyClass::myMethod` and `myObject::myMethod`, and suggests replacing them with an equivalent lambda expression.\n\nLambda expressions can be easier to modify than method references.\n\nExample:\n\n\n System.out::println\n\nAfter the quick-fix is applied:\n\n\n s -> System.out.println(s)\n\nBy default, this inspection does not highlight the code in the editor, but only provides a quick-fix." + "text": "Reports tail recursion, that is, when a method calls itself as its last action before returning. Tail recursion can always be replaced by looping, which will be considerably faster. Some JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different performance characteristics on different virtual machines. Example: 'int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }' After the quick-fix is applied: 'int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }'", + "markdown": "Reports tail recursion, that is, when a method calls itself as its last action before returning.\n\n\nTail recursion can always be replaced by looping, which will be considerably faster.\nSome JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different\nperformance characteristics on different virtual machines.\n\nExample:\n\n\n int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "note", "parameters": { - "suppressToolId": "MethodRefCanBeReplacedWithLambda", + "suppressToolId": "TailRecursion", "ideaSeverity": "INFORMATION", "qodanaSeverity": "Info" } @@ -17125,8 +17125,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -17291,7 +17291,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -17357,7 +17357,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -17390,7 +17390,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -17435,22 +17435,19 @@ ] }, { - "id": "JDBCPrepareStatementWithNonConstantString", + "id": "BooleanParameter", "shortDescription": { - "text": "Call to 'Connection.prepare*()' with non-constant string" + "text": "'public' method with 'boolean' parameter" }, "fullDescription": { - "text": "Reports calls to 'java.sql.Connection.prepareStatement()', 'java.sql.Connection.prepareCall()', or any of their variants which take a dynamically-constructed string as the statement to prepare. Constructed SQL statements are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");' Use the inspection settings to consider any 'static' 'final' fields as constants. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";'", - "markdown": "Reports calls to `java.sql.Connection.prepareStatement()`, `java.sql.Connection.prepareCall()`, or any of their variants which take a dynamically-constructed string as the statement to prepare.\n\n\nConstructed SQL statements are a common source of\nsecurity breaches. By default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");\n\nUse the inspection settings to consider any `static` `final` fields as constants. Be careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";\n" + "text": "Reports public methods that accept a 'boolean' parameter. It's almost always bad practice to add a 'boolean' parameter to a public method (part of an API) if that method is not a setter. When reading code using such a method, it can be difficult to decipher what the 'boolean' stands for without looking at the source or documentation. This problem is also known as the boolean trap. The 'boolean' parameter can often be replaced with an 'enum'. Example: '// Warning: it's hard to understand what the\n // boolean parameters mean when looking at\n // a call to this method\n public boolean setPermission(File f,\n int access,\n boolean enable,\n boolean ownerOnly) {\n // ...\n }' Use the Only report methods with multiple boolean parameters option to warn only when a method contains more than one boolean parameter.", + "markdown": "Reports public methods that accept a `boolean` parameter.\n\nIt's almost always bad practice to add a `boolean` parameter to a public method (part of an API) if that method is not a setter.\nWhen reading code using such a method, it can be difficult to decipher what the `boolean` stands for without looking at\nthe source or documentation.\n\nThis problem is also known as [the boolean trap](https://ariya.io/2011/08/hall-of-api-shame-boolean-trap).\nThe `boolean` parameter can often be replaced with an `enum`.\n\nExample:\n\n\n // Warning: it's hard to understand what the\n // boolean parameters mean when looking at\n // a call to this method\n public boolean setPermission(File f,\n int access,\n boolean enable,\n boolean ownerOnly) {\n // ...\n }\n\n\nUse the **Only report methods with multiple boolean parameters** option to warn only when a method contains more than one boolean parameter." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "JDBCPrepareStatementWithNonConstantString", - "cweIds": [ - 89 - ], + "suppressToolId": "BooleanParameter", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -17458,8 +17455,8 @@ "relationships": [ { "target": { - "id": "Java/Security", - "index": 30, + "id": "Java/Abstraction issues", + "index": 78, "toolComponent": { "name": "QDJVMC" } @@ -17471,19 +17468,22 @@ ] }, { - "id": "BooleanParameter", + "id": "JDBCPrepareStatementWithNonConstantString", "shortDescription": { - "text": "'public' method with 'boolean' parameter" + "text": "Call to 'Connection.prepare*()' with non-constant string" }, "fullDescription": { - "text": "Reports public methods that accept a 'boolean' parameter. It's almost always bad practice to add a 'boolean' parameter to a public method (part of an API) if that method is not a setter. When reading code using such a method, it can be difficult to decipher what the 'boolean' stands for without looking at the source or documentation. This problem is also known as the boolean trap. The 'boolean' parameter can often be replaced with an 'enum'. Example: '// Warning: it's hard to understand what the\n // boolean parameters mean when looking at\n // a call to this method\n public boolean setPermission(File f,\n int access,\n boolean enable,\n boolean ownerOnly) {\n // ...\n }' Use the Only report methods with multiple boolean parameters option to warn only when a method contains more than one boolean parameter.", - "markdown": "Reports public methods that accept a `boolean` parameter.\n\nIt's almost always bad practice to add a `boolean` parameter to a public method (part of an API) if that method is not a setter.\nWhen reading code using such a method, it can be difficult to decipher what the `boolean` stands for without looking at\nthe source or documentation.\n\nThis problem is also known as [the boolean trap](https://ariya.io/2011/08/hall-of-api-shame-boolean-trap).\nThe `boolean` parameter can often be replaced with an `enum`.\n\nExample:\n\n\n // Warning: it's hard to understand what the\n // boolean parameters mean when looking at\n // a call to this method\n public boolean setPermission(File f,\n int access,\n boolean enable,\n boolean ownerOnly) {\n // ...\n }\n\n\nUse the **Only report methods with multiple boolean parameters** option to warn only when a method contains more than one boolean parameter." + "text": "Reports calls to 'java.sql.Connection.prepareStatement()', 'java.sql.Connection.prepareCall()', or any of their variants which take a dynamically-constructed string as the statement to prepare. Constructed SQL statements are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");' Use the inspection settings to consider any 'static' 'final' fields as constants. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";'", + "markdown": "Reports calls to `java.sql.Connection.prepareStatement()`, `java.sql.Connection.prepareCall()`, or any of their variants which take a dynamically-constructed string as the statement to prepare.\n\n\nConstructed SQL statements are a common source of\nsecurity breaches. By default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");\n\nUse the inspection settings to consider any `static` `final` fields as constants. Be careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "BooleanParameter", + "suppressToolId": "JDBCPrepareStatementWithNonConstantString", + "cweIds": [ + 89 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -17491,8 +17491,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 78, + "id": "Java/Security", + "index": 30, "toolComponent": { "name": "QDJVMC" } @@ -17676,19 +17676,19 @@ ] }, { - "id": "ToArrayCallWithZeroLengthArrayArgument", + "id": "Java9ModuleExportsPackageToItself", "shortDescription": { - "text": "'Collection.toArray()' call style" + "text": "Module exports/opens package to itself" }, "fullDescription": { - "text": "Reports 'Collection.toArray()' calls that are not in the preferred style, and suggests applying the preferred style. There are two styles to convert a collection to an array: A pre-sized array, for example, 'c.toArray(new String[c.size()])' An empty array, for example, 'c.toArray(new String[0])' In older Java versions, using a pre-sized array was recommended, as the reflection call necessary to create an array of proper size was quite slow. However, since late updates of OpenJDK 6, this call was intrinsified, making the performance of the empty array version the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the 'size' and 'toArray' calls. This may result in extra 'null's at the end of the array if the collection was concurrently shrunk during the operation. Use the inspection options to select the preferred style.", - "markdown": "Reports `Collection.toArray()` calls that are not in the preferred style, and suggests applying the preferred style.\n\nThere are two styles to convert a collection to an array:\n\n* A pre-sized array, for example, `c.toArray(new String[c.size()])`\n* An empty array, for example, `c.toArray(new String[0])`\n\nIn older Java versions, using a pre-sized array was recommended, as the reflection\ncall necessary to create an array of proper size was quite slow.\n\nHowever, since late updates of OpenJDK 6, this call was intrinsified, making\nthe performance of the empty array version the same, and sometimes even better, compared\nto the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or\nsynchronized collection as a data race is possible between the `size` and `toArray`\ncalls. This may result in extra `null`s at the end of the array if the collection was concurrently\nshrunk during the operation.\n\nUse the inspection options to select the preferred style." + "text": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from 'module-info.java'. Example: 'module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }' After the quick-fix is applied: 'module main {\n }' This inspection only reports if the language level of the project or module is 9 or higher.", + "markdown": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from `module-info.java`.\n\nExample:\n\n\n module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }\n\nAfter the quick-fix is applied:\n\n\n module main {\n }\n\nThis inspection only reports if the language level of the project or module is 9 or higher." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ToArrayCallWithZeroLengthArrayArgument", + "suppressToolId": "Java9ModuleExportsPackageToItself", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -17696,8 +17696,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Visibility", + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -17709,19 +17709,19 @@ ] }, { - "id": "Java9ModuleExportsPackageToItself", + "id": "ToArrayCallWithZeroLengthArrayArgument", "shortDescription": { - "text": "Module exports/opens package to itself" + "text": "'Collection.toArray()' call style" }, "fullDescription": { - "text": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from 'module-info.java'. Example: 'module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }' After the quick-fix is applied: 'module main {\n }' This inspection only reports if the language level of the project or module is 9 or higher.", - "markdown": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from `module-info.java`.\n\nExample:\n\n\n module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }\n\nAfter the quick-fix is applied:\n\n\n module main {\n }\n\nThis inspection only reports if the language level of the project or module is 9 or higher." + "text": "Reports 'Collection.toArray()' calls that are not in the preferred style, and suggests applying the preferred style. There are two styles to convert a collection to an array: A pre-sized array, for example, 'c.toArray(new String[c.size()])' An empty array, for example, 'c.toArray(new String[0])' In older Java versions, using a pre-sized array was recommended, as the reflection call necessary to create an array of proper size was quite slow. However, since late updates of OpenJDK 6, this call was intrinsified, making the performance of the empty array version the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the 'size' and 'toArray' calls. This may result in extra 'null's at the end of the array if the collection was concurrently shrunk during the operation. Use the inspection options to select the preferred style.", + "markdown": "Reports `Collection.toArray()` calls that are not in the preferred style, and suggests applying the preferred style.\n\nThere are two styles to convert a collection to an array:\n\n* A pre-sized array, for example, `c.toArray(new String[c.size()])`\n* An empty array, for example, `c.toArray(new String[0])`\n\nIn older Java versions, using a pre-sized array was recommended, as the reflection\ncall necessary to create an array of proper size was quite slow.\n\nHowever, since late updates of OpenJDK 6, this call was intrinsified, making\nthe performance of the empty array version the same, and sometimes even better, compared\nto the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or\nsynchronized collection as a data race is possible between the `size` and `toArray`\ncalls. This may result in extra `null`s at the end of the array if the collection was concurrently\nshrunk during the operation.\n\nUse the inspection options to select the preferred style." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "Java9ModuleExportsPackageToItself", + "suppressToolId": "ToArrayCallWithZeroLengthArrayArgument", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -17729,8 +17729,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 57, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -17796,7 +17796,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -17843,6 +17843,39 @@ } ] }, + { + "id": "CommentedOutCode", + "shortDescription": { + "text": "Commented out code" + }, + "fullDescription": { + "text": "Reports comments that contain Java code. Usually, code that is commented out gets outdated very quickly and becomes misleading. As most projects use some kind of version control system, it is better to delete commented out code completely and use the VCS history instead. New in 2020.3", + "markdown": "Reports comments that contain Java code.\n\nUsually, code that is commented out gets outdated very quickly and becomes misleading.\nAs most projects use some kind of version control system,\nit is better to delete commented out code completely and use the VCS history instead.\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "CommentedOutCode", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "AssignmentToStaticFieldFromInstanceMethod", "shortDescription": { @@ -17876,39 +17909,6 @@ } ] }, - { - "id": "CommentedOutCode", - "shortDescription": { - "text": "Commented out code" - }, - "fullDescription": { - "text": "Reports comments that contain Java code. Usually, code that is commented out gets outdated very quickly and becomes misleading. As most projects use some kind of version control system, it is better to delete commented out code completely and use the VCS history instead. New in 2020.3", - "markdown": "Reports comments that contain Java code.\n\nUsually, code that is commented out gets outdated very quickly and becomes misleading.\nAs most projects use some kind of version control system,\nit is better to delete commented out code completely and use the VCS history instead.\n\nNew in 2020.3" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "CommentedOutCode", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Code maturity", - "index": 50, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "ClassWithoutLogger", "shortDescription": { @@ -17964,7 +17964,7 @@ { "target": { "id": "Java/Memory", - "index": 73, + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -17976,19 +17976,19 @@ ] }, { - "id": "AnonymousClassComplexity", + "id": "AbstractClassWithOnlyOneDirectInheritor", "shortDescription": { - "text": "Overly complex anonymous class" + "text": "Abstract class with a single direct inheritor" }, "fullDescription": { - "text": "Reports anonymous inner classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Anonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes. Use the Cyclomatic complexity limit field to specify the maximum allowed complexity for a class.", - "markdown": "Reports anonymous inner classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nAnonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes.\n\nUse the **Cyclomatic complexity limit** field to specify the maximum allowed complexity for a class." + "text": "Reports abstract classes that have precisely one direct inheritor. While such classes may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the abstract class with its inheritor. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'abstract class Base {} // will be reported\n\n class Inheritor extends Base {}'", + "markdown": "Reports abstract classes that have precisely one direct inheritor. While such classes may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the abstract class with its inheritor.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n abstract class Base {} // will be reported\n\n class Inheritor extends Base {}\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "OverlyComplexAnonymousInnerClass", + "suppressToolId": "AbstractClassWithOnlyOneDirectInheritor", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -17996,8 +17996,8 @@ "relationships": [ { "target": { - "id": "Java/Class metrics", - "index": 87, + "id": "Java/Performance/Embedded", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -18009,19 +18009,19 @@ ] }, { - "id": "AbstractClassWithOnlyOneDirectInheritor", + "id": "AnonymousClassComplexity", "shortDescription": { - "text": "Abstract class with a single direct inheritor" + "text": "Overly complex anonymous class" }, "fullDescription": { - "text": "Reports abstract classes that have precisely one direct inheritor. While such classes may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the abstract class with its inheritor. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'abstract class Base {} // will be reported\n\n class Inheritor extends Base {}'", - "markdown": "Reports abstract classes that have precisely one direct inheritor. While such classes may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the abstract class with its inheritor.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n abstract class Base {} // will be reported\n\n class Inheritor extends Base {}\n" + "text": "Reports anonymous inner classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Anonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes. Use the Cyclomatic complexity limit field to specify the maximum allowed complexity for a class.", + "markdown": "Reports anonymous inner classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nAnonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes.\n\nUse the **Cyclomatic complexity limit** field to specify the maximum allowed complexity for a class." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "AbstractClassWithOnlyOneDirectInheritor", + "suppressToolId": "OverlyComplexAnonymousInnerClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -18029,8 +18029,8 @@ "relationships": [ { "target": { - "id": "Java/Performance/Embedded", - "index": 21, + "id": "Java/Class metrics", + "index": 87, "toolComponent": { "name": "QDJVMC" } @@ -18301,7 +18301,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -18367,7 +18367,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -18466,7 +18466,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -18499,7 +18499,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -18700,7 +18700,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -18865,7 +18865,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -18877,19 +18877,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.", + "markdown": "Reports Stream API call chains ending with the `count()` operation that could be optimized.\n\n\nThe following call chains are replaced by this inspection:\n\n* `Collection.stream().count()` → `Collection.size()`. In Java 8 `Collection.stream().count()` actually iterates over the collection elements to count them, while `Collection.size()` is much faster for most of the collections.\n* `Stream.flatMap(Collection::stream).count()` → `Stream.mapToLong(Collection::size).sum()`. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up.\n* `Stream.filter(o -> ...).count() > 0` → `Stream.anyMatch(o -> ...)`. Unlike the original call, `anyMatch()` may stop the computation as soon as a matching element is found.\n* `Stream.filter(o -> ...).count() == 0` → `Stream.noneMatch(o -> ...)`. Similar to the above.\n\n\nNote that if the replacement involves a short-circuiting operation like `anyMatch()`, there could be a visible behavior change,\nif the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ParameterTypePreventsOverriding", + "suppressToolId": "ReplaceInefficientStreamCount", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -18897,8 +18897,8 @@ "relationships": [ { "target": { - "id": "Java/Inheritance issues", - "index": 25, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -18910,19 +18910,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.", - "markdown": "Reports Stream API call chains ending with the `count()` operation that could be optimized.\n\n\nThe following call chains are replaced by this inspection:\n\n* `Collection.stream().count()` → `Collection.size()`. In Java 8 `Collection.stream().count()` actually iterates over the collection elements to count them, while `Collection.size()` is much faster for most of the collections.\n* `Stream.flatMap(Collection::stream).count()` → `Stream.mapToLong(Collection::size).sum()`. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up.\n* `Stream.filter(o -> ...).count() > 0` → `Stream.anyMatch(o -> ...)`. Unlike the original call, `anyMatch()` may stop the computation as soon as a matching element is found.\n* `Stream.filter(o -> ...).count() == 0` → `Stream.noneMatch(o -> ...)`. Similar to the above.\n\n\nNote that if the replacement involves a short-circuiting operation like `anyMatch()`, there could be a visible behavior change,\nif the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls." + "text": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method. Example: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n}' After the quick-fix is applied: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n}'", + "markdown": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method.\n\n**Example:**\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ReplaceInefficientStreamCount", + "suppressToolId": "ParameterTypePreventsOverriding", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -18930,8 +18930,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Inheritance issues", + "index": 25, "toolComponent": { "name": "QDJVMC" } @@ -18997,7 +18997,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -19228,7 +19228,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -19342,19 +19342,19 @@ ] }, { - "id": "PublicFieldAccessedInSynchronizedContext", + "id": "UnusedLabel", "shortDescription": { - "text": "Non-private field accessed in 'synchronized' context" + "text": "Unused label" }, "fullDescription": { - "text": "Reports non-'final', non-'private' fields that are accessed in a synchronized context. A non-'private' field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\" access may result in unexpectedly inconsistent data structures. Example: 'class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }'", - "markdown": "Reports non-`final`, non-`private` fields that are accessed in a synchronized context.\n\n\nA non-`private` field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\"\naccess may result in unexpectedly inconsistent data structures.\n\n**Example:**\n\n\n class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }\n" + "text": "Reports labels that are not targets of any 'break' or 'continue' statements. Example: 'label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }' After the quick-fix is applied, the label is removed: 'for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }'", + "markdown": "Reports labels that are not targets of any `break` or `continue` statements.\n\n**Example:**\n\n\n label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nAfter the quick-fix is applied, the label is removed:\n\n\n for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "NonPrivateFieldAccessedInSynchronizedContext", + "suppressToolId": "UnusedLabel", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19362,8 +19362,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Declaration redundancy", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -19375,19 +19375,19 @@ ] }, { - "id": "UnusedLabel", + "id": "PublicFieldAccessedInSynchronizedContext", "shortDescription": { - "text": "Unused label" + "text": "Non-private field accessed in 'synchronized' context" }, "fullDescription": { - "text": "Reports labels that are not targets of any 'break' or 'continue' statements. Example: 'label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }' After the quick-fix is applied, the label is removed: 'for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }'", - "markdown": "Reports labels that are not targets of any `break` or `continue` statements.\n\n**Example:**\n\n\n label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nAfter the quick-fix is applied, the label is removed:\n\n\n for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n" + "text": "Reports non-'final', non-'private' fields that are accessed in a synchronized context. A non-'private' field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\" access may result in unexpectedly inconsistent data structures. Example: 'class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }'", + "markdown": "Reports non-`final`, non-`private` fields that are accessed in a synchronized context.\n\n\nA non-`private` field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\"\naccess may result in unexpectedly inconsistent data structures.\n\n**Example:**\n\n\n class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnusedLabel", + "suppressToolId": "NonPrivateFieldAccessedInSynchronizedContext", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19395,8 +19395,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -19632,7 +19632,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -19677,22 +19677,19 @@ ] }, { - "id": "ComparableImplementedButEqualsNotOverridden", + "id": "PackageVisibleField", "shortDescription": { - "text": "'Comparable' implemented but 'equals()' not overridden" + "text": "Package-visible field" }, "fullDescription": { - "text": "Reports classes that implement 'java.lang.Comparable' but do not override 'equals()'. If 'equals()' is not overridden, the 'equals()' implementation is not consistent with the 'compareTo()' implementation. If an object of such a class is added to a collection such as 'java.util.SortedSet', this collection will violate the contract of 'java.util.Set', which is defined in terms of 'equals()'. Example: 'class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n }' After the quick fix is applied: 'class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n\n @Override\n public boolean equals(Object o) {\n return o instanceof Length && compareTo((Length) o) == 0;\n }\n }'", - "markdown": "Reports classes that implement `java.lang.Comparable` but do not override `equals()`.\n\n\nIf `equals()`\nis not overridden, the `equals()` implementation is not consistent with\nthe `compareTo()` implementation. If an object of such a class is added\nto a collection such as `java.util.SortedSet`, this collection will violate\nthe contract of `java.util.Set`, which is defined in terms of\n`equals()`.\n\n**Example:**\n\n\n class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n }\n\nAfter the quick fix is applied:\n\n\n class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n\n @Override\n public boolean equals(Object o) {\n return o instanceof Length && compareTo((Length) o) == 0;\n }\n }\n" + "text": "Reports fields that are declared without any access modifier (also known as package-private). Constants (that is, fields marked 'static' and 'final') are not reported. Example: 'public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }'", + "markdown": "Reports fields that are declared without any access modifier (also known as package-private).\n\nConstants (that is, fields marked `static` and `final`) are not reported.\n\n**Example:**\n\n\n public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ComparableImplementedButEqualsNotOverridden", - "cweIds": [ - 697 - ], + "suppressToolId": "PackageVisibleField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19700,8 +19697,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Encapsulation", + "index": 60, "toolComponent": { "name": "QDJVMC" } @@ -19713,19 +19710,22 @@ ] }, { - "id": "PackageVisibleField", + "id": "ComparableImplementedButEqualsNotOverridden", "shortDescription": { - "text": "Package-visible field" + "text": "'Comparable' implemented but 'equals()' not overridden" }, "fullDescription": { - "text": "Reports fields that are declared without any access modifier (also known as package-private). Constants (that is, fields marked 'static' and 'final') are not reported. Example: 'public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }'", - "markdown": "Reports fields that are declared without any access modifier (also known as package-private).\n\nConstants (that is, fields marked `static` and `final`) are not reported.\n\n**Example:**\n\n\n public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }\n" + "text": "Reports classes that implement 'java.lang.Comparable' but do not override 'equals()'. If 'equals()' is not overridden, the 'equals()' implementation is not consistent with the 'compareTo()' implementation. If an object of such a class is added to a collection such as 'java.util.SortedSet', this collection will violate the contract of 'java.util.Set', which is defined in terms of 'equals()'. Example: 'class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n }' After the quick fix is applied: 'class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n\n @Override\n public boolean equals(Object o) {\n return o instanceof Length && compareTo((Length) o) == 0;\n }\n }'", + "markdown": "Reports classes that implement `java.lang.Comparable` but do not override `equals()`.\n\n\nIf `equals()`\nis not overridden, the `equals()` implementation is not consistent with\nthe `compareTo()` implementation. If an object of such a class is added\nto a collection such as `java.util.SortedSet`, this collection will violate\nthe contract of `java.util.Set`, which is defined in terms of\n`equals()`.\n\n**Example:**\n\n\n class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n }\n\nAfter the quick fix is applied:\n\n\n class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n\n @Override\n public boolean equals(Object o) {\n return o instanceof Length && compareTo((Length) o) == 0;\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "PackageVisibleField", + "suppressToolId": "ComparableImplementedButEqualsNotOverridden", + "cweIds": [ + 697 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19733,8 +19733,8 @@ "relationships": [ { "target": { - "id": "Java/Encapsulation", - "index": 60, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -19833,7 +19833,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -19882,19 +19882,19 @@ ] }, { - "id": "NewClassNamingConvention", + "id": "LoggingStringTemplateAsArgument", "shortDescription": { - "text": "Class naming convention" + "text": "String template as argument to logging call" }, "fullDescription": { - "text": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class produces a warning because the length of its name is 6, which is less than 8: 'public class MyTest{}'. A quick-fix that renames such classes is available only in the editor. Configure the inspection: Use the list in the Options section to specify which classes should be checked. Deselect the checkboxes for the classes for which you want to skip the check. For each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the provided input fields. Specify 0 in the length fields to skip corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format.", - "markdown": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class\nproduces a warning because the length of its name is 6, which is less than 8: `public class MyTest{}`.\n\nA quick-fix that renames such classes is available only in the editor.\n\nConfigure the inspection:\n\n\nUse the list in the **Options** section to specify which classes should be checked. Deselect the checkboxes for the classes for which\nyou want to skip the check.\n\nFor each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the\nprovided input fields. Specify **0** in the length fields to skip corresponding checks.\n\nRegular expressions should be specified in the standard `java.util.regex` format." + "text": "Reports string templates that are used as arguments to SLF4J and Log4j 2 logging methods. The method 'org.apache.logging.log4j.Logger.log()' and its overloads are supported only for all log levels option. String templates are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled. Example (for Kotlin): 'val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")' After the quick-fix is applied (for Kotlin): 'val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)' Note that the suggested replacement might not be equivalent to the original code, for example, when string templates contain method calls or assignment expressions. Use the Warn on list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated. Use the Do not warn when only expressions with primitive types, their wrappers or String are included option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance. New in 2023.1", + "markdown": "Reports string templates that are used as arguments to **SLF4J** and **Log4j 2** logging methods. The method `org.apache.logging.log4j.Logger.log()` and its overloads are supported only for **all log levels** option. String templates are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")\n\n**After the quick-fix is applied (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)\n\n\nNote that the suggested replacement might not be equivalent to the original code, for example,\nwhen string templates contain method calls or assignment expressions.\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated.\n* Use the **Do not warn when only expressions with primitive types, their wrappers or String are included** option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance.\n\nNew in 2023.1" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "NewClassNamingConvention", + "suppressToolId": "LoggingStringTemplateAsArgument", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19902,8 +19902,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions/Class", - "index": 71, + "id": "JVM languages/Logging", + "index": 45, "toolComponent": { "name": "QDJVMC" } @@ -19915,19 +19915,19 @@ ] }, { - "id": "LoggingStringTemplateAsArgument", + "id": "NewClassNamingConvention", "shortDescription": { - "text": "String template as argument to logging call" + "text": "Class naming convention" }, "fullDescription": { - "text": "Reports string templates that are used as arguments to SLF4J and Log4j 2 logging methods. The method 'org.apache.logging.log4j.Logger.log()' and its overloads are supported only for all log levels option. String templates are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled. Example (for Kotlin): 'val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")' After the quick-fix is applied (for Kotlin): 'val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)' Note that the suggested replacement might not be equivalent to the original code, for example, when string templates contain method calls or assignment expressions. Use the Warn on list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated. Use the Do not warn when only expressions with primitive types, their wrappers or String are included option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance. New in 2023.1", - "markdown": "Reports string templates that are used as arguments to **SLF4J** and **Log4j 2** logging methods. The method `org.apache.logging.log4j.Logger.log()` and its overloads are supported only for **all log levels** option. String templates are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")\n\n**After the quick-fix is applied (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)\n\n\nNote that the suggested replacement might not be equivalent to the original code, for example,\nwhen string templates contain method calls or assignment expressions.\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated.\n* Use the **Do not warn when only expressions with primitive types, their wrappers or String are included** option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance.\n\nNew in 2023.1" + "text": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class produces a warning because the length of its name is 6, which is less than 8: 'public class MyTest{}'. A quick-fix that renames such classes is available only in the editor. Configure the inspection: Use the list in the Options section to specify which classes should be checked. Deselect the checkboxes for the classes for which you want to skip the check. For each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the provided input fields. Specify 0 in the length fields to skip corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format.", + "markdown": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class\nproduces a warning because the length of its name is 6, which is less than 8: `public class MyTest{}`.\n\nA quick-fix that renames such classes is available only in the editor.\n\nConfigure the inspection:\n\n\nUse the list in the **Options** section to specify which classes should be checked. Deselect the checkboxes for the classes for which\nyou want to skip the check.\n\nFor each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the\nprovided input fields. Specify **0** in the length fields to skip corresponding checks.\n\nRegular expressions should be specified in the standard `java.util.regex` format." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "LoggingStringTemplateAsArgument", + "suppressToolId": "NewClassNamingConvention", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -19935,8 +19935,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Logging", - "index": 46, + "id": "Java/Naming conventions/Class", + "index": 71, "toolComponent": { "name": "QDJVMC" } @@ -19969,7 +19969,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -20035,7 +20035,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -20101,7 +20101,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -20113,19 +20113,23 @@ ] }, { - "id": "ConditionalBreakInInfiniteLoop", + "id": "StringConcatenationInFormatCall", "shortDescription": { - "text": "Conditional break inside loop" + "text": "String concatenation as argument to 'format()' call" }, "fullDescription": { - "text": "Reports conditional breaks at the beginning or at the end of a loop and suggests adding a loop condition instead to shorten the code. Example: 'while (true) {\n if (i == 23) break;\n i++;\n }' After the quick fix is applied: 'while (i != 23) {\n i++;\n }'", - "markdown": "Reports conditional breaks at the beginning or at the end of a loop and suggests adding a loop condition instead to shorten the code.\n\nExample:\n\n\n while (true) {\n if (i == 23) break;\n i++;\n }\n\nAfter the quick fix is applied:\n\n\n while (i != 23) {\n i++;\n }\n" + "text": "Reports non-constant string concatenations used as a format string argument. While occasionally intended, this is usually a misuse of a formatting method and may even cause security issues if the variables used in the concatenated string contain special characters like '%'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }' Here, the 'userName' will be interpreted as a part of format string, which may result in 'IllegalFormatException' (for example, if 'userName' is '\"%\"') or in using an enormous amount of memory (for example, if 'userName' is '\"%2000000000%\"'). The call should be probably replaced with 'String.format(\"Hello, %s\", userName);'. This inspection checks calls to formatting methods on 'java.util.Formatter', 'java.lang.String', 'java.io.PrintWriter', or 'java.io.PrintStream'.", + "markdown": "Reports non-constant string concatenations used as a format string argument.\n\n\nWhile occasionally intended, this is usually a misuse of a formatting method\nand may even cause security issues if the variables used in the concatenated string\ncontain special characters like `%`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }\n\n\nHere, the `userName` will be interpreted as a part of format string, which may result\nin `IllegalFormatException` (for example, if `userName` is `\"%\"`) or\nin using an enormous amount of memory (for example, if `userName` is `\"%2000000000%\"`).\nThe call should be probably replaced with `String.format(\"Hello, %s\", userName);`.\n\n\nThis inspection checks calls to formatting methods on\n`java.util.Formatter`,\n`java.lang.String`,\n`java.io.PrintWriter`,\nor `java.io.PrintStream`." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ConditionalBreakInInfiniteLoop", + "suppressToolId": "StringConcatenationInFormatCall", + "cweIds": [ + 116, + 134 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20133,8 +20137,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -20146,23 +20150,19 @@ ] }, { - "id": "StringConcatenationInFormatCall", + "id": "ConditionalBreakInInfiniteLoop", "shortDescription": { - "text": "String concatenation as argument to 'format()' call" + "text": "Conditional break inside loop" }, "fullDescription": { - "text": "Reports non-constant string concatenations used as a format string argument. While occasionally intended, this is usually a misuse of a formatting method and may even cause security issues if the variables used in the concatenated string contain special characters like '%'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }' Here, the 'userName' will be interpreted as a part of format string, which may result in 'IllegalFormatException' (for example, if 'userName' is '\"%\"') or in using an enormous amount of memory (for example, if 'userName' is '\"%2000000000%\"'). The call should be probably replaced with 'String.format(\"Hello, %s\", userName);'. This inspection checks calls to formatting methods on 'java.util.Formatter', 'java.lang.String', 'java.io.PrintWriter', or 'java.io.PrintStream'.", - "markdown": "Reports non-constant string concatenations used as a format string argument.\n\n\nWhile occasionally intended, this is usually a misuse of a formatting method\nand may even cause security issues if the variables used in the concatenated string\ncontain special characters like `%`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }\n\n\nHere, the `userName` will be interpreted as a part of format string, which may result\nin `IllegalFormatException` (for example, if `userName` is `\"%\"`) or\nin using an enormous amount of memory (for example, if `userName` is `\"%2000000000%\"`).\nThe call should be probably replaced with `String.format(\"Hello, %s\", userName);`.\n\n\nThis inspection checks calls to formatting methods on\n`java.util.Formatter`,\n`java.lang.String`,\n`java.io.PrintWriter`,\nor `java.io.PrintStream`." + "text": "Reports conditional breaks at the beginning or at the end of a loop and suggests adding a loop condition instead to shorten the code. Example: 'while (true) {\n if (i == 23) break;\n i++;\n }' After the quick fix is applied: 'while (i != 23) {\n i++;\n }'", + "markdown": "Reports conditional breaks at the beginning or at the end of a loop and suggests adding a loop condition instead to shorten the code.\n\nExample:\n\n\n while (true) {\n if (i == 23) break;\n i++;\n }\n\nAfter the quick fix is applied:\n\n\n while (i != 23) {\n i++;\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "StringConcatenationInFormatCall", - "cweIds": [ - 116, - 134 - ], + "suppressToolId": "ConditionalBreakInInfiniteLoop", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20170,8 +20170,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -20204,7 +20204,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -20348,19 +20348,22 @@ ] }, { - "id": "JUnit5AssertionsConverter", + "id": "SuspiciousListRemoveInLoop", "shortDescription": { - "text": "JUnit 5 obsolete assertions" + "text": "Suspicious 'List.remove()' in loop" }, "fullDescription": { - "text": "Reports any calls to methods from the 'junit.framework.Assert', 'org.junit.Assert', or 'org.junit.Assume' classes inside JUnit 5 tests. Although the tests work properly, migration to 'org.junit.jupiter.api.Assertions'/'org.junit.jupiter.api.Assumptions' will help you avoid dependencies on old JUnit version. Example: 'import org.junit.Assert;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assert.assertEquals(4, 2 + 2);\n }\n }' After the quick-fix is applied: 'import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assertions.assertEquals(4, 2 + 2);\n }\n }'", - "markdown": "Reports any calls to methods from the `junit.framework.Assert`, `org.junit.Assert`, or `org.junit.Assume`\nclasses inside JUnit 5 tests.\n\nAlthough the tests work properly, migration to `org.junit.jupiter.api.Assertions`/`org.junit.jupiter.api.Assumptions`\nwill help you avoid dependencies on old JUnit version.\n\n**Example:**\n\n\n import org.junit.Assert;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assert.assertEquals(4, 2 + 2);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assertions.assertEquals(4, 2 + 2);\n }\n }\n" + "text": "Reports 'list.remove(index)' calls inside an ascending counted loop. This is suspicious as the list becomes shorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable after the removal, but probably removing via an iterator or using the 'removeIf()' method (Java 8 and later) is a more robust alternative. If you don't expect that 'remove()' will be called more than once in a loop, consider adding a 'break' after it. Example: 'public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }' The code looks like '1 2 3 4' is going to be printed, but in reality, '3' will be skipped in the output. New in 2018.2", + "markdown": "Reports `list.remove(index)` calls inside an ascending counted loop.\n\n\nThis is suspicious as the list becomes\nshorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable\nafter the removal,\nbut probably removing via an iterator or using the `removeIf()` method (Java 8 and later) is a more robust alternative.\nIf you don't expect that `remove()` will be called more than once in a loop, consider adding a `break` after it.\n\n**Example:**\n\n public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }\n\nThe code looks like `1 2 3 4` is going to be printed, but in reality, `3` will be skipped in the output.\n\nNew in 2018.2" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "JUnit5AssertionsConverter", + "suppressToolId": "SuspiciousListRemoveInLoop", + "cweIds": [ + 129 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20368,8 +20371,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Test frameworks", - "index": 94, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -20381,22 +20384,19 @@ ] }, { - "id": "SuspiciousListRemoveInLoop", + "id": "JUnit5AssertionsConverter", "shortDescription": { - "text": "Suspicious 'List.remove()' in loop" + "text": "JUnit 5 obsolete assertions" }, "fullDescription": { - "text": "Reports 'list.remove(index)' calls inside an ascending counted loop. This is suspicious as the list becomes shorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable after the removal, but probably removing via an iterator or using the 'removeIf()' method (Java 8 and later) is a more robust alternative. If you don't expect that 'remove()' will be called more than once in a loop, consider adding a 'break' after it. Example: 'public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }' The code looks like '1 2 3 4' is going to be printed, but in reality, '3' will be skipped in the output. New in 2018.2", - "markdown": "Reports `list.remove(index)` calls inside an ascending counted loop.\n\n\nThis is suspicious as the list becomes\nshorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable\nafter the removal,\nbut probably removing via an iterator or using the `removeIf()` method (Java 8 and later) is a more robust alternative.\nIf you don't expect that `remove()` will be called more than once in a loop, consider adding a `break` after it.\n\n**Example:**\n\n public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }\n\nThe code looks like `1 2 3 4` is going to be printed, but in reality, `3` will be skipped in the output.\n\nNew in 2018.2" + "text": "Reports any calls to methods from the 'junit.framework.Assert', 'org.junit.Assert', or 'org.junit.Assume' classes inside JUnit 5 tests. Although the tests work properly, migration to 'org.junit.jupiter.api.Assertions'/'org.junit.jupiter.api.Assumptions' will help you avoid dependencies on old JUnit version. Example: 'import org.junit.Assert;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assert.assertEquals(4, 2 + 2);\n }\n }' After the quick-fix is applied: 'import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assertions.assertEquals(4, 2 + 2);\n }\n }'", + "markdown": "Reports any calls to methods from the `junit.framework.Assert`, `org.junit.Assert`, or `org.junit.Assume`\nclasses inside JUnit 5 tests.\n\nAlthough the tests work properly, migration to `org.junit.jupiter.api.Assertions`/`org.junit.jupiter.api.Assumptions`\nwill help you avoid dependencies on old JUnit version.\n\n**Example:**\n\n\n import org.junit.Assert;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assert.assertEquals(4, 2 + 2);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assertions.assertEquals(4, 2 + 2);\n }\n }\n" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SuspiciousListRemoveInLoop", - "cweIds": [ - 129 - ], + "suppressToolId": "JUnit5AssertionsConverter", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -20404,8 +20404,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "JVM languages/Test frameworks", + "index": 94, "toolComponent": { "name": "QDJVMC" } @@ -20438,7 +20438,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -20471,7 +20471,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -20516,19 +20516,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" } @@ -20536,8 +20536,8 @@ "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -20549,19 +20549,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" } @@ -20569,8 +20569,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Declaration redundancy", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -20603,7 +20603,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -20702,7 +20702,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -20801,7 +20801,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -20834,7 +20834,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -20900,7 +20900,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -21069,7 +21069,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -21081,22 +21081,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 only reports if the language level of the project or module is 8 or higher.", + "markdown": "Reports `Optional` expressions used as `if` or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read.\n\nExample:\n\n\n if (str.isPresent()) str.get().trim();\n\nAfter the quick-fix is applied:\n\n\n str.ifPresent(String::trim);\n\nThis inspection only reports if the language level of the project or module is 8 or higher." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "RedundantOperationOnEmptyContainer", - "cweIds": [ - 561 - ], + "suppressToolId": "OptionalIsPresent", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21104,8 +21101,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -21117,19 +21114,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 only reports if the language level of the project or module is 8 or higher.", - "markdown": "Reports `Optional` expressions used as `if` or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read.\n\nExample:\n\n\n if (str.isPresent()) str.get().trim();\n\nAfter the quick-fix is applied:\n\n\n str.ifPresent(String::trim);\n\nThis inspection only reports if the language level of the project or module is 8 or higher." + "text": "Reports redundant operations on empty collections, maps or arrays. Iterating, removing elements, sorting, and some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug. Example: 'if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }' New in 2019.1", + "markdown": "Reports redundant operations on empty collections, maps or arrays.\n\n\nIterating, removing elements, sorting,\nand some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug.\n\n**Example:**\n\n\n if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }\n\nNew in 2019.1" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "OptionalIsPresent", + "suppressToolId": "RedundantOperationOnEmptyContainer", + "cweIds": [ + 561 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21137,8 +21137,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -21150,19 +21150,19 @@ ] }, { - "id": "FieldNamingConvention", + "id": "AtomicFieldUpdaterNotStaticFinal", "shortDescription": { - "text": "Field naming convention" + "text": "'AtomicFieldUpdater' field not declared 'static final'" }, "fullDescription": { - "text": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant produces a warning because the length of its name is 3, which is less than 5: 'public static final int MAX = 42;'. A quick-fix that renames such fields is available only in the editor. Configure the inspection: Use the list in the Options section to specify which fields should be checked. Deselect the checkboxes for the fields for which you want to skip the check. For each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the provided input fields. Specify 0 in the length fields to skip the corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format.", - "markdown": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant\nproduces a warning because the length of its name is 3, which is less than 5: `public static final int MAX = 42;`.\n\nA quick-fix that renames such fields is available only in the editor.\n\nConfigure the inspection:\n\nUse the list in the **Options** section to specify which fields should be checked. Deselect the checkboxes for the fields for which\nyou want to skip the check.\n\nFor each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the\nprovided input fields.\nSpecify **0** in the length fields to skip the corresponding checks.\n\nRegular expressions should be specified in the standard\n`java.util.regex` format." + "text": "Reports fields of types: 'java.util.concurrent.atomic.AtomicLongFieldUpdater' 'java.util.concurrent.atomic.AtomicIntegerFieldUpdater' 'java.util.concurrent.atomic.AtomicReferenceFieldUpdater' that are not 'static final'. Because only one atomic field updater is needed for updating a 'volatile' field in all instances of a class, it can almost always be 'static'. Making the updater 'final' allows the JVM to optimize access for improved performance. Example: 'class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }' After the quick-fix is applied: 'class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }'", + "markdown": "Reports fields of types:\n\n* `java.util.concurrent.atomic.AtomicLongFieldUpdater`\n* `java.util.concurrent.atomic.AtomicIntegerFieldUpdater`\n* `java.util.concurrent.atomic.AtomicReferenceFieldUpdater`\n\nthat are not `static final`. Because only one atomic field updater is needed for updating a `volatile` field in all instances of a class, it can almost always be `static`.\n\nMaking the updater `final` allows the JVM to optimize access for improved performance.\n\n**Example:**\n\n\n class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "FieldNamingConvention", + "suppressToolId": "AtomicFieldUpdaterNotStaticFinal", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21170,8 +21170,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions", - "index": 51, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -21183,19 +21183,19 @@ ] }, { - "id": "AtomicFieldUpdaterNotStaticFinal", + "id": "FieldNamingConvention", "shortDescription": { - "text": "'AtomicFieldUpdater' field not declared 'static final'" + "text": "Field naming convention" }, "fullDescription": { - "text": "Reports fields of types: 'java.util.concurrent.atomic.AtomicLongFieldUpdater' 'java.util.concurrent.atomic.AtomicIntegerFieldUpdater' 'java.util.concurrent.atomic.AtomicReferenceFieldUpdater' that are not 'static final'. Because only one atomic field updater is needed for updating a 'volatile' field in all instances of a class, it can almost always be 'static'. Making the updater 'final' allows the JVM to optimize access for improved performance. Example: 'class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }' After the quick-fix is applied: 'class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }'", - "markdown": "Reports fields of types:\n\n* `java.util.concurrent.atomic.AtomicLongFieldUpdater`\n* `java.util.concurrent.atomic.AtomicIntegerFieldUpdater`\n* `java.util.concurrent.atomic.AtomicReferenceFieldUpdater`\n\nthat are not `static final`. Because only one atomic field updater is needed for updating a `volatile` field in all instances of a class, it can almost always be `static`.\n\nMaking the updater `final` allows the JVM to optimize access for improved performance.\n\n**Example:**\n\n\n class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n" + "text": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant produces a warning because the length of its name is 3, which is less than 5: 'public static final int MAX = 42;'. A quick-fix that renames such fields is available only in the editor. Configure the inspection: Use the list in the Options section to specify which fields should be checked. Deselect the checkboxes for the fields for which you want to skip the check. For each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the provided input fields. Specify 0 in the length fields to skip the corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format.", + "markdown": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant\nproduces a warning because the length of its name is 3, which is less than 5: `public static final int MAX = 42;`.\n\nA quick-fix that renames such fields is available only in the editor.\n\nConfigure the inspection:\n\nUse the list in the **Options** section to specify which fields should be checked. Deselect the checkboxes for the fields for which\nyou want to skip the check.\n\nFor each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the\nprovided input fields.\nSpecify **0** in the length fields to skip the corresponding checks.\n\nRegular expressions should be specified in the standard\n`java.util.regex` format." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "AtomicFieldUpdaterNotStaticFinal", + "suppressToolId": "FieldNamingConvention", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21203,8 +21203,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Naming conventions", + "index": 51, "toolComponent": { "name": "QDJVMC" } @@ -21249,19 +21249,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" } @@ -21269,8 +21269,8 @@ "relationships": [ { "target": { - "id": "Java/Naming conventions/Class", - "index": 71, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -21282,19 +21282,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" } @@ -21302,8 +21302,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Naming conventions/Class", + "index": 71, "toolComponent": { "name": "QDJVMC" } @@ -21336,7 +21336,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -21369,7 +21369,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -21381,19 +21381,19 @@ ] }, { - "id": "RecordStoreResource", + "id": "ClassWithTooManyDependents", "shortDescription": { - "text": "'RecordStore' opened but not safely closed" + "text": "Class with too many dependents" }, "fullDescription": { - "text": "Reports Java ME 'javax.microedition.rms.RecordStore' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }'", - "markdown": "Reports Java ME `javax.microedition.rms.RecordStore` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block.\n\nSuch resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }\n" + "text": "Reports a class on which too many other classes are directly dependent. Any modification to such a class may require changing many other classes, which may be expensive. Only top-level classes are reported. Use the field below to specify the maximum allowed number of dependents for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports a class on which too many other classes are directly dependent.\n\nAny modification to such a class may require changing many other classes, which may be expensive.\n\nOnly top-level classes are reported.\n\nUse the field below to specify the maximum allowed number of dependents for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "RecordStoreOpenedButNotSafelyClosed", + "suppressToolId": "ClassWithTooManyDependents", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21401,8 +21401,8 @@ "relationships": [ { "target": { - "id": "Java/Performance/Embedded", - "index": 21, + "id": "Java/Dependency issues", + "index": 89, "toolComponent": { "name": "QDJVMC" } @@ -21414,19 +21414,19 @@ ] }, { - "id": "ClassWithTooManyDependents", + "id": "RecordStoreResource", "shortDescription": { - "text": "Class with too many dependents" + "text": "'RecordStore' opened but not safely closed" }, "fullDescription": { - "text": "Reports a class on which too many other classes are directly dependent. Any modification to such a class may require changing many other classes, which may be expensive. Only top-level classes are reported. Use the field below to specify the maximum allowed number of dependents for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports a class on which too many other classes are directly dependent.\n\nAny modification to such a class may require changing many other classes, which may be expensive.\n\nOnly top-level classes are reported.\n\nUse the field below to specify the maximum allowed number of dependents for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports Java ME 'javax.microedition.rms.RecordStore' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }'", + "markdown": "Reports Java ME `javax.microedition.rms.RecordStore` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block.\n\nSuch resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassWithTooManyDependents", + "suppressToolId": "RecordStoreOpenedButNotSafelyClosed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21434,8 +21434,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 89, + "id": "Java/Performance/Embedded", + "index": 21, "toolComponent": { "name": "QDJVMC" } @@ -21468,7 +21468,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -21765,7 +21765,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -21867,7 +21867,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -21912,19 +21912,19 @@ ] }, { - "id": "SynchronizeOnValueBasedClass", + "id": "NestedConditionalExpression", "shortDescription": { - "text": "Value-based warnings" + "text": "Nested conditional expression" }, "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 nested conditional expressions as they may result in extremely confusing code. Example: 'int y = a == 10 ? b == 20 ? 10 : a : b;'", + "markdown": "Reports nested conditional expressions as they may result in extremely confusing code.\n\nExample:\n\n\n int y = a == 10 ? b == 20 ? 10 : a : b;\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "synchronization", + "suppressToolId": "NestedConditionalExpression", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21932,8 +21932,8 @@ "relationships": [ { "target": { - "id": "Java/Compiler issues", - "index": 90, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -21978,19 +21978,19 @@ ] }, { - "id": "NestedConditionalExpression", + "id": "SynchronizeOnValueBasedClass", "shortDescription": { - "text": "Nested conditional expression" + "text": "Value-based warnings" }, "fullDescription": { - "text": "Reports nested conditional expressions as they may result in extremely confusing code. Example: 'int y = a == 10 ? b == 20 ? 10 : a : b;'", - "markdown": "Reports nested conditional expressions as they may result in extremely confusing code.\n\nExample:\n\n\n int y = a == 10 ? b == 20 ? 10 : a : b;\n" + "text": "Reports attempts to synchronize on an instance of a value-based class that produce compile-time warnings and raise run-time exceptions starting from Java 16. For example, 'java.lang.Double' is annotated with 'jdk.internal.ValueBased', so the following code will produce a compile-time warning: 'Double d = 20.0;\nsynchronized (d) { ... } // javac warning' New in 2021.1", + "markdown": "Reports attempts to synchronize on an instance of a value-based class that produce compile-time warnings and raise run-time exceptions starting from Java 16.\n\n\nFor example, `java.lang.Double` is annotated with `jdk.internal.ValueBased`, so the following code will\nproduce a compile-time warning:\n\n\n Double d = 20.0;\n synchronized (d) { ... } // javac warning\n\nNew in 2021.1" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "NestedConditionalExpression", + "suppressToolId": "synchronization", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -21998,8 +21998,8 @@ "relationships": [ { "target": { - "id": "Java/Control flow issues", - "index": 26, + "id": "Java/Compiler issues", + "index": 90, "toolComponent": { "name": "QDJVMC" } @@ -22032,7 +22032,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -22044,19 +22044,19 @@ ] }, { - "id": "WhileCanBeForeach", + "id": "BulkFileAttributesRead", "shortDescription": { - "text": "'while' loop can be replaced with enhanced 'for' loop" + "text": "Bulk 'Files.readAttributes()' call can be used" }, "fullDescription": { - "text": "Reports 'while' loops that iterate over collections and can be replaced with enhanced 'for' loops (foreach iteration syntax). Example: 'Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }' Can be replaced with: 'for (Object obj : c) {\n System.out.println(obj);\n }' This inspection only reports if the language level of the project or module is 5 or higher.", - "markdown": "Reports `while` loops that iterate over collections and can be replaced with enhanced `for` loops (foreach iteration syntax).\n\n**Example:**\n\n\n Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }\n\nCan be replaced with:\n\n\n for (Object obj : c) {\n System.out.println(obj);\n }\n\nThis inspection only reports if the language level of the project or module is 5 or higher." + "text": "Reports multiple sequential 'java.io.File' attribute checks, such as: 'isDirectory()' 'isFile()' 'lastModified()' 'length()' Such calls can be replaced with a bulk 'Files.readAttributes()' call. This is usually more performant than multiple separate attribute checks. Example: 'boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }' After the quick-fix is applied: 'boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }' This inspection does not show a warning if 'IOException' is not handled in the current context, but the quick-fix is still available. Note that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if the file does not exist at all. This inspection only reports if the language level of the project or module is 7 or higher. New in 2022.1", + "markdown": "Reports multiple sequential `java.io.File` attribute checks, such as:\n\n* `isDirectory()`\n* `isFile()`\n* `lastModified()`\n* `length()`\n\nSuch calls can be replaced with a bulk `Files.readAttributes()` call. This is usually more performant than multiple separate attribute checks.\n\nExample:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }\n\nThis inspection does not show a warning if `IOException` is not handled in the current context, but the quick-fix is still available.\n\nNote that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if\nthe file does not exist at all.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nNew in 2022.1" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "WhileLoopReplaceableByForEach", + "suppressToolId": "BulkFileAttributesRead", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22064,8 +22064,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 5", - "index": 53, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -22077,19 +22077,19 @@ ] }, { - "id": "BulkFileAttributesRead", + "id": "WhileCanBeForeach", "shortDescription": { - "text": "Bulk 'Files.readAttributes()' call can be used" + "text": "'while' loop can be replaced with enhanced 'for' loop" }, "fullDescription": { - "text": "Reports multiple sequential 'java.io.File' attribute checks, such as: 'isDirectory()' 'isFile()' 'lastModified()' 'length()' Such calls can be replaced with a bulk 'Files.readAttributes()' call. This is usually more performant than multiple separate attribute checks. Example: 'boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }' After the quick-fix is applied: 'boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }' This inspection does not show a warning if 'IOException' is not handled in the current context, but the quick-fix is still available. Note that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if the file does not exist at all. This inspection only reports if the language level of the project or module is 7 or higher. New in 2022.1", - "markdown": "Reports multiple sequential `java.io.File` attribute checks, such as:\n\n* `isDirectory()`\n* `isFile()`\n* `lastModified()`\n* `length()`\n\nSuch calls can be replaced with a bulk `Files.readAttributes()` call. This is usually more performant than multiple separate attribute checks.\n\nExample:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }\n\nThis inspection does not show a warning if `IOException` is not handled in the current context, but the quick-fix is still available.\n\nNote that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if\nthe file does not exist at all.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nNew in 2022.1" + "text": "Reports 'while' loops that iterate over collections and can be replaced with enhanced 'for' loops (foreach iteration syntax). Example: 'Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }' Can be replaced with: 'for (Object obj : c) {\n System.out.println(obj);\n }' This inspection only reports if the language level of the project or module is 5 or higher.", + "markdown": "Reports `while` loops that iterate over collections and can be replaced with enhanced `for` loops (foreach iteration syntax).\n\n**Example:**\n\n\n Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }\n\nCan be replaced with:\n\n\n for (Object obj : c) {\n System.out.println(obj);\n }\n\nThis inspection only reports if the language level of the project or module is 5 or higher." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "BulkFileAttributesRead", + "suppressToolId": "WhileLoopReplaceableByForEach", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22097,8 +22097,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Java language level migration aids/Java 5", + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -22167,7 +22167,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -22200,7 +22200,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -22365,7 +22365,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -22464,7 +22464,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -22497,7 +22497,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -22509,19 +22509,19 @@ ] }, { - "id": "HardcodedLineSeparators", + "id": "UnnecessaryConstantArrayCreationExpression", "shortDescription": { - "text": "Hardcoded line separator" + "text": "Redundant 'new' expression in constant array creation" }, "fullDescription": { - "text": "Reports linefeed ('\\n') and carriage return ('\\r') character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded. Example: 'String count = \"first\\nsecond\\rthird\";'", - "markdown": "Reports linefeed (`\\n`) and carriage return (`\\r`) character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded.\n\n**Example:**\n\n\n String count = \"first\\nsecond\\rthird\";\n" + "text": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment. Example: 'int[] foo = new int[] {42};' After the quick-fix is applied: 'int[] foo = {42};'", + "markdown": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment.\n\n**Example:**\n\n\n int[] foo = new int[] {42};\n\nAfter the quick-fix is applied:\n\n\n int[] foo = {42};\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "HardcodedLineSeparator", + "suppressToolId": "UnnecessaryConstantArrayCreationExpression", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22529,8 +22529,8 @@ "relationships": [ { "target": { - "id": "Java/Portability", - "index": 7, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -22542,19 +22542,19 @@ ] }, { - "id": "UnnecessaryConstantArrayCreationExpression", + "id": "HardcodedLineSeparators", "shortDescription": { - "text": "Redundant 'new' expression in constant array creation" + "text": "Hardcoded line separator" }, "fullDescription": { - "text": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment. Example: 'int[] foo = new int[] {42};' After the quick-fix is applied: 'int[] foo = {42};'", - "markdown": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment.\n\n**Example:**\n\n\n int[] foo = new int[] {42};\n\nAfter the quick-fix is applied:\n\n\n int[] foo = {42};\n" + "text": "Reports linefeed ('\\n') and carriage return ('\\r') character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded. Example: 'String count = \"first\\nsecond\\rthird\";'", + "markdown": "Reports linefeed (`\\n`) and carriage return (`\\r`) character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded.\n\n**Example:**\n\n\n String count = \"first\\nsecond\\rthird\";\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryConstantArrayCreationExpression", + "suppressToolId": "HardcodedLineSeparator", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22562,8 +22562,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Portability", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -22596,7 +22596,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -22833,7 +22833,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -22878,19 +22878,19 @@ ] }, { - "id": "InterfaceMethodClashesWithObject", + "id": "SimplifiableAssertion", "shortDescription": { - "text": "Interface method clashes with method in 'Object'" + "text": "Simplifiable assertion" }, "fullDescription": { - "text": "Reports interface methods that clash with the protected methods 'clone()' and 'finalize()' from the 'java.lang.Object' class. In an interface, it is possible to declare these methods with a return type that is incompatible with the 'java.lang.Object' methods. A class that implements such an interface will not be compilable. When the interface is functional, it remains possible to create a lambda from it, but this is not recommended. Example: '// Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }'", - "markdown": "Reports interface methods that clash with the **protected** methods `clone()` and `finalize()` from the `java.lang.Object` class.\n\nIn an interface, it is possible to declare these methods with a return type that is incompatible with the `java.lang.Object` methods.\nA class that implements such an interface will not be compilable.\nWhen the interface is functional, it remains possible to create a lambda from it, but this is not recommended.\n\nExample:\n\n\n // Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }\n" + "text": "Reports any 'assert' calls that can be replaced with simpler and equivalent calls. Example → Replacement 'assertEquals(true, x());' 'assertTrue(x());' 'assertTrue(y() != null);' 'assertNotNull(y());' 'assertTrue(z == z());' 'assertSame(z, z());' 'assertTrue(a.equals(a()));' 'assertEquals(a, a());' 'assertTrue(false);' 'fail();'", + "markdown": "Reports any `assert` calls that can be replaced with simpler and equivalent calls.\n\n| Example | → | Replacement |\n|----------------------------------|---|-------------------------|\n| `assertEquals(`**true**`, x());` | | `assertTrue(x());` |\n| `assertTrue(y() != null);` | | `assertNotNull(y());` |\n| `assertTrue(z == z());` | | `assertSame(z, z());` |\n| `assertTrue(a.equals(a()));` | | `assertEquals(a, a());` |\n| `assertTrue(`**false**`);` | | `fail();` |" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "InterfaceMethodClashesWithObject", + "suppressToolId": "SimplifiableAssertion", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -22898,8 +22898,8 @@ "relationships": [ { "target": { - "id": "Java/Abstraction issues", - "index": 78, + "id": "Java/Test frameworks", + "index": 96, "toolComponent": { "name": "QDJVMC" } @@ -22911,19 +22911,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" } @@ -22931,8 +22931,8 @@ "relationships": [ { "target": { - "id": "Java/Test frameworks", - "index": 96, + "id": "Java/Abstraction issues", + "index": 78, "toolComponent": { "name": "QDJVMC" } @@ -23202,7 +23202,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -23247,22 +23247,19 @@ ] }, { - "id": "ComparatorMethodParameterNotUsed", + "id": "UseOfSunClasses", "shortDescription": { - "text": "Suspicious 'Comparator.compare()' implementation" + "text": "Use of 'sun.*' classes" }, "fullDescription": { - "text": "Reports problems in 'Comparator.compare()' and 'Comparable.compareTo()' implementations. The following cases are reported: A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly. It's evident that the method does not return '0' for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data. The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order. The comparison method returns 'Integer.MIN_VALUE'. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of 'Integer.MIN_VALUE' is 'Integer.MIN_VALUE'. Example: 'Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;'", - "markdown": "Reports problems in `Comparator.compare()` and `Comparable.compareTo()` implementations.\n\nThe following cases are reported:\n\n* A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly.\n* It's evident that the method does not return `0` for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data.\n* The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order.\n* The comparison method returns `Integer.MIN_VALUE`. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of `Integer.MIN_VALUE` is `Integer.MIN_VALUE`.\n\n**Example:**\n\n\n Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;\n" + "text": "Reports uses of classes from the 'sun.*' hierarchy. Such classes are non-portable between different JVMs.", + "markdown": "Reports uses of classes from the `sun.*` hierarchy. Such classes are non-portable between different JVMs." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ComparatorMethodParameterNotUsed", - "cweIds": [ - 628 - ], + "suppressToolId": "UseOfSunClasses", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23270,8 +23267,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Portability", + "index": 7, "toolComponent": { "name": "QDJVMC" } @@ -23283,19 +23280,22 @@ ] }, { - "id": "UseOfSunClasses", + "id": "ComparatorMethodParameterNotUsed", "shortDescription": { - "text": "Use of 'sun.*' classes" + "text": "Suspicious 'Comparator.compare()' implementation" }, "fullDescription": { - "text": "Reports uses of classes from the 'sun.*' hierarchy. Such classes are non-portable between different JVMs.", - "markdown": "Reports uses of classes from the `sun.*` hierarchy. Such classes are non-portable between different JVMs." + "text": "Reports problems in 'Comparator.compare()' and 'Comparable.compareTo()' implementations. The following cases are reported: A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly. It's evident that the method does not return '0' for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data. The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order. The comparison method returns 'Integer.MIN_VALUE'. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of 'Integer.MIN_VALUE' is 'Integer.MIN_VALUE'. Example: 'Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;'", + "markdown": "Reports problems in `Comparator.compare()` and `Comparable.compareTo()` implementations.\n\nThe following cases are reported:\n\n* A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly.\n* It's evident that the method does not return `0` for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data.\n* The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order.\n* The comparison method returns `Integer.MIN_VALUE`. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of `Integer.MIN_VALUE` is `Integer.MIN_VALUE`.\n\n**Example:**\n\n\n Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "UseOfSunClasses", + "suppressToolId": "ComparatorMethodParameterNotUsed", + "cweIds": [ + 628 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23303,8 +23303,8 @@ "relationships": [ { "target": { - "id": "Java/Portability", - "index": 7, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -23370,7 +23370,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -23382,19 +23382,19 @@ ] }, { - "id": "SimplifyCollector", + "id": "Annotation", "shortDescription": { - "text": "Simplifiable collector" + "text": "Annotation" }, "fullDescription": { - "text": "Reports collectors that can be simplified. In particular, some cascaded 'groupingBy()' collectors can be expressed by using a simpler 'toMap()' collector, which is also likely to be more performant. Example: 'Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));' After the quick-fix is applied: 'Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));' This inspection only reports if the language level of the project or module is 8 or higher. New in 2017.1", - "markdown": "Reports collectors that can be simplified.\n\nIn particular, some cascaded `groupingBy()` collectors can be expressed by using a\nsimpler `toMap()` collector, which is also likely to be more performant.\n\nExample:\n\n\n Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));\n\nAfter the quick-fix is applied:\n\n\n Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nNew in 2017.1" + "text": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM.", + "markdown": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SimplifyCollector", + "suppressToolId": "Annotation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23402,8 +23402,8 @@ "relationships": [ { "target": { - "id": "Java/Verbose or redundant code constructs", - "index": 37, + "id": "Java/Java language level issues", + "index": 64, "toolComponent": { "name": "QDJVMC" } @@ -23415,19 +23415,19 @@ ] }, { - "id": "Annotation", + "id": "SimplifyCollector", "shortDescription": { - "text": "Annotation" + "text": "Simplifiable collector" }, "fullDescription": { - "text": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM.", - "markdown": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM." + "text": "Reports collectors that can be simplified. In particular, some cascaded 'groupingBy()' collectors can be expressed by using a simpler 'toMap()' collector, which is also likely to be more performant. Example: 'Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));' After the quick-fix is applied: 'Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));' This inspection only reports if the language level of the project or module is 8 or higher. New in 2017.1", + "markdown": "Reports collectors that can be simplified.\n\nIn particular, some cascaded `groupingBy()` collectors can be expressed by using a\nsimpler `toMap()` collector, which is also likely to be more performant.\n\nExample:\n\n\n Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));\n\nAfter the quick-fix is applied:\n\n\n Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nNew in 2017.1" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "Annotation", + "suppressToolId": "SimplifyCollector", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23435,8 +23435,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level issues", - "index": 64, + "id": "Java/Verbose or redundant code constructs", + "index": 37, "toolComponent": { "name": "QDJVMC" } @@ -23469,7 +23469,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -23514,19 +23514,19 @@ ] }, { - "id": "UnnecessaryUnicodeEscape", + "id": "StringTokenizer", "shortDescription": { - "text": "Unnecessary unicode escape sequence" + "text": "Use of 'StringTokenizer'" }, "fullDescription": { - "text": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab). Example: 'String s = \"\\u0062\";'", - "markdown": "Reports unnecessary unicode escape sequences. For example, when the file encoding can handle the character without escaping it. Unicode control characters are not reported by this inspection (except for a line feed and a tab).\n\n**Example:**\n\n String s = \"\\u0062\";\n" + "text": "Reports usages of the 'StringTokenizer' class. Excessive use of 'StringTokenizer' is incorrect in an internationalized environment.", + "markdown": "Reports usages of the `StringTokenizer` class. Excessive use of `StringTokenizer` is incorrect in an internationalized environment." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryUnicodeEscape", + "suppressToolId": "UseOfStringTokenizer", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -23547,19 +23547,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" } @@ -23716,19 +23716,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" } @@ -23736,8 +23736,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 27, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -23749,19 +23749,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" } @@ -23769,8 +23769,8 @@ "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -23902,7 +23902,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -23935,7 +23935,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -23968,7 +23968,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -24034,7 +24034,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -24067,7 +24067,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -24133,7 +24133,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -24166,7 +24166,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -24463,7 +24463,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -24706,19 +24706,19 @@ ] }, { - "id": "UnnecessaryToStringCall", + "id": "SuppressionAnnotation", "shortDescription": { - "text": "Unnecessary call to 'toString()'" + "text": "Inspection suppression annotation" }, "fullDescription": { - "text": "Reports calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null.", - "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods, and the explicit call to `toString()` is not needed.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null." + "text": "Reports comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }'", + "markdown": "Reports comments or annotations suppressing inspections.\n\nThis inspection can be useful when leaving suppressions intentionally for further review.\n\n**Example:**\n\n\n @SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryToStringCall", + "suppressToolId": "SuppressionAnnotation", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24726,8 +24726,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Code maturity", + "index": 50, "toolComponent": { "name": "QDJVMC" } @@ -24739,19 +24739,19 @@ ] }, { - "id": "SuppressionAnnotation", + "id": "ClassOnlyUsedInOnePackage", "shortDescription": { - "text": "Inspection suppression annotation" + "text": "Class only used from one other package" }, "fullDescription": { - "text": "Reports comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }'", - "markdown": "Reports comments or annotations suppressing inspections.\n\nThis inspection can be useful when leaving suppressions intentionally for further review.\n\n**Example:**\n\n\n @SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }\n" + "text": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SuppressionAnnotation", + "suppressToolId": "ClassOnlyUsedInOnePackage", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24759,8 +24759,8 @@ "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 50, + "id": "Java/Packaging issues", + "index": 36, "toolComponent": { "name": "QDJVMC" } @@ -24772,19 +24772,19 @@ ] }, { - "id": "ClassOnlyUsedInOnePackage", + "id": "UnnecessaryToStringCall", "shortDescription": { - "text": "Class only used from one other package" + "text": "Unnecessary call to 'toString()'" }, "fullDescription": { - "text": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null.", + "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods, and the explicit call to `toString()` is not needed.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassOnlyUsedInOnePackage", + "suppressToolId": "UnnecessaryToStringCall", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24792,8 +24792,8 @@ "relationships": [ { "target": { - "id": "Java/Packaging issues", - "index": 36, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -24871,28 +24871,28 @@ ] }, { - "id": "SynchronizeOnNonFinalField", + "id": "ReturnSeparatedFromComputation", "shortDescription": { - "text": "Synchronization on a non-final field" + "text": "'return' separated from the result computation" }, "fullDescription": { - "text": "Reports 'synchronized' statement lock expressions that consist of a non-'final' field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object. Example: 'private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }'", - "markdown": "Reports `synchronized` statement lock expressions that consist of a non-`final` field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object.\n\n**Example:**\n\n\n private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }\n" + "text": "Reports 'return' statements that return a local variable where the value of the variable is computed somewhere else within the same method. The quick-fix inlines the returned variable by moving the return statement to the location in which the value of the variable is computed. When the returned value can't be inlined into the 'return' statement, the quick-fix attempts to move the return statement as close to the computation of the returned value as possible. Example: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;' After the quick-fix is applied: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;'", + "markdown": "Reports `return` statements that return a local variable where the value of the variable is computed somewhere else within the same method.\n\nThe quick-fix inlines the returned variable by moving the return statement to the location in which the value\nof the variable is computed.\nWhen the returned value can't be inlined into the `return` statement,\nthe quick-fix attempts to move the return statement as close to the computation of the returned value as possible.\n\nExample:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;\n\nAfter the quick-fix is applied:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;\n" }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "SynchronizeOnNonFinalField", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ReturnSeparatedFromComputation", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Threading issues", - "index": 8, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -24904,19 +24904,19 @@ ] }, { - "id": "CastThatLosesPrecision", + "id": "SynchronizeOnNonFinalField", "shortDescription": { - "text": "Numeric cast that loses precision" + "text": "Synchronization on a non-final field" }, "fullDescription": { - "text": "Reports cast operations between primitive numeric types that may result in precision loss. Such casts are not necessarily a problem but may result in difficult to trace bugs if the loss of precision is unexpected. Example: 'int a = 420;\n byte b = (byte) a;' Use the Ignore casts from int to char option to ignore casts from 'int' to 'char'. This type of cast is often used when implementing I/O operations because the 'read()' method of the 'java.io.Reader' class returns an 'int'. Use the Ignore casts from int 128-255 to byte option to ignore casts of constant values (128-255) from 'int' to 'byte'. Such values will overflow to negative numbers that still fit inside a byte.", - "markdown": "Reports cast operations between primitive numeric types that may result in precision loss.\n\nSuch casts are not necessarily a problem but may result in difficult to\ntrace bugs if the loss of precision is unexpected.\n\n**Example:**\n\n\n int a = 420;\n byte b = (byte) a;\n\nUse the **Ignore casts from int to char** option to ignore casts from `int` to `char`.\nThis type of cast is often used when implementing I/O operations because the `read()` method of the\n`java.io.Reader` class returns an `int`.\n\nUse the **Ignore casts from int 128-255 to byte** option to ignore casts of constant values (128-255) from `int` to\n`byte`.\nSuch values will overflow to negative numbers that still fit inside a byte." + "text": "Reports 'synchronized' statement lock expressions that consist of a non-'final' field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object. Example: 'private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }'", + "markdown": "Reports `synchronized` statement lock expressions that consist of a non-`final` field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object.\n\n**Example:**\n\n\n private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "NumericCastThatLosesPrecision", + "suppressToolId": "SynchronizeOnNonFinalField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -24924,8 +24924,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues/Cast", - "index": 102, + "id": "Java/Threading issues", + "index": 8, "toolComponent": { "name": "QDJVMC" } @@ -24937,28 +24937,28 @@ ] }, { - "id": "ReturnSeparatedFromComputation", + "id": "CastThatLosesPrecision", "shortDescription": { - "text": "'return' separated from the result computation" + "text": "Numeric cast that loses precision" }, "fullDescription": { - "text": "Reports 'return' statements that return a local variable where the value of the variable is computed somewhere else within the same method. The quick-fix inlines the returned variable by moving the return statement to the location in which the value of the variable is computed. When the returned value can't be inlined into the 'return' statement, the quick-fix attempts to move the return statement as close to the computation of the returned value as possible. Example: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;' After the quick-fix is applied: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;'", - "markdown": "Reports `return` statements that return a local variable where the value of the variable is computed somewhere else within the same method.\n\nThe quick-fix inlines the returned variable by moving the return statement to the location in which the value\nof the variable is computed.\nWhen the returned value can't be inlined into the `return` statement,\nthe quick-fix attempts to move the return statement as close to the computation of the returned value as possible.\n\nExample:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;\n\nAfter the quick-fix is applied:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;\n" + "text": "Reports cast operations between primitive numeric types that may result in precision loss. Such casts are not necessarily a problem but may result in difficult to trace bugs if the loss of precision is unexpected. Example: 'int a = 420;\n byte b = (byte) a;' Use the Ignore casts from int to char option to ignore casts from 'int' to 'char'. This type of cast is often used when implementing I/O operations because the 'read()' method of the 'java.io.Reader' class returns an 'int'. Use the Ignore casts from int 128-255 to byte option to ignore casts of constant values (128-255) from 'int' to 'byte'. Such values will overflow to negative numbers that still fit inside a byte.", + "markdown": "Reports cast operations between primitive numeric types that may result in precision loss.\n\nSuch casts are not necessarily a problem but may result in difficult to\ntrace bugs if the loss of precision is unexpected.\n\n**Example:**\n\n\n int a = 420;\n byte b = (byte) a;\n\nUse the **Ignore casts from int to char** option to ignore casts from `int` to `char`.\nThis type of cast is often used when implementing I/O operations because the `read()` method of the\n`java.io.Reader` class returns an `int`.\n\nUse the **Ignore casts from int 128-255 to byte** option to ignore casts of constant values (128-255) from `int` to\n`byte`.\nSuch values will overflow to negative numbers that still fit inside a byte." }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "ReturnSeparatedFromComputation", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "NumericCastThatLosesPrecision", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Numeric issues/Cast", + "index": 102, "toolComponent": { "name": "QDJVMC" } @@ -24991,7 +24991,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -25171,19 +25171,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 reports only if the language level of the project or module is 8 or higher.", + "markdown": "Reports common usage patterns of `java.util.Map` and suggests replacing them with: `getOrDefault()`, `computeIfAbsent()`, `putIfAbsent()`, `merge()`, or `replaceAll()`.\n\nExample:\n\n\n map.containsKey(key) ? map.get(key) : \"default\";\n\nAfter the quick-fix is applied:\n\n\n map.getOrDefault(key, \"default\");\n\nExample:\n\n\n List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }\n\nAfter the quick-fix is applied:\n\n\n map.computeIfAbsent(key, localKey -> new ArrayList<>());\n\nExample:\n\n\n Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);\n\nAfter the quick-fix is applied:\n\n\n map.merge(key, 1, (localKey, localValue) -> localValue + 1);\n\nExample:\n\n\n for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }\n\nAfter the quick-fix is applied:\n\n\n map.replaceAll((localKey, localValue) -> transform(localValue));\n\nNote that the replacement with `computeIfAbsent()` or `merge()` might work incorrectly for some `Map`\nimplementations if the code extracted to the lambda expression modifies the same `Map`. By default,\nthe warning doesn't appear if this code might have side effects. If necessary, enable the\n**Suggest replacement even if lambda may have side effects** option to always show the warning.\n\nAlso, due to different handling of the `null` value in old methods like `put()` and newer methods like\n`computeIfAbsent()` or `merge()`, semantics might change if storing the `null` value into given\n`Map` is important. The inspection won't suggest the replacement when the value is statically known to be nullable,\nbut for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning\nand adding an explanatory comment.\n\nThis inspection reports only if the language level of the project or module is 8 or higher." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "TestOnlyProblems", + "suppressToolId": "Java8MapApi", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25191,8 +25191,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Test frameworks", - "index": 94, + "id": "Java/Java language level migration aids/Java 8", + "index": 62, "toolComponent": { "name": "QDJVMC" } @@ -25204,19 +25204,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 reports only if the language level of the project or module is 8 or higher.", - "markdown": "Reports common usage patterns of `java.util.Map` and suggests replacing them with: `getOrDefault()`, `computeIfAbsent()`, `putIfAbsent()`, `merge()`, or `replaceAll()`.\n\nExample:\n\n\n map.containsKey(key) ? map.get(key) : \"default\";\n\nAfter the quick-fix is applied:\n\n\n map.getOrDefault(key, \"default\");\n\nExample:\n\n\n List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }\n\nAfter the quick-fix is applied:\n\n\n map.computeIfAbsent(key, localKey -> new ArrayList<>());\n\nExample:\n\n\n Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);\n\nAfter the quick-fix is applied:\n\n\n map.merge(key, 1, (localKey, localValue) -> localValue + 1);\n\nExample:\n\n\n for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }\n\nAfter the quick-fix is applied:\n\n\n map.replaceAll((localKey, localValue) -> transform(localValue));\n\nNote that the replacement with `computeIfAbsent()` or `merge()` might work incorrectly for some `Map`\nimplementations if the code extracted to the lambda expression modifies the same `Map`. By default,\nthe warning doesn't appear if this code might have side effects. If necessary, enable the\n**Suggest replacement even if lambda may have side effects** option to always show the warning.\n\nAlso, due to different handling of the `null` value in old methods like `put()` and newer methods like\n`computeIfAbsent()` or `merge()`, semantics might change if storing the `null` value into given\n`Map` is important. The inspection won't suggest the replacement when the value is statically known to be nullable,\nbut for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning\nand adding an explanatory comment.\n\nThis inspection reports only if the language level of the project or module is 8 or higher." + "text": "Reports '@TestOnly'- and '@VisibleForTesting'-annotated methods and classes that are used in production code. Also reports usage of applying '@TestOnly' '@VisibleForTesting' to the same element. The problems are not reported if such method or class is referenced from: Code under the Test Sources folder A test class (JUnit/TestNG) Another '@TestOnly'-annotated method Example (in production code): '@TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }'", + "markdown": "Reports `@TestOnly`- and `@VisibleForTesting`-annotated methods and classes that are used in production code. Also reports usage of applying `@TestOnly` `@VisibleForTesting` to the same element.\n\nThe problems are not reported if such method or class is referenced from:\n\n* Code under the **Test Sources** folder\n* A test class (JUnit/TestNG)\n* Another `@TestOnly`-annotated method\n\n**Example (in production code):**\n\n\n @TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "Java8MapApi", + "suppressToolId": "TestOnlyProblems", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25224,8 +25224,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 8", - "index": 62, + "id": "JVM languages/Test frameworks", + "index": 94, "toolComponent": { "name": "QDJVMC" } @@ -25237,19 +25237,19 @@ ] }, { - "id": "MeaninglessRecordAnnotationInspection", + "id": "JUnit5Converter", "shortDescription": { - "text": "Meaningless record annotation" + "text": "JUnit 4 test can be JUnit 5" }, "fullDescription": { - "text": "Reports annotations used on record components that have no effect. This can happen in two cases: The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined. The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined. Example: '@Target(ElementType.METHOD)\n@interface A { }\n \n// The annotation will not appear in bytecode at all,\n// as it should be propagated to the accessor but accessor is explicitly defined \nrecord R(@A int x) {\n public int x() { return x; }\n}' New in 2021.1", - "markdown": "Reports annotations used on record components that have no effect.\n\nThis can happen in two cases:\n\n* The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined.\n* The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined.\n\nExample:\n\n\n @Target(ElementType.METHOD)\n @interface A { }\n \n // The annotation will not appear in bytecode at all,\n // as it should be propagated to the accessor but accessor is explicitly defined \n record R(@A int x) {\n public int x() { return x; }\n }\n\nNew in 2021.1" + "text": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes. Example: 'import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }' After the quick-fix is applied: 'import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }' This inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project.", + "markdown": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes.\n\n**Example:**\n\n\n import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }\n\nThis inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MeaninglessRecordAnnotationInspection", + "suppressToolId": "JUnit5Converter", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25257,8 +25257,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "JVM languages/Test frameworks", + "index": 94, "toolComponent": { "name": "QDJVMC" } @@ -25270,19 +25270,19 @@ ] }, { - "id": "JUnit5Converter", + "id": "MeaninglessRecordAnnotationInspection", "shortDescription": { - "text": "JUnit 4 test can be JUnit 5" + "text": "Meaningless record annotation" }, "fullDescription": { - "text": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes. Example: 'import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }' After the quick-fix is applied: 'import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }' This inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project.", - "markdown": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes.\n\n**Example:**\n\n\n import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }\n\nThis inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project." + "text": "Reports annotations used on record components that have no effect. This can happen in two cases: The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined. The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined. Example: '@Target(ElementType.METHOD)\n@interface A { }\n \n// The annotation will not appear in bytecode at all,\n// as it should be propagated to the accessor but accessor is explicitly defined \nrecord R(@A int x) {\n public int x() { return x; }\n}' New in 2021.1", + "markdown": "Reports annotations used on record components that have no effect.\n\nThis can happen in two cases:\n\n* The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined.\n* The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined.\n\nExample:\n\n\n @Target(ElementType.METHOD)\n @interface A { }\n \n // The annotation will not appear in bytecode at all,\n // as it should be propagated to the accessor but accessor is explicitly defined \n record R(@A int x) {\n public int x() { return x; }\n }\n\nNew in 2021.1" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "JUnit5Converter", + "suppressToolId": "MeaninglessRecordAnnotationInspection", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25290,8 +25290,8 @@ "relationships": [ { "target": { - "id": "JVM languages/Test frameworks", - "index": 94, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -25360,7 +25360,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -25462,7 +25462,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -25507,19 +25507,22 @@ ] }, { - "id": "SuspiciousDateFormat", + "id": "MagicConstant", "shortDescription": { - "text": "Suspicious date format pattern" + "text": "Magic constant" }, "fullDescription": { - "text": "Reports date format patterns that are likely used by mistake. The following patterns are reported: Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December. Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended. Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended. Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended. Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended. Examples: 'new SimpleDateFormat(\"YYYY-MM-dd\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"yyyy-MM-DD\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"HH:MM\")': likely '\"HH:mm\"' was intended. New in 2020.1", - "markdown": "Reports date format patterns that are likely used by mistake.\n\nThe following patterns are reported:\n\n* Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December.\n* Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended.\n* Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended.\n* Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended.\n* Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended.\n\n\nExamples: \n\n`new SimpleDateFormat(\"YYYY-MM-dd\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"yyyy-MM-DD\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"HH:MM\")`: likely `\"HH:mm\"` was intended.\n\nNew in 2020.1" + "text": "Reports expressions that can be replaced with \"magic\" constants. Example 1: '// Bare literal \"2\" is used, warning:\n Font font = new Font(\"Arial\", 2)' Example 2: '// Predefined constant is used, good:\n Font font = new Font(\"Arial\", Font.ITALIC)' When possible, the quick-fix inserts an appropriate predefined constant. The behavior of this inspection is controlled by 'org.intellij.lang.annotations.MagicConstant' annotation. Some standard Java library methods are pre-annotated, but you can use this annotation in your code as well.", + "markdown": "Reports expressions that can be replaced with \"magic\" constants.\n\nExample 1:\n\n\n // Bare literal \"2\" is used, warning:\n Font font = new Font(\"Arial\", 2)\n\nExample 2:\n\n\n // Predefined constant is used, good:\n Font font = new Font(\"Arial\", Font.ITALIC)\n\n\nWhen possible, the quick-fix inserts an appropriate predefined constant.\n\n\nThe behavior of this inspection is controlled by `org.intellij.lang.annotations.MagicConstant` annotation.\nSome standard Java library methods are pre-annotated, but you can use this annotation in your code as well." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SuspiciousDateFormat", + "suppressToolId": "MagicConstant", + "cweIds": [ + 489 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25540,22 +25543,19 @@ ] }, { - "id": "MagicConstant", + "id": "ClassNewInstance", "shortDescription": { - "text": "Magic constant" + "text": "Unsafe call to 'Class.newInstance()'" }, "fullDescription": { - "text": "Reports expressions that can be replaced with \"magic\" constants. Example 1: '// Bare literal \"2\" is used, warning:\n Font font = new Font(\"Arial\", 2)' Example 2: '// Predefined constant is used, good:\n Font font = new Font(\"Arial\", Font.ITALIC)' When possible, the quick-fix inserts an appropriate predefined constant. The behavior of this inspection is controlled by 'org.intellij.lang.annotations.MagicConstant' annotation. Some standard Java library methods are pre-annotated, but you can use this annotation in your code as well.", - "markdown": "Reports expressions that can be replaced with \"magic\" constants.\n\nExample 1:\n\n\n // Bare literal \"2\" is used, warning:\n Font font = new Font(\"Arial\", 2)\n\nExample 2:\n\n\n // Predefined constant is used, good:\n Font font = new Font(\"Arial\", Font.ITALIC)\n\n\nWhen possible, the quick-fix inserts an appropriate predefined constant.\n\n\nThe behavior of this inspection is controlled by `org.intellij.lang.annotations.MagicConstant` annotation.\nSome standard Java library methods are pre-annotated, but you can use this annotation in your code as well." + "text": "Reports calls to 'java.lang.Class.newInstance()'. This method propagates exceptions thrown by the no-arguments constructor, including checked exceptions. Usages of this method effectively bypass the compile-time exception checking that would otherwise be performed by the compiler. A quick-fix is suggested to replace the call with a call to the 'java.lang.reflect.Constructor.newInstance()' method, which avoids this problem by wrapping any exception thrown by the constructor in a (checked) 'java.lang.reflect.InvocationTargetException'. Example: 'clazz.newInstance()' After the quick-fix is applied: 'clazz.getConstructor().newInstance();'", + "markdown": "Reports calls to `java.lang.Class.newInstance()`.\n\n\nThis method propagates exceptions thrown by\nthe no-arguments constructor, including checked exceptions. Usages of this method\neffectively bypass the compile-time exception checking that would\notherwise be performed by the compiler.\n\n\nA quick-fix is suggested to replace the call with a call to the\n`java.lang.reflect.Constructor.newInstance()` method, which\navoids this problem by wrapping any exception thrown by the constructor in a\n(checked) `java.lang.reflect.InvocationTargetException`.\n\n**Example:**\n\n\n clazz.newInstance()\n\nAfter the quick-fix is applied:\n\n\n clazz.getConstructor().newInstance();\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "MagicConstant", - "cweIds": [ - 489 - ], + "suppressToolId": "ClassNewInstance", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25576,19 +25576,19 @@ ] }, { - "id": "ClassNewInstance", + "id": "SuspiciousDateFormat", "shortDescription": { - "text": "Unsafe call to 'Class.newInstance()'" + "text": "Suspicious date format pattern" }, "fullDescription": { - "text": "Reports calls to 'java.lang.Class.newInstance()'. This method propagates exceptions thrown by the no-arguments constructor, including checked exceptions. Usages of this method effectively bypass the compile-time exception checking that would otherwise be performed by the compiler. A quick-fix is suggested to replace the call with a call to the 'java.lang.reflect.Constructor.newInstance()' method, which avoids this problem by wrapping any exception thrown by the constructor in a (checked) 'java.lang.reflect.InvocationTargetException'. Example: 'clazz.newInstance()' After the quick-fix is applied: 'clazz.getConstructor().newInstance();'", - "markdown": "Reports calls to `java.lang.Class.newInstance()`.\n\n\nThis method propagates exceptions thrown by\nthe no-arguments constructor, including checked exceptions. Usages of this method\neffectively bypass the compile-time exception checking that would\notherwise be performed by the compiler.\n\n\nA quick-fix is suggested to replace the call with a call to the\n`java.lang.reflect.Constructor.newInstance()` method, which\navoids this problem by wrapping any exception thrown by the constructor in a\n(checked) `java.lang.reflect.InvocationTargetException`.\n\n**Example:**\n\n\n clazz.newInstance()\n\nAfter the quick-fix is applied:\n\n\n clazz.getConstructor().newInstance();\n" + "text": "Reports date format patterns that are likely used by mistake. The following patterns are reported: Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December. Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended. Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended. Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended. Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended. Examples: 'new SimpleDateFormat(\"YYYY-MM-dd\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"yyyy-MM-DD\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"HH:MM\")': likely '\"HH:mm\"' was intended. New in 2020.1", + "markdown": "Reports date format patterns that are likely used by mistake.\n\nThe following patterns are reported:\n\n* Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December.\n* Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended.\n* Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended.\n* Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended.\n* Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended.\n\n\nExamples: \n\n`new SimpleDateFormat(\"YYYY-MM-dd\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"yyyy-MM-DD\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"HH:MM\")`: likely `\"HH:mm\"` was intended.\n\nNew in 2020.1" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ClassNewInstance", + "suppressToolId": "SuspiciousDateFormat", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25630,7 +25630,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -25795,7 +25795,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -25927,7 +25927,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -25972,23 +25972,19 @@ ] }, { - "id": "IgnoreResultOfCall", + "id": "BlockingMethodInNonBlockingContext", "shortDescription": { - "text": "Result of method call ignored" + "text": "Possibly blocking call in non-blocking context" }, "fullDescription": { - "text": "Reports method calls whose result is ignored. For many methods, ignoring the result is perfectly legitimate, but for some it is almost certainly an error. Examples of methods where ignoring the result is likely an error include 'java.io.inputStream.read()', which returns the number of bytes actually read, and any method on 'java.lang.String' or 'java.math.BigInteger'. These methods do not produce side-effects and thus pointless if their result is ignored. The calls to the following methods are inspected: Simple getters (which do nothing except return a field) Methods specified in the settings of this inspection Methods annotated with 'org.jetbrains.annotations.Contract(pure=true)' Methods annotated with .*.'CheckReturnValue' Methods in a class or package annotated with 'javax.annotation.CheckReturnValue' Optionally, all non-library methods Calls to methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation are not reported. Use the inspection settings to specify the classes to check. Methods are matched by name or name pattern using Java regular expression syntax. For classes, use fully-qualified names. Each entry applies to both the class and all its inheritors.", - "markdown": "Reports method calls whose result is ignored.\n\nFor many methods, ignoring the result is perfectly\nlegitimate, but for some it is almost certainly an error. Examples of methods where ignoring\nthe result is likely an error include `java.io.inputStream.read()`,\nwhich returns the number of bytes actually read, and any method on\n`java.lang.String` or `java.math.BigInteger`. These methods do not produce side-effects and thus pointless\nif their result is ignored.\n\nThe calls to the following methods are inspected:\n\n* Simple getters (which do nothing except return a field)\n* Methods specified in the settings of this inspection\n* Methods annotated with `org.jetbrains.annotations.Contract(pure=true)`\n* Methods annotated with .\\*.`CheckReturnValue`\n* Methods in a class or package annotated with `javax.annotation.CheckReturnValue`\n* Optionally, all non-library methods\n\nCalls to methods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation are not reported.\n\n\nUse the inspection settings to specify the classes to check.\nMethods are matched by name or name pattern using Java regular expression syntax.\nFor classes, use fully-qualified names. Each entry applies to both the class and all its inheritors." + "text": "Reports thread-blocking method calls in code fragments where threads should not be blocked. Example (Project Reactor): 'Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n);' Consider running blocking code with a proper scheduler, for example 'Schedulers.boundedElastic()', or try to find an alternative non-blocking API. Example (Kotlin Coroutines): 'suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n}' Consider running blocking code with a special dispatcher, for example 'Dispatchers.IO', or try to find an alternative non-blocking API. Configure the inspection: In the Blocking Annotations list, specify annotations that mark thread-blocking methods. In the Non-Blocking Annotations list, specify annotations that mark non-blocking methods. Specified annotations can be used as External Annotations", + "markdown": "Reports thread-blocking method calls in code fragments where threads should not be blocked.\n\n**Example (Project Reactor):**\n\n\n Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n );\n\nConsider running blocking code [with a proper\nscheduler](https://projectreactor.io/docs/core/release/reference/#faq.wrap-blocking), for example `Schedulers.boundedElastic()`, or try to find an alternative non-blocking API.\n\n**Example (Kotlin Coroutines):**\n\n\n suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n }\n\nConsider running blocking code [with a special dispatcher](https://kotlinlang.org/docs/coroutine-context-and-dispatchers.html),\nfor example `Dispatchers.IO`, or try to find an alternative non-blocking API.\n\nConfigure the inspection:\n\n* In the **Blocking Annotations** list, specify annotations that mark thread-blocking methods.\n* In the **Non-Blocking Annotations** list, specify annotations that mark non-blocking methods.\n\nSpecified annotations can be used as [External Annotations](https://www.jetbrains.com/help/idea/external-annotations.html)" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ResultOfMethodCallIgnored", - "cweIds": [ - 252, - 563 - ], + "suppressToolId": "BlockingMethodInNonBlockingContext", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -25996,8 +25992,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "JVM languages", + "index": 2, "toolComponent": { "name": "QDJVMC" } @@ -26009,19 +26005,23 @@ ] }, { - "id": "BlockingMethodInNonBlockingContext", + "id": "IgnoreResultOfCall", "shortDescription": { - "text": "Possibly blocking call in non-blocking context" + "text": "Result of method call ignored" }, "fullDescription": { - "text": "Reports thread-blocking method calls in code fragments where threads should not be blocked. Example (Project Reactor): 'Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n);' Consider running blocking code with a proper scheduler, for example 'Schedulers.boundedElastic()', or try to find an alternative non-blocking API. Example (Kotlin Coroutines): 'suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n}' Consider running blocking code with a special dispatcher, for example 'Dispatchers.IO', or try to find an alternative non-blocking API. Configure the inspection: In the Blocking Annotations list, specify annotations that mark thread-blocking methods. In the Non-Blocking Annotations list, specify annotations that mark non-blocking methods. Specified annotations can be used as External Annotations", - "markdown": "Reports thread-blocking method calls in code fragments where threads should not be blocked.\n\n**Example (Project Reactor):**\n\n\n Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n );\n\nConsider running blocking code [with a proper\nscheduler](https://projectreactor.io/docs/core/release/reference/#faq.wrap-blocking), for example `Schedulers.boundedElastic()`, or try to find an alternative non-blocking API.\n\n**Example (Kotlin Coroutines):**\n\n\n suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n }\n\nConsider running blocking code [with a special dispatcher](https://kotlinlang.org/docs/coroutine-context-and-dispatchers.html),\nfor example `Dispatchers.IO`, or try to find an alternative non-blocking API.\n\nConfigure the inspection:\n\n* In the **Blocking Annotations** list, specify annotations that mark thread-blocking methods.\n* In the **Non-Blocking Annotations** list, specify annotations that mark non-blocking methods.\n\nSpecified annotations can be used as [External Annotations](https://www.jetbrains.com/help/idea/external-annotations.html)" + "text": "Reports method calls whose result is ignored. For many methods, ignoring the result is perfectly legitimate, but for some it is almost certainly an error. Examples of methods where ignoring the result is likely an error include 'java.io.inputStream.read()', which returns the number of bytes actually read, and any method on 'java.lang.String' or 'java.math.BigInteger'. These methods do not produce side-effects and thus pointless if their result is ignored. The calls to the following methods are inspected: Simple getters (which do nothing except return a field) Methods specified in the settings of this inspection Methods annotated with 'org.jetbrains.annotations.Contract(pure=true)' Methods annotated with .*.'CheckReturnValue' Methods in a class or package annotated with 'javax.annotation.CheckReturnValue' Optionally, all non-library methods Calls to methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation are not reported. Use the inspection settings to specify the classes to check. Methods are matched by name or name pattern using Java regular expression syntax. For classes, use fully-qualified names. Each entry applies to both the class and all its inheritors.", + "markdown": "Reports method calls whose result is ignored.\n\nFor many methods, ignoring the result is perfectly\nlegitimate, but for some it is almost certainly an error. Examples of methods where ignoring\nthe result is likely an error include `java.io.inputStream.read()`,\nwhich returns the number of bytes actually read, and any method on\n`java.lang.String` or `java.math.BigInteger`. These methods do not produce side-effects and thus pointless\nif their result is ignored.\n\nThe calls to the following methods are inspected:\n\n* Simple getters (which do nothing except return a field)\n* Methods specified in the settings of this inspection\n* Methods annotated with `org.jetbrains.annotations.Contract(pure=true)`\n* Methods annotated with .\\*.`CheckReturnValue`\n* Methods in a class or package annotated with `javax.annotation.CheckReturnValue`\n* Optionally, all non-library methods\n\nCalls to methods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation are not reported.\n\n\nUse the inspection settings to specify the classes to check.\nMethods are matched by name or name pattern using Java regular expression syntax.\nFor classes, use fully-qualified names. Each entry applies to both the class and all its inheritors." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "BlockingMethodInNonBlockingContext", + "suppressToolId": "ResultOfMethodCallIgnored", + "cweIds": [ + 252, + 563 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26029,8 +26029,8 @@ "relationships": [ { "target": { - "id": "JVM languages", - "index": 2, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -26042,19 +26042,19 @@ ] }, { - "id": "ParametersPerConstructor", + "id": "NonReproducibleMathCall", "shortDescription": { - "text": "Constructor with too many parameters" + "text": "Non-reproducible call to 'Math'" }, "fullDescription": { - "text": "Reports constructors whose number of parameters exceeds the specified maximum. Such objects are hard to instantiate, especially if some parameters are optional. Constructors with too many parameters may indicate that refactoring is necessary. Consider applying the builder pattern, for example. Example: 'public BankAccount(long accountNumber,\n String owner,\n double balance,\n double interestRate) {\n // fields initialization\n }' Configure the inspection: Use the Parameter limit field to specify the maximum allowed number of parameters in a constructor. Use the Ignore constructors with visibility list to specify whether the inspection should ignore constructors with specific visibility.", - "markdown": "Reports constructors whose number of parameters exceeds the specified maximum. Such objects are hard to instantiate, especially if some parameters are optional. Constructors with too many parameters may indicate that refactoring is necessary. Consider applying the builder pattern, for example.\n\n**Example:**\n\n\n public BankAccount(long accountNumber,\n String owner,\n double balance,\n double interestRate) {\n // fields initialization\n }\n\nConfigure the inspection:\n\n* Use the **Parameter limit** field to specify the maximum allowed number of parameters in a constructor.\n* Use the **Ignore constructors with visibility** list to specify whether the inspection should ignore constructors with specific visibility." + "text": "Reports calls to 'java.lang.Math' methods, which results are not guaranteed to be reproduced precisely. In environments where reproducibility of results is required, 'java.lang.StrictMath' should be used instead.", + "markdown": "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." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ConstructorWithTooManyParameters", + "suppressToolId": "NonReproducibleMathCall", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26062,8 +26062,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 95, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -26075,19 +26075,19 @@ ] }, { - "id": "NonReproducibleMathCall", + "id": "ParametersPerConstructor", "shortDescription": { - "text": "Non-reproducible call to 'Math'" + "text": "Constructor with too many parameters" }, "fullDescription": { - "text": "Reports calls to 'java.lang.Math' methods, which results are not guaranteed to be reproduced precisely. In environments where reproducibility of results is required, 'java.lang.StrictMath' should be used instead.", - "markdown": "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." + "text": "Reports constructors whose number of parameters exceeds the specified maximum. Such objects are hard to instantiate, especially if some parameters are optional. Constructors with too many parameters may indicate that refactoring is necessary. Consider applying the builder pattern, for example. Example: 'public BankAccount(long accountNumber,\n String owner,\n double balance,\n double interestRate) {\n // fields initialization\n }' Configure the inspection: Use the Parameter limit field to specify the maximum allowed number of parameters in a constructor. Use the Ignore constructors with visibility list to specify whether the inspection should ignore constructors with specific visibility.", + "markdown": "Reports constructors whose number of parameters exceeds the specified maximum. Such objects are hard to instantiate, especially if some parameters are optional. Constructors with too many parameters may indicate that refactoring is necessary. Consider applying the builder pattern, for example.\n\n**Example:**\n\n\n public BankAccount(long accountNumber,\n String owner,\n double balance,\n double interestRate) {\n // fields initialization\n }\n\nConfigure the inspection:\n\n* Use the **Parameter limit** field to specify the maximum allowed number of parameters in a constructor.\n* Use the **Ignore constructors with visibility** list to specify whether the inspection should ignore constructors with specific visibility." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonReproducibleMathCall", + "suppressToolId": "ConstructorWithTooManyParameters", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26095,8 +26095,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 27, + "id": "Java/Method metrics", + "index": 95, "toolComponent": { "name": "QDJVMC" } @@ -26162,7 +26162,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -26228,7 +26228,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -26309,39 +26309,6 @@ } ] }, - { - "id": "ConfusingElse", - "shortDescription": { - "text": "Redundant 'else'" - }, - "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." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ConfusingElseBranch", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Control flow issues", - "index": 26, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "InnerClassReferencedViaSubclass", "shortDescription": { @@ -26376,28 +26343,28 @@ ] }, { - "id": "ScheduledThreadPoolExecutorWithZeroCoreThreads", + "id": "ConfusingElse", "shortDescription": { - "text": "'ScheduledThreadPoolExecutor' with zero core threads" + "text": "Redundant 'else'" }, "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 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": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "ScheduledThreadPoolExecutorWithZeroCoreThreads", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ConfusingElseBranch", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Control flow issues", + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -26441,6 +26408,39 @@ } ] }, + { + "id": "ScheduledThreadPoolExecutorWithZeroCoreThreads", + "shortDescription": { + "text": "'ScheduledThreadPoolExecutor' with zero core threads" + }, + "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" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ScheduledThreadPoolExecutorWithZeroCoreThreads", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "SynchronizeOnThis", "shortDescription": { @@ -26665,7 +26665,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -26710,19 +26710,19 @@ ] }, { - "id": "UnnecessaryCallToStringValueOf", + "id": "FloatingPointEquality", "shortDescription": { - "text": "Unnecessary conversion to 'String'" + "text": "Floating-point equality comparison" }, "fullDescription": { - "text": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. 'String.valueOf()' or 'Integer.toString()'. Such calls are unnecessary when used in string concatenations. Example: 'System.out.println(\"Number: \" + Integer.toString(count));' After the quick-fix is applied: 'System.out.println(\"Number: \" + count);' Additionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are: Classes 'java.io.PrintWriter', 'java.io.PrintStream' 'print()', 'println()' Classes 'java.lang.StringBuilder', 'java.lang.StringBuffer' 'append()' Class 'org.slf4j.Logger' 'trace()', 'debug()', 'info()', 'warn()', 'error()' Use the Report calls that can be replaced with a concatenation with the empty string option to also report cases where concatenations with the empty string can be used instead of a call to 'String.valueOf()'.", - "markdown": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. `String.valueOf()` or `Integer.toString()`. Such calls are unnecessary when used in string concatenations.\n\nExample:\n\n\n System.out.println(\"Number: \" + Integer.toString(count));\n\nAfter the quick-fix is applied:\n\n\n System.out.println(\"Number: \" + count);\n\nAdditionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are:\n\n* Classes `java.io.PrintWriter`, `java.io.PrintStream`\n * `print()`, `println()`\n* Classes `java.lang.StringBuilder`, `java.lang.StringBuffer`\n * `append()`\n* Class `org.slf4j.Logger`\n * `trace()`, `debug()`, `info()`, `warn()`, `error()`\n\n\nUse the **Report calls that can be replaced with a concatenation with the empty string**\noption to also report cases where concatenations with the empty string can be used instead of a call to `String.valueOf()`." + "text": "Reports floating-point values that are being compared using the '==' or '!=' operator. Floating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics. This inspection ignores comparisons with zero and infinity literals. Example: 'void m(double d1, double d2) {\n if (d1 == d2) {}\n }'", + "markdown": "Reports floating-point values that are being compared using the `==` or `!=` operator.\n\nFloating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics.\n\nThis inspection ignores comparisons with zero and infinity literals.\n\n**Example:**\n\n\n void m(double d1, double d2) {\n if (d1 == d2) {}\n }\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryCallToStringValueOf", + "suppressToolId": "FloatingPointEquality", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26730,8 +26730,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Numeric issues", + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -26743,19 +26743,19 @@ ] }, { - "id": "FloatingPointEquality", + "id": "UnnecessaryCallToStringValueOf", "shortDescription": { - "text": "Floating-point equality comparison" + "text": "Unnecessary conversion to 'String'" }, "fullDescription": { - "text": "Reports floating-point values that are being compared using the '==' or '!=' operator. Floating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics. This inspection ignores comparisons with zero and infinity literals. Example: 'void m(double d1, double d2) {\n if (d1 == d2) {}\n }'", - "markdown": "Reports floating-point values that are being compared using the `==` or `!=` operator.\n\nFloating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics.\n\nThis inspection ignores comparisons with zero and infinity literals.\n\n**Example:**\n\n\n void m(double d1, double d2) {\n if (d1 == d2) {}\n }\n" + "text": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. 'String.valueOf()' or 'Integer.toString()'. Such calls are unnecessary when used in string concatenations. Example: 'System.out.println(\"Number: \" + Integer.toString(count));' After the quick-fix is applied: 'System.out.println(\"Number: \" + count);' Additionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are: Classes 'java.io.PrintWriter', 'java.io.PrintStream' 'print()', 'println()' Classes 'java.lang.StringBuilder', 'java.lang.StringBuffer' 'append()' Class 'org.slf4j.Logger' 'trace()', 'debug()', 'info()', 'warn()', 'error()' Use the Report calls that can be replaced with a concatenation with the empty string option to also report cases where concatenations with the empty string can be used instead of a call to 'String.valueOf()'.", + "markdown": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. `String.valueOf()` or `Integer.toString()`. Such calls are unnecessary when used in string concatenations.\n\nExample:\n\n\n System.out.println(\"Number: \" + Integer.toString(count));\n\nAfter the quick-fix is applied:\n\n\n System.out.println(\"Number: \" + count);\n\nAdditionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are:\n\n* Classes `java.io.PrintWriter`, `java.io.PrintStream`\n * `print()`, `println()`\n* Classes `java.lang.StringBuilder`, `java.lang.StringBuffer`\n * `append()`\n* Class `org.slf4j.Logger`\n * `trace()`, `debug()`, `info()`, `warn()`, `error()`\n\n\nUse the **Report calls that can be replaced with a concatenation with the empty string**\noption to also report cases where concatenations with the empty string can be used instead of a call to `String.valueOf()`." }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "FloatingPointEquality", + "suppressToolId": "UnnecessaryCallToStringValueOf", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -26763,8 +26763,8 @@ "relationships": [ { "target": { - "id": "Java/Numeric issues", - "index": 27, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -26809,28 +26809,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 Java 21 '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();' New in 2023.3", + "markdown": "Reports collection API method calls that can be simplified using Java 21 `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\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": 60, + "id": "Java/Java language level migration aids/Java 21", + "index": 103, "toolComponent": { "name": "QDJVMC" } @@ -26842,28 +26842,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 Java 21 '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();' New in 2023.3", - "markdown": "Reports collection API method calls that can be simplified using Java 21 `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\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": 103, + "id": "Java/Encapsulation", + "index": 60, "toolComponent": { "name": "QDJVMC" } @@ -26929,7 +26929,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -26962,7 +26962,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -27061,7 +27061,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -27106,19 +27106,19 @@ ] }, { - "id": "JDBCResource", + "id": "ThrowsRuntimeException", "shortDescription": { - "text": "JDBC resource opened but not safely closed" + "text": "Unchecked exception declared in 'throws' clause" }, "fullDescription": { - "text": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include 'java.sql.Connection', 'java.sql.Statement', 'java.sql.PreparedStatement', 'java.sql.CallableStatement', and 'java.sql.ResultSet'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }' Use the following options to configure the inspection: Whether a JDBC resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.", - "markdown": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include `java.sql.Connection`, `java.sql.Statement`, `java.sql.PreparedStatement`, `java.sql.CallableStatement`, and `java.sql.ResultSet`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a JDBC resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument." + "text": "Reports declaration of an unchecked exception ('java.lang.RuntimeException' or one of its subclasses) in the 'throws' clause of a method. Declarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc '@throws' tag. Example: 'public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }'", + "markdown": "Reports declaration of an unchecked exception (`java.lang.RuntimeException` or one of its subclasses) in the `throws` clause of a method.\n\nDeclarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc `@throws` tag.\n\n**Example:**\n\n\n public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "JDBCResourceOpenedButNotSafelyClosed", + "suppressToolId": "ThrowsRuntimeException", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27126,8 +27126,8 @@ "relationships": [ { "target": { - "id": "Java/Resource management", - "index": 47, + "id": "Java/Error handling", + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -27139,19 +27139,19 @@ ] }, { - "id": "ThrowsRuntimeException", + "id": "JDBCResource", "shortDescription": { - "text": "Unchecked exception declared in 'throws' clause" + "text": "JDBC resource opened but not safely closed" }, "fullDescription": { - "text": "Reports declaration of an unchecked exception ('java.lang.RuntimeException' or one of its subclasses) in the 'throws' clause of a method. Declarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc '@throws' tag. Example: 'public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }'", - "markdown": "Reports declaration of an unchecked exception (`java.lang.RuntimeException` or one of its subclasses) in the `throws` clause of a method.\n\nDeclarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc `@throws` tag.\n\n**Example:**\n\n\n public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }\n" + "text": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include 'java.sql.Connection', 'java.sql.Statement', 'java.sql.PreparedStatement', 'java.sql.CallableStatement', and 'java.sql.ResultSet'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }' Use the following options to configure the inspection: Whether a JDBC resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument.", + "markdown": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include `java.sql.Connection`, `java.sql.Statement`, `java.sql.PreparedStatement`, `java.sql.CallableStatement`, and `java.sql.ResultSet`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a JDBC resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ThrowsRuntimeException", + "suppressToolId": "JDBCResourceOpenedButNotSafelyClosed", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27159,8 +27159,8 @@ "relationships": [ { "target": { - "id": "Java/Error handling", - "index": 14, + "id": "Java/Resource management", + "index": 47, "toolComponent": { "name": "QDJVMC" } @@ -27328,7 +27328,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -27361,7 +27361,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -27394,7 +27394,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27460,7 +27460,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -27493,7 +27493,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -27538,19 +27538,19 @@ ] }, { - "id": "LocalVariableHidingMemberVariable", + "id": "AssignmentToLambdaParameter", "shortDescription": { - "text": "Local variable hides field" + "text": "Assignment to lambda parameter" }, "fullDescription": { - "text": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }' You can configure the following options for this inspection: Ignore non-accessible fields - ignore local variables named identically to superclass fields that are not visible (for example, because they are private). Ignore local variables in a static context hiding non-static fields - for example when the local variable is inside a static method or inside a method which is inside a static inner class.", - "markdown": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended.\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }\n\n\nYou can configure the following options for this inspection:\n\n1. **Ignore non-accessible fields** - ignore local variables named identically to superclass fields that are not visible (for example, because they are private).\n2. **Ignore local variables in a static context hiding non-static fields** - for example when the local variable is inside a static method or inside a method which is inside a static inner class." + "text": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable. The quick-fix adds a declaration of a new variable. Example: 'list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });' After the quick-fix is applied: 'list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });' Use the Ignore if assignment is a transformation of the original parameter option to ignore assignments that modify the parameter value based on its previous value.", + "markdown": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });\n\nAfter the quick-fix is applied:\n\n\n list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });\n\nUse the **Ignore if assignment is a transformation of the original parameter** option to ignore assignments that modify the parameter\nvalue based on its previous value." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "LocalVariableHidesMemberVariable", + "suppressToolId": "AssignmentToLambdaParameter", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27558,8 +27558,8 @@ "relationships": [ { "target": { - "id": "Java/Visibility", - "index": 57, + "id": "Java/Assignment issues", + "index": 34, "toolComponent": { "name": "QDJVMC" } @@ -27571,19 +27571,19 @@ ] }, { - "id": "AssignmentToLambdaParameter", + "id": "LocalVariableHidingMemberVariable", "shortDescription": { - "text": "Assignment to lambda parameter" + "text": "Local variable hides field" }, "fullDescription": { - "text": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable. The quick-fix adds a declaration of a new variable. Example: 'list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });' After the quick-fix is applied: 'list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });' Use the Ignore if assignment is a transformation of the original parameter option to ignore assignments that modify the parameter value based on its previous value.", - "markdown": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });\n\nAfter the quick-fix is applied:\n\n\n list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });\n\nUse the **Ignore if assignment is a transformation of the original parameter** option to ignore assignments that modify the parameter\nvalue based on its previous value." + "text": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }' You can configure the following options for this inspection: Ignore non-accessible fields - ignore local variables named identically to superclass fields that are not visible (for example, because they are private). Ignore local variables in a static context hiding non-static fields - for example when the local variable is inside a static method or inside a method which is inside a static inner class.", + "markdown": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended.\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }\n\n\nYou can configure the following options for this inspection:\n\n1. **Ignore non-accessible fields** - ignore local variables named identically to superclass fields that are not visible (for example, because they are private).\n2. **Ignore local variables in a static context hiding non-static fields** - for example when the local variable is inside a static method or inside a method which is inside a static inner class." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "AssignmentToLambdaParameter", + "suppressToolId": "LocalVariableHidesMemberVariable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -27591,8 +27591,8 @@ "relationships": [ { "target": { - "id": "Java/Assignment issues", - "index": 34, + "id": "Java/Visibility", + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -27691,7 +27691,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -27724,7 +27724,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -27793,7 +27793,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -27859,7 +27859,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -27958,7 +27958,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -27991,7 +27991,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -28226,7 +28226,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -28259,7 +28259,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -28325,7 +28325,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -28523,7 +28523,7 @@ { "target": { "id": "Java/Memory", - "index": 73, + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -28791,7 +28791,7 @@ { "target": { "id": "Java/Memory", - "index": 73, + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -28960,7 +28960,7 @@ { "target": { "id": "Java/Visibility", - "index": 57, + "index": 56, "toolComponent": { "name": "QDJVMC" } @@ -28972,19 +28972,19 @@ ] }, { - "id": "InnerClassMayBeStatic", + "id": "SetReplaceableByEnumSet", "shortDescription": { - "text": "Inner class may be 'static'" + "text": "'Set' can be replaced with 'EnumSet'" }, "fullDescription": { - "text": "Reports inner classes that can be made 'static'. A 'static' inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class. Example: 'public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' After the quick-fix is applied: 'public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }'", - "markdown": "Reports inner classes that can be made `static`.\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nThis prevents a common cause of memory leaks and uses less memory per instance of the class.\n\n**Example:**\n\n\n public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n" + "text": "Reports instantiations of 'java.util.Set' objects whose content types are enumerated classes. Such 'Set' objects can be replaced with 'java.util.EnumSet' objects. 'EnumSet' implementations can be much more efficient compared to other sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to 'EnumSet.noneOf()'. This quick-fix is not available when the type of the variable is a sub-class of 'Set'. Example: 'enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();' After the quick-fix is applied: 'enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);'", + "markdown": "Reports instantiations of `java.util.Set` objects whose content types are enumerated classes. Such `Set` objects can be replaced with `java.util.EnumSet` objects.\n\n\n`EnumSet` implementations can be much more efficient compared to\nother sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to\n`EnumSet.noneOf()`. This quick-fix is not available when the type of the variable is a sub-class of `Set`.\n\n**Example:**\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();\n\nAfter the quick-fix is applied:\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InnerClassMayBeStatic", + "suppressToolId": "SetReplaceableByEnumSet", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -28992,8 +28992,8 @@ "relationships": [ { "target": { - "id": "Java/Memory", - "index": 73, + "id": "Java/Performance", + "index": 10, "toolComponent": { "name": "QDJVMC" } @@ -29005,19 +29005,19 @@ ] }, { - "id": "SetReplaceableByEnumSet", + "id": "InnerClassMayBeStatic", "shortDescription": { - "text": "'Set' can be replaced with 'EnumSet'" + "text": "Inner class may be 'static'" }, "fullDescription": { - "text": "Reports instantiations of 'java.util.Set' objects whose content types are enumerated classes. Such 'Set' objects can be replaced with 'java.util.EnumSet' objects. 'EnumSet' implementations can be much more efficient compared to other sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to 'EnumSet.noneOf()'. This quick-fix is not available when the type of the variable is a sub-class of 'Set'. Example: 'enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();' After the quick-fix is applied: 'enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);'", - "markdown": "Reports instantiations of `java.util.Set` objects whose content types are enumerated classes. Such `Set` objects can be replaced with `java.util.EnumSet` objects.\n\n\n`EnumSet` implementations can be much more efficient compared to\nother sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to\n`EnumSet.noneOf()`. This quick-fix is not available when the type of the variable is a sub-class of `Set`.\n\n**Example:**\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();\n\nAfter the quick-fix is applied:\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);\n" + "text": "Reports inner classes that can be made 'static'. A 'static' inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class. Example: 'public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' After the quick-fix is applied: 'public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }'", + "markdown": "Reports inner classes that can be made `static`.\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nThis prevents a common cause of memory leaks and uses less memory per instance of the class.\n\n**Example:**\n\n\n public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "SetReplaceableByEnumSet", + "suppressToolId": "InnerClassMayBeStatic", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29025,8 +29025,8 @@ "relationships": [ { "target": { - "id": "Java/Performance", - "index": 10, + "id": "Java/Memory", + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -29059,7 +29059,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -29104,19 +29104,19 @@ ] }, { - "id": "NonSerializableWithSerializationMethods", + "id": "CloneReturnsClassType", "shortDescription": { - "text": "Non-serializable class with 'readObject()' or 'writeObject()'" + "text": "'clone()' should have return type equal to the class it contains" }, "fullDescription": { - "text": "Reports non-'Serializable' classes that define 'readObject()' or 'writeObject()' methods. Such methods in that context normally indicate an error. Example: 'public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }'", - "markdown": "Reports non-`Serializable` classes that define `readObject()` or `writeObject()` methods. Such methods in that context normally indicate an error.\n\n**Example:**\n\n\n public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }\n" + "text": "Reports 'clone()' methods with return types different from the class they're located in. Often a 'clone()' method will have a return type of 'java.lang.Object', which makes it harder to use by its clients. Effective Java (the second and third editions) recommends making the return type of the 'clone()' method the same as the class type of the object it returns. Example: 'class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' After the quick-fix is applied: 'class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }'", + "markdown": "Reports `clone()` methods with return types different from the class they're located in.\n\nOften a `clone()` method will have a return type of `java.lang.Object`, which makes it harder to use by its clients.\n*Effective Java* (the second and third editions) recommends making the return type of the `clone()` method the same as the\nclass type of the object it returns.\n\n**Example:**\n\n\n class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "NonSerializableClassWithSerializationMethods", + "suppressToolId": "CloneReturnsClassType", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29124,8 +29124,8 @@ "relationships": [ { "target": { - "id": "Java/Serialization issues", - "index": 18, + "id": "Java/Cloning issues", + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -29137,19 +29137,19 @@ ] }, { - "id": "CloneReturnsClassType", + "id": "NonSerializableWithSerializationMethods", "shortDescription": { - "text": "'clone()' should have return type equal to the class it contains" + "text": "Non-serializable class with 'readObject()' or 'writeObject()'" }, "fullDescription": { - "text": "Reports 'clone()' methods with return types different from the class they're located in. Often a 'clone()' method will have a return type of 'java.lang.Object', which makes it harder to use by its clients. Effective Java (the second and third editions) recommends making the return type of the 'clone()' method the same as the class type of the object it returns. Example: 'class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' After the quick-fix is applied: 'class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }'", - "markdown": "Reports `clone()` methods with return types different from the class they're located in.\n\nOften a `clone()` method will have a return type of `java.lang.Object`, which makes it harder to use by its clients.\n*Effective Java* (the second and third editions) recommends making the return type of the `clone()` method the same as the\nclass type of the object it returns.\n\n**Example:**\n\n\n class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n" + "text": "Reports non-'Serializable' classes that define 'readObject()' or 'writeObject()' methods. Such methods in that context normally indicate an error. Example: 'public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }'", + "markdown": "Reports non-`Serializable` classes that define `readObject()` or `writeObject()` methods. Such methods in that context normally indicate an error.\n\n**Example:**\n\n\n public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CloneReturnsClassType", + "suppressToolId": "NonSerializableClassWithSerializationMethods", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29157,8 +29157,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 82, + "id": "Java/Serialization issues", + "index": 18, "toolComponent": { "name": "QDJVMC" } @@ -29191,7 +29191,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -29224,7 +29224,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -29323,7 +29323,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -29356,7 +29356,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -29389,7 +29389,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -29422,7 +29422,7 @@ { "target": { "id": "Java/Numeric issues", - "index": 27, + "index": 26, "toolComponent": { "name": "QDJVMC" } @@ -29557,7 +29557,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -29602,19 +29602,19 @@ ] }, { - "id": "EnumerationCanBeIteration", + "id": "ThreadDumpStack", "shortDescription": { - "text": "Enumeration can be iteration" + "text": "Call to 'Thread.dumpStack()'" }, "fullDescription": { - "text": "Reports calls to 'Enumeration' methods that are used on collections and may be replaced with equivalent 'Iterator' constructs. Example: 'Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }' After the quick-fix is applied: 'Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }'", - "markdown": "Reports calls to `Enumeration` methods that are used on collections and may be replaced with equivalent `Iterator` constructs.\n\n**Example:**\n\n\n Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }\n\nAfter the quick-fix is applied:\n\n\n Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }\n" + "text": "Reports usages of 'Thread.dumpStack()'. 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 usages of `Thread.dumpStack()`.\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, "level": "warning", "parameters": { - "suppressToolId": "EnumerationCanBeIteration", + "suppressToolId": "CallToThreadDumpStack", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29622,8 +29622,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids", - "index": 52, + "id": "Java/Code maturity", + "index": 50, "toolComponent": { "name": "QDJVMC" } @@ -29635,19 +29635,19 @@ ] }, { - "id": "ThreadDumpStack", + "id": "EnumerationCanBeIteration", "shortDescription": { - "text": "Call to 'Thread.dumpStack()'" + "text": "Enumeration can be iteration" }, "fullDescription": { - "text": "Reports usages of 'Thread.dumpStack()'. 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 usages of `Thread.dumpStack()`.\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 calls to 'Enumeration' methods that are used on collections and may be replaced with equivalent 'Iterator' constructs. Example: 'Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }' After the quick-fix is applied: 'Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }'", + "markdown": "Reports calls to `Enumeration` methods that are used on collections and may be replaced with equivalent `Iterator` constructs.\n\n**Example:**\n\n\n Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }\n\nAfter the quick-fix is applied:\n\n\n Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "CallToThreadDumpStack", + "suppressToolId": "EnumerationCanBeIteration", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29655,8 +29655,8 @@ "relationships": [ { "target": { - "id": "Java/Code maturity", - "index": 50, + "id": "Java/Java language level migration aids", + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -29668,28 +29668,28 @@ ] }, { - "id": "UnnecessaryBlockStatement", + "id": "FinalMethodInFinalClass", "shortDescription": { - "text": "Unnecessary code block" + "text": "'final' method in 'final' class" }, "fullDescription": { - "text": "Reports code blocks that are redundant to the semantics of the program and can be replaced with their contents. The code blocks that are the bodies of 'if', 'do', 'while', or 'for' statements will not be reported by this inspection. Example: 'void foo() {\n { // unnecessary\n int result = call();\n analyze(result);\n } // unnecessary\n }' Configure the inspection: Use the Ignore branches of 'switch' statements option to ignore the code blocks that are used as branches of switch statements.", - "markdown": "Reports code blocks that are redundant to the semantics of the program and can be replaced with their contents.\n\nThe code blocks that are the bodies of `if`, `do`,\n`while`, or `for` statements will not be reported by this\ninspection.\n\nExample:\n\n\n void foo() {\n { // unnecessary\n int result = call();\n analyze(result);\n } // unnecessary\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore branches of 'switch' statements** option to ignore the code blocks that are used as branches of switch statements." + "text": "Reports 'final' methods in 'final' classes. Since 'final' classes cannot be inherited, marking a method as 'final' may be unnecessary and confusing. Example: 'record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly.", + "markdown": "Reports `final` methods in `final` classes.\n\nSince `final` classes cannot be inherited, marking a method as `final`\nmay be unnecessary and confusing.\n\n**Example:**\n\n record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." }, "defaultConfiguration": { - "enabled": false, - "level": "note", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryCodeBlock", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "FinalMethodInFinalClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Declaration redundancy", + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -29701,28 +29701,28 @@ ] }, { - "id": "FinalMethodInFinalClass", + "id": "UnnecessaryBlockStatement", "shortDescription": { - "text": "'final' method in 'final' class" + "text": "Unnecessary code block" }, "fullDescription": { - "text": "Reports 'final' methods in 'final' classes. Since 'final' classes cannot be inherited, marking a method as 'final' may be unnecessary and confusing. Example: 'record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly.", - "markdown": "Reports `final` methods in `final` classes.\n\nSince `final` classes cannot be inherited, marking a method as `final`\nmay be unnecessary and confusing.\n\n**Example:**\n\n record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly." + "text": "Reports code blocks that are redundant to the semantics of the program and can be replaced with their contents. The code blocks that are the bodies of 'if', 'do', 'while', or 'for' statements will not be reported by this inspection. Example: 'void foo() {\n { // unnecessary\n int result = call();\n analyze(result);\n } // unnecessary\n }' Configure the inspection: Use the Ignore branches of 'switch' statements option to ignore the code blocks that are used as branches of switch statements.", + "markdown": "Reports code blocks that are redundant to the semantics of the program and can be replaced with their contents.\n\nThe code blocks that are the bodies of `if`, `do`,\n`while`, or `for` statements will not be reported by this\ninspection.\n\nExample:\n\n\n void foo() {\n { // unnecessary\n int result = call();\n analyze(result);\n } // unnecessary\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore branches of 'switch' statements** option to ignore the code blocks that are used as branches of switch statements." }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "note", "parameters": { - "suppressToolId": "FinalMethodInFinalClass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "UnnecessaryCodeBlock", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Java/Declaration redundancy", - "index": 15, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -29755,7 +29755,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29788,7 +29788,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -29906,19 +29906,19 @@ ] }, { - "id": "AssignmentOrReturnOfFieldWithMutableType", + "id": "UnnecessaryUnboxing", "shortDescription": { - "text": "Assignment or return of field with mutable type" + "text": "Unnecessary unboxing" }, "fullDescription": { - "text": "Reports return of, or assignment from a method parameter to an array or a mutable type like 'Collection', 'Date', 'Map', 'Calendar', etc. Because such types are mutable, this construct may result in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for performance reasons, it is inherently prone to bugs. The following mutable types are reported: 'java.util.Date' 'java.util.Calendar' 'java.util.Collection' 'java.util.Map' 'com.google.common.collect.Multimap' 'com.google.common.collect.Table' The quick-fix adds a call to the field's '.clone()' method. Example: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }' After the quick-fix is applied: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }' Use the Ignore assignments in and returns from private methods option to ignore assignments and returns in 'private' methods.", - "markdown": "Reports return of, or assignment from a method parameter to an array or a mutable type like `Collection`, `Date`, `Map`, `Calendar`, etc.\n\nBecause such types are mutable, this construct may\nresult in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for\nperformance reasons, it is inherently prone to bugs.\n\nThe following mutable types are reported:\n\n* `java.util.Date`\n* `java.util.Calendar`\n* `java.util.Collection`\n* `java.util.Map`\n* `com.google.common.collect.Multimap`\n* `com.google.common.collect.Table`\n\nThe quick-fix adds a call to the field's `.clone()` method.\n\n**Example:**\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }\n\nUse the **Ignore assignments in and returns from private methods** option to ignore assignments and returns in `private` methods." + "text": "Reports unboxing, that is explicit unwrapping of wrapped primitive values. Unboxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = Integer.valueOf(42).intValue();' → 'Integer i = Integer.valueOf(42);' 'int k = Integer.valueOf(42).intValue();' → 'int k = Integer.valueOf(42);' (reports only when the Only report truly superfluously unboxed expressions option is not checked) Use the Only report truly superfluously unboxed expressions option to only report truly superfluous unboxing, where an unboxed value is immediately boxed either implicitly or explicitly. In this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing. This inspection only reports if the language level of the project or module is 5 or higher.", + "markdown": "Reports unboxing, that is explicit unwrapping of wrapped primitive values.\n\nUnboxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = Integer.valueOf(42).intValue();` → `Integer i = Integer.valueOf(42);`\n* `int k = Integer.valueOf(42).intValue();` → `int k = Integer.valueOf(42);`\n\n (reports only when the **Only report truly superfluously unboxed expressions** option is not checked)\n\n\nUse the **Only report truly superfluously unboxed expressions** option to only report truly superfluous unboxing,\nwhere an unboxed value is immediately boxed either implicitly or explicitly.\nIn this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "AssignmentOrReturnOfFieldWithMutableType", + "suppressToolId": "UnnecessaryUnboxing", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29926,8 +29926,8 @@ "relationships": [ { "target": { - "id": "Java/Encapsulation", - "index": 60, + "id": "Java/Java language level migration aids/Java 5", + "index": 53, "toolComponent": { "name": "QDJVMC" } @@ -29939,19 +29939,19 @@ ] }, { - "id": "UnnecessaryUnboxing", + "id": "AssignmentOrReturnOfFieldWithMutableType", "shortDescription": { - "text": "Unnecessary unboxing" + "text": "Assignment or return of field with mutable type" }, "fullDescription": { - "text": "Reports unboxing, that is explicit unwrapping of wrapped primitive values. Unboxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = Integer.valueOf(42).intValue();' → 'Integer i = Integer.valueOf(42);' 'int k = Integer.valueOf(42).intValue();' → 'int k = Integer.valueOf(42);' (reports only when the Only report truly superfluously unboxed expressions option is not checked) Use the Only report truly superfluously unboxed expressions option to only report truly superfluous unboxing, where an unboxed value is immediately boxed either implicitly or explicitly. In this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing. This inspection only reports if the language level of the project or module is 5 or higher.", - "markdown": "Reports unboxing, that is explicit unwrapping of wrapped primitive values.\n\nUnboxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = Integer.valueOf(42).intValue();` → `Integer i = Integer.valueOf(42);`\n* `int k = Integer.valueOf(42).intValue();` → `int k = Integer.valueOf(42);`\n\n (reports only when the **Only report truly superfluously unboxed expressions** option is not checked)\n\n\nUse the **Only report truly superfluously unboxed expressions** option to only report truly superfluous unboxing,\nwhere an unboxed value is immediately boxed either implicitly or explicitly.\nIn this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher." + "text": "Reports return of, or assignment from a method parameter to an array or a mutable type like 'Collection', 'Date', 'Map', 'Calendar', etc. Because such types are mutable, this construct may result in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for performance reasons, it is inherently prone to bugs. The following mutable types are reported: 'java.util.Date' 'java.util.Calendar' 'java.util.Collection' 'java.util.Map' 'com.google.common.collect.Multimap' 'com.google.common.collect.Table' The quick-fix adds a call to the field's '.clone()' method. Example: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }' After the quick-fix is applied: 'class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }' Use the Ignore assignments in and returns from private methods option to ignore assignments and returns in 'private' methods.", + "markdown": "Reports return of, or assignment from a method parameter to an array or a mutable type like `Collection`, `Date`, `Map`, `Calendar`, etc.\n\nBecause such types are mutable, this construct may\nresult in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for\nperformance reasons, it is inherently prone to bugs.\n\nThe following mutable types are reported:\n\n* `java.util.Date`\n* `java.util.Calendar`\n* `java.util.Collection`\n* `java.util.Map`\n* `com.google.common.collect.Multimap`\n* `com.google.common.collect.Table`\n\nThe quick-fix adds a call to the field's `.clone()` method.\n\n**Example:**\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Log {\n String[] messages;\n ...\n\n String[] getMessages() {\n return messages.clone();\n }\n }\n\nUse the **Ignore assignments in and returns from private methods** option to ignore assignments and returns in `private` methods." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryUnboxing", + "suppressToolId": "AssignmentOrReturnOfFieldWithMutableType", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -29959,8 +29959,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids/Java 5", - "index": 53, + "id": "Java/Encapsulation", + "index": 60, "toolComponent": { "name": "QDJVMC" } @@ -30026,7 +30026,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -30059,7 +30059,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -30071,19 +30071,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" } @@ -30104,19 +30104,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" } @@ -30276,19 +30276,19 @@ ] }, { - "id": "ClassWithTooManyDependencies", + "id": "ClassWithoutNoArgConstructor", "shortDescription": { - "text": "Class with too many dependencies" + "text": "Class without no-arg constructor" }, "fullDescription": { - "text": "Reports classes that are directly dependent on too many other classes in the project. Modifications to any dependency of such classes may require changing the class, thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of dependencies field to specify the maximum allowed number of dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", - "markdown": "Reports classes that are directly dependent on too many other classes in the project.\n\nModifications to any dependency of such classes may require changing the class, thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of dependencies** field to specify the maximum allowed number of dependencies for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." + "text": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection. Example: 'public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }' Use the checkbox below to ignore classes without explicit constructors. The compiler provides a default no-arg constructor to such classes.", + "markdown": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection.\n\n**Example:**\n\n\n public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }\n\n\nUse the checkbox below to ignore classes without explicit constructors.\nThe compiler provides a default no-arg constructor to such classes." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassWithTooManyDependencies", + "suppressToolId": "ClassWithoutNoArgConstructor", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -30296,8 +30296,8 @@ "relationships": [ { "target": { - "id": "Java/Dependency issues", - "index": 89, + "id": "Java/JavaBeans issues", + "index": 33, "toolComponent": { "name": "QDJVMC" } @@ -30309,19 +30309,19 @@ ] }, { - "id": "ClassWithoutNoArgConstructor", + "id": "ClassWithTooManyDependencies", "shortDescription": { - "text": "Class without no-arg constructor" + "text": "Class with too many dependencies" }, "fullDescription": { - "text": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection. Example: 'public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }' Use the checkbox below to ignore classes without explicit constructors. The compiler provides a default no-arg constructor to such classes.", - "markdown": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection.\n\n**Example:**\n\n\n public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }\n\n\nUse the checkbox below to ignore classes without explicit constructors.\nThe compiler provides a default no-arg constructor to such classes." + "text": "Reports classes that are directly dependent on too many other classes in the project. Modifications to any dependency of such classes may require changing the class, thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of dependencies field to specify the maximum allowed number of dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor.", + "markdown": "Reports classes that are directly dependent on too many other classes in the project.\n\nModifications to any dependency of such classes may require changing the class, thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of dependencies** field to specify the maximum allowed number of dependencies for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ClassWithoutNoArgConstructor", + "suppressToolId": "ClassWithTooManyDependencies", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -30329,8 +30329,8 @@ "relationships": [ { "target": { - "id": "Java/JavaBeans issues", - "index": 33, + "id": "Java/Dependency issues", + "index": 89, "toolComponent": { "name": "QDJVMC" } @@ -30468,7 +30468,7 @@ { "target": { "id": "Java/Error handling", - "index": 14, + "index": 15, "toolComponent": { "name": "QDJVMC" } @@ -30633,7 +30633,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -30732,7 +30732,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -30765,7 +30765,7 @@ { "target": { "id": "Java/Javadoc", - "index": 45, + "index": 46, "toolComponent": { "name": "QDJVMC" } @@ -30897,7 +30897,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -31029,7 +31029,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -31194,7 +31194,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -31206,19 +31206,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" } @@ -31226,8 +31226,8 @@ "relationships": [ { "target": { - "id": "Java/Data flow", - "index": 23, + "id": "Java/Method metrics", + "index": 95, "toolComponent": { "name": "QDJVMC" } @@ -31239,19 +31239,22 @@ ] }, { - "id": "MethodWithMultipleLoops", + "id": "SuspiciousIntegerDivAssignment", "shortDescription": { - "text": "Method with multiple loops" + "text": "Suspicious integer division assignment" }, "fullDescription": { - "text": "Reports methods that contain more than one loop statement. Example: The method below will be reported because it contains two loops: 'void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }' The following method will also be reported because it contains a nested loop: 'void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }'", - "markdown": "Reports methods that contain more than one loop statement.\n\n**Example:**\n\nThe method below will be reported because it contains two loops:\n\n\n void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }\n\nThe following method will also be reported because it contains a nested loop:\n\n\n void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }\n" + "text": "Reports assignments whose right side is a division that shouldn't be truncated to integer. While occasionally intended, this construction is often buggy. Example: 'int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result' This code should be replaced with: 'int x = 18;\n x *= 3.0/2;' In the inspection options, you can disable warnings for suspicious but possibly correct divisions, for example, when the dividend can't be calculated statically. 'void calc(int d) {\n int x = 18;\n x *= d/2;\n }' New in 2019.2", + "markdown": "Reports assignments whose right side is a division that shouldn't be truncated to integer.\n\nWhile occasionally intended, this construction is often buggy.\n\n**Example:**\n\n\n int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result\n\n\nThis code should be replaced with:\n\n\n int x = 18;\n x *= 3.0/2;\n\n\nIn the inspection options, you can disable warnings for suspicious but possibly correct divisions,\nfor example, when the dividend can't be calculated statically.\n\n\n void calc(int d) {\n int x = 18;\n x *= d/2;\n }\n\n\nNew in 2019.2" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "MethodWithMultipleLoops", + "suppressToolId": "SuspiciousIntegerDivAssignment", + "cweIds": [ + 682 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31259,8 +31262,8 @@ "relationships": [ { "target": { - "id": "Java/Method metrics", - "index": 95, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -31272,22 +31275,19 @@ ] }, { - "id": "SuspiciousIntegerDivAssignment", + "id": "NegativelyNamedBooleanVariable", "shortDescription": { - "text": "Suspicious integer division assignment" + "text": "Negatively named boolean variable" }, "fullDescription": { - "text": "Reports assignments whose right side is a division that shouldn't be truncated to integer. While occasionally intended, this construction is often buggy. Example: 'int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result' This code should be replaced with: 'int x = 18;\n x *= 3.0/2;' In the inspection options, you can disable warnings for suspicious but possibly correct divisions, for example, when the dividend can't be calculated statically. 'void calc(int d) {\n int x = 18;\n x *= d/2;\n }' New in 2019.2", - "markdown": "Reports assignments whose right side is a division that shouldn't be truncated to integer.\n\nWhile occasionally intended, this construction is often buggy.\n\n**Example:**\n\n\n int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result\n\n\nThis code should be replaced with:\n\n\n int x = 18;\n x *= 3.0/2;\n\n\nIn the inspection options, you can disable warnings for suspicious but possibly correct divisions,\nfor example, when the dividend can't be calculated statically.\n\n\n void calc(int d) {\n int x = 18;\n x *= d/2;\n }\n\n\nNew in 2019.2" + "text": "Reports negatively named variables, for example: 'disabled', 'hidden', or 'isNotChanged'. Usually, inverting the 'boolean' value and removing the negation from the name makes the code easier to understand. Example: 'boolean disabled = false;'", + "markdown": "Reports negatively named variables, for example: `disabled`, `hidden`, or `isNotChanged`.\n\nUsually, inverting the `boolean` value and removing the negation from the name makes the code easier to understand.\n\nExample:\n\n\n boolean disabled = false;\n" }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "SuspiciousIntegerDivAssignment", - "cweIds": [ - 682 - ], + "suppressToolId": "NegativelyNamedBooleanVariable", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31295,8 +31295,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Data flow", + "index": 23, "toolComponent": { "name": "QDJVMC" } @@ -31464,7 +31464,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -31530,7 +31530,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -31563,7 +31563,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -31629,7 +31629,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -31662,7 +31662,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -31695,7 +31695,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -31761,7 +31761,7 @@ { "target": { "id": "Java/Declaration redundancy", - "index": 15, + "index": 14, "toolComponent": { "name": "QDJVMC" } @@ -31893,7 +31893,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -31905,19 +31905,19 @@ ] }, { - "id": "UnnecessarySuperConstructor", + "id": "ThisEscapedInConstructor", "shortDescription": { - "text": "Unnecessary call to 'super()'" + "text": "'this' reference escaped in object construction" }, "fullDescription": { - "text": "Reports calls to no-arg superclass constructors during object construction. Such calls are unnecessary and may be removed. Example: 'class Foo {\n Foo() {\n super();\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n }\n }'", - "markdown": "Reports calls to no-arg superclass constructors during object construction.\n\nSuch calls are unnecessary and may be removed.\n\n**Example:**\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n }\n }\n" + "text": "Reports possible escapes of 'this' during the object initialization. The escapes occur when 'this' is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized. Example: 'class Foo {\n {\n System.out.println(this);\n }\n }'", + "markdown": "Reports possible escapes of `this` during the object initialization. The escapes occur when `this` is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized.\n\n**Example:**\n\n\n class Foo {\n {\n System.out.println(this);\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryCallToSuper", + "suppressToolId": "ThisEscapedInObjectConstruction", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31925,8 +31925,8 @@ "relationships": [ { "target": { - "id": "Java/Code style issues", - "index": 12, + "id": "Java/Initialization", + "index": 28, "toolComponent": { "name": "QDJVMC" } @@ -31938,19 +31938,19 @@ ] }, { - "id": "ThisEscapedInConstructor", + "id": "UnnecessarySuperConstructor", "shortDescription": { - "text": "'this' reference escaped in object construction" + "text": "Unnecessary call to 'super()'" }, "fullDescription": { - "text": "Reports possible escapes of 'this' during the object initialization. The escapes occur when 'this' is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized. Example: 'class Foo {\n {\n System.out.println(this);\n }\n }'", - "markdown": "Reports possible escapes of `this` during the object initialization. The escapes occur when `this` is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized.\n\n**Example:**\n\n\n class Foo {\n {\n System.out.println(this);\n }\n }\n" + "text": "Reports calls to no-arg superclass constructors during object construction. Such calls are unnecessary and may be removed. Example: 'class Foo {\n Foo() {\n super();\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n }\n }'", + "markdown": "Reports calls to no-arg superclass constructors during object construction.\n\nSuch calls are unnecessary and may be removed.\n\n**Example:**\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n }\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "ThisEscapedInObjectConstruction", + "suppressToolId": "UnnecessaryCallToSuper", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -31958,8 +31958,8 @@ "relationships": [ { "target": { - "id": "Java/Initialization", - "index": 28, + "id": "Java/Code style issues", + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -32004,19 +32004,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" } @@ -32024,8 +32024,8 @@ "relationships": [ { "target": { - "id": "Java/Cloning issues", - "index": 82, + "id": "Java/Java language level migration aids", + "index": 52, "toolComponent": { "name": "QDJVMC" } @@ -32037,19 +32037,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" } @@ -32057,8 +32057,8 @@ "relationships": [ { "target": { - "id": "Java/Java language level migration aids", - "index": 52, + "id": "Java/Cloning issues", + "index": 82, "toolComponent": { "name": "QDJVMC" } @@ -32139,19 +32139,23 @@ ] }, { - "id": "ModuleWithTooFewClasses", + "id": "InfiniteRecursion", "shortDescription": { - "text": "Module with too few classes" + "text": "Infinite recursion" }, "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 methods that call themselves infinitely unless an exception is thrown. Methods reported by this inspection cannot return normally. While such behavior may be intended, in many cases this is just an oversight. Example: 'int baz() {\n return baz();\n }'", + "markdown": "Reports methods that call themselves infinitely unless an exception is thrown.\n\n\nMethods reported by this inspection cannot return normally.\nWhile such behavior may be intended, in many cases this is just an oversight.\n\n**Example:**\n\n int baz() {\n return baz();\n }\n" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "ModuleWithTooFewClasses", + "suppressToolId": "InfiniteRecursion", + "cweIds": [ + 674, + 835 + ], "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32159,8 +32163,8 @@ "relationships": [ { "target": { - "id": "Java/Modularization issues", - "index": 69, + "id": "Java/Probable bugs", + "index": 13, "toolComponent": { "name": "QDJVMC" } @@ -32172,23 +32176,19 @@ ] }, { - "id": "InfiniteRecursion", + "id": "ModuleWithTooFewClasses", "shortDescription": { - "text": "Infinite recursion" + "text": "Module with too few classes" }, "fullDescription": { - "text": "Reports methods that call themselves infinitely unless an exception is thrown. Methods reported by this inspection cannot return normally. While such behavior may be intended, in many cases this is just an oversight. Example: 'int baz() {\n return baz();\n }'", - "markdown": "Reports methods that call themselves infinitely unless an exception is thrown.\n\n\nMethods reported by this inspection cannot return normally.\nWhile such behavior may be intended, in many cases this is just an oversight.\n\n**Example:**\n\n int baz() {\n return baz();\n }\n" + "text": "Reports 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": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "InfiniteRecursion", - "cweIds": [ - 674, - 835 - ], + "suppressToolId": "ModuleWithTooFewClasses", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32196,8 +32196,8 @@ "relationships": [ { "target": { - "id": "Java/Probable bugs", - "index": 13, + "id": "Java/Modularization issues", + "index": 69, "toolComponent": { "name": "QDJVMC" } @@ -32263,7 +32263,7 @@ { "target": { "id": "Java/Memory", - "index": 73, + "index": 72, "toolComponent": { "name": "QDJVMC" } @@ -32329,7 +32329,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -32341,19 +32341,19 @@ ] }, { - "id": "RedundantComparatorComparing", + "id": "RedundantEmbeddedExpression", "shortDescription": { - "text": "Comparator method can be simplified" + "text": "Redundant embedded expression in string template" }, "fullDescription": { - "text": "Reports 'Comparator' combinator constructs that can be simplified. Example: 'c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());' After the quick-fixes are applied: 'c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());' New in 2018.1", - "markdown": "Reports `Comparator` combinator constructs that can be simplified.\n\nExample:\n\n\n c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());\n\nAfter the quick-fixes are applied:\n\n\n c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());\n\nNew in 2018.1" + "text": "Reports redundant embedded expressions in 'STR' templates, such as trivial literals or empty expressions. Example: 'System.out.println(STR.\"Hello \\{\"world\"}\");' After the quick-fix is applied: 'System.out.println(STR.\"Hello world\");' This inspection only reports if the language level of the project or module is 21 or higher. New in 2023.3", + "markdown": "Reports redundant embedded expressions in `STR` templates, such as trivial literals or empty expressions.\n\nExample:\n\n\n System.out.println(STR.\"Hello \\{\"world\"}\");\n\nAfter the quick-fix is applied:\n\n\n System.out.println(STR.\"Hello world\");\n\nThis inspection only reports if the language level of the project or module is 21 or higher.\n\nNew in 2023.3" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "RedundantComparatorComparing", + "suppressToolId": "RedundantEmbeddedExpression", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32374,19 +32374,19 @@ ] }, { - "id": "RedundantEmbeddedExpression", + "id": "RedundantComparatorComparing", "shortDescription": { - "text": "Redundant embedded expression in string template" + "text": "Comparator method can be simplified" }, "fullDescription": { - "text": "Reports redundant embedded expressions in 'STR' templates, such as trivial literals or empty expressions. Example: 'System.out.println(STR.\"Hello \\{\"world\"}\");' After the quick-fix is applied: 'System.out.println(STR.\"Hello world\");' This inspection only reports if the language level of the project or module is 21 or higher. New in 2023.3", - "markdown": "Reports redundant embedded expressions in `STR` templates, such as trivial literals or empty expressions.\n\nExample:\n\n\n System.out.println(STR.\"Hello \\{\"world\"}\");\n\nAfter the quick-fix is applied:\n\n\n System.out.println(STR.\"Hello world\");\n\nThis inspection only reports if the language level of the project or module is 21 or higher.\n\nNew in 2023.3" + "text": "Reports 'Comparator' combinator constructs that can be simplified. Example: 'c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());' After the quick-fixes are applied: 'c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());' New in 2018.1", + "markdown": "Reports `Comparator` combinator constructs that can be simplified.\n\nExample:\n\n\n c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());\n\nAfter the quick-fixes are applied:\n\n\n c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());\n\nNew in 2018.1" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "RedundantEmbeddedExpression", + "suppressToolId": "RedundantComparatorComparing", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -32428,7 +32428,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -32632,7 +32632,7 @@ { "target": { "id": "Java/Class structure", - "index": 11, + "index": 12, "toolComponent": { "name": "QDJVMC" } @@ -32698,7 +32698,7 @@ { "target": { "id": "Java/Code style issues", - "index": 12, + "index": 11, "toolComponent": { "name": "QDJVMC" } @@ -32929,7 +32929,7 @@ { "target": { "id": "Java/Control flow issues", - "index": 26, + "index": 27, "toolComponent": { "name": "QDJVMC" } @@ -33448,28 +33448,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": 16, + "id": "Kotlin/Naming conventions", + "index": 49, "toolComponent": { "name": "QDJVMC" } @@ -33481,28 +33481,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": 49, + "id": "Kotlin/Migration", + "index": 16, "toolComponent": { "name": "QDJVMC" } @@ -34207,28 +34207,28 @@ ] }, { - "id": "ProtectedInFinal", + "id": "FakeJvmFieldConstant", "shortDescription": { - "text": "'protected' visibility is effectively 'private' in a final class" + "text": "Kotlin non-const property used as Java constant" }, "fullDescription": { - "text": "Reports 'protected' visibility used inside of a 'final' class. In such cases 'protected' members are accessible only in the class itself, so they are effectively 'private'. Example: 'class FinalClass {\n protected fun foo() {}\n }' After the quick-fix is applied: 'class FinalClass {\n private fun foo() {}\n }'", - "markdown": "Reports `protected` visibility used inside of a `final` class. In such cases `protected` members are accessible only in the class itself, so they are effectively `private`.\n\n**Example:**\n\n\n class FinalClass {\n protected fun foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class FinalClass {\n private fun foo() {}\n }\n" + "text": "Reports Kotlin properties that are not 'const' and used as Java annotation arguments. For example, a property with the '@JvmField' annotation has an initializer that can be evaluated at compile-time, and it has a primitive or 'String' type. Such properties have a 'ConstantValue' attribute in bytecode in Kotlin 1.1-1.2. This attribute allows javac to fold usages of the corresponding field and use that field in annotations. This can lead to incorrect behavior in the case of separate or incremental compilation in mixed Java/Kotlin code. This behavior is subject to change in Kotlin 1.3 (no 'ConstantValue' attribute any more). Example: Kotlin code in foo.kt file: 'annotation class Ann(val s: String)\n @JvmField val importantString = \"important\"' Java code: 'public class JavaUser {\n // This is dangerous\n @Ann(s = FooKt.importantString)\n public void foo() {}\n }' To fix the problem replace the '@JvmField' annotation with the 'const' modifier on a relevant Kotlin property or inline it.", + "markdown": "Reports Kotlin properties that are not `const` and used as Java annotation arguments.\n\n\nFor example, a property with the `@JvmField` annotation has an initializer that can be evaluated at compile-time,\nand it has a primitive or `String` type.\n\n\nSuch properties have a `ConstantValue` attribute in bytecode in Kotlin 1.1-1.2.\nThis attribute allows javac to fold usages of the corresponding field and use that field in annotations.\nThis can lead to incorrect behavior in the case of separate or incremental compilation in mixed Java/Kotlin code.\nThis behavior is subject to change in Kotlin 1.3 (no `ConstantValue` attribute any more).\n\n**Example:**\n\nKotlin code in foo.kt file:\n\n\n annotation class Ann(val s: String)\n @JvmField val importantString = \"important\"\n\nJava code:\n\n\n public class JavaUser {\n // This is dangerous\n @Ann(s = FooKt.importantString)\n public void foo() {}\n }\n\nTo fix the problem replace the `@JvmField` annotation with the `const` modifier on a relevant Kotlin property or inline it." }, "defaultConfiguration": { "enabled": true, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "ProtectedInFinal", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "FakeJvmFieldConstant", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 4, + "id": "Kotlin/Java interop issues", + "index": 70, "toolComponent": { "name": "QDJVMC" } @@ -34240,28 +34240,28 @@ ] }, { - "id": "FakeJvmFieldConstant", + "id": "ProtectedInFinal", "shortDescription": { - "text": "Kotlin non-const property used as Java constant" + "text": "'protected' visibility is effectively 'private' in a final class" }, "fullDescription": { - "text": "Reports Kotlin properties that are not 'const' and used as Java annotation arguments. For example, a property with the '@JvmField' annotation has an initializer that can be evaluated at compile-time, and it has a primitive or 'String' type. Such properties have a 'ConstantValue' attribute in bytecode in Kotlin 1.1-1.2. This attribute allows javac to fold usages of the corresponding field and use that field in annotations. This can lead to incorrect behavior in the case of separate or incremental compilation in mixed Java/Kotlin code. This behavior is subject to change in Kotlin 1.3 (no 'ConstantValue' attribute any more). Example: Kotlin code in foo.kt file: 'annotation class Ann(val s: String)\n @JvmField val importantString = \"important\"' Java code: 'public class JavaUser {\n // This is dangerous\n @Ann(s = FooKt.importantString)\n public void foo() {}\n }' To fix the problem replace the '@JvmField' annotation with the 'const' modifier on a relevant Kotlin property or inline it.", - "markdown": "Reports Kotlin properties that are not `const` and used as Java annotation arguments.\n\n\nFor example, a property with the `@JvmField` annotation has an initializer that can be evaluated at compile-time,\nand it has a primitive or `String` type.\n\n\nSuch properties have a `ConstantValue` attribute in bytecode in Kotlin 1.1-1.2.\nThis attribute allows javac to fold usages of the corresponding field and use that field in annotations.\nThis can lead to incorrect behavior in the case of separate or incremental compilation in mixed Java/Kotlin code.\nThis behavior is subject to change in Kotlin 1.3 (no `ConstantValue` attribute any more).\n\n**Example:**\n\nKotlin code in foo.kt file:\n\n\n annotation class Ann(val s: String)\n @JvmField val importantString = \"important\"\n\nJava code:\n\n\n public class JavaUser {\n // This is dangerous\n @Ann(s = FooKt.importantString)\n public void foo() {}\n }\n\nTo fix the problem replace the `@JvmField` annotation with the `const` modifier on a relevant Kotlin property or inline it." + "text": "Reports 'protected' visibility used inside of a 'final' class. In such cases 'protected' members are accessible only in the class itself, so they are effectively 'private'. Example: 'class FinalClass {\n protected fun foo() {}\n }' After the quick-fix is applied: 'class FinalClass {\n private fun foo() {}\n }'", + "markdown": "Reports `protected` visibility used inside of a `final` class. In such cases `protected` members are accessible only in the class itself, so they are effectively `private`.\n\n**Example:**\n\n\n class FinalClass {\n protected fun foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class FinalClass {\n private fun foo() {}\n }\n" }, "defaultConfiguration": { "enabled": true, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "FakeJvmFieldConstant", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ProtectedInFinal", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin/Java interop issues", - "index": 70, + "id": "Kotlin/Style issues", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -34503,39 +34503,6 @@ } ] }, - { - "id": "DeprecatedCallableAddReplaceWith", - "shortDescription": { - "text": "@Deprecated annotation without 'replaceWith' argument" - }, - "fullDescription": { - "text": "Reports deprecated functions and properties that do not have the 'kotlin.ReplaceWith' argument in its 'kotlin.deprecated' annotation and suggests to add one based on their body. Kotlin provides the 'ReplaceWith' argument to replace deprecated declarations automatically. It is recommended to use the argument to fix deprecation issues in code. Example: '@Deprecated(\"Use refined() instead.\")\n fun deprecated() = refined()\n\n fun refined() = 42' The quick-fix adds the 'ReplaceWith()' argument: '@Deprecated(\"Use refined() instead.\", ReplaceWith(\"refined()\"))\n fun deprecated() = refined()\n\n fun refined() = 42'", - "markdown": "Reports deprecated functions and properties that do not have the `kotlin.ReplaceWith` argument in its `kotlin.deprecated` annotation and suggests to add one based on their body.\n\n\nKotlin provides the `ReplaceWith` argument to replace deprecated declarations automatically.\nIt is recommended to use the argument to fix deprecation issues in code.\n\n**Example:**\n\n\n @Deprecated(\"Use refined() instead.\")\n fun deprecated() = refined()\n\n fun refined() = 42\n\nThe quick-fix adds the `ReplaceWith()` argument:\n\n\n @Deprecated(\"Use refined() instead.\", ReplaceWith(\"refined()\"))\n fun deprecated() = refined()\n\n fun refined() = 42\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "DeprecatedCallableAddReplaceWith", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Kotlin/Other problems", - "index": 55, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "ReplaceAssertBooleanWithAssertEquality", "shortDescription": { @@ -34569,6 +34536,39 @@ } ] }, + { + "id": "DeprecatedCallableAddReplaceWith", + "shortDescription": { + "text": "@Deprecated annotation without 'replaceWith' argument" + }, + "fullDescription": { + "text": "Reports deprecated functions and properties that do not have the 'kotlin.ReplaceWith' argument in its 'kotlin.deprecated' annotation and suggests to add one based on their body. Kotlin provides the 'ReplaceWith' argument to replace deprecated declarations automatically. It is recommended to use the argument to fix deprecation issues in code. Example: '@Deprecated(\"Use refined() instead.\")\n fun deprecated() = refined()\n\n fun refined() = 42' The quick-fix adds the 'ReplaceWith()' argument: '@Deprecated(\"Use refined() instead.\", ReplaceWith(\"refined()\"))\n fun deprecated() = refined()\n\n fun refined() = 42'", + "markdown": "Reports deprecated functions and properties that do not have the `kotlin.ReplaceWith` argument in its `kotlin.deprecated` annotation and suggests to add one based on their body.\n\n\nKotlin provides the `ReplaceWith` argument to replace deprecated declarations automatically.\nIt is recommended to use the argument to fix deprecation issues in code.\n\n**Example:**\n\n\n @Deprecated(\"Use refined() instead.\")\n fun deprecated() = refined()\n\n fun refined() = 42\n\nThe quick-fix adds the `ReplaceWith()` argument:\n\n\n @Deprecated(\"Use refined() instead.\", ReplaceWith(\"refined()\"))\n fun deprecated() = refined()\n\n fun refined() = 42\n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "DeprecatedCallableAddReplaceWith", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Other problems", + "index": 55, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "UnnecessaryOptInAnnotation", "shortDescription": { @@ -34768,19 +34768,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" } @@ -34788,8 +34788,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Naming conventions", - "index": 49, + "id": "Kotlin/Style issues", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -34801,19 +34801,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" } @@ -34821,8 +34821,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 4, + "id": "Kotlin/Naming conventions", + "index": 49, "toolComponent": { "name": "QDJVMC" } @@ -36022,28 +36022,28 @@ ] }, { - "id": "KotlinEqualsBetweenInconvertibleTypes", + "id": "JoinDeclarationAndAssignment", "shortDescription": { - "text": "'equals()' between objects of inconvertible types" + "text": "Join declaration and assignment" }, "fullDescription": { - "text": "Reports calls to 'equals()' where the receiver and the argument are of incompatible primitive, enum, or string types. While such a call might theoretically be useful, most likely it represents a bug. Example: '5.equals(\"\");'", - "markdown": "Reports calls to `equals()` where the receiver and the argument are of incompatible primitive, enum, or string types.\n\nWhile such a call might theoretically be useful, most likely it represents a bug.\n\n**Example:**\n\n 5.equals(\"\");\n" + "text": "Reports property declarations that can be joined with the following assignment. Example: 'val x: String\n x = System.getProperty(\"\")' The quick fix joins the declaration with the assignment: 'val x = System.getProperty(\"\")' Configure the inspection: You can disable the option Report with complex initialization of member properties to skip properties with complex initialization. This covers two cases: The property initializer is complex (it is a multiline or a compound/control-flow expression) The property is first initialized and then immediately used in subsequent code (for example, to call additional initialization methods)", + "markdown": "Reports property declarations that can be joined with the following assignment.\n\n**Example:**\n\n\n val x: String\n x = System.getProperty(\"\")\n\nThe quick fix joins the declaration with the assignment:\n\n\n val x = System.getProperty(\"\")\n\nConfigure the inspection:\n\nYou can disable the option **Report with complex initialization of member properties** to skip properties with complex initialization. This covers two cases:\n\n1. The property initializer is complex (it is a multiline or a compound/control-flow expression)\n2. The property is first initialized and then immediately used in subsequent code (for example, to call additional initialization methods)" }, "defaultConfiguration": { "enabled": true, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "EqualsBetweenInconvertibleTypes", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "JoinDeclarationAndAssignment", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin/Probable bugs", - "index": 24, + "id": "Kotlin/Style issues", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -36055,28 +36055,28 @@ ] }, { - "id": "JoinDeclarationAndAssignment", + "id": "KotlinEqualsBetweenInconvertibleTypes", "shortDescription": { - "text": "Join declaration and assignment" + "text": "'equals()' between objects of inconvertible types" }, "fullDescription": { - "text": "Reports property declarations that can be joined with the following assignment. Example: 'val x: String\n x = System.getProperty(\"\")' The quick fix joins the declaration with the assignment: 'val x = System.getProperty(\"\")' Configure the inspection: You can disable the option Report with complex initialization of member properties to skip properties with complex initialization. This covers two cases: The property initializer is complex (it is a multiline or a compound/control-flow expression) The property is first initialized and then immediately used in subsequent code (for example, to call additional initialization methods)", - "markdown": "Reports property declarations that can be joined with the following assignment.\n\n**Example:**\n\n\n val x: String\n x = System.getProperty(\"\")\n\nThe quick fix joins the declaration with the assignment:\n\n\n val x = System.getProperty(\"\")\n\nConfigure the inspection:\n\nYou can disable the option **Report with complex initialization of member properties** to skip properties with complex initialization. This covers two cases:\n\n1. The property initializer is complex (it is a multiline or a compound/control-flow expression)\n2. The property is first initialized and then immediately used in subsequent code (for example, to call additional initialization methods)" + "text": "Reports calls to 'equals()' where the receiver and the argument are of incompatible primitive, enum, or string types. While such a call might theoretically be useful, most likely it represents a bug. Example: '5.equals(\"\");'", + "markdown": "Reports calls to `equals()` where the receiver and the argument are of incompatible primitive, enum, or string types.\n\nWhile such a call might theoretically be useful, most likely it represents a bug.\n\n**Example:**\n\n 5.equals(\"\");\n" }, "defaultConfiguration": { "enabled": true, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "JoinDeclarationAndAssignment", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "EqualsBetweenInconvertibleTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 4, + "id": "Kotlin/Probable bugs", + "index": 24, "toolComponent": { "name": "QDJVMC" } @@ -36550,28 +36550,28 @@ ] }, { - "id": "DeprecatedMavenDependency", + "id": "UnnecessaryVariable", "shortDescription": { - "text": "Deprecated library is used in Maven" + "text": "Unnecessary local variable" }, "fullDescription": { - "text": "Reports deprecated maven dependency. Example: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n ' The quick fix changes the deprecated dependency to a maintained one: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n '", - "markdown": "Reports deprecated maven dependency.\n\n**Example:**\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n \n\nThe quick fix changes the deprecated dependency to a maintained one:\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n \n" + "text": "Reports local variables that are used only in the very next 'return' statement or are exact copies of other variables. Such variables can be safely inlined to make the code more clear. Example: 'fun sum(a: Int, b: Int): Int {\n val c = a + b\n return c\n }' After the quick-fix is applied: 'fun sum(a: Int, b: Int): Int {\n return a + b\n }' Configure the inspection: Use the Report immediately returned variables option to report immediately returned variables. When given descriptive names, such variables may improve the code readability in some cases, that's why this option is disabled by default.", + "markdown": "Reports local variables that are used only in the very next `return` statement or are exact copies of other variables.\n\nSuch variables can be safely inlined to make the code more clear.\n\n**Example:**\n\n\n fun sum(a: Int, b: Int): Int {\n val c = a + b\n return c\n }\n\nAfter the quick-fix is applied:\n\n\n fun sum(a: Int, b: Int): Int {\n return a + b\n }\n\nConfigure the inspection:\n\nUse the **Report immediately returned variables** option to report immediately returned variables.\nWhen given descriptive names, such variables may improve the code readability in some cases, that's why this option is disabled by default." }, "defaultConfiguration": { "enabled": true, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "DeprecatedMavenDependency", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "UnnecessaryVariable", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin", - "index": 3, + "id": "Kotlin/Redundant constructs", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -36583,28 +36583,28 @@ ] }, { - "id": "UnnecessaryVariable", + "id": "DeprecatedMavenDependency", "shortDescription": { - "text": "Unnecessary local variable" + "text": "Deprecated library is used in Maven" }, "fullDescription": { - "text": "Reports local variables that are used only in the very next 'return' statement or are exact copies of other variables. Such variables can be safely inlined to make the code more clear. Example: 'fun sum(a: Int, b: Int): Int {\n val c = a + b\n return c\n }' After the quick-fix is applied: 'fun sum(a: Int, b: Int): Int {\n return a + b\n }' Configure the inspection: Use the Report immediately returned variables option to report immediately returned variables. When given descriptive names, such variables may improve the code readability in some cases, that's why this option is disabled by default.", - "markdown": "Reports local variables that are used only in the very next `return` statement or are exact copies of other variables.\n\nSuch variables can be safely inlined to make the code more clear.\n\n**Example:**\n\n\n fun sum(a: Int, b: Int): Int {\n val c = a + b\n return c\n }\n\nAfter the quick-fix is applied:\n\n\n fun sum(a: Int, b: Int): Int {\n return a + b\n }\n\nConfigure the inspection:\n\nUse the **Report immediately returned variables** option to report immediately returned variables.\nWhen given descriptive names, such variables may improve the code readability in some cases, that's why this option is disabled by default." + "text": "Reports deprecated maven dependency. Example: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n ' The quick fix changes the deprecated dependency to a maintained one: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n '", + "markdown": "Reports deprecated maven dependency.\n\n**Example:**\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n \n\nThe quick fix changes the deprecated dependency to a maintained one:\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n \n" }, "defaultConfiguration": { "enabled": true, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "UnnecessaryVariable", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "DeprecatedMavenDependency", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 5, + "id": "Kotlin", + "index": 3, "toolComponent": { "name": "QDJVMC" } @@ -37738,19 +37738,19 @@ ] }, { - "id": "RedundantAsSequence", + "id": "RemoveToStringInStringTemplate", "shortDescription": { - "text": "Redundant 'asSequence' call" + "text": "Redundant call to 'toString()' in string template" }, "fullDescription": { - "text": "Reports redundant 'asSequence()' call that can never have a positive performance effect. 'asSequence()' speeds up collection processing that includes multiple operations because it performs operations lazily and doesn't create intermediate collections. However, if a terminal operation (such as 'toList()') is used right after 'asSequence()', this doesn't give you any positive performance effect. Example: 'fun test(list: List) {\n list.asSequence().last()\n }' After the quick-fix is applied: 'fun test(list: List) {\n list.last()\n }'", - "markdown": "Reports redundant `asSequence()` call that can never have a positive performance effect.\n\n\n`asSequence()` speeds up collection processing that includes multiple operations because it performs operations lazily\nand doesn't create intermediate collections.\n\n\nHowever, if a terminal operation (such as `toList()`) is used right after `asSequence()`, this doesn't give\nyou any positive performance effect.\n\n**Example:**\n\n\n fun test(list: List) {\n list.asSequence().last()\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(list: List) {\n list.last()\n }\n" + "text": "Reports calls to 'toString()' in string templates that can be safely removed. Example: 'fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4).toString()}\" // 'toString()' is redundant\n }' After the quick-fix is applied: 'fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4)}\"\n }'", + "markdown": "Reports calls to `toString()` in string templates that can be safely removed.\n\n**Example:**\n\n fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4).toString()}\" // 'toString()' is redundant\n }\n\nAfter the quick-fix is applied:\n\n fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4)}\"\n }\n" }, "defaultConfiguration": { "enabled": true, "level": "note", "parameters": { - "suppressToolId": "RedundantAsSequence", + "suppressToolId": "RemoveToStringInStringTemplate", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -37758,8 +37758,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 4, + "id": "Kotlin/Redundant constructs", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -37771,19 +37771,19 @@ ] }, { - "id": "RemoveToStringInStringTemplate", + "id": "RedundantAsSequence", "shortDescription": { - "text": "Redundant call to 'toString()' in string template" + "text": "Redundant 'asSequence' call" }, "fullDescription": { - "text": "Reports calls to 'toString()' in string templates that can be safely removed. Example: 'fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4).toString()}\" // 'toString()' is redundant\n }' After the quick-fix is applied: 'fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4)}\"\n }'", - "markdown": "Reports calls to `toString()` in string templates that can be safely removed.\n\n**Example:**\n\n fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4).toString()}\" // 'toString()' is redundant\n }\n\nAfter the quick-fix is applied:\n\n fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4)}\"\n }\n" + "text": "Reports redundant 'asSequence()' call that can never have a positive performance effect. 'asSequence()' speeds up collection processing that includes multiple operations because it performs operations lazily and doesn't create intermediate collections. However, if a terminal operation (such as 'toList()') is used right after 'asSequence()', this doesn't give you any positive performance effect. Example: 'fun test(list: List) {\n list.asSequence().last()\n }' After the quick-fix is applied: 'fun test(list: List) {\n list.last()\n }'", + "markdown": "Reports redundant `asSequence()` call that can never have a positive performance effect.\n\n\n`asSequence()` speeds up collection processing that includes multiple operations because it performs operations lazily\nand doesn't create intermediate collections.\n\n\nHowever, if a terminal operation (such as `toList()`) is used right after `asSequence()`, this doesn't give\nyou any positive performance effect.\n\n**Example:**\n\n\n fun test(list: List) {\n list.asSequence().last()\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(list: List) {\n list.last()\n }\n" }, "defaultConfiguration": { "enabled": true, "level": "note", "parameters": { - "suppressToolId": "RemoveToStringInStringTemplate", + "suppressToolId": "RedundantAsSequence", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -37791,8 +37791,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 5, + "id": "Kotlin/Style issues", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -39619,28 +39619,28 @@ ] }, { - "id": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", + "id": "ConvertTwoComparisonsToRangeCheck", "shortDescription": { - "text": "Meaningless annotations targets on superclass" + "text": "Two comparisons should be converted to a range check" }, "fullDescription": { - "text": "Reports meaningless annotation targets on superclasses since Kotlin 1.4. Annotation targets such as '@get:' are meaningless on superclasses and are prohibited. Example: 'interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo' After the quick-fix is applied: 'interface Foo\n\n annotation class Ann\n\n class E : Foo' This inspection only reports if the Kotlin language level of the project or module is 1.4 or higher.", - "markdown": "Reports meaningless annotation targets on superclasses since Kotlin 1.4.\n\nAnnotation targets such as `@get:` are meaningless on superclasses and are prohibited.\n\n**Example:**\n\n\n interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo\n\nAfter the quick-fix is applied:\n\n\n interface Foo\n\n annotation class Ann\n\n class E : Foo\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." + "text": "Reports two consecutive comparisons that can be converted to a range check. Checking against a range makes code simpler by removing test subject duplication. Example: 'fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }' The quick-fix replaces the comparison-based check with a range one: 'fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }'", + "markdown": "Reports two consecutive comparisons that can be converted to a range check.\n\nChecking against a range makes code simpler by removing test subject duplication.\n\n**Example:**\n\n\n fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }\n\nThe quick-fix replaces the comparison-based check with a range one:\n\n\n fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }\n" }, "defaultConfiguration": { - "enabled": false, - "level": "error", + "enabled": true, + "level": "note", "parameters": { - "suppressToolId": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "suppressToolId": "ConvertTwoComparisonsToRangeCheck", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 16, + "id": "Kotlin/Style issues", + "index": 4, "toolComponent": { "name": "QDJVMC" } @@ -39652,28 +39652,28 @@ ] }, { - "id": "ConvertTwoComparisonsToRangeCheck", + "id": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", "shortDescription": { - "text": "Two comparisons should be converted to a range check" + "text": "Meaningless annotations targets on superclass" }, "fullDescription": { - "text": "Reports two consecutive comparisons that can be converted to a range check. Checking against a range makes code simpler by removing test subject duplication. Example: 'fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }' The quick-fix replaces the comparison-based check with a range one: 'fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }'", - "markdown": "Reports two consecutive comparisons that can be converted to a range check.\n\nChecking against a range makes code simpler by removing test subject duplication.\n\n**Example:**\n\n\n fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }\n\nThe quick-fix replaces the comparison-based check with a range one:\n\n\n fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }\n" + "text": "Reports meaningless annotation targets on superclasses since Kotlin 1.4. Annotation targets such as '@get:' are meaningless on superclasses and are prohibited. Example: 'interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo' After the quick-fix is applied: 'interface Foo\n\n annotation class Ann\n\n class E : Foo' This inspection only reports if the Kotlin language level of the project or module is 1.4 or higher.", + "markdown": "Reports meaningless annotation targets on superclasses since Kotlin 1.4.\n\nAnnotation targets such as `@get:` are meaningless on superclasses and are prohibited.\n\n**Example:**\n\n\n interface Foo\n\n annotation class Ann\n\n class E : @field:Ann @get:Ann @set:Ann @setparam:Ann Foo\n\nAfter the quick-fix is applied:\n\n\n interface Foo\n\n annotation class Ann\n\n class E : Foo\n\nThis inspection only reports if the Kotlin language level of the project or module is 1.4 or higher." }, "defaultConfiguration": { - "enabled": true, - "level": "note", + "enabled": false, + "level": "error", "parameters": { - "suppressToolId": "ConvertTwoComparisonsToRangeCheck", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "ProhibitUseSiteTargetAnnotationsOnSuperTypesMigration", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Kotlin/Style issues", - "index": 4, + "id": "Kotlin/Migration", + "index": 16, "toolComponent": { "name": "QDJVMC" } @@ -39784,19 +39784,19 @@ ] }, { - "id": "RemoveRedundantQualifierName", + "id": "EnumValuesSoftDeprecate", "shortDescription": { - "text": "Redundant qualifier name" + "text": "'Enum.values()' is recommended to be replaced by 'Enum.entries' since 1.9" }, "fullDescription": { - "text": "Reports redundant qualifiers (or their parts) on class names, functions, and properties. A fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to. In the contexts where the name can be shortened, the inspection informs on the opportunity and the associated 'Remove redundant qualifier name' quick-fix allows amending the code. Examples: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }' After the quick-fix is applied: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }'", - "markdown": "Reports redundant qualifiers (or their parts) on class names, functions, and properties.\n\n\nA fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to.\nIn the contexts where the name can be shortened, the inspection informs on the opportunity and the associated\n'Remove redundant qualifier name' quick-fix allows amending the code.\n\n**Examples:**\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }\n\nAfter the quick-fix is applied:\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }\n" + "text": "Reports calls from Kotlin to 'values()' method in enum classes that can be replaced with 'entries' property read. Use of 'Enum.entries' may improve performance of your code. The quick-fix replaces 'values()' with 'entries'. More details: KT-48872 Provide modern and performant replacement for Enum.values() Note: 'entries' property type is different from the return type of 'values()' method ('EnumEntries' which inherits from 'List' instead of 'Array'). Due to this in some cases quick fix inserts extra '.toTypedArray()' conversion to not break the code, but for most common cases replacement will be done without it (e.g. in 'for' loop). Example: 'enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())' After the quick-fix is applied: 'enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())'", + "markdown": "Reports calls from Kotlin to `values()` method in enum classes that can be replaced with `entries` property read.\n\n\nUse of `Enum.entries` may improve performance of your code.\n\n\nThe quick-fix replaces `values()` with `entries`.\n\n\n**More details:** [KT-48872 Provide modern and performant replacement for Enum.values()](https://youtrack.jetbrains.com/issue/KT-48872)\n\n\n**Note:** `entries` property type is different from the return type of `values()` method\n(`EnumEntries` which inherits from `List` instead of `Array`).\nDue to this in some cases quick fix inserts extra `.toTypedArray()` conversion to not break the code, but\nfor most common cases replacement will be done without it (e.g. in `for` loop).\n\n**Example:**\n\n\n enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())\n\nAfter the quick-fix is applied:\n\n\n enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())\n" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "RemoveRedundantQualifierName", + "suppressToolId": "EnumValuesSoftDeprecate", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -39804,8 +39804,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 5, + "id": "Kotlin/Other problems", + "index": 55, "toolComponent": { "name": "QDJVMC" } @@ -39817,19 +39817,19 @@ ] }, { - "id": "EnumValuesSoftDeprecate", + "id": "RemoveRedundantQualifierName", "shortDescription": { - "text": "'Enum.values()' is recommended to be replaced by 'Enum.entries' since 1.9" + "text": "Redundant qualifier name" }, "fullDescription": { - "text": "Reports calls from Kotlin to 'values()' method in enum classes that can be replaced with 'entries' property read. Use of 'Enum.entries' may improve performance of your code. The quick-fix replaces 'values()' with 'entries'. More details: KT-48872 Provide modern and performant replacement for Enum.values() Note: 'entries' property type is different from the return type of 'values()' method ('EnumEntries' which inherits from 'List' instead of 'Array'). Due to this in some cases quick fix inserts extra '.toTypedArray()' conversion to not break the code, but for most common cases replacement will be done without it (e.g. in 'for' loop). Example: 'enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())' After the quick-fix is applied: 'enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())'", - "markdown": "Reports calls from Kotlin to `values()` method in enum classes that can be replaced with `entries` property read.\n\n\nUse of `Enum.entries` may improve performance of your code.\n\n\nThe quick-fix replaces `values()` with `entries`.\n\n\n**More details:** [KT-48872 Provide modern and performant replacement for Enum.values()](https://youtrack.jetbrains.com/issue/KT-48872)\n\n\n**Note:** `entries` property type is different from the return type of `values()` method\n(`EnumEntries` which inherits from `List` instead of `Array`).\nDue to this in some cases quick fix inserts extra `.toTypedArray()` conversion to not break the code, but\nfor most common cases replacement will be done without it (e.g. in `for` loop).\n\n**Example:**\n\n\n enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())\n\nAfter the quick-fix is applied:\n\n\n enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())\n" + "text": "Reports redundant qualifiers (or their parts) on class names, functions, and properties. A fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to. In the contexts where the name can be shortened, the inspection informs on the opportunity and the associated 'Remove redundant qualifier name' quick-fix allows amending the code. Examples: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }' After the quick-fix is applied: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }'", + "markdown": "Reports redundant qualifiers (or their parts) on class names, functions, and properties.\n\n\nA fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to.\nIn the contexts where the name can be shortened, the inspection informs on the opportunity and the associated\n'Remove redundant qualifier name' quick-fix allows amending the code.\n\n**Examples:**\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }\n\nAfter the quick-fix is applied:\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }\n" }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "EnumValuesSoftDeprecate", + "suppressToolId": "RemoveRedundantQualifierName", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -39837,8 +39837,8 @@ "relationships": [ { "target": { - "id": "Kotlin/Other problems", - "index": 55, + "id": "Kotlin/Redundant constructs", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -40113,39 +40113,6 @@ } ] }, - { - "id": "KotlinJvmAnnotationInJava", - "shortDescription": { - "text": "Kotlin JVM annotation in Java" - }, - "fullDescription": { - "text": "Reports useless Kotlin JVM annotations in Java code. Example: 'import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }'", - "markdown": "Reports useless Kotlin JVM annotations in Java code.\n\n**Example:**\n\n\n import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "KotlinJvmAnnotationInJava", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Kotlin/Java interop issues", - "index": 70, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, { "id": "ObsoleteKotlinJsPackages", "shortDescription": { @@ -40179,6 +40146,39 @@ } ] }, + { + "id": "KotlinJvmAnnotationInJava", + "shortDescription": { + "text": "Kotlin JVM annotation in Java" + }, + "fullDescription": { + "text": "Reports useless Kotlin JVM annotations in Java code. Example: 'import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }'", + "markdown": "Reports useless Kotlin JVM annotations in Java code.\n\n**Example:**\n\n\n import kotlin.jvm.Volatile;\n\n public class Test {\n @Volatile\n public int i;\n }\n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "KotlinJvmAnnotationInJava", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Java interop issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, { "id": "CascadeIf", "shortDescription": { @@ -40444,28 +40444,28 @@ ] }, { - "id": "RedundantUnitExpression", + "id": "RestrictReturnStatementTargetMigration", "shortDescription": { - "text": "Redundant 'Unit'" + "text": "Target label does not denote a function since 1.4" }, "fullDescription": { - "text": "Reports redundant 'Unit' expressions. 'Unit' in Kotlin can be used as the return type of functions that do not return anything meaningful. The 'Unit' type has only one possible value, which is the 'Unit' object. Examples: 'fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }'", - "markdown": "Reports redundant `Unit` expressions.\n\n\n`Unit` in Kotlin can be used as the return type of functions that do not return anything meaningful.\nThe `Unit` type has only one possible value, which is the `Unit` object.\n\n**Examples:**\n\n\n fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }\n" + "text": "Reports labels that don't points to a functions. It's forbidden to declare a target label that does not denote a function. The quick-fix removes the label. Example: 'fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }' After the quick-fix is applied: 'fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }' This inspection only reports if the language level of the project or module is 1.4 or higher.", + "markdown": "Reports labels that don't points to a functions.\n\nIt's forbidden to declare a target label that does not denote a function.\n\nThe quick-fix removes the label.\n\n**Example:**\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }\n\nAfter the quick-fix is applied:\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }\n\nThis inspection only reports if the language level of the project or module is 1.4 or higher." }, "defaultConfiguration": { - "enabled": true, - "level": "warning", + "enabled": false, + "level": "error", "parameters": { - "suppressToolId": "RedundantUnitExpression", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "RestrictReturnStatementTargetMigration", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" } }, "relationships": [ { "target": { - "id": "Kotlin/Redundant constructs", - "index": 5, + "id": "Kotlin/Migration", + "index": 16, "toolComponent": { "name": "QDJVMC" } @@ -40477,28 +40477,28 @@ ] }, { - "id": "RestrictReturnStatementTargetMigration", + "id": "RedundantUnitExpression", "shortDescription": { - "text": "Target label does not denote a function since 1.4" + "text": "Redundant 'Unit'" }, "fullDescription": { - "text": "Reports labels that don't points to a functions. It's forbidden to declare a target label that does not denote a function. The quick-fix removes the label. Example: 'fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }' After the quick-fix is applied: 'fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }' This inspection only reports if the language level of the project or module is 1.4 or higher.", - "markdown": "Reports labels that don't points to a functions.\n\nIt's forbidden to declare a target label that does not denote a function.\n\nThe quick-fix removes the label.\n\n**Example:**\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return@L }\n fn()\n }\n\nAfter the quick-fix is applied:\n\n\n fun testValLabelInReturn() {\n L@ val fn = { return }\n fn()\n }\n\nThis inspection only reports if the language level of the project or module is 1.4 or higher." + "text": "Reports redundant 'Unit' expressions. 'Unit' in Kotlin can be used as the return type of functions that do not return anything meaningful. The 'Unit' type has only one possible value, which is the 'Unit' object. Examples: 'fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }'", + "markdown": "Reports redundant `Unit` expressions.\n\n\n`Unit` in Kotlin can be used as the return type of functions that do not return anything meaningful.\nThe `Unit` type has only one possible value, which is the `Unit` object.\n\n**Examples:**\n\n\n fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }\n" }, "defaultConfiguration": { - "enabled": false, - "level": "error", + "enabled": true, + "level": "warning", "parameters": { - "suppressToolId": "RestrictReturnStatementTargetMigration", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "suppressToolId": "RedundantUnitExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Kotlin/Migration", - "index": 16, + "id": "Kotlin/Redundant constructs", + "index": 5, "toolComponent": { "name": "QDJVMC" } @@ -41896,7 +41896,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -42028,7 +42028,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -42094,7 +42094,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -42292,7 +42292,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -42358,7 +42358,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -42370,28 +42370,28 @@ ] }, { - "id": "UnnecessaryQualifiedReference", + "id": "ChangeToMethod", "shortDescription": { - "text": "Unnecessary qualified reference" + "text": "Operator invocation can be replaced with method call" }, "fullDescription": { - "text": "Reports fully qualified references, which can be replaced with import. Example: 'def swingBuilder = new groovy.swing.SwingBuilder()' After the quick-fix is applied: 'import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()'", - "markdown": "Reports fully qualified references, which can be replaced with import.\n\n**Example:**\n\n\n def swingBuilder = new groovy.swing.SwingBuilder()\n\nAfter the quick-fix is applied:\n\n\n import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()\n" + "text": "Reports operator invocations that can be replaced with method calls. Example: 'a + b' After the quick-fix is applied: 'a.plus(b)'", + "markdown": "Reports operator invocations that can be replaced with method calls.\n\n**Example:**\n\n\n a + b\n\nAfter the quick-fix is applied:\n\n\n a.plus(b)\n" }, "defaultConfiguration": { "enabled": false, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "UnnecessaryQualifiedReference", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "ChangeToMethod", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" } }, "relationships": [ { "target": { - "id": "Groovy/Potentially confusing code constructs", - "index": 74, + "id": "Groovy/Style", + "index": 84, "toolComponent": { "name": "QDJVMC" } @@ -42403,28 +42403,28 @@ ] }, { - "id": "ChangeToMethod", + "id": "UnnecessaryQualifiedReference", "shortDescription": { - "text": "Operator invocation can be replaced with method call" + "text": "Unnecessary qualified reference" }, "fullDescription": { - "text": "Reports operator invocations that can be replaced with method calls. Example: 'a + b' After the quick-fix is applied: 'a.plus(b)'", - "markdown": "Reports operator invocations that can be replaced with method calls.\n\n**Example:**\n\n\n a + b\n\nAfter the quick-fix is applied:\n\n\n a.plus(b)\n" + "text": "Reports fully qualified references, which can be replaced with import. Example: 'def swingBuilder = new groovy.swing.SwingBuilder()' After the quick-fix is applied: 'import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()'", + "markdown": "Reports fully qualified references, which can be replaced with import.\n\n**Example:**\n\n\n def swingBuilder = new groovy.swing.SwingBuilder()\n\nAfter the quick-fix is applied:\n\n\n import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()\n" }, "defaultConfiguration": { "enabled": false, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "ChangeToMethod", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" + "suppressToolId": "UnnecessaryQualifiedReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ { "target": { - "id": "Groovy/Style", - "index": 84, + "id": "Groovy/Potentially confusing code constructs", + "index": 74, "toolComponent": { "name": "QDJVMC" } @@ -42457,7 +42457,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -42523,7 +42523,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -43051,7 +43051,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -43249,7 +43249,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -43513,7 +43513,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -43525,19 +43525,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" } @@ -43545,8 +43545,8 @@ "relationships": [ { "target": { - "id": "Groovy/Method metrics", - "index": 107, + "id": "Groovy/Potentially confusing code constructs", + "index": 74, "toolComponent": { "name": "QDJVMC" } @@ -43558,19 +43558,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" } @@ -43578,8 +43578,8 @@ "relationships": [ { "target": { - "id": "Groovy/Potentially confusing code constructs", - "index": 74, + "id": "Groovy/Method metrics", + "index": 107, "toolComponent": { "name": "QDJVMC" } @@ -43690,19 +43690,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" } @@ -43710,8 +43710,8 @@ "relationships": [ { "target": { - "id": "Groovy/Potentially confusing code constructs", - "index": 74, + "id": "Groovy/Probable bugs", + "index": 54, "toolComponent": { "name": "QDJVMC" } @@ -43723,19 +43723,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" } @@ -43743,8 +43743,8 @@ "relationships": [ { "target": { - "id": "Groovy/Probable bugs", - "index": 54, + "id": "Groovy/Potentially confusing code constructs", + "index": 74, "toolComponent": { "name": "QDJVMC" } @@ -43975,7 +43975,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -44239,7 +44239,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -44536,7 +44536,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -45196,7 +45196,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -45394,7 +45394,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -45658,7 +45658,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -45922,7 +45922,7 @@ { "target": { "id": "Groovy/Control flow issues", - "index": 72, + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -45967,19 +45967,19 @@ ] }, { - "id": "GroovySynchronizationOnNonFinalField", + "id": "GroovyReturnFromClosureCanBeImplicit", "shortDescription": { - "text": "Synchronization on non-final field" + "text": "'return' statement can be implicit" }, "fullDescription": { - "text": "Reports 'synchronized' statements where the lock expression is a non-'final' field. Such statements are unlikely to have useful semantics, as different threads may be locking on different objects even when operating on the same object.", - "markdown": "Reports `synchronized` statements where the lock expression is a non-`final` field.\n\n\nSuch statements are unlikely to have useful semantics, as different\nthreads may be locking on different objects even when operating on the same object." + "text": "Reports return statements at the end of closures which can be made implicit. Groovy closures implicitly return the value of the last statement in them. Example: 'def foo = {\n return 1\n }' After the quick-fix is applied: 'def foo = {\n 1\n }'", + "markdown": "Reports return statements at the end of closures which can be made implicit.\n\n\nGroovy closures implicitly return the value of the last statement in them.\n\n**Example:**\n\n\n def foo = {\n return 1\n }\n\nAfter the quick-fix is applied:\n\n\n def foo = {\n 1\n }\n" }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovySynchronizationOnNonFinalField", + "suppressToolId": "GroovyReturnFromClosureCanBeImplicit", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -45987,8 +45987,8 @@ "relationships": [ { "target": { - "id": "Groovy/Threading issues", - "index": 38, + "id": "Groovy/Control flow issues", + "index": 73, "toolComponent": { "name": "QDJVMC" } @@ -46000,19 +46000,19 @@ ] }, { - "id": "GroovyReturnFromClosureCanBeImplicit", + "id": "GroovySynchronizationOnNonFinalField", "shortDescription": { - "text": "'return' statement can be implicit" + "text": "Synchronization on non-final field" }, "fullDescription": { - "text": "Reports return statements at the end of closures which can be made implicit. Groovy closures implicitly return the value of the last statement in them. Example: 'def foo = {\n return 1\n }' After the quick-fix is applied: 'def foo = {\n 1\n }'", - "markdown": "Reports return statements at the end of closures which can be made implicit.\n\n\nGroovy closures implicitly return the value of the last statement in them.\n\n**Example:**\n\n\n def foo = {\n return 1\n }\n\nAfter the quick-fix is applied:\n\n\n def foo = {\n 1\n }\n" + "text": "Reports 'synchronized' statements where the lock expression is a non-'final' field. Such statements are unlikely to have useful semantics, as different threads may be locking on different objects even when operating on the same object.", + "markdown": "Reports `synchronized` statements where the lock expression is a non-`final` field.\n\n\nSuch statements are unlikely to have useful semantics, as different\nthreads may be locking on different objects even when operating on the same object." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "GroovyReturnFromClosureCanBeImplicit", + "suppressToolId": "GroovySynchronizationOnNonFinalField", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -46020,8 +46020,8 @@ "relationships": [ { "target": { - "id": "Groovy/Control flow issues", - "index": 72, + "id": "Groovy/Threading issues", + "index": 38, "toolComponent": { "name": "QDJVMC" } @@ -47794,19 +47794,19 @@ ] }, { - "id": "XmlDeprecatedElement", + "id": "RegExpRedundantNestedCharacterClass", "shortDescription": { - "text": "Deprecated symbol" + "text": "Redundant nested character class" }, "fullDescription": { - "text": "Reports a deprecated XML element or attribute. Symbols can be marked by XML comment or documentation tag with text 'deprecated'.", - "markdown": "Reports a deprecated XML element or attribute.\n\nSymbols can be marked by XML comment or documentation tag with text 'deprecated'." + "text": "Reports unnecessary nested character classes. Example: '[a-c[x-z]]' After the quick-fix is applied: '[a-cx-z]' New in 2020.2", + "markdown": "Reports unnecessary nested character classes.\n\n**Example:**\n\n\n [a-c[x-z]]\n\nAfter the quick-fix is applied:\n\n\n [a-cx-z]\n\nNew in 2020.2" }, "defaultConfiguration": { - "enabled": false, + "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "XmlDeprecatedElement", + "suppressToolId": "RegExpRedundantNestedCharacterClass", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -47814,8 +47814,8 @@ "relationships": [ { "target": { - "id": "XML", - "index": 65, + "id": "RegExp", + "index": 83, "toolComponent": { "name": "QDJVMC" } @@ -47827,19 +47827,19 @@ ] }, { - "id": "RegExpRedundantNestedCharacterClass", + "id": "XmlDeprecatedElement", "shortDescription": { - "text": "Redundant nested character class" + "text": "Deprecated symbol" }, "fullDescription": { - "text": "Reports unnecessary nested character classes. Example: '[a-c[x-z]]' After the quick-fix is applied: '[a-cx-z]' New in 2020.2", - "markdown": "Reports unnecessary nested character classes.\n\n**Example:**\n\n\n [a-c[x-z]]\n\nAfter the quick-fix is applied:\n\n\n [a-cx-z]\n\nNew in 2020.2" + "text": "Reports a deprecated XML element or attribute. Symbols can be marked by XML comment or documentation tag with text 'deprecated'.", + "markdown": "Reports a deprecated XML element or attribute.\n\nSymbols can be marked by XML comment or documentation tag with text 'deprecated'." }, "defaultConfiguration": { - "enabled": true, + "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "RegExpRedundantNestedCharacterClass", + "suppressToolId": "XmlDeprecatedElement", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -47847,8 +47847,8 @@ "relationships": [ { "target": { - "id": "RegExp", - "index": 83, + "id": "XML", + "index": 65, "toolComponent": { "name": "QDJVMC" } @@ -48065,6 +48065,282 @@ ], "isComprehensive": false }, + { + "name": "com.intellij.java-i18n", + "version": "233.14714", + "rules": [ + { + "id": "UnusedMessageFormatParameter", + "shortDescription": { + "text": "Missing message format parameter" + }, + "fullDescription": { + "text": "Reports properties values that look like 'java.text.MessageFormat' format strings but do not use some the parameters of the '{xx}' kind. Example: '# parameter {0} is not used\nerror.message=Something happened in line {1}'", + "markdown": "Reports properties values that look like `java.text.MessageFormat` format strings but do not use some the parameters of the `{xx}` kind.\n\nExample:\n\n\n # parameter {0} is not used\n error.message=Something happened in line {1}\n \n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedMessageFormatParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToBasicLatin", + "shortDescription": { + "text": "Non-Basic Latin character" + }, + "fullDescription": { + "text": "Reports non-Basic Latin characters in literals and suggests replacing them with unicode entities. Example: '// © 2021\n char c = '©';\n String s = \"Áî\";'\n After the quick-fix is applied: '// © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";'", + "markdown": "Reports non-Basic Latin characters in literals and suggests replacing them with unicode entities.\n\nExample:\n\n\n // © 2021\n char c = '©';\n String s = \"Áî\";\n\nAfter the quick-fix is applied:\n\n\n // © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertToBasicLatin", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InconsistentResourceBundle", + "shortDescription": { + "text": "Inconsistent resource bundle" + }, + "fullDescription": { + "text": "Reports problems in the properties files contained in the resource bundle. Report missing translations Use this option to report properties contained in the parent properties file that are missing in inherited ones (unless it's a language dialect). Example: '# messages.properties\n abc=xxx\n\n # messages_fr.properties\n # Empty file' Property 'abc' will be reported as untranslated. Report inconsistent properties Use this option to report properties contained in inherited properties file that are missing in the parent one (or in siblings if there is no parent). Example: '# messages.properties\n # Empty file\n\n # messages_fr.properties\n abc=xxx' Property 'abc' translation is not available here for any language except French, and, thus, will be reported as missing in the (default) properties file 'messages.properties'. Report properties overridden with the same value Use this option to report properties copy-pasted into several properties files verbatim. Example: '# messages.properties\n abc=xxx\n\n # messages_fr.properties\n abc=xxx' Property 'abc' will be reported as unnecessarily inherited in the file 'messages_fr.properties' . Report properties overridden with different placeholders Use this option to check for placeholder consistency in overridden properties. Example: '# messages.properties\n qwe={0}xxx{1}\n abc={0}yyy{1}\n\n # messages_fr.properties\n qwe={0}xxx{0}xxx{1}\n abc={0}yyy' Property 'abc' will be reported as a property containing message format placeholders not corresponding to 'messages.properties'. Report properties overridden with different values endings Use this option to check for ending consistency in overridden properties. Example: '# messages.properties\n abc=xxxzzz\n\n # messages_fr.properties\n abc=xxx;' Property 'abc' will be reported as ending with special signs ('!' / '?' / '.' / ':' / ';') whereas the parent value in 'messages.properties' doesn't.", + "markdown": "Reports problems in the properties files contained in the resource bundle.\n\n* **Report missing translations** \n\n Use this option to report properties contained in the parent properties file that are missing in inherited ones (unless it's a language dialect). \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n # Empty file\n \n Property `abc` will be reported as untranslated. \n\n* **Report inconsistent properties** \n\n Use this option to report properties contained in inherited properties file that are missing in the parent one (or in siblings if there is no parent). \n\n Example:\n\n\n # messages.properties\n # Empty file\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` translation is not available here for any language except French, and, thus, will be reported as missing in the (default) properties file `messages.properties`. \n\n* **Report properties overridden with the same value** \n\n Use this option to report properties copy-pasted into several properties files verbatim. \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` will be reported as unnecessarily inherited in the file `messages_fr.properties` . \n\n* **Report properties overridden with different placeholders** \n\n Use this option to check for placeholder consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n qwe={0}xxx{1}\n abc={0}yyy{1}\n\n # messages_fr.properties\n qwe={0}xxx{0}xxx{1}\n abc={0}yyy\n \n Property `abc` will be reported as a property containing message format placeholders not corresponding to `messages.properties`. \n\n* **Report properties overridden with different values endings** \n\n Use this option to check for ending consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n abc=xxxzzz\n\n # messages_fr.properties\n abc=xxx;\n \n Property `abc` will be reported as ending with special signs (`!` / `?` / `.` / `:` / `;`) whereas the parent value in `messages.properties` doesn't." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "InconsistentResourceBundle", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HardCodedStringLiteral", + "shortDescription": { + "text": "Hardcoded strings" + }, + "fullDescription": { + "text": "Reports any instances of hardcoded 'String' literals. Hardcoded 'String' literals are probably errors in an internationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available to transform a string literal into a 'java.util.ResourceBundle.getString()' method call.", + "markdown": "Reports any instances of hardcoded `String` literals.\n\nHardcoded `String` literals are probably errors in an\ninternationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available\nto transform a string literal into a `java.util.ResourceBundle.getString()` method call." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HardCodedStringLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DialogTitleCapitalization", + "shortDescription": { + "text": "Incorrect string capitalization" + }, + "fullDescription": { + "text": "Reports strings in method parameters and return values annotated with '@Nls' and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines. Example: 'void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\");' After the quick-fix is applied: 'setTitle(\"This Is Sentence Capitalization but Should Be Title\");'", + "markdown": "Reports strings in method parameters and return values annotated with `@Nls` and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines.\n\n**Example:**\n\n\n void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\"); \n\nAfter the quick-fix is applied:\n\n\n setTitle(\"This Is Sentence Capitalization but Should Be Title\"); \n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DialogTitleCapitalization", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnresolvedPropertyKey", + "shortDescription": { + "text": "Invalid property key" + }, + "fullDescription": { + "text": "Reports invalid arguments that are passed to methods with parameters annotated as '@PropertyKey'. These arguments should be valid property keys in corresponding properties files. Also, the inspection verifies that the 'resourceBundle' argument of the '@PropertyKey' annotation is an existing resource bundle. Use the quick-fix to create a new property or to select an existing one. Example: '@PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";'", + "markdown": "Reports invalid arguments that are passed to methods with parameters annotated as `@PropertyKey`.\n\nThese arguments should be valid property keys in corresponding properties files.\nAlso, the inspection verifies that the `resourceBundle`\nargument of the `@PropertyKey` annotation is an existing resource bundle.\n\n\nUse the quick-fix to create a new property or to select an existing one.\n\nExample:\n\n\n @PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";\n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "UnresolvedPropertyKey", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Properties files", + "index": 120, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousLocalesLanguages", + "shortDescription": { + "text": "Suspicious resource bundle locale languages" + }, + "fullDescription": { + "text": "Reports locales with language codes that are not supported by Java.", + "markdown": "Reports locales with language codes that are not supported by Java." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousLocalesLanguages", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicateStringLiteralInspection", + "shortDescription": { + "text": "Duplicate string literal" + }, + "fullDescription": { + "text": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal. Example: 'class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }' Configure the inspection: Use the Min string length field to set the minimal string length required to detect duplicates. Use the Ignore @PropertyKey expressions option to ignore strings passed as arguments to methods annotated with 'org.jetbrains.annotations.PropertyKey'.", + "markdown": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal.\n\nExample:\n\n\n class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }\n\nConfigure the inspection:\n\n* Use the **Min string length** field to set the minimal string length required to detect duplicates.\n* Use the **Ignore @PropertyKey expressions** option to ignore strings passed as arguments to methods annotated with `org.jetbrains.annotations.PropertyKey`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicateStringLiteralInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, { "name": "org.editorconfig.editorconfigjetbrains", "version": "233.14714", @@ -48091,7 +48367,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48124,7 +48400,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48157,7 +48433,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48190,7 +48466,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48223,7 +48499,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48256,7 +48532,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48289,7 +48565,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48322,7 +48598,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48355,7 +48631,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48388,7 +48664,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48421,7 +48697,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48454,7 +48730,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48487,7 +48763,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48520,7 +48796,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48553,7 +48829,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48586,7 +48862,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48619,7 +48895,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48652,7 +48928,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48685,7 +48961,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48718,7 +48994,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48751,7 +49027,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48784,7 +49060,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48817,7 +49093,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48850,7 +49126,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48883,7 +49159,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48916,7 +49192,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48949,7 +49225,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -48982,7 +49258,7 @@ { "target": { "id": "EditorConfig", - "index": 31, + "index": 32, "toolComponent": { "name": "QDJVMC" } @@ -49015,249 +49291,6 @@ { "target": { "id": "EditorConfig", - "index": 31, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.java-i18n", - "version": "233.14714", - "rules": [ - { - "id": "UnusedMessageFormatParameter", - "shortDescription": { - "text": "Missing message format parameter" - }, - "fullDescription": { - "text": "Reports properties values that look like 'java.text.MessageFormat' format strings but do not use some the parameters of the '{xx}' kind. Example: '# parameter {0} is not used\nerror.message=Something happened in line {1}'", - "markdown": "Reports properties values that look like `java.text.MessageFormat` format strings but do not use some the parameters of the `{xx}` kind.\n\nExample:\n\n\n # parameter {0} is not used\n error.message=Something happened in line {1}\n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnusedMessageFormatParameter", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 32, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConvertToBasicLatin", - "shortDescription": { - "text": "Non-Basic Latin character" - }, - "fullDescription": { - "text": "Reports non-Basic Latin characters in literals and suggests replacing them with unicode entities. Example: '// © 2021\n char c = '©';\n String s = \"Áî\";'\n After the quick-fix is applied: '// © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";'", - "markdown": "Reports non-Basic Latin characters in literals and suggests replacing them with unicode entities.\n\nExample:\n\n\n // © 2021\n char c = '©';\n String s = \"Áî\";\n\nAfter the quick-fix is applied:\n\n\n // © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ConvertToBasicLatin", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Internationalization", - "index": 9, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "InconsistentResourceBundle", - "shortDescription": { - "text": "Inconsistent resource bundle" - }, - "fullDescription": { - "text": "Reports problems in the properties files contained in the resource bundle. Report missing translations Use this option to report properties contained in the parent properties file that are missing in inherited ones (unless it's a language dialect). Example: '# messages.properties\n abc=xxx\n\n # messages_fr.properties\n # Empty file' Property 'abc' will be reported as untranslated. Report inconsistent properties Use this option to report properties contained in inherited properties file that are missing in the parent one (or in siblings if there is no parent). Example: '# messages.properties\n # Empty file\n\n # messages_fr.properties\n abc=xxx' Property 'abc' translation is not available here for any language except French, and, thus, will be reported as missing in the (default) properties file 'messages.properties'. Report properties overridden with the same value Use this option to report properties copy-pasted into several properties files verbatim. Example: '# messages.properties\n abc=xxx\n\n # messages_fr.properties\n abc=xxx' Property 'abc' will be reported as unnecessarily inherited in the file 'messages_fr.properties' . Report properties overridden with different placeholders Use this option to check for placeholder consistency in overridden properties. Example: '# messages.properties\n qwe={0}xxx{1}\n abc={0}yyy{1}\n\n # messages_fr.properties\n qwe={0}xxx{0}xxx{1}\n abc={0}yyy' Property 'abc' will be reported as a property containing message format placeholders not corresponding to 'messages.properties'. Report properties overridden with different values endings Use this option to check for ending consistency in overridden properties. Example: '# messages.properties\n abc=xxxzzz\n\n # messages_fr.properties\n abc=xxx;' Property 'abc' will be reported as ending with special signs ('!' / '?' / '.' / ':' / ';') whereas the parent value in 'messages.properties' doesn't.", - "markdown": "Reports problems in the properties files contained in the resource bundle.\n\n* **Report missing translations** \n\n Use this option to report properties contained in the parent properties file that are missing in inherited ones (unless it's a language dialect). \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n # Empty file\n \n Property `abc` will be reported as untranslated. \n\n* **Report inconsistent properties** \n\n Use this option to report properties contained in inherited properties file that are missing in the parent one (or in siblings if there is no parent). \n\n Example:\n\n\n # messages.properties\n # Empty file\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` translation is not available here for any language except French, and, thus, will be reported as missing in the (default) properties file `messages.properties`. \n\n* **Report properties overridden with the same value** \n\n Use this option to report properties copy-pasted into several properties files verbatim. \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` will be reported as unnecessarily inherited in the file `messages_fr.properties` . \n\n* **Report properties overridden with different placeholders** \n\n Use this option to check for placeholder consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n qwe={0}xxx{1}\n abc={0}yyy{1}\n\n # messages_fr.properties\n qwe={0}xxx{0}xxx{1}\n abc={0}yyy\n \n Property `abc` will be reported as a property containing message format placeholders not corresponding to `messages.properties`. \n\n* **Report properties overridden with different values endings** \n\n Use this option to check for ending consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n abc=xxxzzz\n\n # messages_fr.properties\n abc=xxx;\n \n Property `abc` will be reported as ending with special signs (`!` / `?` / `.` / `:` / `;`) whereas the parent value in `messages.properties` doesn't." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "InconsistentResourceBundle", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 32, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HardCodedStringLiteral", - "shortDescription": { - "text": "Hardcoded strings" - }, - "fullDescription": { - "text": "Reports any instances of hardcoded 'String' literals. Hardcoded 'String' literals are probably errors in an internationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available to transform a string literal into a 'java.util.ResourceBundle.getString()' method call.", - "markdown": "Reports any instances of hardcoded `String` literals.\n\nHardcoded `String` literals are probably errors in an\ninternationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available\nto transform a string literal into a `java.util.ResourceBundle.getString()` method call." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HardCodedStringLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Internationalization", - "index": 9, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DialogTitleCapitalization", - "shortDescription": { - "text": "Incorrect string capitalization" - }, - "fullDescription": { - "text": "Reports strings in method parameters and return values annotated with '@Nls' and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines. Example: 'void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\");' After the quick-fix is applied: 'setTitle(\"This Is Sentence Capitalization but Should Be Title\");'", - "markdown": "Reports strings in method parameters and return values annotated with `@Nls` and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines.\n\n**Example:**\n\n\n void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\"); \n\nAfter the quick-fix is applied:\n\n\n setTitle(\"This Is Sentence Capitalization but Should Be Title\"); \n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "DialogTitleCapitalization", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Internationalization", - "index": 9, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnresolvedPropertyKey", - "shortDescription": { - "text": "Invalid property key" - }, - "fullDescription": { - "text": "Reports invalid arguments that are passed to methods with parameters annotated as '@PropertyKey'. These arguments should be valid property keys in corresponding properties files. Also, the inspection verifies that the 'resourceBundle' argument of the '@PropertyKey' annotation is an existing resource bundle. Use the quick-fix to create a new property or to select an existing one. Example: '@PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";'", - "markdown": "Reports invalid arguments that are passed to methods with parameters annotated as `@PropertyKey`.\n\nThese arguments should be valid property keys in corresponding properties files.\nAlso, the inspection verifies that the `resourceBundle`\nargument of the `@PropertyKey` annotation is an existing resource bundle.\n\n\nUse the quick-fix to create a new property or to select an existing one.\n\nExample:\n\n\n @PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "error", - "parameters": { - "suppressToolId": "UnresolvedPropertyKey", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Properties files", - "index": 120, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SuspiciousLocalesLanguages", - "shortDescription": { - "text": "Suspicious resource bundle locale languages" - }, - "fullDescription": { - "text": "Reports locales with language codes that are not supported by Java.", - "markdown": "Reports locales with language codes that are not supported by Java." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SuspiciousLocalesLanguages", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", "index": 32, "toolComponent": { "name": "QDJVMC" @@ -49268,39 +49301,6 @@ ] } ] - }, - { - "id": "DuplicateStringLiteralInspection", - "shortDescription": { - "text": "Duplicate string literal" - }, - "fullDescription": { - "text": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal. Example: 'class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }' Configure the inspection: Use the Min string length field to set the minimal string length required to detect duplicates. Use the Ignore @PropertyKey expressions option to ignore strings passed as arguments to methods annotated with 'org.jetbrains.annotations.PropertyKey'.", - "markdown": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal.\n\nExample:\n\n\n class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }\n\nConfigure the inspection:\n\n* Use the **Min string length** field to set the minimal string length required to detect duplicates.\n* Use the **Ignore @PropertyKey expressions** option to ignore strings passed as arguments to methods annotated with `org.jetbrains.annotations.PropertyKey`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DuplicateStringLiteralInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Java/Internationalization", - "index": 9, - "toolComponent": { - "name": "QDJVMC" - } - }, - "kinds": [ - "superset" - ] - } - ] } ], "language": "en-US", @@ -49645,7 +49645,7 @@ { "target": { "id": "Plugin DevKit/Workspace model", - "index": 56, + "index": 57, "toolComponent": { "name": "QDJVMC" } @@ -49744,7 +49744,7 @@ { "target": { "id": "Plugin DevKit/Workspace model", - "index": 56, + "index": 57, "toolComponent": { "name": "QDJVMC" } @@ -51691,7 +51691,7 @@ { "target": { "id": "Plugin DevKit/Workspace model", - "index": 56, + "index": 57, "toolComponent": { "name": "QDJVMC" } @@ -52387,7 +52387,7 @@ { "target": { "id": "Properties files", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -52420,7 +52420,7 @@ { "target": { "id": "Properties files", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -52453,7 +52453,7 @@ { "target": { "id": "Properties files", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -52486,7 +52486,7 @@ { "target": { "id": "Properties files", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -52519,7 +52519,7 @@ { "target": { "id": "Properties files", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -52552,7 +52552,7 @@ { "target": { "id": "Properties files", - "index": 32, + "index": 31, "toolComponent": { "name": "QDJVMC" } @@ -52995,7 +52995,7 @@ }, "invocations": [ { - "startTimeUtc": "2024-04-07T19:07:40.275962883Z", + "startTimeUtc": "2024-04-07T19:26:54.364608591Z", "exitCode": 0, "toolExecutionNotifications": [ { @@ -53003,7 +53003,7 @@ "text": "Analysis by sanity inspection \"Sanity\" was suspended due to high number of problems." }, "level": "error", - "timeUtc": "2024-04-07T19:12:02.610825588Z", + "timeUtc": "2024-04-07T19:31:09.65989098Z", "properties": { "qodanaKind": "sanityFailure" } @@ -53016,7 +53016,7 @@ "versionControlProvenance": [ { "repositoryUri": "https://github.com/cvette/intellij-neos.git", - "revisionId": "e16bb7633abe2287d7ad5fd47fc0539fee8f5afc", + "revisionId": "7fbfd9180ed7e9ee2e15525219b4108d4d090796", "branch": "refs/heads/main", "properties": { "repoUrl": "https://github.com/cvette/intellij-neos", @@ -64878,9 +64878,9 @@ ], "automationDetails": { "id": "project/qodana/2024-04-07", - "guid": "b5d37468-2edb-4a64-b104-e1c2f395cc6c", + "guid": "586ca181-a175-46f4-8aa4-a8b3f76c960c", "properties": { - "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/8590961841" + "jobUrl": "https://github.com/cvette/intellij-neos/actions/runs/8591072885" } }, "newlineSequences": [