Fixes `NumericToString` inspection violations in test code.
Description:
>Reports any call of toString() on numeric objects. Such calls are usually incorrect in an internationalized environment.
Fixes `TryWithIdenticalCatches` inspection violations in test code.
Description:
>Reports identical catch sections in try blocks under JDK 7. A quickfix is available to collapse the sections into a multi-catch section.
This inspection only reports if the project or module is configured to use a language level of 7.0 or higher.
Fixes `MultipleExceptionsDeclaredOnTestMethod` inspection violations.
Description:
>Reports JUnit test methods with more than one exception declared in the throws clause. Such a throws clause can be more concisely declared as `throws Exception`.
Fixes some `ZeroLengthArrayInitialization` inspection violations.
Description:
>Reports on allocations of arrays with known lengths of zero. Since array lengths in Java are non-modifiable, it is almost always possible to share zero-length arrays, rather than repeatedly allocating new zero-length arrays. Such sharing may provide useful optimizations in program runtime or footprint. Note that this inspection does not report zero-length arrays allocated as static final fields, as it is assumed that those arrays are being used to implement array sharing.
Fixes `StandardVariableNames` inspection violations in test code.
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 `CallToSimpleSetterInClass` inspection violations.
Description:
>Reports any calls to a simple property setter from within the property's class. A simple property setter is defined as one which simply assigns the value of its parameter to a field, and does no other calculation. Such simple setter calls may be safely inlined, at a small performance improvement. Some coding standards also suggest against the use of simple setters for code clarity reasons.
Fixes `FieldMayBeStatic` inspection violations.
Description:
>Reports any instance variables which may safely be made static. A field may be static if it is declared final, and is initialized with a constant.
Fixes `ParametersPerMethod` inspection violation.
Description:
>Reports methods with too many parameters. Methods with too many parameters can be a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection.
Fixes `SuspiciousGetterSetter` inspection violations.
Description:
>Reports suspicious getter or setter methods. A getter or setter is suspicious if it accesses a different field than would be expected by its name.
Fixes `RedundantMethodOverride` inspection violations in test code.
Description:
>Reports any method that has a body and signature that are identical to its super method. Such a method is redundant and probably a coding error.
Fixes `ConstantNamingConvention` inspection violations in test code.
Description:
>Reports any constants whose names are either too short, too long, or do not follow the specified regular expression pattern. Constants are fields declared static final.
Fixes `MethodCanBeVariableArityMethod` inspection violations in test code.
Description:
>Reports methods with which can be converted to be a variable arity/varargs method, available in Java 5 and newer.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
Additionally, obsolete assertions were removed.
Fixes `TooBroadScope` inspection violations.
Description:
>Reports any variable declarations of which the scope can be narrowed. Especially useful for "Pascal style" declarations at the start of a method, but variables with too broad a scope are also often left over after refactorings.
Fixes `StaticMethodNamingConvention` inspection violations in test code.
Description:
>Reports static methods whose names are either too short, too long, or do not follow the specified regular expression pattern.
Fixes `ThrowsRuntimeException` inspection violations in test code.
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 `UnnecessaryLocalVariable` inspection violation.
Description:
>Reports unnecessary local variables, which add nothing to the comprehensibility of a method. Variables caught include local variables which are immediately returned, local variables that are immediately assigned to another variable and then not used, and local variables which always have the same value as another local variable or parameter.
Fixes `NegativelyNamedBooleanVariable` inspection violation.
Description:
>Reports negatively named variables, for example 'disabled', 'hidden', 'isNotChanged'. It is usually more clear to invert the boolean value and remove the negation from the name.
Fixes `CanBeFinal` inspection violations in test code.
Description:
>This inspection reports all fields, methods or classes, found in the specified inspection scope, that may have a final modifier added to their declarations.
Fixes `ReturnOfCollectionField` inspection violations in test code.
Description:
>Reports any attempt to return an array or Collection field from a method. 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.
Fixes `UnnecessaryFullyQualifiedName` inspection violations in test code.
Description:
>Reports on fully qualified class names which can be shortened. The quick fix for this inspection will shorten the fully qualified names, adding import statements as necessary.
Fixes `BadExceptionThrown` inspection violations in test code.
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 `CallToSimpleSetterInClass` inspection violations in test code.
Description:
>Reports any calls to a simple property setter from within the property's class. A simple property setter is defined as one which simply assigns the value of its parameter to a field, and does no other calculation. Such simple setter calls may be safely inlined, at a small performance improvement. Some coding standards also suggest against the use of simple setters for code clarity reasons.
Fixes `ObjectToString` inspection violations in test code.
Description:
>Reports any calls to .toString() which use the default implementation from java.lang.Object. The default implementation is rarely desired, but easy to use by accident. Calls to .toString() on objects of type java.lang.Object are ignored by this inspection.
Fixes `StringConcatenationInsideStringBufferAppend` inspection violations in test code.
Description:
>Reports String concatenation used as the argument to StringBuffer.append(), StringBuilder.append() or Appendable.append(). Such calls may profitably be turned into chained append calls on the existing StringBuffer/Builder/Appendable, saving the cost of an extra StringBuffer/Builder allocation.
This inspection ignores compile time evaluated String concatenations, which when converted to chained append calls would only worsen performance.
Fixes `LengthOneStringInIndexOf` inspection violations in test code.
Description:
>Reports String literals of length one being used as a parameter in String.indexOf() or String.lastIndexOf() calls. These String literals may be replaced by equivalent character literals, gaining some performance enhancement.
Fixes `MismatchedArrayReadWrite` inspection violations in test code.
Description:
>Reports any array fields or variables whose contents are read but not written, or written but not read. Such mismatched reads and writes are pointless, and probably indicate dead, incomplete or erroneous code.
Fixes `UnusedAssignment` inspection violations in test code.
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 `RedundantArrayCreation` inspection violations in test code introduced after recent commits.
Description:
>This inspection reports unnecessary creation of array expression to be passed as an argument to varargs parameter.
Fixes `AnonymousClassVariableHidesContainingMethodVariable` inspection violations in test code introduced after recent commits.
Description:
>Reports anonymous class variables being named identically to variables of a containing method or lambda expression. Such a variable name may be confusing.
Fixes `MethodMayBeStatic` inspection violations in test code introduced after recent commits.
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 `MissingOverrideAnnotation` inspection violations in test code.
Description:
>Reports any methods which override methods in a superclass but do not have the @java.lang.Override annotation.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
Fixes ` UnusedMessageFormatParameter` inspection violation introduced in #1648.
Description:
>This inspection reports properties values which looks like java.text.MessageFormat format strings but do not use some of the parameters of {xx} kind.
For example:
```
# parameter {0} is not used
error.message=Something happened in line {1}
```
Fixes `ArraysAsListWithZeroOrOneArgument` inspection violations in test code.
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.