text
stringlengths
41
445
<s>[INST] CloneMethodMustBePublic [/INST] clone() method must be public if the class implements Cloneable</s>
<s>[INST] CommentRequired [/INST] Comment is required</s>
<s>[INST] CommentSize [/INST] Comment is too large</s>
<s>[INST] CommentContent [/INST] Invalid words or phrases found</s>
<s>[INST] CommentDefaultAccessModifier [/INST] Missing commented default access modifier</s>
<s>[INST] UnnecessaryConstructor [/INST] Avoid unnecessary constructors - the compiler will generate these for you</s>
<s>[INST] NullAssignment [/INST] Assigning an Object to null is a code smell. Consider refactoring.</s>
<s>[INST] OnlyOneReturn [/INST] A method should have only one exit point, and that should be the last statement in the method</s>
<s>[INST] AssignmentInOperand [/INST] Avoid assignments in operands</s>
<s>[INST] AtLeastOneConstructor [/INST] Each class should declare at least one constructor</s>
<s>[INST] DontImportSun [/INST] Avoid importing anything from the 'sun.*' packages</s>
<s>[INST] SuspiciousOctalEscape [/INST] Suspicious decimal characters following octal escape in string literal</s>
<s>[INST] CallSuperInConstructor [/INST] It is a good practice to call super() in a constructor</s>
<s>[INST] UnnecessaryParentheses [/INST] This statement may have some unnecessary parentheses</s>
<s>[INST] AvoidFinalLocalVariable [/INST] Avoid using final local variables, turn them into fields</s>
<s>[INST] AvoidUsingVolatile [/INST] Use of modifier volatile is not recommended.</s>
<s>[INST] AvoidUsingNativeCode [/INST] The use of native code is not recommended.</s>
<s>[INST] AvoidAccessibilityAlteration [/INST] You should modify visibility of class or methods using getDeclaredConstructors(), getDeclaredConstructor(Class[]), setAccessible() or PrivilegedAction.</s>
<s>[INST] DoNotCallGarbageCollectionExplicitly [/INST] Do not explicitly trigger a garbage collection.</s>
<s>[INST] OneDeclarationPerLine [/INST] Use one line for each declaration, it enhances code readability.</s>
<s>[INST] AvoidPrefixingMethodParameters [/INST] Avoid prefixing parameters by in, out or inOut. Uses Javadoc to document this behavior.</s>
<s>[INST] AvoidLiteralsInIfCondition [/INST] Avoid using Literals in Conditional Statements</s>
<s>[INST] UseObjectForClearerAPI [/INST] Rather than using a lot of String arguments, consider using a container object for those values.</s>
<s>[INST] UseConcurrentHashMap [/INST] If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation</s>
<s>[INST] LooseCoupling [/INST] Avoid using implementation types like ''{0}''; use the interface instead</s>
<s>[INST] LoosePackageCoupling [/INST] Use of ''{0}'' outside of package hierarchy ''{1}'' is not recommended; use recommended classes instead</s>
<s>[INST] UseUtilityClass [/INST] All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.</s>
<s>[INST] SimplifyBooleanReturns [/INST] Avoid unnecessary if..then..else statements when returning booleans</s>
<s>[INST] SimplifyBooleanExpressions [/INST] Avoid unnecessary comparisons in boolean expressions</s>
<s>[INST] SwitchStmtsShouldHaveDefault [/INST] Switch statements should have a default label</s>
<s>[INST] AvoidDeeplyNestedIfStmts [/INST] Deeply nested if..then statements are hard to read</s>
<s>[INST] SwitchDensity [/INST] A high ratio of statements to labels in a switch statement. Consider refactoring.</s>
<s>[INST] ConstructorCallsOverridableMethod [/INST] Overridable {0} called during object construction</s>
<s>[INST] AccessorClassGeneration [/INST] Avoid instantiation through private constructors from outside of the constructor's class.</s>
<s>[INST] FinalFieldCouldBeStatic [/INST] This final field could be made static</s>
<s>[INST] CloseResource [/INST] Ensure that resources like this {0} object are closed after use</s>
<s>[INST] NonStaticInitializer [/INST] Non-static initializers are confusing</s>
<s>[INST] DefaultLabelNotLastInSwitchStmt [/INST] The default label should be the last label in a switch statement</s>
<s>[INST] NonCaseLabelInSwitchStatement [/INST] A non-case label was present in a switch statement</s>
<s>[INST] OptimizableToArrayCall [/INST] This call to Collection.toArray() may be optimizable</s>
<s>[INST] BadComparison [/INST] Avoid equality comparisons with Double.NaN</s>
<s>[INST] EqualsNull [/INST] Avoid using equals() to compare against null</s>
<s>[INST] ConfusingTernary [/INST] Avoid if (x != y) ..; else ..;</s>
<s>[INST] InstantiationToGetClass [/INST] Avoid instantiating an object just to call getClass() on it; use the .class public member instead</s>
<s>[INST] IdempotentOperations [/INST] Avoid idempotent operations (like assigning a variable to itself).</s>
<s>[INST] SimpleDateFormatNeedsLocale [/INST] When instantiating a SimpleDateFormat object, specify a Locale</s>
<s>[INST] ImmutableField [/INST] Private field ''{0}'' could be made final; it is only initialized in the declaration or constructor.</s>
<s>[INST] UseLocaleWithCaseConversions [/INST] When doing a String.toLowerCase()/toUpperCase() call, use a Locale</s>
<s>[INST] AvoidProtectedFieldInFinalClass [/INST] Avoid protected fields in a final class. Change to private or package access.</s>
<s>[INST] AssignmentToNonFinalStatic [/INST] Possible unsafe assignment to a non-final static field in a constructor.</s>
<s>[INST] MissingStaticMethodInNonInstantiatableClass [/INST] Class cannot be instantiated and does not provide any static methods or fields</s>
<s>[INST] AvoidSynchronizedAtMethodLevel [/INST] Use block level rather than method level synchronization</s>
<s>[INST] MissingBreakInSwitch [/INST] A switch statement does not contain a break</s>
<s>[INST] UseNotifyAllInsteadOfNotify [/INST] Call Thread.notifyAll() rather than Thread.notify()</s>
<s>[INST] AvoidInstanceofChecksInCatchClause [/INST] An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type.</s>
<s>[INST] AbstractClassWithoutAbstractMethod [/INST] This abstract class does not have any abstract methods</s>
<s>[INST] SimplifyConditional [/INST] No need to check for null before an instanceof</s>
<s>[INST] CompareObjectsWithEquals [/INST] Use equals() to compare object references.</s>
<s>[INST] PositionLiteralsFirstInComparisons [/INST] Position literals first in String comparisons</s>
<s>[INST] PositionLiteralsFirstInCaseInsensitiveComparisons [/INST] Position literals first in String comparisons for EqualsIgnoreCase</s>
<s>[INST] UnnecessaryLocalBeforeReturn [/INST] Consider simply returning the value vs storing it in local variable ''{0}''</s>
<s>[INST] NonThreadSafeSingleton [/INST] Singleton is not thread safe</s>
<s>[INST] SingleMethodSingleton [/INST] Class contains multiple getInstance methods. Please review.</s>
<s>[INST] SingletonClassReturningNewInstance [/INST] getInstance method always creates a new object and hence does not comply to Singleton Design Pattern behaviour. Please review</s>
<s>[INST] UncommentedEmptyMethodBody [/INST] Document empty method body</s>
<s>[INST] UncommentedEmptyConstructor [/INST] Document empty constructor</s>
<s>[INST] AvoidConstantsInterface [/INST] An Interface should be used only to model a behaviour; consider converting this to a class.</s>
<s>[INST] UnsynchronizedStaticDateFormatter [/INST] Static DateFormatter objects should be accessed in a synchronized manner</s>
<s>[INST] PreserveStackTrace [/INST] New exception is thrown in catch block, original stack trace may be lost</s>
<s>[INST] UseCollectionIsEmpty [/INST] Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty()</s>
<s>[INST] ClassWithOnlyPrivateConstructorsShouldBeFinal [/INST] A class which only has private constructors should be final</s>
<s>[INST] EmptyMethodInAbstractClassShouldBeAbstract [/INST] An empty method in an abstract class should be abstract instead</s>
<s>[INST] SingularField [/INST] Perhaps ''{0}'' could be replaced by a local variable.</s>
<s>[INST] AbstractClassWithoutAnyMethod [/INST] No abstract method which means that the keyword is most likely used to prevent instantiation. Use a private or protected constructor instead.</s>
<s>[INST] TooFewBranchesForASwitchStatement [/INST] A switch with less than three branches is inefficient, use a 'if statement' instead.</s>
<s>[INST] LogicInversion [/INST] Use opposite operator instead of the logic complement operator.</s>
<s>[INST] UseVarargs [/INST] Consider using varargs for methods or constructors which take an array the last parameter.</s>
<s>[INST] FieldDeclarationsShouldBeAtStartOfClass [/INST] Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.</s>
<s>[INST] AvoidProtectedMethodInFinalClassNotExtending [/INST] Avoid protected methods in a final class that doesn't extend anything other than Object. Change to private or package access.</s>
<s>[INST] ConstantsInInterface [/INST] Avoid constants in interfaces. Interfaces define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19.</s>
<s>[INST] EmptyCatchBlock [/INST] Avoid empty catch blocks</s>
<s>[INST] EmptyIfStmt [/INST] Avoid empty 'if' statements</s>
<s>[INST] EmptyWhileStmt [/INST] Avoid empty 'while' statements</s>
<s>[INST] EmptyTryBlock [/INST] Avoid empty try blocks</s>
<s>[INST] EmptyFinallyBlock [/INST] Avoid empty finally blocks</s>
<s>[INST] EmptySwitchStatements [/INST] Avoid empty switch statements</s>
<s>[INST] EmptySynchronizedBlock [/INST] Avoid empty synchronized blocks</s>
<s>[INST] EmptyStatementNotInLoop [/INST] An empty statement (semicolon) not part of a loop</s>
<s>[INST] EmptyInitializer [/INST] Empty initializer was found</s>
<s>[INST] EmptyStatementBlock [/INST] Avoid empty block statements.</s>
<s>[INST] EmptyStaticInitializer [/INST] Empty static initializer was found</s>
<s>[INST] EmptyFinalizer [/INST] Avoid empty finalize methods</s>
<s>[INST] FinalizeOnlyCallsSuperFinalize [/INST] Finalize should do something besides just calling super.finalize()</s>
<s>[INST] FinalizeOverloaded [/INST] Finalize methods should not be overloaded</s>
<s>[INST] FinalizeDoesNotCallSuperFinalize [/INST] Last statement in finalize method should be a call to super.finalize()</s>
<s>[INST] FinalizeShouldBeProtected [/INST] If you override finalize(), make it protected</s>
<s>[INST] AvoidCallingFinalize [/INST] Avoid calling finalize() explicitly</s>
<s>[INST] TooManyStaticImports [/INST] Too many static imports may lead to messy code</s>
<s>[INST] UnnecessaryFullyQualifiedName [/INST] Unnecessary use of fully qualified name ''{0}'' due to existing {2}import ''{1}''</s>
<s>[INST] UseProperClassLoader [/INST] In J2EE, getClassLoader() might not work as expected. Use Thread.currentThread().getContextClassLoader() instead.</s>