Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
While suppression works fine, it causes false positive in `RedundantSuppression` inspection reported as [IDEA-144818](https://youtrack.jetbrains.com/issue/IDEA-144818).
Tag `@noinspection` is self-descriptive enough on its own.
ParameterNameDiffersFromOverriddenParameter does not require parameters to match names anymore if method is from external library and parameter may be wrongly named there.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes some `TestMethodWithoutAssertion` inspection violations.
Description:
>Reports test methods of JUnit test case classes that do not contain any assertions. Such methods indicate either incomplete or weak test cases.
Fixes `ConditionalExpression` inspection violations.
Description:
>Reports the ternary condition operator. Some coding standards prohibit the use of the condition operator, in favor of if-else statements.
Fixes `SpellCheckingInspection` inspection violations introduced in recent commits.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes `ProblematicWhitespace` inspection violations introduced in recent commits.
Description:
>Reports tabs used for indentation when the code style is configured to use only spaces.
Fixes `LocalVariableNamingConvention` inspection violations introduced in recent commits.
Description:
>Reports local variables whose names are either too short, too long, or do not follow the specified regular expression pattern.
Fixes `ZeroLengthArrayInitialization` inspection violations introduced in recent commits.
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 `SimplifiableJUnitAssertion` inspection violations introduced in recent commits.
Description:
>Reports any JUnit assertTrue calls which can be replaced by equivalent assertEquals calls. assertEquals calls will normally give better error messages in case of test failure than assertTrue can.
Fixes `MisorderedAssertEqualsParameters` inspection violations introduced in recent commits.
Description:
>Reports any calls to JUnit assertEquals() which have a non-literal as the expected result argument and a literal as the actual result argument. Such calls will behave fine for assertions which pass, but may give confusing error reports if their expected and actual arguments differ.
Fixes `StringToUpperWithoutLocale` inspection violations introduced in recent commits.
Description:
>Reports any call of toUpperCase() or toLowerCase() on String objects which do not specify a java.util.Locale. Such calls are usually incorrect in an internationalized environment.
Fixes `NewExceptionWithoutArguments` inspection violations introduced in recent commits.
Description:
>Reports exception instance creation without any arguments specified. When an exception is constructed without arguments it contains no information about the fault that happened, which makes debugging needlessly hard.
Fixes `TooBroadScope` inspection violations introduced in recent commits.
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 `UnnecessaryFullyQualifiedName` inspection violations introduced in recent commits.
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.
Inspection in this case is right. Parameter `Properties` can be replaced with `Map<Object, Object>`. It works fine with Checkstyle, but it breaks binary compatiblity with Maven Checkstyle Plugin, which is not acceptable.
Fixes `DeclareCollectionAsInterface` inspection violations.
Description:
>Reports on declarations of Collection variables made by using the collection class as the type, rather than an appropriate interface.
Fixes `TestCaseWithConstructor` inspection violations.
Description:
>Reports on JUnit test cases with initialization logic in their constructors. Initialization of JUnit test cases should be done in setUp() methods instead.
Fixes `UnnecessaryUnboxing` inspection violations.
Description:
>Reports "unboxing", e.g. explicit unwrapping of wrapped primitive values. Unboxing is unnecessary under Java 5 and newer, and can be safely removed.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
Fixes `UnnecessaryBoxing` inspection violations.
Description:
>Reports "boxing", e.g. wrapping of primitive values in objects. Boxing is unnecessary under Java 5 and newer, and can be safely removed.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
Fixes `Element (a.dl-link) is overqualified, just use .dl-link without element name.`
Description:
>Using selector like the one bellow is almost every time unnecessary, unless the element name causes the class to behave differently you can omit it. With this you will shrink the file size and speedup your page load time.
Fixes `Rule is empty` inspection violations.
Description:
>An empty rule is one that doesn't contain any properties, such as:
```
.foo {
}
```
A lot of times, empty rules appear as a result of refactoring without further cleanup. Eliminating empty rules results in smaller file sizes and less style information for the browser to deal with.
Fixes `ParameterNameDiffersFromOverriddenParameter` inspection violation.
Description:
>Reports parameters that have different names from the corresponding parameters in the methods they override. While legal in Java, such inconsistent names may be confusing, and lessen the documentation benefits of good naming practices.
Fixes `ParameterNameDiffersFromOverriddenParameter` inspection violation.
Description:
>Reports parameters that have different names from the corresponding parameters in the methods they override. While legal in Java, such inconsistent names may be confusing, and lessen the documentation benefits of good naming practices.
Fixes `IfStatementWithIdenticalBranches` inspection violation.
Description:
>Reports if statements with identical "then" and else branches. Such statements are almost certainly programmer error.
Fixes `IfStatementWithTooManyBranches` inspection violation.
Description:
>Reports if statements with too many branches. Such statements may be confusing, and are often the sign of inadequate levels of design abstraction.
Fixes `TooBroadScope` inspection violation.
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 `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 `WhileCanBeForeach` inspection violation.
Description:
>Reports while loops which iterate over collections, and can be replaced with the foreach iteration syntax, which is 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.
Fixes `ReturnOfCollectionField` inspection violation.
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 `ReuseOfLocalVariable` inspection violation.
Description:
>Reports local variables that are "reused", overwriting their values with new values unrelated to their original use. Such local variable reuse may be confusing, as the intended semantics of the local variable may vary with each use. It may also be prone to bugs, if code changes result in values that were thought to be overwritten actually being live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity.
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.
The issue was stream not being closed at all or closed, but not in finally block.
Fixes some `IOResource` inspection violations.
Description:
>Reports any I/O resource which is not safely closed in a finally block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. I/O resources checked by this inspection include java.io.InputStream, java.io.OutputStream, java.io.Reader, java.io.Writer and java.io.RandomAccessFile. I/O resources which are wrapped by other I/O resources are not reported, as the wrapped resource will be closed by the wrapping resource.
Fixes `SpellCheckingInspection` inspection violation.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals
Fixes `NegatedIfElse` inspection violation.
Description:
>Reports if statements which contain else branches and whose conditions are negated. Flipping the order of the if and else branches will usually increase the clarity of such statements.
Fixes `ReuseOfLocalVariable` inspection violation.
Description:
>Reports local variables that are "reused", overwriting their values with new values unrelated to their original use. Such local variable reuse may be confusing, as the intended semantics of the local variable may vary with each use. It may also be prone to bugs, if code changes result in values that were thought to be overwritten actually being live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity.
Fixes `UnusedImport` inspection violations.
Description:
>Reports any import statements that are unused. Since IDEA can automatically detect and fix such statements with its "Optimize Imports" command, this inspection is mostly useful for off-line reporting on code bases that you don't intend to change.
Fixes `MethodCanBeVariableArityMethod` inspection violations.
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.
Fixes `JUnitRule` inspection violations.
Description:
>Reports malformed @Rule/@ClassRule usages:
* Checks for any member that is annotated with @Rule but is not public.
* Checks for any member that is annotated with @ClassRule but is not public or not static.
Fixes `UseOfObsoleteAssert` inspection violations.
Description:
>Reports any calls to methods from the junit.framework.Assert class. This class is obsolete and the calls can be replaced by calls to methods from the org.junit.Assert class.
Fixes `BooleanMethodNameMustStartWithQuestion` inspection violations.
Description:
>Reports boolean methods whose names do not start with a question word. Boolean methods that override library methods are ignored by this inspection.
Fixes `MethodMayBeStatic` inspection violations.
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 `UnusedAssignment` inspection violations.
Description:
>This inspection points out the cases where a variable value is never used after its assignment
Fixes `ClassNewInstance` inspection violations.
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 `UnusedParameters` inspection violations.
Description:
>This inspection reports parameters that are not used by their methods and all method implementations/overriders.
The issue was stream not being closed at all or closed, but not in finally block.
Fixes some `IOResource` inspection violations.
Description:
>Reports any I/O resource which is not safely closed in a finally block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. I/O resources checked by this inspection include java.io.InputStream, java.io.OutputStream, java.io.Reader, java.io.Writer and java.io.RandomAccessFile. I/O resources which are wrapped by other I/O resources are not reported, as the wrapped resource will be closed by the wrapping resource.
Fixes `ForLoopWithMissingComponent` inspection violation.
Description:
>Reports for loops that lack initialization, condition, or update clauses. Some coding styles prohibit such loops.
Fixes `OverlyComplexBooleanExpression` inspection violation.
Description:
>Reports boolean expressions with too many terms. Such expressions may be confusing and bug-prone.
Fixes `PublicConstructorInNonPublicClass` inspection violations.
Description:
>Reports all constructors in non-public classes that are declared public.
Fixes `ObsoleteCollection` inspection violations.
Description:
>Reports any uses of java.util.Vector or java.util.Hashtable. While still supported, these classes were made obsolete by the JDK1.2 collection classes, and should probably not be used in new development.
Fixes `ReuseOfLocalVariable` inspection violation.
Description:
>Reports local variables that are "reused", overwriting their values with new values unrelated to their original use. Such local variable reuse may be confusing, as the intended semantics of the local variable may vary with each use. It may also be prone to bugs, if code changes result in values that were thought to be overwritten actually being live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity.
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 some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes some `BooleanMethodNameMustStartWithQuestion` inspection violations.
Description:
>Reports boolean methods whose names do not start with a question word. Boolean methods that override library methods are ignored by this inspection.
Fixes some `ReuseOfLocalVariable` inspection violations.
Description:
>Reports local variables that are "reused", overwriting their values with new values unrelated to their original use. Such local variable reuse may be confusing, as the intended semantics of the local variable may vary with each use. It may also be prone to bugs, if code changes result in values that were thought to be overwritten actually being live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity.
Fixes `ImplicitDefaultCharsetUsage` inspection violations.
Description:
>Reports method and constructor calls which implicitly use the platform's default charset. These can produce different results on (e.g. foreign language) systems that use a different default charset, resulting in unexpected behaviour.
False-positive reported to JetBrains as [IDEA-144521](https://youtrack.jetbrains.com/issue/IDEA-144521).
Fixes `MismatchedArrayReadWrite` inspection violations.
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 `BooleanMethodNameMustStartWithQuestion` inspection violations.
Description:
>Reports boolean methods whose names do not start with a question word. Boolean methods that override library methods are ignored by this inspection.
Fixes `UnusedImport` inspection violations.
Description:
>Reports any import statements that are unused. Since IDEA can automatically detect and fix such statements with its "Optimize Imports" command, this inspection is mostly useful for off-line reporting on code bases that you don't intend to change.
Fixes `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 `CachedNumberConstructorCall` inspection violations.
Description:
>Reports any attempt to instantiate a new Long, Integer, Short or Byte object from a primitive long, integer, short or byte argument. It may be more efficient to use the static method valueOf() here (introduced in Java 5), which will cache objects for values between -128 and 127 inclusive.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
Fixes some `WeakerAccess` inspection violations.
Description:
>This inspection reports all fields, methods or classes, found in the specified inspection scope, that may have their access modifier narrowed down.
Fixes `TooBroadScope` inspection violations introduced in recent commit.
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 `NegatedIfElse` inspection violations introduced in recent commit.
Description:
>Reports if statements which contain else branches and whose conditions are negated. Flipping the order of the if and else branches will usually increase the clarity of such statements.
Fixes `UnnecessaryThis` inspection violations introduced in recent commit.
Description:
>Reports on any unnecessary uses of this in the code. Using this to disambiguate a code reference may easily become unnecessary via automatic refactorings, and is discouraged by many coding styles.
Fixes some `UnusedParameters` inspection violations.
Description:
>This inspection reports parameters that are not used by their methods and all method implementations/overriders.
Fixes `UnusedAssignment` inspection violations.
Description:
>This inspection points out the cases where a variable value is never used after its assignment.
Fixes `MethodMayBeStatic` inspection violation introduced in recent commit.
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 some `WeakerAccess` inspection violations.
Description:
>This inspection reports all fields, methods or classes, found in the specified inspection scope, that may have their access modifier narrowed down.
Fixes `RedundantThrowsDeclaration` inspection violations.
Description:
>This inspection reports exceptions that are declared in a method's signature but never thrown by the method itself.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
Fixes `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 `RedundantThrowsDeclaration` inspection violations.
Description:
>This inspection reports exceptions that are declared in a method's signature but never thrown by the method itself.
Fixes `UnnecessaryThis` inspection violations.
Description:
>Reports on any unnecessary uses of this in the code. Using this to disambiguate a code reference may easily become unnecessary via automatic refactorings, and is discouraged by many coding styles.
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 `BooleanMethodNameMustStartWithQuestion` inspection violations.
Description:
>Reports boolean methods whose names do not start with a question word. Boolean methods that override library methods are ignored by this inspection.
Fixes some `WeakerAccess` inspection violations.
Description:
>This inspection reports all fields, methods or classes, found in the specified inspection scope, that may have their access modifier narrowed down.
Fixes `NewExceptionWithoutArguments` inspection violation.
Description:
>Reports exception instance creation without any arguments specified. When an exception is constructed without arguments it contains no information about the fault that happened, which makes debugging needlessly hard.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click.
Fixes `UnnecessaryThis` inspection violations.
Description:
>Reports on any unnecessary uses of this in the code. Using this to disambiguate a code reference may easily become unnecessary via automatic refactorings, and is discouraged by many coding styles.
Fixes `RedundantThrows` inspection violations.
Description:
>This inspection reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations/derivatives.
Fixes some `ImplicitDefaultCharsetUsage` inspection violations.
Description:
>Reports method and constructor calls which implicitly use the platform's default charset. These can produce different results on (e.g. foreign language) systems that use a different default charset, resulting in unexpected behaviour.
Fixes `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 some `BooleanMethodNameMustStartWithQuestion` inspection violations.
Description:
>Reports boolean methods whose names do not start with a question word. Boolean methods that override library methods are ignored by this inspection
Fixes `MethodMayBeStatic` inspection violation introduced in recent commit.
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 `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 `DynamicRegexReplaceableByCompiledPattern` inspection violations.
Description:
>Reports calls to the regular expression methods of java.lang.String using constants 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.
Fixes `ObjectToString` inspection violations.
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 `EmptyMethod` inspection violations in test code.
Description:
>This inspection reports methods where:
- method is empty OR
- all implementations of interface method are empty OR
- method is empty itself and is overridden only by empty methods
Note that a method containing only the super() call and passing its own parameter is also considered empty. This inspection is automatically suppressed for methods annotated with special annotations, for example, EJB annotations javax.ejb.Init and javax.ejb.Remove.
Fixes some `SpellDynamicRegexReplaceableByCompiledPattern` inspection violations.
Description:
>Reports calls to the regular expression methods of java.lang.String using constants 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.
Fixes `CallToSimpleGetterInClass` inspection violations.
Description:
>Reports any calls to a simple property getter from within the property's class. A simple property getter is defined as one which simply returns the value of a field, and does no other calculation. Such simple getter calls may be safely inlined, at a small performance improvement. Some coding standards also suggest against the use of simple getters for code clarity reasons.
These cases are covered by EqualsVerifier anyway.
Fixes `ObjectEqualsNull` inspection violations.
Description:
>Reports on calls to .equals() which have null as an argument. The semantics of such calls are almost certainly not what was intended.
Details:
```
java.lang.AssertionError: Subclass: equals is not final.
Supply an instance of a redefined subclass using withRedefinedSubclass if equals cannot be final.
```
Fixes `ProtectedField` inspection violations in test code.
Description:
>Reports protected instance variables. Constants (i.e. variables marked static and final) are not reported.
Fixes `CheckedExceptionClass` inspection violations in test code.
Description:
>Reports checked exception classes (i.e. subclasses of Exception which are not also subclasses of RuntimeException). Certain coding standards require that all user-defined exception classes be unchecked.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click.
Fixes some `SpellDynamicRegexReplaceableByCompiledPattern` inspection violations.
Description:
>Reports calls to the regular expression methods of java.lang.String using constants 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.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click.
Fixes `NonBooleanMethodNameMayNotStartWithQuestion` inspection violations.
Description:
>Reports non-boolean methods whose names start with a question word. Non-boolean methods that override library methods are ignored by this inspection.
Fixes some `SpellCheckingInspection` inspection violations.
Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click.
Fixes some `SpellDynamicRegexReplaceableByCompiledPattern` inspection violations.
Description:
>Reports calls to the regular expression methods of java.lang.String using constants 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.
Fixes `UnnecessaryConstructor` inspection violations.
Description:
>Reports unnecessary constructors. A constructor is unnecessary if it is the only constructor of a class, has no parameters, has the same access modifiers as its containing class, and does not perform any initialization except explicitly or implicitly calling the super class constructor without arguments. Such a constructor can be safely removed as it will be generated by the compiler even if not specified.
Fixes `NewExceptionWithoutArguments` inspection violations.
Description:
>Reports exception instance creation without any arguments specified. When an exception is constructed without arguments it contains no information about the fault that happened, which makes debugging needlessly hard.
Fixes some `ParameterNameDiffersFromOverriddenParameter` inspection violations.
Description:
>Reports parameters that have different names from the corresponding parameters in the methods they override. While legal in Java, such inconsistent names may be confusing, and lessen the documentation benefits of good naming practices.
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 `ErrorRethrown` inspection violations.
Description:
>Reports try statements which catch java.lang.Error or any subclass and which do not rethrow the error. Statements which catch java.lang.ThreadDeath are not reported by this inspection.
Fixes `ImplicitDefaultCharsetUsage` inspection violations.
Description:
>Reports method and constructor calls which implicitly use the platform's default charset. These can produce different results on (e.g. foreign language) systems that use a different default charset, resulting in unexpected behaviour.
Fixes `CanBeFinal` inspection violations.
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 `MultipleExceptionsDeclaredOnTestMethod` inspection violation
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 `ZeroLengthArrayInitialization` inspection violation
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 `LocalVariableNamingConvention` inspection violations in test code.
Description:
>Reports local variables whose names are either too short, too long, or do not follow the specified regular expression pattern.
Fixes `AbsoluteAlignmentInUserInterface` inspection violations.
Description:
>Reports usages of absolute alignment constants from AWT and Swing. Internationalized applications should make use of relative alignment, because it respects locale component orientation settings.
Fixes `FieldMayBeStatic` inspection violations in test code.
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 `CallToSimpleGetterInClass` inspection violations.
Description:
>Reports any calls to a simple property getter from within the property's class. A simple property getter is defined as one which simply returns the value of a field, and does no other calculation. Such simple getter calls may be safely inlined, at a small performance improvement. Some coding standards also suggest against the use of simple getters for code clarity reasons.
Fixes `NonSerializableFieldInSerializableClass` inspection violation.
Description:
>Reports non-Serializable fields in Serializable classes. Such fields will result in runtime exceptions if the object is serialized. Fields declared transient or static are not reported, nor are fields of classes which have defined a writeObject method. For purposes of this inspection, fields with java.util.Collection or java.util.Map types are assumed to be Serializable, unless the types they are declared to contain are non-Serializable.
Fixes `LocalVariableHidingMemberVariable` inspection violation in test code.
Description:
>Reports local variables named identically to visible fields of their class or surrounding classes if it is a local variable inside of an inner or anonymous class. Such a variable name may be confusing.
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 `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 `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 `ZeroLengthArrayInitialization` inspection violations in test code.
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 `UnnecessaryLocalVariable` inspection violations.
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 `NegatedIfElse` inspection violations.
Description:
>Reports if statements which contain else branches and whose conditions are negated. Flipping the order of the if and else branches will usually increase the clarity of such statements.
Fixes `PublicConstructorInNonPublicClass` inspection violations.
Description:
>Reports all constructors in non-public classes that are declared public.
Fixes `CallToSimpleGetterInClass` inspection violations.
Description:
>Reports any calls to a simple property getter from within the property's class. A simple property getter is defined as one which simply returns the value of a field, and does no other calculation. Such simple getter calls may be safely inlined, at a small performance improvement. Some coding standards also suggest against the use of simple getters for code clarity reasons.
Fixes `IgnoreResultOfCall` inspection violations in test code.
Description:
>Reports any calls to specific methods where the result of that call is ignored. Both methods specified in the inspection's settings and methods annotated with org.jetbrains.annotations.Contract(pure=true) are checked. For many methods, ignoring the result is perfectly legitimate, but for some methods it is almost certainly an error. Examples of methods where ignoring the result of a call is likely to be an error include java.io.inputStream.read(), which returns the number of bytes actually read, any method on java.lang.String or java.math.BigInteger, as all of those methods are side-effect free and thus pointless if ignored.
Fixes `NullArgumentToVariableArgMethod` inspection violations in test code.
Description:
>Reports any calls to a variable-argument method which has a null in the variable-argument position (e.g System.out.printf("%s", null) ). Such a null argument may be confusing, as it is not wrapped as a single-element array, as may be expected.
Fixes `ClassNewInstance` inspection violations in test code.
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 `UseOfPropertiesAsHashtable` inspection violations in test code.
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 `StaticFieldReferenceOnSubclass` inspection violations.
Description:
>Reports static field accesses where the call is qualified by a subclass of the declaring class, rather than the declaring class itself. Java allows such qualification, but such accesses may be confusing, and may indicate a subtle confusion of inheritance and overriding.
Fixes `UnnecessaryToStringCall` inspection violations in test code.
Description:
>Reports on any calls to toString() used in string concatenations and as arguments to the print() and println() methods of java.io.PrintWriter and java.io.PrintStream, the append() method of java.lang.StringBuilder and java.lang.StringBuffer or the trace(), debug(), info(), warn() and error() methods of org.slf4j.Logger. In these cases the conversion to string will be handled by the underlying library methods and an explicit call to toString() is no needed.
Note that without the toString() call the expression will have slightly different semantics (the string null will be used instead of throwing a NullPointerException).
Fixes `UnnecessaryThis` inspection violations in test code.
Description:
>Reports on any unnecessary uses of this in the code. Using this to disambiguate a code reference may easily become unnecessary via automatic refactorings, and is discouraged by many coding styles.
Fixes `UnnecessarilyQualifiedStaticallyImportedElement` inspection violations in test code.
Description:
>Reports any references to static members which are statically imported and also qualified with their containing class name. Because the elements are already statically imported such qualification is unnecessary and can be removed.
Fixes `UnnecessaryConstantArrayCreationExpression` inspection violations in test code.
Description:
>Reports any constant new array expression which can be replaced with an array initializer. Array initializers omit the type declaration because that is already specified by the declaration of the variable the expression is assigned to.
Fixes `UnnecessaryParentheses` inspection violations in test code.
Description:
>Reports on any instance of unnecessary parentheses. Parentheses are considered unnecessary if the evaluation order of an expression remains unchanged if the parentheses are removed.
Fixes `ThrowablePrintStackTrace` inspection violations in test code.
Description:
>Reports any calls to Throwable.printStackTrace() without arguments. Such statements are often used for temporary debugging, and should probably be either removed from production code, or replaced with a more robust logging facility.
Fixes `RedundantThrows` inspection violations in test code.
Description:
>This inspection reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations/derivatives.
Fixes `StringToUpperWithoutLocale` inspection violations in test code.
Description:
>Reports any call of toUpperCase() or toLowerCase() on String objects which do not specify a java.util.Locale. Such calls are usually incorrect in an internationalized environment.
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.