Fixes MagicConstant violations.
Description:
> Report occurrences where usages of "magic" constants only are allowed but other expressions are used instead. E.g. new Font("Arial", 2 ) // not allowed instead of new Font("Arial", Font. ITALIC ) // OK Please see org.intellij.lang.annotations.MagicConstant annotation description for details.
Fixes `BadExceptionThrown` inspection violations.
Description:
>Reports throw statements which throw inappropriate exceptions. One use of this inspection would be to warn of throw statements which throw overly generic exceptions (e.g. java.lang.Exception or java.io.IOException).
Fixes `ThrowsRuntimeException` inspection violation.
Description:
Reports declarations of unchecked exceptions (RuntimeException and its subclasses) in the throws clause of a method. Declaration of unchecked exceptions are not required and may be removed or moved to a Javadoc @throws tag.
Fixes `UnusedCatchParameter` inspection violations.
Description:
Reports any catch parameters that are unused in their corresponding blocks. This inspection will not report any catch parameters named "ignore" or "ignored". Conversely this inspection will warn on any catch parameters named "ignore" or "ignored" that are actually used.
Fixes `StringReplaceableByStringBuffer` inspection violations.
Description:
Reports any variables declared as java.lang.String which are repeatedly appended to. Such variables may be more efficiently declared as java.lang.StringBuffer or java.lang.StringBuilder.
Fixes `MethodMayBeStatic` inspection violation.
Description:
>Reports any methods which may safely be made static. A method may be static if it is not synchronized, it does not reference any of its class' non static methods and non static fields and is not overridden in a sub class.
Fixes `Simplify empty string check` inspection violations.
Description:
>Reports .equals() being called to compare a String with an empty string. It is normally more performant to test a String for emptiness by comparing its .length() to zero instead.
Fixes `ToArrayCallWithZeroLengthArrayArgument` inspection violation.
Description:
>Reports any call to toArray() on an object of type or subtype java.util.Collection with a zero-length array argument. When passing in an array of too small size, the toArray() method has to construct a new array of the right size using reflection. This has significantly worse performance than passing in an array of at least the size of the collection itself.
Fixes `ArraysAsListWithZeroOrOneArgument` inspection violation.
Description:
>Reports any calls to Arrays.asList() with zero arguments or only one argument. Such calls could be replaced with either a call to Collections.singletonList() or Collections.emptyList() which will save some memory.
Fixes `FloatingPointEquality` inspection violation.
Description:
>Reports floating-point values being compared with an == or != operator. Floating point values are inherently inaccurate, and comparing them for exact equality is almost never the desired semantics. This inspection ignores comparisons with zero and infinity literals.
Fixes `QuestionableName` inspection violations.
Description:
>Reports on any variables, methods, or classes with questionable names. This inspection is best used to report common metasyntactic variables which may be used as names by lazy or confused developers.
Use the list below to specify names which should be reported
Fixes `StandardVariableNames` inspection violations.
Description:
>Reports on any variables with 'standard' names which are of unexpected types. Such names may be confusing. Standard names and types are as follows:
* i, j, k, m, n - int
* f - float
* d - double
* b - byte
* c, ch - char
* l - long
* s, str - String
Fixes `UseOfPropertiesAsHashtable` inspection violations.
Description:
>Reports any calls to the java.util.Hashtable methods put(), putAll() or get() on a java.util.Properties object. For reasons lost to history, Properties inherits from Hashtable, but use of those methods is discouraged to prevent corruption of properties values with non-String data.
Fixes ClassNewInstance inspection violation.
Description:
Reports any calls to java.lang.Class.newInstance(). The newInstance method propagates any exception thrown by the no-arg constructor, including checked exceptions. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. Replacing such a method call with a call to the java.lang.reflect.Constructor.newInstance() method avoids this problem by wrapping any exception thrown by the constructor in a java.lang.reflect.InvocationTargetException.
Fixes SubtractionInCompareTo inspection violations.
Description:
>Reports subtraction in compareTo() methods and methods implementing java.util.Comparator.compare(). While it is a common idiom to use the results of integer subtraction as the result of a compareTo() method, this construct may cause subtle and difficult bugs in cases of integer overflow.
Fixes SuspiciousMethodCalls inspection violation.
Description:
>This inspection reports method calls to parameterized collections, where actual argument type does not correspond to the collection's elements type. For example if you have the following code:
```
List<Integer> list = getListOfElements();
list.remove("");
```
the call to `remove()` will be highlighted.
Fixes UnusedAssignment inspection violations.
Description:
>This inspection points out the cases where a variable value is never used after its assignment, i.e.:
- the variable never gets read after assignment OR
- the value is always overwritten with another assignment before the next variable read OR
- the variable initializer is redundant (for one of the above two reasons) OR
- the variable is never used.
Fixes AssignmentToCollectionFieldFromParameter violations.
Description:
>Reports any attempt to assign an array or Collection field from a method parameter. Since the array or Collection may have its contents modified by the calling method, this construct may result in an object having its state modified unexpectedly. While occasionally useful for performance reasons, this construct is inherently bug-prone.
While increment or decrement expressions nested inside other expressions are admirably terse, such expressions may be confusing, and violate the general design principle that a given construct should do precisely one thing.