text stringlengths 41 445 |
|---|
<s>[INST] MDBAndSessionBeanNamingConvention [/INST] SessionBean or MessageBean should be suffixed by Bean</s> |
<s>[INST] RemoteSessionInterfaceNamingConvention [/INST] Remote Home interface of a Session EJB should be suffixed by 'Home'</s> |
<s>[INST] LocalInterfaceSessionNamingConvention [/INST] The Local Interface of a Session EJB should be suffixed by 'Local'</s> |
<s>[INST] LocalHomeNamingConvention [/INST] The Local Home interface of a Session EJB should be suffixed by 'LocalHome'</s> |
<s>[INST] RemoteInterfaceNamingConvention [/INST] Remote Interface of a Session EJB should NOT be suffixed</s> |
<s>[INST] DoNotCallSystemExit [/INST] System.exit() should not be used in J2EE/JEE apps</s> |
<s>[INST] StaticEJBFieldShouldBeFinal [/INST] EJB's shouldn't have non-final static fields</s> |
<s>[INST] DoNotUseThreads [/INST] To be compliant to J2EE, a webapp should not use any thread.</s> |
<s>[INST] BeanMembersShouldSerialize [/INST] Found non-transient, non-static member. Please mark as transient or provide accessors.</s> |
<s>[INST] MissingSerialVersionUID [/INST] Classes implementing Serializable should set a serialVersionUID</s> |
<s>[INST] JUnitStaticSuite [/INST] You have a suite() method that is not both public and static, so JUnit won't call it to get your TestSuite. Is that what you wanted to do?</s> |
<s>[INST] JUnitSpelling [/INST] You may have misspelled a JUnit framework method (setUp or tearDown)</s> |
<s>[INST] JUnitAssertionsShouldIncludeMessage [/INST] JUnit assertions should include a message</s> |
<s>[INST] JUnitTestsShouldIncludeAssert [/INST] JUnit tests should include assert() or fail()</s> |
<s>[INST] TestClassWithoutTestCases [/INST] This class name ends with 'Test' but contains no test cases</s> |
<s>[INST] UnnecessaryBooleanAssertion [/INST] assertTrue(true) or similar statements are unnecessary</s> |
<s>[INST] JUnitTestContainsTooManyAsserts [/INST] JUnit tests should not contain more than ${maximumAsserts} assert(s).</s> |
<s>[INST] UseCorrectExceptionLogging [/INST] Use the correct logging statement for logging exceptions</s> |
<s>[INST] ProperLogger [/INST] Logger should be defined private static final and have the correct class</s> |
<s>[INST] GuardDebugLogging [/INST] debug logging that involves string concatenation should be guarded with isDebugEnabled() checks</s> |
<s>[INST] GuardLogStatement [/INST] There is log block not surrounded by if</s> |
<s>[INST] MoreThanOneLogger [/INST] Class contains more than one logger.</s> |
<s>[INST] LoggerIsNotStaticFinal [/INST] The Logger variable declaration does not contain the static and final modifiers</s> |
<s>[INST] SystemPrintln [/INST] {0} is used</s> |
<s>[INST] AvoidPrintStackTrace [/INST] Avoid printStackTrace(); use a logger call instead.</s> |
<s>[INST] GuardLogStatementJavaUtil [/INST] There is log block not surrounded by if</s> |
<s>[INST] InvalidSlf4jMessageFormat [/INST] Invalid message format</s> |
<s>[INST] ReplaceVectorWithList [/INST] Consider replacing this Vector with the newer java.util.List</s> |
<s>[INST] ReplaceHashtableWithMap [/INST] Consider replacing this Hashtable with the newer java.util.Map</s> |
<s>[INST] ReplaceEnumerationWithIterator [/INST] Consider replacing this Enumeration with the newer java.util.Iterator</s> |
<s>[INST] AvoidEnumAsIdentifier [/INST] Avoid using enum as an identifier; it's a reserved word in JDK 1.5</s> |
<s>[INST] AvoidAssertAsIdentifier [/INST] Avoid using assert as an identifier; it became a reserved word in JDK 1.4</s> |
<s>[INST] JUnit4TestShouldUseBeforeAnnotation [/INST] JUnit 4 tests that set up tests should use the @Before annotation</s> |
<s>[INST] JUnit4TestShouldUseAfterAnnotation [/INST] JUnit 4 tests that clean up tests should use the @After annotation</s> |
<s>[INST] JUnit4TestShouldUseTestAnnotation [/INST] JUnit 4 tests that execute tests should use the @Test annotation</s> |
<s>[INST] JUnit4SuitesShouldUseSuiteAnnotation [/INST] JUnit 4 indicates test suites via annotations, not the suite method.</s> |
<s>[INST] JUnitUseExpected [/INST] In JUnit4, use the @Test(expected) annotation to denote tests that should throw exceptions</s> |
<s>[INST] ShortVariable [/INST] Avoid variables with short names like {0}</s> |
<s>[INST] LongVariable [/INST] Avoid excessively long variable names like {0}</s> |
<s>[INST] ShortMethodName [/INST] Avoid using short method names</s> |
<s>[INST] VariableNamingConventions [/INST] {0} variable {1} should begin with {2}</s> |
<s>[INST] MethodNamingConventions [/INST] Method name does not begin with a lower case character.</s> |
<s>[INST] ClassNamingConventions [/INST] Class names should begin with an uppercase character</s> |
<s>[INST] AbstractNaming [/INST] Abstract classes should be named 'AbstractXXX'</s> |
<s>[INST] AvoidDollarSigns [/INST] Avoid using dollar signs in variable/method/class/interface names</s> |
<s>[INST] MethodWithSameNameAsEnclosingClass [/INST] Classes should not have non-constructor methods with the same name as the class</s> |
<s>[INST] SuspiciousHashcodeMethodName [/INST] The method name and return type are suspiciously close to hashCode()</s> |
<s>[INST] SuspiciousConstantFieldName [/INST] The field name indicates a constant but its modifiers do not</s> |
<s>[INST] SuspiciousEqualsMethodName [/INST] The method name and parameter number are suspiciously close to equals(Object)</s> |
<s>[INST] AvoidFieldNameMatchingTypeName [/INST] It is somewhat confusing to have a field name matching the declaring class name</s> |
<s>[INST] AvoidFieldNameMatchingMethodName [/INST] Field {0} has the same name as a method</s> |
<s>[INST] NoPackage [/INST] All classes and interfaces must belong to a named package</s> |
<s>[INST] PackageCase [/INST] Package name contains upper case characters</s> |
<s>[INST] MisleadingVariableName [/INST] Avoid naming non-fields with the prefix 'm_'</s> |
<s>[INST] BooleanGetMethodName [/INST] A 'getX()' method which returns a boolean should be named 'isX()'</s> |
<s>[INST] ShortClassName [/INST] Avoid short class names like {0}</s> |
<s>[INST] GenericsNaming [/INST] Generics names should be a one letter long and upper case.</s> |
<s>[INST] LocalVariableCouldBeFinal [/INST] Local variable ''{0}'' could be declared final</s> |
<s>[INST] MethodArgumentCouldBeFinal [/INST] Parameter ''{0}'' is not assigned and could be declared final</s> |
<s>[INST] AvoidInstantiatingObjectsInLoops [/INST] Avoid instantiating new objects inside loops</s> |
<s>[INST] UseArrayListInsteadOfVector [/INST] Use ArrayList instead of Vector</s> |
<s>[INST] UseStringBufferForStringAppends [/INST] Prefer StringBuffer over += for concatenating strings</s> |
<s>[INST] UseArraysAsList [/INST] Use asList instead of tight loops</s> |
<s>[INST] AvoidArrayLoops [/INST] System.arraycopy is more efficient</s> |
<s>[INST] AddEmptyString [/INST] Do not add empty strings</s> |
<s>[INST] RedundantFieldInitializer [/INST] Avoid using redundant field initializer for ''${variableName}''</s> |
<s>[INST] PrematureDeclaration [/INST] Avoid declaring a variable if it is unreferenced before a possible exit point.</s> |
<s>[INST] AvoidCatchingThrowable [/INST] A catch statement should never catch throwable since it includes errors.</s> |
<s>[INST] SignatureDeclareThrowsException [/INST] A method/constructor shouldn't explicitly throw java.lang.Exception</s> |
<s>[INST] ExceptionAsFlowControl [/INST] Avoid using exceptions as flow control.</s> |
<s>[INST] AvoidCatchingNPE [/INST] Avoid catching NullPointerException; consider removing the cause of the NPE.</s> |
<s>[INST] AvoidThrowingRawExceptionTypes [/INST] Avoid throwing raw exception types.</s> |
<s>[INST] AvoidThrowingNullPointerException [/INST] Avoid throwing null pointer exceptions.</s> |
<s>[INST] AvoidRethrowingException [/INST] A catch statement that catches an exception only to rethrow it should be avoided.</s> |
<s>[INST] DoNotExtendJavaLangError [/INST] Exceptions should not extend java.lang.Error</s> |
<s>[INST] DoNotThrowExceptionInFinally [/INST] A throw statement in a finally block makes the control flow hard to understand.</s> |
<s>[INST] AvoidThrowingNewInstanceOfSameException [/INST] A catch statement that catches an exception only to wrap it in a new instance of the same type of exception and throw it should be avoided</s> |
<s>[INST] AvoidCatchingGenericException [/INST] Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block</s> |
<s>[INST] AvoidLosingExceptionInformation [/INST] Avoid statements in a catch block that invoke accessors on the exception without using the information</s> |
<s>[INST] AvoidDuplicateLiterals [/INST] The String literal {0} appears {1} times in this file; the first occurrence is on line {2}</s> |
<s>[INST] StringInstantiation [/INST] Avoid instantiating String objects; this is usually unnecessary.</s> |
<s>[INST] StringToString [/INST] Avoid calling toString() on String objects; this is unnecessary.</s> |
<s>[INST] InefficientStringBuffering [/INST] Avoid concatenating nonliterals in a StringBuffer/StringBuilder constructor or append().</s> |
<s>[INST] UnnecessaryCaseChange [/INST] Using equalsIgnoreCase() is cleaner than using toUpperCase/toLowerCase().equals().</s> |
<s>[INST] UseStringBufferLength [/INST] This is an inefficient use of StringBuffer.toString; call StringBuffer.length instead.</s> |
<s>[INST] AppendCharacterWithChar [/INST] Avoid appending characters as strings in StringBuffer.append.</s> |
<s>[INST] ConsecutiveAppendsShouldReuse [/INST] StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable.</s> |
<s>[INST] ConsecutiveLiteralAppends [/INST] StringBuffer (or StringBuilder).append is called {0} consecutive times with literal Strings. Use a single append with a single combined String.</s> |
<s>[INST] UseIndexOfChar [/INST] String.indexOf(char) is faster than String.indexOf(String).</s> |
<s>[INST] InefficientEmptyStringCheck [/INST] String.trim().length()==0 is an inefficient way to validate an empty String.</s> |
<s>[INST] InsufficientStringBufferDeclaration [/INST] StringBuffer constructor is initialized with size {0}, but has at least {1} characters appended.</s> |
<s>[INST] UselessStringValueOf [/INST] No need to call String.valueOf to append to a string.</s> |
<s>[INST] StringBufferInstantiationWithChar [/INST] Do not instantiate a StringBuffer or StringBuilder with a char</s> |
<s>[INST] UseEqualsToCompareStrings [/INST] Use equals() to compare strings instead of ''=='' or ''!=''</s> |
<s>[INST] AvoidStringBufferField [/INST] StringBuffers can grow quite a lot, and so may become a source of memory leak (if the owning class has a long life time).</s> |
<s>[INST] MethodReturnsInternalArray [/INST] Returning ''{0}'' may expose an internal array.</s> |
<s>[INST] ArrayIsStoredDirectly [/INST] The user-supplied array ''{0}'' is stored directly.</s> |
<s>[INST] UnnecessaryConversionTemporary [/INST] Avoid unnecessary temporaries when converting primitives to Strings</s> |
<s>[INST] UnnecessaryReturn [/INST] Avoid unnecessary return statements</s> |
<s>[INST] UnnecessaryFinalModifier [/INST] Unnecessary final modifier in final class</s> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.