From 4882bc07fd6f5fe25cf799c2dfbbfed2df4f5497 Mon Sep 17 00:00:00 2001 From: Johann Beleites Date: Fri, 19 Apr 2024 11:04:28 +0200 Subject: [PATCH] Batch rename sample files (#4738) Rename most sample of: AWS, A.*, [B-T].*. --- .../aws/AwsConsumerBuilderUsageCheckTest.java | 4 +- ...entialsShouldBeSetExplicitlyCheckTest.java | 2 +- .../aws/AwsLambdaSyncCallCheckTest.java | 2 +- .../aws/AwsLongTermAccessKeysCheckTest.java | 2 +- .../checks/aws/AwsRegionSetterCheckTest.java | 2 +- ...sRegionShouldBeSetExplicitlyCheckTest.java | 2 +- ...ableResourcesInitializedOnceCheckTest.java | 2 +- ...edCredentialsShouldNotBeUsedCheckTest.java | 4 +- ...> AwsConsumerBuilderUsageCheckSample.java} | 12 +-- ...> AwsConsumerBuilderUsageCheckSample.java} | 2 +- ...ialsShouldBeSetExplicitlyCheckSample.java} | 8 +- ...java => AwsLambdaSyncCallCheckSample.java} | 2 +- ... => AwsLongTermAccessKeysCheckSample.java} | 2 +- ...k.java => AwsRegionSetterCheckSample.java} | 2 +- ...gionShouldBeSetExplicitlyCheckSample.java} | 2 +- ...eResourcesInitializedOnceCheckSample.java} | 2 +- ...redentialsShouldNotBeUsedCheckSample.java} | 2 +- ...sNoFieldShouldBeInterfaceCheckSample.java} | 0 ...ldShouldBeInterfaceCheckSample_java9.java} | 0 ...uldBeInterfaceCheckSample_no_version.java} | 0 ...va => AccessibilityChangeCheckSample.java} | 2 +- ...AnnotationDefaultArgumentCheckSample.java} | 2 +- ...nymousClassShouldBeLambdaCheckSample.java} | 0 ...ck.java => ArrayForVarArgCheckSample.java} | 2 +- ... => AtLeastOneConstructorCheckSample.java} | 2 +- ...va => BooleanMethodReturnCheckSample.java} | 2 +- ...reCheck.java => DeadStoreCheckSample.java} | 2 +- ...a => DoubleCheckedLockingCheckSample.java} | 2 +- ....java => EnumMutableFieldCheckSample.java} | 0 ...lsNotOverriddenInSubclassCheckSample.java} | 2 +- ...icodeCharactersTextBlocksCheckSample.java} | 0 ...java => FinalizeFieldsSetCheckSample.java} | 2 +- ... => ForLoopFalseConditionCheckSample.java} | 0 ...ForLoopIncrementAndUpdateCheckSample.java} | 2 +- ...va => ForLoopVariableTypeCheckSample.java} | 2 +- ...=> GarbageCollectorCalledCheckSample.java} | 0 ...java => HardCodedPasswordCheckSample.java} | 2 +- ...=> IdenticalCasesInSwitchCheckSample.java} | 2 +- ...=> ImmediateReverseBoxingCheckSample.java} | 2 +- ...mediatelyReturnedVariableCheckSample.java} | 2 +- ...faceOrSuperclassShadowingCheckSample.java} | 0 ...a => InterruptedExceptionCheckSample.java} | 2 +- ....java => IsInstanceMethodCheckSample.java} | 2 +- ... => IteratorNextExceptionCheckSample.java} | 14 +-- ...java => LazyArgEvaluationCheckSample.java} | 0 ...java => LeastSpecificTypeCheckSample.java} | 14 +-- ... => LeftCurlyBraceEndLineCheckSample.java} | 0 ...> LeftCurlyBraceStartLineCheckSample.java} | 0 ... => LongBitsToDoubleOnIntCheckSample.java} | 2 +- ...va => MapKeyNotComparableCheckSample.java} | 2 +- ...a => MethodOnlyCallsSuperCheckSample.java} | 2 +- ...ethodWithExcessiveReturnsCheckSample.java} | 0 ...va => MutableMembersUsageCheckSample.java} | 0 ...heck.java => NestedBlocksCheckSample.java} | 0 ...ava => NestedIfStatementsCheckSample.java} | 0 ...=> NestedSwitchExpressionCheckSample.java} | 2 +- ...java => NoTestInTestClassCheckSample.java} | 0 ...ava => OverrideAnnotationCheckSample.java} | 0 ... => ParameterReassignedToCheckSample.java} | 0 ...aredStatementAndResultSetCheckSample.java} | 2 +- ...> PrivateFieldUsedLocallyCheckSample.java} | 2 +- ...ublicStaticMutableMembersCheckSample.java} | 2 +- ...heck.java => RawExceptionCheckSample.java} | 2 +- ...TypeCheck.java => RawTypeCheckSample.java} | 2 +- ...a => RecordInsteadOfClassCheckSample.java} | 2 +- ...> RedundantAbstractMethodCheckSample.java} | 4 +- ...ck.java => RedundantCloseCheckSample.java} | 2 +- ...edundantThrowsDeclarationCheckSample.java} | 2 +- ...java => RedundantTypeCastCheckSample.java} | 0 ...ionOnNonRuntimeAnnotationCheckSample.java} | 2 +- ... ReplaceLambdaByMethodRefCheckSample.java} | 0 ...estrictedIdentifiersUsageCheckSample.java} | 2 +- ...> ReturnEmptyArrayNotNullCheckSample.java} | 10 +- ...eck.java => RunFinalizersCheckSample.java} | 2 +- ... S2201_IgnoredReturnValueCheckSample.java} | 0 ...a => ServletInstanceFieldCheckSample.java} | 2 +- ...Check.java => SillyEqualsCheckSample.java} | 2 +- ...k.java => SimpleClassNameCheckSample.java} | 0 ....java => StaticFieldUpateCheckSample.java} | 2 +- ...heck.java => StaticMethodCheckSample.java} | 0 ...StringLiteralInsideEqualsCheckSample.java} | 2 +- ...ringToPrimitiveConversionCheckSample.java} | 2 +- ... => StrongCipherAlgorithmCheckSample.java} | 2 +- ...k.java => SunPackagesUsedCheckSample.java} | 2 +- ....java => SwitchCaseTooBigCheckSample.java} | 2 +- ...sesShouldBeCommaSeparatedCheckSample.java} | 2 +- ... => SwitchDefaultLastCaseCheckSample.java} | 2 +- ...SwitchInsteadOfIfSequenceCheckSample.java} | 2 +- ...> SwitchLastCaseIsDefaultCheckSample.java} | 2 +- ....java => SwitchWithLabelsCheckSample.java} | 0 ...ronizationOnStringOrBoxedCheckSample.java} | 0 ...a => TextBlocksDuplicatedCheckSample.java} | 0 ...ava => ThreadOverridesRunCheckSample.java} | 2 +- ...ck.java => TooManyMethodsCheckSample.java} | 2 +- ...java => TooManyParametersCheckSample.java} | 0 ...entFieldInNonSerializableCheckSample.java} | 2 +- ...=> TypeUpperBoundNotFinalCheckSample.java} | 2 +- ...ethodNamedHashcodeOrEqualCheckSample.java} | 0 ...ck.java => EmptyLineRegexCheckSample.java} | 2 +- ...va => DebugFeatureEnabledCheckSample.java} | 2 +- ...va => DisableAutoEscapingCheckSample.java} | 2 +- ...redentialsShouldNotBeUsedCheckSample.java} | 2 +- ...heck.java => SecureCookieCheckSample.java} | 6 +- ...ava => ServerCertificatesCheckSample.java} | 0 ... SerialVersionUidInRecordCheckSample.java} | 2 +- ...eFieldInSerializableClassCheckSample.java} | 0 ...ializableSuperConstructorCheckSample.java} | 0 ...IncompatibleTransactionalCheckSample.java} | 8 +- ...sactionalMethodVisibilityCheckSample.java} | 2 +- ...sertJAssertionsInConsumerCheckSample.java} | 2 +- ...=> AssertionsCompletenessCheckSample.java} | 2 +- ...> JUnit45MethodAnnotationCheckSample.java} | 4 +- ...entlyIgnoreClassAndMethodCheckSample.java} | 2 +- ...> MockitoEqSimplificationCheckSample.java} | 2 +- ...java => TooManyAssertionsCheckSample.java} | 0 ...ck.java => DivisionByZeroCheckSample.java} | 0 ....java => LocksNotUnlockedCheckSample.java} | 2 +- ...pComputeIfAbsentOrPresentCheckSample.java} | 0 ....java => NonNullSetToNullCheckSample.java} | 4 +- ...java => S3959_SwitchExpressionSample.java} | 2 +- ... SpringScanDefaultPackageCheckSample.java} | 2 +- ...actClassNoFieldShouldBeInterfaceCheck.java | 98 ------------------- ...ssNoFieldShouldBeInterfaceCheckSample.java | 98 +++++++++++++++++++ ...va => AccessibilityChangeCheckSample.java} | 2 +- ...essibilityChangeOnRecordsCheckSample.java} | 2 +- ...AnnotationDefaultArgumentCheckSample.java} | 2 +- ...nymousClassShouldBeLambdaCheckSample.java} | 4 +- ...eck.java => ArrayCopyLoopCheckSample.java} | 2 +- ... ArrayDesignatorAfterTypeCheckSample.java} | 2 +- ...ArrayDesignatorOnVariableCheckSample.java} | 2 +- ...ck.java => ArrayForVarArgCheckSample.java} | 40 ++++---- ... ArrayHashCodeAndToStringCheckSample.java} | 2 +- ...AsListOfPrimitiveToStreamCheckSample.java} | 2 +- ...> AssertOnBooleanVariableCheckSample.java} | 6 +- ...ssertionsInProductionCodeCheckSample.java} | 2 +- ...nParametersOfPublicMethodCheckSample.java} | 0 ...AssignmentInSubExpressionCheckSample.java} | 6 +- ... => AtLeastOneConstructorCheckSample.java} | 0 ...thCheck.java => BasicAuthCheckSample.java} | 2 +- ...gDecimalDoubleConstructorCheckSample.java} | 2 +- ...ck.java => BooleanLiteralCheckSample.java} | 2 +- ...va => BooleanMethodReturnCheckSample.java} | 14 +-- ...> BoxedBooleanExpressionsCheckSample.java} | 2 +- ...Check.java => BrainMethodCheckSample.java} | 2 +- ...=> DanglingElseStatementsCheckSample.java} | 2 +- ...ava => DateFormatWeekYearCheckSample.java} | 2 +- ...java => DateUtilsTruncateCheckSample.java} | 4 +- ...reCheck.java => DeadStoreCheckSample.java} | 10 +- ...a => DefaultEncodingUsageCheckSample.java} | 2 +- ...> DefaultInitializedFieldCheckSample.java} | 2 +- ...va => DeprecatedArgumentsCheckSample.java} | 2 +- ...=> DepthOfInheritanceTreeCheckSample.java} | 4 +- .../DoubleBraceInitializationCheck.java | 30 ------ .../DoubleBraceInitializationCheckSample.java | 30 ++++++ ...a => DoubleCheckedLockingCheckSample.java} | 10 +- ...uplicateConditionIfElseIfCheckSample.java} | 2 +- ....java => DynamicClassLoadCheckSample.java} | 2 +- ...heck.java => EmptyMethodsCheckSample.java} | 2 +- ...va => EmptyStatementUsageCheckSample.java} | 6 +- ...mMapCheck.java => EnumMapCheckSample.java} | 4 +- ....java => EnumMutableFieldCheckSample.java} | 0 ...mSetCheck.java => EnumSetCheckSample.java} | 2 +- ...lsNotOverriddenInSubclassCheckSample.java} | 2 +- ...va => EqualsOnAtomicClassCheckSample.java} | 2 +- ...lsParametersMarkedNonNullCheckSample.java} | 2 +- .../java/checks/ErrorClassExtendedCheck.java | 31 ------ .../checks/ErrorClassExtendedCheckSample.java | 31 ++++++ ... EscapedUnicodeCharactersCheckSample.java} | 2 +- ...a => ExpressionComplexityCheckSample.java} | 8 +- ...java => FinalizeFieldsSetCheckSample.java} | 2 +- ....java => FixmeTagPresenceCheckSample.java} | 2 +- ... => ForLoopFalseConditionCheckSample.java} | 2 +- ...ForLoopIncrementAndUpdateCheckSample.java} | 2 +- ...va => ForLoopVariableTypeCheckSample.java} | 2 +- ...=> GarbageCollectorCalledCheckSample.java} | 2 +- ...ck.java => GetClassLoaderCheckSample.java} | 2 +- ... => GetRequestedSessionIdCheckSample.java} | 2 +- ...java => HardCodedPasswordCheckSample.java} | 2 +- ...k.java => HardCodedSecretCheckSample.java} | 2 +- ...Check.java => HardcodedIpCheckSample.java} | 2 +- ...heck.java => HardcodedURICheckSample.java} | 2 +- ...ava => HasNextCallingNextCheckSample.java} | 22 ++--- ...Check.java => HiddenFieldCheckSample.java} | 4 +- ...=> IdenticalCasesInSwitchCheckSample.java} | 2 +- ... IgnoredStreamReturnValueCheckSample.java} | 2 +- ...=> ImmediateReverseBoxingCheckSample.java} | 2 +- ...mediatelyReturnedVariableCheckSample.java} | 2 +- ... => ImplementsEnumerationCheckSample.java} | 0 ...va => InappropriateRegexpCheckSample.java} | 2 +- ...> IncorrectOrderOfMembersCheckSample.java} | 2 +- ...dentationAfterConditionalCheckSample.java} | 2 +- ...nerClassOfNonSerializableCheckSample.java} | 4 +- ... InnerClassOfSerializableCheckSample.java} | 4 +- ...k.java => InputStreamReadCheckSample.java} | 6 +- ...=> InsecureCreateTempFileCheckSample.java} | 4 +- ...InstanceofUsedOnExceptionCheckSample.java} | 2 +- .../InterfaceAsConstantContainerCheck.java | 52 ---------- ...terfaceAsConstantContainerCheckSample.java | 52 ++++++++++ ...faceOrSuperclassShadowingCheckSample.java} | 2 +- ...a => InterruptedExceptionCheckSample.java} | 2 +- ...java => InvalidDateValuesCheckSample.java} | 4 +- ....java => IsInstanceMethodCheckSample.java} | 2 +- ....java => IterableIteratorCheckSample.java} | 2 +- ... => IteratorNextExceptionCheckSample.java} | 46 ++++----- ...=> JacksonDeserializationCheckSample.java} | 2 +- ...JdbcDriverExplicitLoadingCheckSample.java} | 2 +- ... => LabelsShouldNotBeUsedCheckSample.java} | 2 +- ...heck.java => LambdaTooBigCheckSample.java} | 2 +- ...java => LazyArgEvaluationCheckSample.java} | 6 +- ...java => LeastSpecificTypeCheckSample.java} | 6 +- ... => LeftCurlyBraceEndLineCheckSample.java} | 8 +- ...> LeftCurlyBraceStartLineCheckSample.java} | 2 +- ... LoggedRethrownExceptionsCheckSample.java} | 4 +- ... => LongBitsToDoubleOnIntCheckSample.java} | 2 +- ...va => MapKeyNotComparableCheckSample.java} | 4 +- ...Check.java => MathOnFloatCheckSample.java} | 2 +- ...ifferOnlyByCapitalizationCheckSample.java} | 6 +- ...a => MethodOnlyCallsSuperCheckSample.java} | 14 +-- ...ethodWithExcessiveReturnsCheckSample.java} | 8 +- ...java => MissingDeprecatedCheckSample.java} | 6 +- ...nRecordWithArrayComponentCheckSample.java} | 2 +- ...ck.java => ModifiersOrderCheckSample.java} | 2 +- ...k.java => ModulusEqualityCheckSample.java} | 2 +- ...va => MutableMembersUsageCheckSample.java} | 22 ++--- ...rowCheck.java => NPEThrowCheckSample.java} | 2 +- ...heck.java => NestedBlocksCheckSample.java} | 2 +- ...ava => NestedIfStatementsCheckSample.java} | 2 +- ... => NestedSwitchStatementCheckSample.java} | 8 +- ...=> NestedTernaryOperatorsCheckSample.java} | 6 +- ...ck.java => NestedTryCatchCheckSample.java} | 2 +- ...> NoCheckstyleTagPresenceCheckSample.java} | 0 ....java => NoPmdTagPresenceCheckSample.java} | 0 ...NonStaticClassInitializerCheckSample.java} | 4 +- ...otifyCheck.java => NotifyCheckSample.java} | 0 ...> NullCheckWithInstanceofCheckSample.java} | 28 +++--- ...CreatedOnlyToCallGetClassCheckSample.java} | 0 ...ck.java => ObjectFinalizeCheckSample.java} | 2 +- ...erridenCallsSuperFinalizeCheckSample.java} | 0 ...inalizeOverridenNotPublicCheckSample.java} | 6 +- ...ava => OmitPermittedTypesCheckSample.java} | 0 ... => OneDeclarationPerLineCheckSample.java} | 4 +- ...va => OptionalAsParameterCheckSample.java} | 12 +-- ...OutputStreamOverrideWriteCheckSample.java} | 0 ...eck.java => PopulateBeansCheckSample.java} | 0 ...k.java => PredictableSeedCheckSample.java} | 0 ...aredStatementAndResultSetCheckSample.java} | 2 +- ...WrappersInTernaryOperatorCheckSample.java} | 2 +- ... PrimitivesMarkedNullableCheckSample.java} | 6 +- ...tivesMarkedNullableCheckSampleParent.java} | 2 +- ...lCheck.java => PrintfFailCheckSample.java} | 2 +- ...heck.java => PrintfMisuseCheckSample.java} | 4 +- ...> PrivateFieldUsedLocallyCheckSample.java} | 2 +- ...heck.java => PseudoRandomCheckSample.java} | 2 +- ...onstructorInAbstractClassCheckSample.java} | 0 ...ublicStaticMutableMembersCheckSample.java} | 18 ++-- ....java => RandomFloatToIntCheckSample.java} | 6 +- ... RawByteBitwiseOperationsCheckSample.java} | 4 +- ...heck.java => RawExceptionCheckSample.java} | 6 +- ...TypeCheck.java => RawTypeCheckSample.java} | 6 +- ...=> RecordDuplicatedGetterCheckSample.java} | 2 +- ...a => RecordInsteadOfClassCheckSample.java} | 2 +- ...> RedundantAbstractMethodCheckSample.java} | 2 +- ...ck.java => RedundantCloseCheckSample.java} | 2 +- ...java => RedundantModifierCheckSample.java} | 2 +- ...=> RedundantRecordMethodsCheckSample.java} | 2 +- ...edundantThrowsDeclarationCheckSample.java} | 10 +- ...java => RedundantTypeCastCheckSample.java} | 46 ++++----- ...ionOnNonRuntimeAnnotationCheckSample.java} | 2 +- ...> RegexPatternsNeedlesslyCheckSample.java} | 8 +- ...a => ReplaceGuavaWithJavaCheckSample.java} | 18 ++-- ... ReplaceLambdaByMethodRefCheckSample.java} | 0 ...estrictedIdentifiersUsageCheckSample.java} | 2 +- ...k.java => ResultSetIsLastCheckSample.java} | 2 +- ...> ReturnEmptyArrayNotNullCheckSample.java} | 20 ++-- ...Check.java => ReuseRandomCheckSample.java} | 4 +- ...yBraceSameLineAsNextBlockCheckSample.java} | 2 +- ... S2201_IgnoredReturnValueCheckSample.java} | 6 +- ...ledThreadPoolExecutorZeroCheckSample.java} | 2 +- ...k.java => SelfAssignementCheckSample.java} | 12 +-- ...a => ServletInstanceFieldCheckSample.java} | 2 +- ...etMethodsExceptionsThrownCheckSample.java} | 4 +- ....java => ShiftOnIntOrLongCheckSample.java} | 2 +- ...Check.java => SillyEqualsCheckSample.java} | 4 +- ... => SillyStringOperationsCheckSample.java} | 2 +- ...k.java => SimpleClassNameCheckSample.java} | 0 ...teralForSingleLineStringsCheckSample.java} | 2 +- ...lizedFunctionalInterfacesCheckSample.java} | 2 +- ...StandardCharsetsConstantsCheckSample.java} | 2 +- ....java => StaticFieldUpateCheckSample.java} | 10 +- ...cFieldUpdateInConstructorCheckSample.java} | 12 +-- .../java/checks/StaticMembersAccessCheck.java | 92 ----------------- .../StaticMembersAccessCheckSample.java | 92 +++++++++++++++++ ...heck.java => StaticMethodCheckSample.java} | 2 +- ...kCheck.java => StreamPeekCheckSample.java} | 2 +- ...gBufferAndBuilderWithCharCheckSample.java} | 2 +- ...> StringConcatToTextBlockCheckSample.java} | 2 +- ...StringConcatenationInLoopCheckSample.java} | 10 +- ...> StringLiteralDuplicatedCheckSample.java} | 2 +- ...StringLiteralInsideEqualsCheckSample.java} | 4 +- ...> StringMethodsWithLocaleCheckSample.java} | 2 +- ...va => StringOffsetMethodsCheckSample.java} | 2 +- ...tringPrimitiveConstructorCheckSample.java} | 2 +- ...ringToPrimitiveConversionCheckSample.java} | 2 +- ... => StrongCipherAlgorithmCheckSample.java} | 2 +- ...> SubClassStaticReferenceCheckSample.java} | 0 ....java => SwitchCaseTooBigCheckSample.java} | 2 +- ...sesShouldBeCommaSeparatedCheckSample.java} | 2 +- ... => SwitchDefaultLastCaseCheckSample.java} | 2 +- ...SwitchInsteadOfIfSequenceCheckSample.java} | 2 +- ...> SwitchLastCaseIsDefaultCheckSample.java} | 2 +- ...=> SwitchRedundantKeywordCheckSample.java} | 2 +- ....java => SwitchWithLabelsCheckSample.java} | 0 ...=> SwitchWithTooManyCasesCheckSample.java} | 2 +- ...va => SyncGetterAndSetterCheckSample.java} | 4 +- ...ronizationOnStringOrBoxedCheckSample.java} | 2 +- ...nchronizedClassUsageByAPICheckSample.java} | 2 +- ...=> SynchronizedClassUsageCheckSample.java} | 4 +- ....java => SynchronizedLockCheckSample.java} | 2 +- ...a => SynchronizedOverrideCheckSample.java} | 8 +- ...va => SystemOutOrErrUsageCheckSample.java} | 2 +- ...locksInComplexExpressionsCheckSample.java} | 2 +- ... ThreadAsRunnableArgumentCheckSample.java} | 6 +- ...ava => ThreadOverridesRunCheckSample.java} | 2 +- ...unCheck.java => ThreadRunCheckSample.java} | 2 +- ...Check.java => ThreadSleepCheckSample.java} | 2 +- ...ck.java => ThreadWaitCallCheckSample.java} | 2 +- ...java => ThrowsFromFinallyCheckSample.java} | 6 +- ...rrayCheck.java => ToArrayCheckSample.java} | 2 +- ... => ToStringReturningNullCheckSample.java} | 8 +- ...va => ToStringUsingBoxingCheckSample.java} | 2 +- ...k.java => TodoTagPresenceCheckSample.java} | 0 ...ck.java => TooManyMethodsCheckSample.java} | 20 ++-- ...java => TooManyParametersCheckSample.java} | 6 +- ...k.java => TrailingCommentCheckSample.java} | 2 +- ...entFieldInNonSerializableCheckSample.java} | 2 +- ....java => TryWithResourcesCheckSample.java} | 2 +- ...heck.java => TwoLocksWaitCheckSample.java} | 4 +- ...> TypeParametersShadowingCheckSample.java} | 2 +- ...=> TypeUpperBoundNotFinalCheckSample.java} | 2 +- ...java => BooleanMethodNameCheckSample.java} | 6 +- ...FieldNameMatchingTypeNameCheckSample.java} | 0 ...ethodNamedHashcodeOrEqualCheckSample.java} | 0 ...eck.java => AbstractRegexCheckSample.java} | 2 +- ....java => AnchorPrecedenceCheckSample.java} | 2 +- ...uplicatesInCharacterClassCheckSample.java} | 2 +- ...ck.java => EmptyLineRegexCheckSample.java} | 2 +- ...k.java => EmptyRegexGroupCheckSample.java} | 2 +- ... => EmptyStringRepetitionCheckSample.java} | 2 +- ...eSequenceControlCharacterCheckSample.java} | 2 +- ...GraphemeClustersInClassesCheckSample.java} | 2 +- ...> ImpossibleBackReferenceCheckSample.java} | 2 +- ...a => ImpossibleBoundariesCheckSample.java} | 2 +- ...heck.java => InvalidRegexCheckSample.java} | 2 +- ...ava => MultipleWhitespaceCheckSample.java} | 2 +- ...iveQuantifierContinuationCheckSample.java} | 2 +- ...{RedosCheck.java => RedosCheckSample.java} | 2 +- ...edundantRegexAlternativesCheckSample.java} | 2 +- ...k.java => RegexComplexityCheckSample.java} | 2 +- ...ck.java => RegexLookaheadCheckSample.java} | 2 +- ...va => ReluctantQuantifierCheckSample.java} | 2 +- ...fierWithEmptyContinuationCheckSample.java} | 2 +- ... SingleCharCharacterClassCheckSample.java} | 2 +- ...ingleCharacterAlternationCheckSample.java} | 2 +- ... => SuperfluousCurlyBraceCheckSample.java} | 2 +- ...iometricAuthWithoutCryptoCheckSample.java} | 2 +- ...va => AndroidBroadcastingCheckSample.java} | 2 +- ...ileDatabaseEncryptionKeysCheckSample.java} | 2 +- ...roidNonAuthenticatedUsersCheckSample.java} | 2 +- ...ndroidUnencryptedDatabaseCheckSample.java} | 2 +- ...> AndroidUnencryptedFilesCheckSample.java} | 2 +- ...orizationsStrongDecisionsCheckSample.java} | 2 +- ...Check.java => DataHashingCheckSample.java} | 0 ...va => DebugFeatureEnabledCheckSample.java} | 6 +- ...va => DisableAutoEscapingCheckSample.java} | 2 +- ... => EmptyDatabasePasswordCheckSample.java} | 2 +- ...va => EncryptionAlgorithmCheckSample.java} | 2 +- ...> ExcessiveContentRequestCheckSample.java} | 2 +- ...k.java => FilePermissionsCheckSample.java} | 2 +- ...ava => IntegerToHexStringCheckSample.java} | 2 +- ...APAuthenticatedConnectionCheckSample.java} | 0 ...va => LDAPDeserializationCheckSample.java} | 0 ....java => LogConfigurationCheckSample.java} | 0 ...SAML2AuthenticationBypassCheckSample.java} | 2 +- ....java => ReceivingIntentsCheckSample.java} | 2 +- ...heck.java => SecureCookieCheckSample.java} | 8 +- ...ava => ServerCertificatesCheckSample.java} | 0 ...nalizableClassConstructorCheckSample.java} | 0 ...a => NonSerializableWriteCheckSample.java} | 2 +- ...rializationIgnoredMembersCheckSample.java} | 2 +- ....java => SerialVersionUidCheckSample.java} | 26 ++--- ... SerialVersionUidInRecordCheckSample.java} | 2 +- ...eFieldInSerializableClassCheckSample.java} | 8 +- ...rializableObjectInSessionCheckSample.java} | 2 +- ...ializableSuperConstructorCheckSample.java} | 0 ...thodsOnConfigurationClassCheckSample.java} | 2 +- ...rWhenMultipleConstructorsCheckSample.java} | 8 +- ...teNamingConventionForSpELCheckSample.java} | 2 +- ...ityUsedAsRequestParameterCheckSample.java} | 2 +- ...equestMappingMethodPublicCheckSample.java} | 0 ... => SpringAntMatcherOrderCheckSample.java} | 2 +- ...rationWithAutowiredFieldsCheckSample.java} | 2 +- ...IncompatibleTransactionalCheckSample.java} | 32 +++--- ...pringRequestMappingMethodCheckSample.java} | 2 +- ...SpringSecurityDisableCSRFCheckSample.java} | 2 +- ... => SpringSessionFixationCheckSample.java} | 2 +- ...sactionalMethodVisibilityCheckSample.java} | 2 +- ...ava => DenialOfServiceXMLCheckSample.java} | 2 +- ...ck.java => DivisionByZeroCheckSample.java} | 14 +-- ....java => LocksNotUnlockedCheckSample.java} | 2 +- ...pComputeIfAbsentOrPresentCheckSample.java} | 2 +- ...Check.java => MinMaxRangeCheckSample.java} | 6 +- ...heck.java => NoWayOutLoopCheckSample.java} | 16 +-- ....java => NonNullSetToNullCheckSample.java} | 50 +++++----- ....java => NonNullSetToNullCheckSample.java} | 4 +- ...ava => ObjectOutputStreamCheckSample.java} | 2 +- ...ptionalGetBeforeIsPresentCheckSample.java} | 6 +- ...java => ParameterNullnessCheckSample.java} | 2 +- ...java => ParameterNullnessCheckSample.java} | 2 +- ...a => RedundantAssignmentsCheckSample.java} | 2 +- ...> S3958_StreamNotConsumedCheckSample.java} | 2 +- ...a => S3959_StreamConsumedCheckSample.java} | 2 +- ...377_XmlValidatedSignatureCheckSample.java} | 0 ...AssertJApplyConfigurationCheckSample.java} | 2 +- ...sertJAssertionsInConsumerCheckSample.java} | 2 +- ...sertJConsecutiveAssertionCheckSample.java} | 2 +- ...rtJContextBeforeAssertionCheckSample.java} | 2 +- ...> AssertJTestForEmptinessCheckSample.java} | 2 +- ...> AssertThatThrownByAloneCheckSample.java} | 2 +- ...=> AssertionArgumentOrderCheckSample.java} | 26 ++--- ...a => AssertionInThreadRunCheckSample.java} | 10 +- ...va => AssertionInTryCatchCheckSample.java} | 2 +- ...=> AssertionsCompletenessCheckSample.java} | 6 +- ...ssertionsInProductionCodeCheckSample.java} | 2 +- ... AssertionsWithoutMessageCheckSample.java} | 24 ++--- ....java => BadTestClassNameCheckSample.java} | 22 ++--- ...OrNullLiteralInAssertionsCheckSample.java} | 2 +- ...java => ExpectedExceptionCheckSample.java} | 2 +- ...heck.java => IgnoredTestsCheckSample.java} | 4 +- ...> JUnit45MethodAnnotationCheckSample.java} | 26 ++--- ...aultPackageClassAndMethodCheckSample.java} | 2 +- ...entlyIgnoreClassAndMethodCheckSample.java} | 2 +- ...UnitCompatibleAnnotationsCheckSample.java} | 2 +- ... => JunitNestedAnnotationCheckSample.java} | 2 +- ...> MockitoEqSimplificationCheckSample.java} | 2 +- ... => NonRandomizedTestDataCheckSample.java} | 2 +- ...eExpectedCheckedExceptionCheckSample.java} | 2 +- ...eExpectedRuntimeExceptionCheckSample.java} | 2 +- ...java => ParameterizedTestCheckSample.java} | 6 +- ...ava => RandomizedTestDataCheckSample.java} | 2 +- ...gAssertionsSimplificationCheckSample.java} | 2 +- ...tionWithExpectedExceptionCheckSample.java} | 2 +- ...eck.java => TestStabilityCheckSample.java} | 2 +- ...ava => ThreadSleepInTestsCheckSample.java} | 2 +- ...lassNoFieldShouldBeInterfaceCheckTest.java | 6 +- .../checks/AccessibilityChangeCheckTest.java | 4 +- ...AccessibilityChangeOnRecordsCheckTest.java | 4 +- .../AnnotationDefaultArgumentCheckTest.java | 4 +- ...AnonymousClassShouldBeLambdaCheckTest.java | 4 +- .../java/checks/ArrayCopyLoopCheckTest.java | 2 +- .../ArrayDesignatorAfterTypeCheckTest.java | 2 +- .../ArrayDesignatorOnVariableCheckTest.java | 2 +- .../java/checks/ArrayForVarArgCheckTest.java | 4 +- .../ArrayHashCodeAndToStringCheckTest.java | 2 +- ...aysAsListOfPrimitiveToStreamCheckTest.java | 2 +- .../AssertOnBooleanVariableCheckTest.java | 2 +- .../AssertionsInProductionCodeCheckTest.java | 6 +- ...tsOnParametersOfPublicMethodCheckTest.java | 2 +- .../AssignmentInSubExpressionCheckTest.java | 2 +- .../AtLeastOneConstructorCheckTest.java | 4 +- .../sonar/java/checks/BasicAuthCheckTest.java | 2 +- .../BigDecimalDoubleConstructorCheckTest.java | 2 +- .../java/checks/BooleanLiteralCheckTest.java | 2 +- .../checks/BooleanMethodReturnCheckTest.java | 4 +- .../BoxedBooleanExpressionsCheckTest.java | 4 +- .../DanglingElseStatementsCheckTest.java | 2 +- .../checks/DateFormatWeekYearCheckTest.java | 2 +- .../checks/DateUtilsTruncateCheckTest.java | 2 +- .../sonar/java/checks/DeadStoreCheckTest.java | 4 +- .../checks/DefaultEncodingUsageCheckTest.java | 4 +- .../DefaultInitializedFieldCheckTest.java | 2 +- .../checks/DeprecatedArgumentsCheckTest.java | 2 +- .../DepthOfInheritanceTreeCheckTest.java | 2 +- .../DoubleBraceInitializationCheckTest.java | 2 +- .../DuplicateConditionIfElseIfCheckTest.java | 2 +- .../checks/DynamicClassLoadCheckTest.java | 2 +- .../java/checks/EmptyMethodsCheckTest.java | 2 +- .../checks/EmptyStatementUsageCheckTest.java | 2 +- .../sonar/java/checks/EnumMapCheckTest.java | 2 +- .../checks/EnumMutableFieldCheckTest.java | 4 +- .../sonar/java/checks/EnumSetCheckTest.java | 2 +- ...qualsNotOverriddenInSubclassCheckTest.java | 4 +- .../checks/EqualsOnAtomicClassCheckTest.java | 2 +- ...qualsParametersMarkedNonNullCheckTest.java | 2 +- .../checks/ErrorClassExtendedCheckTest.java | 2 +- .../EscapedUnicodeCharactersCheckTest.java | 4 +- .../checks/ExpressionComplexityCheckTest.java | 2 +- .../checks/FinalizeFieldsSetCheckTest.java | 4 +- .../checks/FixmeTagPresenceCheckTest.java | 2 +- .../ForLoopFalseConditionCheckTest.java | 4 +- .../ForLoopIncrementAndUpdateCheckTest.java | 4 +- .../checks/ForLoopVariableTypeCheckTest.java | 6 +- .../GarbageCollectorCalledCheckTest.java | 4 +- .../java/checks/GetClassLoaderCheckTest.java | 2 +- .../GetRequestedSessionIdCheckTest.java | 2 +- .../checks/HardCodedPasswordCheckTest.java | 4 +- .../java/checks/HardCodedSecretCheckTest.java | 2 +- .../java/checks/HardcodedIpCheckTest.java | 2 +- .../java/checks/HardcodedURICheckTest.java | 2 +- .../checks/HasNextCallingNextCheckTest.java | 2 +- .../java/checks/HiddenFieldCheckTest.java | 2 +- .../IdenticalCasesInSwitchCheckTest.java | 4 +- .../checks/IgnoredReturnValueCheckTest.java | 4 +- .../IgnoredStreamReturnValueCheckTest.java | 2 +- .../ImmediateReverseBoxingCheckTest.java | 4 +- .../ImmediatelyReturnedVariableCheckTest.java | 4 +- .../ImplementsEnumerationCheckTest.java | 2 +- .../checks/InappropriateRegexpCheckTest.java | 2 +- .../IncorrectOrderOfMembersCheckTest.java | 2 +- .../IndentationAfterConditionalCheckTest.java | 2 +- .../InnerClassOfNonSerializableCheckTest.java | 2 +- .../InnerClassOfSerializableCheckTest.java | 2 +- .../java/checks/InputStreamReadCheckTest.java | 2 +- .../InsecureCreateTempFileCheckTest.java | 2 +- .../InstanceofUsedOnExceptionCheckTest.java | 2 +- ...InterfaceAsConstantContainerCheckTest.java | 2 +- ...terfaceOrSuperclassShadowingCheckTest.java | 4 +- .../checks/InterruptedExceptionCheckTest.java | 8 +- .../checks/InvalidDateValuesCheckTest.java | 2 +- .../checks/IsInstanceMethodCheckTest.java | 4 +- .../checks/IterableIteratorCheckTest.java | 2 +- .../IteratorNextExceptionCheckTest.java | 4 +- .../JacksonDeserializationCheckTest.java | 4 +- .../JdbcDriverExplicitLoadingCheckTest.java | 2 +- .../LabelsShouldNotBeUsedCheckTest.java | 2 +- .../java/checks/LambdaTooBigCheckTest.java | 2 +- .../checks/LazyArgEvaluationCheckTest.java | 4 +- .../checks/LeastSpecificTypeCheckTest.java | 4 +- .../LeftCurlyBraceEndLineCheckTest.java | 4 +- .../LeftCurlyBraceStartLineCheckTest.java | 4 +- .../LoggedRethrownExceptionsCheckTest.java | 2 +- .../LongBitsToDoubleOnIntCheckTest.java | 4 +- .../checks/MapKeyNotComparableCheckTest.java | 4 +- .../java/checks/MathOnFloatCheckTest.java | 2 +- ...rsDifferOnlyByCapitalizationCheckTest.java | 2 +- .../checks/MethodOnlyCallsSuperCheckTest.java | 8 +- .../MethodWithExcessiveReturnsCheckTest.java | 4 +- .../checks/MissingDeprecatedCheckTest.java | 2 +- ...esInRecordWithArrayComponentCheckTest.java | 2 +- .../java/checks/ModifiersOrderCheckTest.java | 2 +- .../java/checks/ModulusEqualityCheckTest.java | 2 +- .../checks/MutableMembersUsageCheckTest.java | 4 +- .../sonar/java/checks/NPEThrowCheckTest.java | 2 +- .../java/checks/NestedBlocksCheckTest.java | 4 +- .../checks/NestedIfStatementsCheckTest.java | 4 +- .../java/checks/NestedSwitchCheckTest.java | 4 +- .../NestedTernaryOperatorsCheckTest.java | 2 +- .../java/checks/NestedTryCatchCheckTest.java | 2 +- .../NoCheckstyleTagPresenceCheckTest.java | 2 +- .../checks/NoPmdTagPresenceCheckTest.java | 2 +- .../NonStaticClassInitializerCheckTest.java | 2 +- .../sonar/java/checks/NotifyCheckTest.java | 2 +- .../NullCheckWithInstanceofCheckTest.java | 2 +- ...ectCreatedOnlyToCallGetClassCheckTest.java | 2 +- .../java/checks/ObjectFinalizeCheckTest.java | 2 +- ...eOverridenCallsSuperFinalizeCheckTest.java | 2 +- ...ctFinalizeOverridenNotPublicCheckTest.java | 2 +- .../checks/OmitPermittedTypesCheckTest.java | 2 +- .../OneDeclarationPerLineCheckTest.java | 2 +- .../checks/OptionalAsParameterCheckTest.java | 2 +- .../OutputStreamOverrideWriteCheckTest.java | 2 +- .../checks/OverrideAnnotationCheckTest.java | 6 +- .../ParameterReassignedToCheckTest.java | 2 +- .../java/checks/PopulateBeansCheckTest.java | 2 +- .../java/checks/PredictableSeedCheckTest.java | 2 +- ...reparedStatementAndResultSetCheckTest.java | 4 +- ...iveWrappersInTernaryOperatorCheckTest.java | 2 +- .../PrimitivesMarkedNullableCheckTest.java | 4 +- .../java/checks/PrintfFailCheckTest.java | 2 +- .../java/checks/PrintfMisuseCheckTest.java | 2 +- .../PrivateFieldUsedLocallyCheckTest.java | 4 +- .../java/checks/PseudoRandomCheckTest.java | 2 +- ...icConstructorInAbstractClassCheckTest.java | 4 +- .../PublicStaticMutableMembersCheckTest.java | 8 +- .../checks/RandomFloatToIntCheckTest.java | 2 +- .../RawByteBitwiseOperationsCheckTest.java | 2 +- .../java/checks/RawExceptionCheckTest.java | 4 +- .../sonar/java/checks/RawTypeCheckTest.java | 6 +- .../RecordDuplicatedGetterCheckTest.java | 2 +- .../checks/RecordInsteadOfClassCheckTest.java | 4 +- .../RedundantAbstractMethodCheckTest.java | 6 +- .../java/checks/RedundantCloseCheckTest.java | 4 +- .../checks/RedundantModifierCheckTest.java | 2 +- .../RedundantRecordMethodsCheckTest.java | 2 +- .../RedundantThrowsDeclarationCheckTest.java | 4 +- .../checks/RedundantTypeCastCheckTest.java | 8 +- ...ectionOnNonRuntimeAnnotationCheckTest.java | 4 +- .../RegexPatternsNeedlesslyCheckTest.java | 2 +- .../checks/ReplaceGuavaWithJavaCheckTest.java | 2 +- .../ReplaceLambdaByMethodRefCheckTest.java | 2 +- .../RestrictedIdentifiersUsageCheckTest.java | 6 +- .../java/checks/ResultSetIsLastCheckTest.java | 2 +- .../ReturnEmptyArrayNotNullCheckTest.java | 4 +- .../java/checks/ReuseRandomCheckTest.java | 2 +- ...urlyBraceSameLineAsNextBlockCheckTest.java | 2 +- .../java/checks/RunFinalizersCheckTest.java | 4 +- ...eduledThreadPoolExecutorZeroCheckTest.java | 2 +- .../java/checks/SelfAssignementCheckTest.java | 2 +- .../checks/ServletInstanceFieldCheckTest.java | 8 +- ...rvletMethodsExceptionsThrownCheckTest.java | 2 +- .../checks/ShiftOnIntOrLongCheckTest.java | 2 +- .../java/checks/SillyEqualsCheckTest.java | 4 +- .../SillyStringOperationsCheckTest.java | 2 +- .../java/checks/SimpleClassNameCheckTest.java | 4 +- ...gLiteralForSingleLineStringsCheckTest.java | 2 +- ...cializedFunctionalInterfacesCheckTest.java | 4 +- .../StandardCharsetsConstantsCheckTest.java | 6 +- .../checks/StaticFieldUpateCheckTest.java | 4 +- ...aticFieldUpdateInConstructorCheckTest.java | 2 +- .../checks/StaticMembersAccessCheckTest.java | 2 +- .../java/checks/StaticMethodCheckTest.java | 4 +- .../java/checks/StreamPeekCheckTest.java | 2 +- ...ringBufferAndBuilderWithCharCheckTest.java | 2 +- .../StringConcatToTextBlockCheckTest.java | 6 +- .../StringConcatenationInLoopCheckTest.java | 2 +- .../StringLiteralDuplicatedCheckTest.java | 4 +- .../StringLiteralInsideEqualsCheckTest.java | 4 +- .../StringMethodsWithLocaleCheckTest.java | 2 +- .../checks/StringOffsetMethodsCheckTest.java | 2 +- .../StringPrimitiveConstructorCheckTest.java | 2 +- .../StringToPrimitiveConversionCheckTest.java | 4 +- .../StrongCipherAlgorithmCheckTest.java | 4 +- .../SubClassStaticReferenceCheckTest.java | 2 +- .../java/checks/SunPackagesUsedCheckTest.java | 2 +- .../checks/SwitchCaseTooBigCheckTest.java | 6 +- ...hCasesShouldBeCommaSeparatedCheckTest.java | 6 +- .../SwitchDefaultLastCaseCheckTest.java | 4 +- .../SwitchInsteadOfIfSequenceCheckTest.java | 6 +- .../SwitchLastCaseIsDefaultCheckTest.java | 6 +- .../SwitchRedundantKeywordCheckTest.java | 2 +- .../checks/SwitchWithLabelsCheckTest.java | 4 +- .../SwitchWithTooManyCasesCheckTest.java | 2 +- .../checks/SyncGetterAndSetterCheckTest.java | 2 +- ...nchronizationOnStringOrBoxedCheckTest.java | 4 +- .../SynchronizedClassUsageCheckTest.java | 8 +- .../checks/SynchronizedLockCheckTest.java | 2 +- .../checks/SynchronizedOverrideCheckTest.java | 2 +- .../checks/SystemOutOrErrUsageCheckTest.java | 2 +- ...xtBlocksInComplexExpressionsCheckTest.java | 2 +- .../ThreadAsRunnableArgumentCheckTest.java | 2 +- .../checks/ThreadOverridesRunCheckTest.java | 4 +- .../sonar/java/checks/ThreadRunCheckTest.java | 2 +- .../java/checks/ThreadSleepCheckTest.java | 2 +- .../java/checks/ThreadWaitCallCheckTest.java | 2 +- .../checks/ThrowsFromFinallyCheckTest.java | 2 +- .../sonar/java/checks/ToArrayCheckTest.java | 2 +- .../ToStringReturningNullCheckTest.java | 2 +- .../checks/ToStringUsingBoxingCheckTest.java | 2 +- .../java/checks/TodoTagPresenceCheckTest.java | 2 +- .../java/checks/TooManyMethodsCheckTest.java | 4 +- .../checks/TooManyParametersCheckTest.java | 4 +- .../java/checks/TrailingCommentCheckTest.java | 4 +- ...nsientFieldInNonSerializableCheckTest.java | 4 +- .../checks/TryWithResourcesCheckTest.java | 2 +- .../TypeParametersShadowingCheckTest.java | 2 +- .../TypeUpperBoundNotFinalCheckTest.java | 4 +- .../checks/design/BrainMethodCheckTest.java | 2 +- .../naming/BadTestClassNameCheckTest.java | 2 +- .../naming/BooleanMethodNameCheckTest.java | 2 +- .../FieldNameMatchingTypeNameCheckTest.java | 2 +- .../MethodNamedHashcodeOrEqualCheckTest.java | 4 +- .../checks/regex/AbstractRegexCheckTest.java | 2 +- .../regex/AnchorPrecedenceCheckTest.java | 2 +- .../DuplicatesInCharacterClassCheckTest.java | 2 +- .../checks/regex/EmptyLineRegexCheckTest.java | 4 +- .../regex/EmptyRegexGroupCheckTest.java | 2 +- .../regex/EmptyStringRepetitionCheckTest.java | 2 +- ...capeSequenceControlCharacterCheckTest.java | 2 +- .../GraphemeClustersInClassesCheckTest.java | 2 +- .../ImpossibleBackReferenceCheckTest.java | 2 +- .../regex/ImpossibleBoundariesCheckTest.java | 2 +- .../checks/regex/InvalidRegexCheckTest.java | 2 +- .../regex/MultipleWhitespaceCheckTest.java | 2 +- ...essiveQuantifierContinuationCheckTest.java | 2 +- .../java/checks/regex/RedosCheckTest.java | 4 +- .../RedundantRegexAlternativesCheckTest.java | 2 +- .../regex/RegexComplexityCheckTest.java | 2 +- .../checks/regex/RegexLookaheadCheckTest.java | 2 +- .../regex/ReluctantQuantifierCheckTest.java | 2 +- ...ntifierWithEmptyContinuationCheckTest.java | 2 +- .../SingleCharCharacterClassCheckTest.java | 2 +- .../SingleCharacterAlternationCheckTest.java | 2 +- .../regex/SuperfluousCurlyBraceCheckTest.java | 2 +- ...idBiometricAuthWithoutCryptoCheckTest.java | 2 +- .../AndroidBroadcastingCheckTest.java | 2 +- ...MobileDatabaseEncryptionKeysCheckTest.java | 2 +- ...AndroidNonAuthenticatedUsersCheckTest.java | 2 +- .../AndroidUnencryptedDatabaseCheckTest.java | 2 +- .../AndroidUnencryptedFilesCheckTest.java | 4 +- ...uthorizationsStrongDecisionsCheckTest.java | 2 +- .../checks/security/DataHashingCheckTest.java | 2 +- .../DebugFeatureEnabledCheckTest.java | 6 +- .../DisableAutoEscapingCheckTest.java | 4 +- .../EmptyDatabasePasswordCheckTest.java | 2 +- .../EncryptionAlgorithmCheckTest.java | 2 +- .../ExcessiveContentRequestCheckTest.java | 2 +- .../security/FilePermissionsCheckTest.java | 2 +- .../security/IntegerToHexStringCheckTest.java | 2 +- .../LDAPAuthenticatedConnectionCheckTest.java | 2 +- .../LDAPDeserializationCheckTest.java | 2 +- .../security/LogConfigurationCheckTest.java | 2 +- ...penSAML2AuthenticationBypassCheckTest.java | 2 +- .../security/ReceivingIntentsCheckTest.java | 2 +- .../security/SecureCookieCheckTest.java | 2 +- .../security/ServerCertificatesCheckTest.java | 2 +- ...ternalizableClassConstructorCheckTest.java | 2 +- .../NonSerializableWriteCheckTest.java | 2 +- ...dSerializationIgnoredMembersCheckTest.java | 2 +- .../SerialVersionUidCheckTest.java | 2 +- .../SerialVersionUidInRecordCheckTest.java | 4 +- ...ableFieldInSerializableClassCheckTest.java | 8 +- .../SerializableObjectInSessionCheckTest.java | 2 +- ...SerializableSuperConstructorCheckTest.java | 4 +- ...cMethodsOnConfigurationClassCheckTest.java | 2 +- ...ctorWhenMultipleConstructorsCheckTest.java | 2 +- ...ibuteNamingConventionForSpELCheckTest.java | 4 +- ...EntityUsedAsRequestParameterCheckTest.java | 4 +- .../RequestMappingMethodPublicCheckTest.java | 4 +- .../SpringAntMatcherOrderCheckTest.java | 4 +- ...igurationWithAutowiredFieldsCheckTest.java | 2 +- ...ingIncompatibleTransactionalCheckTest.java | 4 +- .../SpringRequestMappingMethodCheckTest.java | 4 +- .../SpringScanDefaultPackageCheckTest.java | 4 +- .../SpringSecurityDisableCSRFCheckTest.java | 2 +- .../SpringSessionFixationCheckTest.java | 2 +- ...ransactionalMethodVisibilityCheckTest.java | 4 +- .../DoubleCheckedLockingCheckTest.java | 4 +- .../TwoLocksWaitCheckTest.java | 2 +- .../AssertJApplyConfigurationCheckTest.java | 2 +- .../AssertJAssertionsInConsumerCheckTest.java | 4 +- .../AssertJConsecutiveAssertionCheckTest.java | 2 +- ...ssertJContextBeforeAssertionCheckTest.java | 2 +- .../AssertJTestForEmptinessCheckTest.java | 2 +- .../AssertThatThrownByAloneCheckTest.java | 2 +- .../AssertionArgumentOrderCheckTest.java | 2 +- .../tests/AssertionInThreadRunCheckTest.java | 4 +- .../tests/AssertionInTryCatchCheckTest.java | 2 +- .../AssertionsCompletenessCheckTest.java | 6 +- .../AssertionsWithoutMessageCheckTest.java | 2 +- ...eanOrNullLiteralInAssertionsCheckTest.java | 2 +- .../tests/ExpectedExceptionCheckTest.java | 2 +- .../checks/tests/IgnoredTestsCheckTest.java | 4 +- .../JUnit45MethodAnnotationCheckTest.java | 4 +- ...DefaultPackageClassAndMethodCheckTest.java | 2 +- ...SilentlyIgnoreClassAndMethodCheckTest.java | 2 +- .../JUnitCompatibleAnnotationsCheckTest.java | 2 +- .../tests/JunitNestedAnnotationCheckTest.java | 4 +- .../MockitoEqSimplificationCheckTest.java | 4 +- .../tests/NoTestInTestClassCheckTest.java | 2 +- .../OneExpectedCheckedExceptionCheckTest.java | 2 +- .../OneExpectedRuntimeExceptionCheckTest.java | 2 +- .../tests/ParameterizedTestCheckTest.java | 2 +- .../tests/RandomizedTestDataCheckTest.java | 4 +- ...ringAssertionsSimplificationCheckTest.java | 2 +- ...otationWithExpectedExceptionCheckTest.java | 2 +- .../checks/tests/TestsStabilityCheckTest.java | 2 +- .../tests/ThreadSleepInTestsCheckTest.java | 2 +- .../tests/TooManyAssertionsCheckTest.java | 2 +- .../checks/DenialOfServiceXMLCheckTest.java | 2 +- .../se/checks/DivisionByZeroCheckTest.java | 6 +- .../se/checks/LocksNotUnlockedCheckTest.java | 4 +- .../MapComputeIfAbsentOrPresentCheckTest.java | 4 +- .../java/se/checks/MinMaxRangeCheckTest.java | 2 +- .../java/se/checks/NoWayOutLoopCheckTest.java | 2 +- .../se/checks/NonNullSetToNullCheckTest.java | 6 +- .../checks/ObjectOutputStreamCheckTest.java | 2 +- .../OptionalGetBeforeIsPresentCheckTest.java | 2 +- .../se/checks/ParameterNullnessCheckTest.java | 4 +- .../checks/RedundantAssignmentsCheckTest.java | 2 +- .../se/checks/StreamConsumedCheckTest.java | 4 +- .../se/checks/StreamNotConsumedCheckTest.java | 2 +- .../XmlValidatedSignatureCheckTest.java | 2 +- 781 files changed, 1583 insertions(+), 1583 deletions(-) rename java-checks-test-sources/aws/src/main/files/non-compiling/checks/aws/{AwsConsumerBuilderUsageCheck.java => AwsConsumerBuilderUsageCheckSample.java} (89%) rename java-checks-test-sources/aws/src/main/java/checks/aws/{AwsConsumerBuilderUsageCheck.java => AwsConsumerBuilderUsageCheckSample.java} (98%) rename java-checks-test-sources/aws/src/main/java/checks/aws/{AwsCredentialsShouldBeSetExplicitlyCheck.java => AwsCredentialsShouldBeSetExplicitlyCheckSample.java} (93%) rename java-checks-test-sources/aws/src/main/java/checks/aws/{AwsLambdaSyncCallCheck.java => AwsLambdaSyncCallCheckSample.java} (99%) rename java-checks-test-sources/aws/src/main/java/checks/aws/{AwsLongTermAccessKeysCheck.java => AwsLongTermAccessKeysCheckSample.java} (92%) rename java-checks-test-sources/aws/src/main/java/checks/aws/{AwsRegionSetterCheck.java => AwsRegionSetterCheckSample.java} (96%) rename java-checks-test-sources/aws/src/main/java/checks/aws/{AwsRegionShouldBeSetExplicitlyCheck.java => AwsRegionShouldBeSetExplicitlyCheckSample.java} (98%) rename java-checks-test-sources/aws/src/main/java/checks/aws/{AwsReusableResourcesInitializedOnceCheck.java => AwsReusableResourcesInitializedOnceCheckSample.java} (99%) rename java-checks-test-sources/aws/src/main/java/checks/security/{HardCodedCredentialsShouldNotBeUsedCheck.java => HardCodedCredentialsShouldNotBeUsedCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{AbstractClassNoFieldShouldBeInterfaceCheck.java => AbstractClassNoFieldShouldBeInterfaceCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{AbstractClassNoFieldShouldBeInterfaceCheck_java9.java => AbstractClassNoFieldShouldBeInterfaceCheckSample_java9.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{AbstractClassNoFieldShouldBeInterfaceCheck_no_version.java => AbstractClassNoFieldShouldBeInterfaceCheckSample_no_version.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{AccessibilityChangeCheck.java => AccessibilityChangeCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{AnnotationDefaultArgumentCheck.java => AnnotationDefaultArgumentCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{AnonymousClassShouldBeLambdaCheck.java => AnonymousClassShouldBeLambdaCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ArrayForVarArgCheck.java => ArrayForVarArgCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{AtLeastOneConstructorCheck.java => AtLeastOneConstructorCheckSample.java} (87%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{BooleanMethodReturnCheck.java => BooleanMethodReturnCheckSample.java} (77%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{DeadStoreCheck.java => DeadStoreCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{DoubleCheckedLockingCheck.java => DoubleCheckedLockingCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{EnumMutableFieldCheck.java => EnumMutableFieldCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{EqualsNotOverriddenInSubclassCheck.java => EqualsNotOverriddenInSubclassCheckSample.java} (85%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{EscapedUnicodeCharactersTextBlocksCheck.java => EscapedUnicodeCharactersTextBlocksCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{FinalizeFieldsSetCheck.java => FinalizeFieldsSetCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ForLoopFalseConditionCheck.java => ForLoopFalseConditionCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ForLoopIncrementAndUpdateCheck.java => ForLoopIncrementAndUpdateCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ForLoopVariableTypeCheck.java => ForLoopVariableTypeCheckSample.java} (85%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{GarbageCollectorCalledCheck.java => GarbageCollectorCalledCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{HardCodedPasswordCheck.java => HardCodedPasswordCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{IdenticalCasesInSwitchCheck.java => IdenticalCasesInSwitchCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ImmediateReverseBoxingCheck.java => ImmediateReverseBoxingCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ImmediatelyReturnedVariableCheck.java => ImmediatelyReturnedVariableCheckSample.java} (80%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{InterfaceOrSuperclassShadowingCheck.java => InterfaceOrSuperclassShadowingCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{InterruptedExceptionCheck.java => InterruptedExceptionCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{IsInstanceMethodCheck.java => IsInstanceMethodCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{IteratorNextExceptionCheck.java => IteratorNextExceptionCheckSample.java} (76%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{LazyArgEvaluationCheck.java => LazyArgEvaluationCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{LeastSpecificTypeCheck.java => LeastSpecificTypeCheckSample.java} (80%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{LeftCurlyBraceEndLineCheck.java => LeftCurlyBraceEndLineCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{LeftCurlyBraceStartLineCheck.java => LeftCurlyBraceStartLineCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{LongBitsToDoubleOnIntCheck.java => LongBitsToDoubleOnIntCheckSample.java} (79%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{MapKeyNotComparableCheck.java => MapKeyNotComparableCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{MethodOnlyCallsSuperCheck.java => MethodOnlyCallsSuperCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{MethodWithExcessiveReturnsCheck.java => MethodWithExcessiveReturnsCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{MutableMembersUsageCheck.java => MutableMembersUsageCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{NestedBlocksCheck.java => NestedBlocksCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{NestedIfStatementsCheck.java => NestedIfStatementsCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{NestedSwitchExpressionCheck.java => NestedSwitchExpressionCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{NoTestInTestClassCheck.java => NoTestInTestClassCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{OverrideAnnotationCheck.java => OverrideAnnotationCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ParameterReassignedToCheck.java => ParameterReassignedToCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{PreparedStatementAndResultSetCheck.java => PreparedStatementAndResultSetCheckSample.java} (89%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{PrivateFieldUsedLocallyCheck.java => PrivateFieldUsedLocallyCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{PublicStaticMutableMembersCheck.java => PublicStaticMutableMembersCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{RawExceptionCheck.java => RawExceptionCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{RawTypeCheck.java => RawTypeCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{RecordInsteadOfClassCheck.java => RecordInsteadOfClassCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{RedundantAbstractMethodCheck.java => RedundantAbstractMethodCheckSample.java} (56%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{RedundantCloseCheck.java => RedundantCloseCheckSample.java} (79%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{RedundantThrowsDeclarationCheck.java => RedundantThrowsDeclarationCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{RedundantTypeCastCheck.java => RedundantTypeCastCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ReflectionOnNonRuntimeAnnotationCheck.java => ReflectionOnNonRuntimeAnnotationCheckSample.java} (84%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ReplaceLambdaByMethodRefCheck.java => ReplaceLambdaByMethodRefCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{RestrictedIdentifiersUsageCheck.java => RestrictedIdentifiersUsageCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ReturnEmptyArrayNotNullCheck.java => ReturnEmptyArrayNotNullCheckSample.java} (80%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{RunFinalizersCheck.java => RunFinalizersCheckSample.java} (86%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{S2201_IgnoredReturnValueCheck.java => S2201_IgnoredReturnValueCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ServletInstanceFieldCheck.java => ServletInstanceFieldCheckSample.java} (84%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SillyEqualsCheck.java => SillyEqualsCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SimpleClassNameCheck.java => SimpleClassNameCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{StaticFieldUpateCheck.java => StaticFieldUpateCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{StaticMethodCheck.java => StaticMethodCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{StringLiteralInsideEqualsCheck.java => StringLiteralInsideEqualsCheckSample.java} (86%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{StringToPrimitiveConversionCheck.java => StringToPrimitiveConversionCheckSample.java} (63%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{StrongCipherAlgorithmCheck.java => StrongCipherAlgorithmCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SunPackagesUsedCheck.java => SunPackagesUsedCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SwitchCaseTooBigCheck.java => SwitchCaseTooBigCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SwitchCasesShouldBeCommaSeparatedCheck.java => SwitchCasesShouldBeCommaSeparatedCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SwitchDefaultLastCaseCheck.java => SwitchDefaultLastCaseCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SwitchInsteadOfIfSequenceCheck.java => SwitchInsteadOfIfSequenceCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SwitchLastCaseIsDefaultCheck.java => SwitchLastCaseIsDefaultCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SwitchWithLabelsCheck.java => SwitchWithLabelsCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{SynchronizationOnStringOrBoxedCheck.java => SynchronizationOnStringOrBoxedCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{TextBlocksDuplicatedCheck.java => TextBlocksDuplicatedCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{ThreadOverridesRunCheck.java => ThreadOverridesRunCheckSample.java} (88%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{TooManyMethodsCheck.java => TooManyMethodsCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{TooManyParametersCheck.java => TooManyParametersCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{TransientFieldInNonSerializableCheck.java => TransientFieldInNonSerializableCheckSample.java} (70%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/{TypeUpperBoundNotFinalCheck.java => TypeUpperBoundNotFinalCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/naming/{MethodNamedHashcodeOrEqualCheck.java => MethodNamedHashcodeOrEqualCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/regex/{EmptyLineRegexCheck.java => EmptyLineRegexCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/security/{DebugFeatureEnabledCheck.java => DebugFeatureEnabledCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/security/{DisableAutoEscapingCheck.java => DisableAutoEscapingCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/security/{HardCodedCredentialsShouldNotBeUsedCheck.java => HardCodedCredentialsShouldNotBeUsedCheckSample.java} (88%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/security/{SecureCookieCheck.java => SecureCookieCheckSample.java} (83%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/security/{ServerCertificatesCheck.java => ServerCertificatesCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/{SerialVersionUidInRecordCheck.java => SerialVersionUidInRecordCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/{SerializableFieldInSerializableClassCheck.java => SerializableFieldInSerializableClassCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/{SerializableSuperConstructorCheck.java => SerializableSuperConstructorCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/{SpringIncompatibleTransactionalCheck.java => SpringIncompatibleTransactionalCheckSample.java} (89%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/{TransactionalMethodVisibilityCheck.java => TransactionalMethodVisibilityCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/{AssertJAssertionsInConsumerCheck.java => AssertJAssertionsInConsumerCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/{AssertionsCompletenessCheck.java => AssertionsCompletenessCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/{JUnit45MethodAnnotationCheck.java => JUnit45MethodAnnotationCheckSample.java} (59%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/{JUnit5SilentlyIgnoreClassAndMethodCheck.java => JUnit5SilentlyIgnoreClassAndMethodCheckSample.java} (81%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/{MockitoEqSimplificationCheck.java => MockitoEqSimplificationCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/{TooManyAssertionsCheck.java => TooManyAssertionsCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/{DivisionByZeroCheck.java => DivisionByZeroCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/{LocksNotUnlockedCheck.java => LocksNotUnlockedCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/{MapComputeIfAbsentOrPresentCheck.java => MapComputeIfAbsentOrPresentCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/{NonNullSetToNullCheck.java => NonNullSetToNullCheckSample.java} (86%) rename java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/{S3959_SwitchExpression.java => S3959_SwitchExpressionSample.java} (93%) rename java-checks-test-sources/default/src/main/java/{SpringScanDefaultPackageCheck.java => SpringScanDefaultPackageCheckSample.java} (98%) delete mode 100644 java-checks-test-sources/default/src/main/java/checks/AbstractClassNoFieldShouldBeInterfaceCheck.java create mode 100644 java-checks-test-sources/default/src/main/java/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample.java rename java-checks-test-sources/default/src/main/java/checks/{AccessibilityChangeCheck.java => AccessibilityChangeCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{AccessibilityChangeOnRecordsCheck.java => AccessibilityChangeOnRecordsCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{AnnotationDefaultArgumentCheck.java => AnnotationDefaultArgumentCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{AnonymousClassShouldBeLambdaCheck.java => AnonymousClassShouldBeLambdaCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{ArrayCopyLoopCheck.java => ArrayCopyLoopCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{ArrayDesignatorAfterTypeCheck.java => ArrayDesignatorAfterTypeCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ArrayDesignatorOnVariableCheck.java => ArrayDesignatorOnVariableCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{ArrayForVarArgCheck.java => ArrayForVarArgCheckSample.java} (65%) rename java-checks-test-sources/default/src/main/java/checks/{ArrayHashCodeAndToStringCheck.java => ArrayHashCodeAndToStringCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ArraysAsListOfPrimitiveToStreamCheck.java => ArraysAsListOfPrimitiveToStreamCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/{AssertOnBooleanVariableCheck.java => AssertOnBooleanVariableCheckSample.java} (87%) rename java-checks-test-sources/default/src/main/java/checks/{AssertionsInProductionCodeCheck.java => AssertionsInProductionCodeCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/java/checks/{AssertsOnParametersOfPublicMethodCheck.java => AssertsOnParametersOfPublicMethodCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{AssignmentInSubExpressionCheck.java => AssignmentInSubExpressionCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{AtLeastOneConstructorCheck.java => AtLeastOneConstructorCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{BasicAuthCheck.java => BasicAuthCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{BigDecimalDoubleConstructorCheck.java => BigDecimalDoubleConstructorCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{BooleanLiteralCheck.java => BooleanLiteralCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{BooleanMethodReturnCheck.java => BooleanMethodReturnCheckSample.java} (81%) rename java-checks-test-sources/default/src/main/java/checks/{BoxedBooleanExpressionsCheck.java => BoxedBooleanExpressionsCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{BrainMethodCheck.java => BrainMethodCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{DanglingElseStatementsCheck.java => DanglingElseStatementsCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{DateFormatWeekYearCheck.java => DateFormatWeekYearCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{DateUtilsTruncateCheck.java => DateUtilsTruncateCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/java/checks/{DeadStoreCheck.java => DeadStoreCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{DefaultEncodingUsageCheck.java => DefaultEncodingUsageCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{DefaultInitializedFieldCheck.java => DefaultInitializedFieldCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{DeprecatedArgumentsCheck.java => DeprecatedArgumentsCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/{DepthOfInheritanceTreeCheck.java => DepthOfInheritanceTreeCheckSample.java} (56%) delete mode 100644 java-checks-test-sources/default/src/main/java/checks/DoubleBraceInitializationCheck.java create mode 100644 java-checks-test-sources/default/src/main/java/checks/DoubleBraceInitializationCheckSample.java rename java-checks-test-sources/default/src/main/java/checks/{DoubleCheckedLockingCheck.java => DoubleCheckedLockingCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{DuplicateConditionIfElseIfCheck.java => DuplicateConditionIfElseIfCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{DynamicClassLoadCheck.java => DynamicClassLoadCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{EmptyMethodsCheck.java => EmptyMethodsCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{EmptyStatementUsageCheck.java => EmptyStatementUsageCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{EnumMapCheck.java => EnumMapCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/java/checks/{EnumMutableFieldCheck.java => EnumMutableFieldCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{EnumSetCheck.java => EnumSetCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{EqualsNotOverriddenInSubclassCheck.java => EqualsNotOverriddenInSubclassCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{EqualsOnAtomicClassCheck.java => EqualsOnAtomicClassCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{EqualsParametersMarkedNonNullCheck.java => EqualsParametersMarkedNonNullCheckSample.java} (95%) delete mode 100644 java-checks-test-sources/default/src/main/java/checks/ErrorClassExtendedCheck.java create mode 100644 java-checks-test-sources/default/src/main/java/checks/ErrorClassExtendedCheckSample.java rename java-checks-test-sources/default/src/main/java/checks/{EscapedUnicodeCharactersCheck.java => EscapedUnicodeCharactersCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ExpressionComplexityCheck.java => ExpressionComplexityCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{FinalizeFieldsSetCheck.java => FinalizeFieldsSetCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{FixmeTagPresenceCheck.java => FixmeTagPresenceCheckSample.java} (88%) rename java-checks-test-sources/default/src/main/java/checks/{ForLoopFalseConditionCheck.java => ForLoopFalseConditionCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{ForLoopIncrementAndUpdateCheck.java => ForLoopIncrementAndUpdateCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{ForLoopVariableTypeCheck.java => ForLoopVariableTypeCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{GarbageCollectorCalledCheck.java => GarbageCollectorCalledCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{GetClassLoaderCheck.java => GetClassLoaderCheckSample.java} (85%) rename java-checks-test-sources/default/src/main/java/checks/{GetRequestedSessionIdCheck.java => GetRequestedSessionIdCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/java/checks/{HardCodedPasswordCheck.java => HardCodedPasswordCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{HardCodedSecretCheck.java => HardCodedSecretCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{HardcodedIpCheck.java => HardcodedIpCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{HardcodedURICheck.java => HardcodedURICheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{HasNextCallingNextCheck.java => HasNextCallingNextCheckSample.java} (66%) rename java-checks-test-sources/default/src/main/java/checks/{HiddenFieldCheck.java => HiddenFieldCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{IdenticalCasesInSwitchCheck.java => IdenticalCasesInSwitchCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{IgnoredStreamReturnValueCheck.java => IgnoredStreamReturnValueCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ImmediateReverseBoxingCheck.java => ImmediateReverseBoxingCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{ImmediatelyReturnedVariableCheck.java => ImmediatelyReturnedVariableCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{ImplementsEnumerationCheck.java => ImplementsEnumerationCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{InappropriateRegexpCheck.java => InappropriateRegexpCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{IncorrectOrderOfMembersCheck.java => IncorrectOrderOfMembersCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{IndentationAfterConditionalCheck.java => IndentationAfterConditionalCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{InnerClassOfNonSerializableCheck.java => InnerClassOfNonSerializableCheckSample.java} (86%) rename java-checks-test-sources/default/src/main/java/checks/{InnerClassOfSerializableCheck.java => InnerClassOfSerializableCheckSample.java} (84%) rename java-checks-test-sources/default/src/main/java/checks/{InputStreamReadCheck.java => InputStreamReadCheckSample.java} (85%) rename java-checks-test-sources/default/src/main/java/checks/{InsecureCreateTempFileCheck.java => InsecureCreateTempFileCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/java/checks/{InstanceofUsedOnExceptionCheck.java => InstanceofUsedOnExceptionCheckSample.java} (99%) delete mode 100644 java-checks-test-sources/default/src/main/java/checks/InterfaceAsConstantContainerCheck.java create mode 100644 java-checks-test-sources/default/src/main/java/checks/InterfaceAsConstantContainerCheckSample.java rename java-checks-test-sources/default/src/main/java/checks/{InterfaceOrSuperclassShadowingCheck.java => InterfaceOrSuperclassShadowingCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/{InterruptedExceptionCheck.java => InterruptedExceptionCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{InvalidDateValuesCheck.java => InvalidDateValuesCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{IsInstanceMethodCheck.java => IsInstanceMethodCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{IterableIteratorCheck.java => IterableIteratorCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/{IteratorNextExceptionCheck.java => IteratorNextExceptionCheckSample.java} (76%) rename java-checks-test-sources/default/src/main/java/checks/{JacksonDeserializationCheck.java => JacksonDeserializationCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{JdbcDriverExplicitLoadingCheck.java => JdbcDriverExplicitLoadingCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{LabelsShouldNotBeUsedCheck.java => LabelsShouldNotBeUsedCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{LambdaTooBigCheck.java => LambdaTooBigCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/{LazyArgEvaluationCheck.java => LazyArgEvaluationCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{LeastSpecificTypeCheck.java => LeastSpecificTypeCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{LeftCurlyBraceEndLineCheck.java => LeftCurlyBraceEndLineCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/{LeftCurlyBraceStartLineCheck.java => LeftCurlyBraceStartLineCheckSample.java} (81%) rename java-checks-test-sources/default/src/main/java/checks/{LoggedRethrownExceptionsCheck.java => LoggedRethrownExceptionsCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{LongBitsToDoubleOnIntCheck.java => LongBitsToDoubleOnIntCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{MapKeyNotComparableCheck.java => MapKeyNotComparableCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/java/checks/{MathOnFloatCheck.java => MathOnFloatCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{MembersDifferOnlyByCapitalizationCheck.java => MembersDifferOnlyByCapitalizationCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{MethodOnlyCallsSuperCheck.java => MethodOnlyCallsSuperCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/java/checks/{MethodWithExcessiveReturnsCheck.java => MethodWithExcessiveReturnsCheckSample.java} (85%) rename java-checks-test-sources/default/src/main/java/checks/{MissingDeprecatedCheck.java => MissingDeprecatedCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/java/checks/{MissingOverridesInRecordWithArrayComponentCheck.java => MissingOverridesInRecordWithArrayComponentCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ModifiersOrderCheck.java => ModifiersOrderCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ModulusEqualityCheck.java => ModulusEqualityCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{MutableMembersUsageCheck.java => MutableMembersUsageCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{NPEThrowCheck.java => NPEThrowCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{NestedBlocksCheck.java => NestedBlocksCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{NestedIfStatementsCheck.java => NestedIfStatementsCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{NestedSwitchStatementCheck.java => NestedSwitchStatementCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/java/checks/{NestedTernaryOperatorsCheck.java => NestedTernaryOperatorsCheckSample.java} (78%) rename java-checks-test-sources/default/src/main/java/checks/{NestedTryCatchCheck.java => NestedTryCatchCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{NoCheckstyleTagPresenceCheck.java => NoCheckstyleTagPresenceCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{NoPmdTagPresenceCheck.java => NoPmdTagPresenceCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{NonStaticClassInitializerCheck.java => NonStaticClassInitializerCheckSample.java} (79%) rename java-checks-test-sources/default/src/main/java/checks/{NotifyCheck.java => NotifyCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{NullCheckWithInstanceofCheck.java => NullCheckWithInstanceofCheckSample.java} (76%) rename java-checks-test-sources/default/src/main/java/checks/{ObjectCreatedOnlyToCallGetClassCheck.java => ObjectCreatedOnlyToCallGetClassCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{ObjectFinalizeCheck.java => ObjectFinalizeCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{ObjectFinalizeOverridenCallsSuperFinalizeCheck.java => ObjectFinalizeOverridenCallsSuperFinalizeCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{ObjectFinalizeOverridenNotPublicCheck.java => ObjectFinalizeOverridenNotPublicCheckSample.java} (71%) rename java-checks-test-sources/default/src/main/java/checks/OmitPermittedTypesCheck/{OmitPermittedTypesCheck.java => OmitPermittedTypesCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{OneDeclarationPerLineCheck.java => OneDeclarationPerLineCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{OptionalAsParameterCheck.java => OptionalAsParameterCheckSample.java} (71%) rename java-checks-test-sources/default/src/main/java/checks/{OutputStreamOverrideWriteCheck.java => OutputStreamOverrideWriteCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{PopulateBeansCheck.java => PopulateBeansCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{PredictableSeedCheck.java => PredictableSeedCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{PreparedStatementAndResultSetCheck.java => PreparedStatementAndResultSetCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{PrimitiveWrappersInTernaryOperatorCheck.java => PrimitiveWrappersInTernaryOperatorCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/java/checks/{PrimitivesMarkedNullableCheck.java => PrimitivesMarkedNullableCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/java/checks/{PrimitivesMarkedNullableCheckParent.java => PrimitivesMarkedNullableCheckSampleParent.java} (66%) rename java-checks-test-sources/default/src/main/java/checks/{PrintfFailCheck.java => PrintfFailCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{PrintfMisuseCheck.java => PrintfMisuseCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{PrivateFieldUsedLocallyCheck.java => PrivateFieldUsedLocallyCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{PseudoRandomCheck.java => PseudoRandomCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{PublicConstructorInAbstractClassCheck.java => PublicConstructorInAbstractClassCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{PublicStaticMutableMembersCheck.java => PublicStaticMutableMembersCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/java/checks/{RandomFloatToIntCheck.java => RandomFloatToIntCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{RawByteBitwiseOperationsCheck.java => RawByteBitwiseOperationsCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/java/checks/{RawExceptionCheck.java => RawExceptionCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/{RawTypeCheck.java => RawTypeCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/java/checks/{RecordDuplicatedGetterCheck.java => RecordDuplicatedGetterCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{RecordInsteadOfClassCheck.java => RecordInsteadOfClassCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{RedundantAbstractMethodCheck.java => RedundantAbstractMethodCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{RedundantCloseCheck.java => RedundantCloseCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{RedundantModifierCheck.java => RedundantModifierCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{RedundantRecordMethodsCheck.java => RedundantRecordMethodsCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{RedundantThrowsDeclarationCheck.java => RedundantThrowsDeclarationCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{RedundantTypeCastCheck.java => RedundantTypeCastCheckSample.java} (83%) rename java-checks-test-sources/default/src/main/java/checks/{ReflectionOnNonRuntimeAnnotationCheck.java => ReflectionOnNonRuntimeAnnotationCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{RegexPatternsNeedlesslyCheck.java => RegexPatternsNeedlesslyCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/java/checks/{ReplaceGuavaWithJavaCheck.java => ReplaceGuavaWithJavaCheckSample.java} (75%) rename java-checks-test-sources/default/src/main/java/checks/{ReplaceLambdaByMethodRefCheck.java => ReplaceLambdaByMethodRefCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{RestrictedIdentifiersUsageCheck.java => RestrictedIdentifiersUsageCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/java/checks/{ResultSetIsLastCheck.java => ResultSetIsLastCheckSample.java} (87%) rename java-checks-test-sources/default/src/main/java/checks/{ReturnEmptyArrayNotNullCheck.java => ReturnEmptyArrayNotNullCheckSample.java} (82%) rename java-checks-test-sources/default/src/main/java/checks/{ReuseRandomCheck.java => ReuseRandomCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{RightCurlyBraceSameLineAsNextBlockCheck.java => RightCurlyBraceSameLineAsNextBlockCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{S2201_IgnoredReturnValueCheck.java => S2201_IgnoredReturnValueCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ScheduledThreadPoolExecutorZeroCheck.java => ScheduledThreadPoolExecutorZeroCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/java/checks/{SelfAssignementCheck.java => SelfAssignementCheckSample.java} (89%) rename java-checks-test-sources/default/src/main/java/checks/{ServletInstanceFieldCheck.java => ServletInstanceFieldCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ServletMethodsExceptionsThrownCheck.java => ServletMethodsExceptionsThrownCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{ShiftOnIntOrLongCheck.java => ShiftOnIntOrLongCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{SillyEqualsCheck.java => SillyEqualsCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{SillyStringOperationsCheck.java => SillyStringOperationsCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{SimpleClassNameCheck.java => SimpleClassNameCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{SimpleStringLiteralForSingleLineStringsCheck.java => SimpleStringLiteralForSingleLineStringsCheckSample.java} (89%) rename java-checks-test-sources/default/src/main/java/checks/{SpecializedFunctionalInterfacesCheck.java => SpecializedFunctionalInterfacesCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{StandardCharsetsConstantsCheck.java => StandardCharsetsConstantsCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{StaticFieldUpateCheck.java => StaticFieldUpateCheckSample.java} (89%) rename java-checks-test-sources/default/src/main/java/checks/{StaticFieldUpdateInConstructorCheck.java => StaticFieldUpdateInConstructorCheckSample.java} (70%) delete mode 100644 java-checks-test-sources/default/src/main/java/checks/StaticMembersAccessCheck.java create mode 100644 java-checks-test-sources/default/src/main/java/checks/StaticMembersAccessCheckSample.java rename java-checks-test-sources/default/src/main/java/checks/{StaticMethodCheck.java => StaticMethodCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{StreamPeekCheck.java => StreamPeekCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{StringBufferAndBuilderWithCharCheck.java => StringBufferAndBuilderWithCharCheckSample.java} (90%) rename java-checks-test-sources/default/src/main/java/checks/{StringConcatToTextBlockCheck.java => StringConcatToTextBlockCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{StringConcatenationInLoopCheck.java => StringConcatenationInLoopCheckSample.java} (86%) rename java-checks-test-sources/default/src/main/java/checks/{StringLiteralDuplicatedCheck.java => StringLiteralDuplicatedCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{StringLiteralInsideEqualsCheck.java => StringLiteralInsideEqualsCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{StringMethodsWithLocaleCheck.java => StringMethodsWithLocaleCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{StringOffsetMethodsCheck.java => StringOffsetMethodsCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{StringPrimitiveConstructorCheck.java => StringPrimitiveConstructorCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{StringToPrimitiveConversionCheck.java => StringToPrimitiveConversionCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{StrongCipherAlgorithmCheck.java => StrongCipherAlgorithmCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{SubClassStaticReferenceCheck.java => SubClassStaticReferenceCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{SwitchCaseTooBigCheck.java => SwitchCaseTooBigCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{SwitchCasesShouldBeCommaSeparatedCheck.java => SwitchCasesShouldBeCommaSeparatedCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{SwitchDefaultLastCaseCheck.java => SwitchDefaultLastCaseCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{SwitchInsteadOfIfSequenceCheck.java => SwitchInsteadOfIfSequenceCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{SwitchLastCaseIsDefaultCheck.java => SwitchLastCaseIsDefaultCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{SwitchRedundantKeywordCheck.java => SwitchRedundantKeywordCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{SwitchWithLabelsCheck.java => SwitchWithLabelsCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{SwitchWithTooManyCasesCheck.java => SwitchWithTooManyCasesCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{SyncGetterAndSetterCheck.java => SyncGetterAndSetterCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{SynchronizationOnStringOrBoxedCheck.java => SynchronizationOnStringOrBoxedCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{SynchronizedClassUsageByAPICheck.java => SynchronizedClassUsageByAPICheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{SynchronizedClassUsageCheck.java => SynchronizedClassUsageCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{SynchronizedLockCheck.java => SynchronizedLockCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/{SynchronizedOverrideCheck.java => SynchronizedOverrideCheckSample.java} (69%) rename java-checks-test-sources/default/src/main/java/checks/{SystemOutOrErrUsageCheck.java => SystemOutOrErrUsageCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/{TextBlocksInComplexExpressionsCheck.java => TextBlocksInComplexExpressionsCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{ThreadAsRunnableArgumentCheck.java => ThreadAsRunnableArgumentCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ThreadOverridesRunCheck.java => ThreadOverridesRunCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/{ThreadRunCheck.java => ThreadRunCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{ThreadSleepCheck.java => ThreadSleepCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{ThreadWaitCallCheck.java => ThreadWaitCallCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/{ThrowsFromFinallyCheck.java => ThrowsFromFinallyCheckSample.java} (89%) rename java-checks-test-sources/default/src/main/java/checks/{ToArrayCheck.java => ToArrayCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{ToStringReturningNullCheck.java => ToStringReturningNullCheckSample.java} (87%) rename java-checks-test-sources/default/src/main/java/checks/{ToStringUsingBoxingCheck.java => ToStringUsingBoxingCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/{TodoTagPresenceCheck.java => TodoTagPresenceCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/{TooManyMethodsCheck.java => TooManyMethodsCheckSample.java} (54%) rename java-checks-test-sources/default/src/main/java/checks/{TooManyParametersCheck.java => TooManyParametersCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/java/checks/{TrailingCommentCheck.java => TrailingCommentCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/{TransientFieldInNonSerializableCheck.java => TransientFieldInNonSerializableCheckSample.java} (85%) rename java-checks-test-sources/default/src/main/java/checks/{TryWithResourcesCheck.java => TryWithResourcesCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{TwoLocksWaitCheck.java => TwoLocksWaitCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/java/checks/{TypeParametersShadowingCheck.java => TypeParametersShadowingCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/{TypeUpperBoundNotFinalCheck.java => TypeUpperBoundNotFinalCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/naming/{BooleanMethodNameCheck.java => BooleanMethodNameCheckSample.java} (76%) rename java-checks-test-sources/default/src/main/java/checks/naming/{FieldNameMatchingTypeNameCheck.java => FieldNameMatchingTypeNameCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/naming/{MethodNamedHashcodeOrEqualCheck.java => MethodNamedHashcodeOrEqualCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/regex/{AbstractRegexCheck.java => AbstractRegexCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/regex/{AnchorPrecedenceCheck.java => AnchorPrecedenceCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/regex/{DuplicatesInCharacterClassCheck.java => DuplicatesInCharacterClassCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/regex/{EmptyLineRegexCheck.java => EmptyLineRegexCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/regex/{EmptyRegexGroupCheck.java => EmptyRegexGroupCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/regex/{EmptyStringRepetitionCheck.java => EmptyStringRepetitionCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/regex/{EscapeSequenceControlCharacterCheck.java => EscapeSequenceControlCharacterCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/regex/{GraphemeClustersInClassesCheck.java => GraphemeClustersInClassesCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/regex/{ImpossibleBackReferenceCheck.java => ImpossibleBackReferenceCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/regex/{ImpossibleBoundariesCheck.java => ImpossibleBoundariesCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/regex/{InvalidRegexCheck.java => InvalidRegexCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/regex/{MultipleWhitespaceCheck.java => MultipleWhitespaceCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/java/checks/regex/{PossessiveQuantifierContinuationCheck.java => PossessiveQuantifierContinuationCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/regex/{RedosCheck.java => RedosCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/regex/{RedundantRegexAlternativesCheck.java => RedundantRegexAlternativesCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/regex/{RegexComplexityCheck.java => RegexComplexityCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/regex/{RegexLookaheadCheck.java => RegexLookaheadCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/regex/{ReluctantQuantifierCheck.java => ReluctantQuantifierCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/regex/{ReluctantQuantifierWithEmptyContinuationCheck.java => ReluctantQuantifierWithEmptyContinuationCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/regex/{SingleCharCharacterClassCheck.java => SingleCharCharacterClassCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/regex/{SingleCharacterAlternationCheck.java => SingleCharacterAlternationCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/regex/{SuperfluousCurlyBraceCheck.java => SuperfluousCurlyBraceCheckSample.java} (92%) rename java-checks-test-sources/default/src/main/java/checks/security/{AndroidBiometricAuthWithoutCryptoCheck.java => AndroidBiometricAuthWithoutCryptoCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/security/{AndroidBroadcastingCheck.java => AndroidBroadcastingCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/security/{AndroidMobileDatabaseEncryptionKeysCheck.java => AndroidMobileDatabaseEncryptionKeysCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/security/{AndroidNonAuthenticatedUsersCheck.java => AndroidNonAuthenticatedUsersCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/security/{AndroidUnencryptedDatabaseCheck.java => AndroidUnencryptedDatabaseCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/security/{AndroidUnencryptedFilesCheck.java => AndroidUnencryptedFilesCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/security/{AuthorizationsStrongDecisionsCheck.java => AuthorizationsStrongDecisionsCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/security/{DataHashingCheck.java => DataHashingCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/security/{DebugFeatureEnabledCheck.java => DebugFeatureEnabledCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/java/checks/security/{DisableAutoEscapingCheck.java => DisableAutoEscapingCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/security/{EmptyDatabasePasswordCheck.java => EmptyDatabasePasswordCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/security/{EncryptionAlgorithmCheck.java => EncryptionAlgorithmCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/security/ExcessiveContentRequestCheck/{ExcessiveContentRequestCheck.java => ExcessiveContentRequestCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/security/{FilePermissionsCheck.java => FilePermissionsCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/security/{IntegerToHexStringCheck.java => IntegerToHexStringCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/checks/security/{LDAPAuthenticatedConnectionCheck.java => LDAPAuthenticatedConnectionCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/security/{LDAPDeserializationCheck.java => LDAPDeserializationCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/security/{LogConfigurationCheck.java => LogConfigurationCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/security/{OpenSAML2AuthenticationBypassCheck.java => OpenSAML2AuthenticationBypassCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/checks/security/{ReceivingIntentsCheck.java => ReceivingIntentsCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/security/{SecureCookieCheck.java => SecureCookieCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/security/{ServerCertificatesCheck.java => ServerCertificatesCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/serialization/{ExternalizableClassConstructorCheck.java => ExternalizableClassConstructorCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/serialization/{NonSerializableWriteCheck.java => NonSerializableWriteCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/checks/serialization/{RecordSerializationIgnoredMembersCheck.java => RecordSerializationIgnoredMembersCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/serialization/{SerialVersionUidCheck.java => SerialVersionUidCheckSample.java} (53%) rename java-checks-test-sources/default/src/main/java/checks/serialization/{SerialVersionUidInRecordCheck.java => SerialVersionUidInRecordCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/serialization/{SerializableFieldInSerializableClassCheck.java => SerializableFieldInSerializableClassCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/serialization/{SerializableObjectInSessionCheck.java => SerializableObjectInSessionCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/serialization/{SerializableSuperConstructorCheck.java => SerializableSuperConstructorCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/spring/{AsyncMethodsOnConfigurationClassCheck.java => AsyncMethodsOnConfigurationClassCheckSample.java} (91%) rename java-checks-test-sources/default/src/main/java/checks/spring/{AutowiredOnConstructorWhenMultipleConstructorsCheck.java => AutowiredOnConstructorWhenMultipleConstructorsCheckSample.java} (86%) rename java-checks-test-sources/default/src/main/java/checks/spring/{ModelAttributeNamingConventionForSpELCheck.java => ModelAttributeNamingConventionForSpELCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/spring/{PersistentEntityUsedAsRequestParameterCheck.java => PersistentEntityUsedAsRequestParameterCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/spring/{RequestMappingMethodPublicCheck.java => RequestMappingMethodPublicCheckSample.java} (100%) rename java-checks-test-sources/default/src/main/java/checks/spring/{SpringAntMatcherOrderCheck.java => SpringAntMatcherOrderCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/spring/{SpringConfigurationWithAutowiredFieldsCheck.java => SpringConfigurationWithAutowiredFieldsCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/spring/{SpringIncompatibleTransactionalCheck.java => SpringIncompatibleTransactionalCheckSample.java} (86%) rename java-checks-test-sources/default/src/main/java/checks/spring/{SpringRequestMappingMethodCheck.java => SpringRequestMappingMethodCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/checks/spring/{SpringSecurityDisableCSRFCheck.java => SpringSecurityDisableCSRFCheckSample.java} (96%) rename java-checks-test-sources/default/src/main/java/checks/spring/{SpringSessionFixationCheck.java => SpringSessionFixationCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/checks/spring/{TransactionalMethodVisibilityCheck.java => TransactionalMethodVisibilityCheckSample.java} (95%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{DenialOfServiceXMLCheck.java => DenialOfServiceXMLCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{DivisionByZeroCheck.java => DivisionByZeroCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{LocksNotUnlockedCheck.java => LocksNotUnlockedCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{MapComputeIfAbsentOrPresentCheck.java => MapComputeIfAbsentOrPresentCheckSample.java} (99%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{MinMaxRangeCheck.java => MinMaxRangeCheckSample.java} (93%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{NoWayOutLoopCheck.java => NoWayOutLoopCheckSample.java} (94%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/noDefault/{NonNullSetToNullCheck.java => NonNullSetToNullCheckSample.java} (87%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/packageNonNull/{NonNullSetToNullCheck.java => NonNullSetToNullCheckSample.java} (87%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{ObjectOutputStreamCheck.java => ObjectOutputStreamCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{OptionalGetBeforeIsPresentCheck.java => OptionalGetBeforeIsPresentCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/noDefault/{ParameterNullnessCheck.java => ParameterNullnessCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/packageNonNull/{ParameterNullnessCheck.java => ParameterNullnessCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{RedundantAssignmentsCheck.java => RedundantAssignmentsCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{S3958_StreamNotConsumedCheck.java => S3958_StreamNotConsumedCheckSample.java} (98%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{S3959_StreamConsumedCheck.java => S3959_StreamConsumedCheckSample.java} (97%) rename java-checks-test-sources/default/src/main/java/symbolicexecution/checks/{S6377_XmlValidatedSignatureCheck.java => S6377_XmlValidatedSignatureCheckSample.java} (100%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertJApplyConfigurationCheck.java => AssertJApplyConfigurationCheckSample.java} (96%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertJAssertionsInConsumerCheck.java => AssertJAssertionsInConsumerCheckSample.java} (98%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertJConsecutiveAssertionCheck.java => AssertJConsecutiveAssertionCheckSample.java} (99%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertJContextBeforeAssertionCheck.java => AssertJContextBeforeAssertionCheckSample.java} (99%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertJTestForEmptinessCheck.java => AssertJTestForEmptinessCheckSample.java} (99%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertThatThrownByAloneCheck.java => AssertThatThrownByAloneCheckSample.java} (95%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertionArgumentOrderCheck.java => AssertionArgumentOrderCheckSample.java} (78%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertionInThreadRunCheck.java => AssertionInThreadRunCheckSample.java} (82%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertionInTryCatchCheck.java => AssertionInTryCatchCheckSample.java} (99%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertionsCompletenessCheck.java => AssertionsCompletenessCheckSample.java} (98%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertionsInProductionCodeCheck.java => AssertionsInProductionCodeCheckSample.java} (77%) rename java-checks-test-sources/default/src/test/java/checks/tests/{AssertionsWithoutMessageCheck.java => AssertionsWithoutMessageCheckSample.java} (93%) rename java-checks-test-sources/default/src/test/java/checks/tests/{BadTestClassNameCheck.java => BadTestClassNameCheckSample.java} (57%) rename java-checks-test-sources/default/src/test/java/checks/tests/{BooleanOrNullLiteralInAssertionsCheck.java => BooleanOrNullLiteralInAssertionsCheckSample.java} (99%) rename java-checks-test-sources/default/src/test/java/checks/tests/{ExpectedExceptionCheck.java => ExpectedExceptionCheckSample.java} (97%) rename java-checks-test-sources/default/src/test/java/checks/tests/{IgnoredTestsCheck.java => IgnoredTestsCheckSample.java} (96%) rename java-checks-test-sources/default/src/test/java/checks/tests/{JUnit45MethodAnnotationCheck.java => JUnit45MethodAnnotationCheckSample.java} (80%) rename java-checks-test-sources/default/src/test/java/checks/tests/{JUnit5DefaultPackageClassAndMethodCheck.java => JUnit5DefaultPackageClassAndMethodCheckSample.java} (98%) rename java-checks-test-sources/default/src/test/java/checks/tests/{JUnit5SilentlyIgnoreClassAndMethodCheck.java => JUnit5SilentlyIgnoreClassAndMethodCheckSample.java} (98%) rename java-checks-test-sources/default/src/test/java/checks/tests/{JUnitCompatibleAnnotationsCheck.java => JUnitCompatibleAnnotationsCheckSample.java} (90%) rename java-checks-test-sources/default/src/test/java/checks/tests/{JunitNestedAnnotationCheck.java => JunitNestedAnnotationCheckSample.java} (94%) rename java-checks-test-sources/default/src/test/java/checks/tests/{MockitoEqSimplificationCheck.java => MockitoEqSimplificationCheckSample.java} (98%) rename java-checks-test-sources/default/src/test/java/checks/tests/{NonRandomizedTestDataCheck.java => NonRandomizedTestDataCheckSample.java} (95%) rename java-checks-test-sources/default/src/test/java/checks/tests/{OneExpectedCheckedExceptionCheck.java => OneExpectedCheckedExceptionCheckSample.java} (99%) rename java-checks-test-sources/default/src/test/java/checks/tests/{OneExpectedRuntimeExceptionCheck.java => OneExpectedRuntimeExceptionCheckSample.java} (99%) rename java-checks-test-sources/default/src/test/java/checks/tests/{ParameterizedTestCheck.java => ParameterizedTestCheckSample.java} (98%) rename java-checks-test-sources/default/src/test/java/checks/tests/{RandomizedTestDataCheck.java => RandomizedTestDataCheckSample.java} (96%) rename java-checks-test-sources/default/src/test/java/checks/tests/{SpringAssertionsSimplificationCheck.java => SpringAssertionsSimplificationCheckSample.java} (98%) rename java-checks-test-sources/default/src/test/java/checks/tests/{TestAnnotationWithExpectedExceptionCheck.java => TestAnnotationWithExpectedExceptionCheckSample.java} (96%) rename java-checks-test-sources/default/src/test/java/checks/tests/{TestStabilityCheck.java => TestStabilityCheckSample.java} (91%) rename java-checks-test-sources/default/src/test/java/checks/tests/{ThreadSleepInTestsCheck.java => ThreadSleepInTestsCheckSample.java} (96%) diff --git a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsConsumerBuilderUsageCheckTest.java b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsConsumerBuilderUsageCheckTest.java index ac3006d8701..f2072892c18 100644 --- a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsConsumerBuilderUsageCheckTest.java +++ b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsConsumerBuilderUsageCheckTest.java @@ -32,7 +32,7 @@ class AwsConsumerBuilderUsageCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsConsumerBuilderUsageCheck.java")) + .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsConsumerBuilderUsageCheckSample.java")) .withCheck(new AwsConsumerBuilderUsageCheck()) .withClassPath(AWS_CLASSPATH) .verifyIssues(); @@ -41,7 +41,7 @@ void test() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPathInModule(AWS_MODULE, "checks/aws/AwsConsumerBuilderUsageCheck.java")) + .onFile(nonCompilingTestSourcesPathInModule(AWS_MODULE, "checks/aws/AwsConsumerBuilderUsageCheckSample.java")) .withCheck(new AwsConsumerBuilderUsageCheck()) .withClassPath(AWS_CLASSPATH) .verifyIssues(); diff --git a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheckTest.java b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheckTest.java index 5a41efbc260..7a42614cf83 100644 --- a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheckTest.java +++ b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheckTest.java @@ -31,7 +31,7 @@ class AwsCredentialsShouldBeSetExplicitlyCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsCredentialsShouldBeSetExplicitlyCheck.java")) + .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsCredentialsShouldBeSetExplicitlyCheckSample.java")) .withCheck(new AwsCredentialsShouldBeSetExplicitlyCheck()) .withClassPath(AWS_CLASSPATH) .verifyIssues(); diff --git a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsLambdaSyncCallCheckTest.java b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsLambdaSyncCallCheckTest.java index 56b6802c2b3..8c4d5e5154e 100644 --- a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsLambdaSyncCallCheckTest.java +++ b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsLambdaSyncCallCheckTest.java @@ -31,7 +31,7 @@ class AwsLambdaSyncCallCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsLambdaSyncCallCheck.java")) + .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsLambdaSyncCallCheckSample.java")) .withCheck(new AwsLambdaSyncCallCheck()) .withClassPath(AWS_CLASSPATH) .verifyIssues(); diff --git a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsLongTermAccessKeysCheckTest.java b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsLongTermAccessKeysCheckTest.java index cbde86fc5be..34b41a4734d 100644 --- a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsLongTermAccessKeysCheckTest.java +++ b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsLongTermAccessKeysCheckTest.java @@ -30,7 +30,7 @@ class AwsLongTermAccessKeysCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsLongTermAccessKeysCheck.java")) + .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsLongTermAccessKeysCheckSample.java")) .withCheck(new AwsLongTermAccessKeysCheck()) .withClassPath(AWS_CLASSPATH) .verifyIssues(); diff --git a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsRegionSetterCheckTest.java b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsRegionSetterCheckTest.java index a83ac18fb05..eb449d52fe7 100644 --- a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsRegionSetterCheckTest.java +++ b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsRegionSetterCheckTest.java @@ -31,7 +31,7 @@ class AwsRegionSetterCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsRegionSetterCheck.java")) + .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsRegionSetterCheckSample.java")) .withCheck(new AwsRegionSetterCheck()) .withClassPath(AWS_CLASSPATH) .verifyIssues(); diff --git a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheckTest.java b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheckTest.java index c6e931c705d..39e86c7a445 100644 --- a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheckTest.java +++ b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheckTest.java @@ -31,7 +31,7 @@ class AwsRegionShouldBeSetExplicitlyCheckTest { void test() { CheckVerifier.newVerifier() .withCheck(new AwsRegionShouldBeSetExplicitlyCheck()) - .onFiles(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsRegionShouldBeSetExplicitlyCheck.java")) + .onFiles(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsRegionShouldBeSetExplicitlyCheckSample.java")) .withClassPath(AWS_CLASSPATH) .verifyIssues(); } diff --git a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsReusableResourcesInitializedOnceCheckTest.java b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsReusableResourcesInitializedOnceCheckTest.java index a293488b3b4..e2607c04409 100644 --- a/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsReusableResourcesInitializedOnceCheckTest.java +++ b/java-checks-aws/src/test/java/org/sonar/java/checks/aws/AwsReusableResourcesInitializedOnceCheckTest.java @@ -31,7 +31,7 @@ class AwsReusableResourcesInitializedOnceCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsReusableResourcesInitializedOnceCheck.java")) + .onFile(mainCodeSourcesPathInModule(AWS_MODULE, "checks/aws/AwsReusableResourcesInitializedOnceCheckSample.java")) .withCheck(new AwsReusableResourcesInitializedOnceCheck()) .withClassPath(AWS_CLASSPATH) .verifyIssues(); diff --git a/java-checks-aws/src/test/java/org/sonar/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheckTest.java b/java-checks-aws/src/test/java/org/sonar/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheckTest.java index 764cf03200a..b8b124b005e 100644 --- a/java-checks-aws/src/test/java/org/sonar/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheckTest.java +++ b/java-checks-aws/src/test/java/org/sonar/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheckTest.java @@ -52,7 +52,7 @@ void uses_empty_collection_when_methods_cannot_be_loaded() { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPathInModule(AWS_MODULE, "checks/security/HardCodedCredentialsShouldNotBeUsedCheck.java")) + .onFile(TestUtils.mainCodeSourcesPathInModule(AWS_MODULE, "checks/security/HardCodedCredentialsShouldNotBeUsedCheckSample.java")) .withCheck(new HardCodedCredentialsShouldNotBeUsedCheck()) .withClassPath(AWS_CLASSPATH) .verifyIssues(); @@ -61,7 +61,7 @@ void test() { @Test void test_non_compiling_code() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/security/HardCodedCredentialsShouldNotBeUsedCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/security/HardCodedCredentialsShouldNotBeUsedCheckSample.java")) .withCheck(new HardCodedCredentialsShouldNotBeUsedCheck()) .withClassPath(AWS_CLASSPATH) .verifyIssues(); diff --git a/java-checks-test-sources/aws/src/main/files/non-compiling/checks/aws/AwsConsumerBuilderUsageCheck.java b/java-checks-test-sources/aws/src/main/files/non-compiling/checks/aws/AwsConsumerBuilderUsageCheckSample.java similarity index 89% rename from java-checks-test-sources/aws/src/main/files/non-compiling/checks/aws/AwsConsumerBuilderUsageCheck.java rename to java-checks-test-sources/aws/src/main/files/non-compiling/checks/aws/AwsConsumerBuilderUsageCheckSample.java index 607067b3f8e..65516b8e96a 100644 --- a/java-checks-test-sources/aws/src/main/files/non-compiling/checks/aws/AwsConsumerBuilderUsageCheck.java +++ b/java-checks-test-sources/aws/src/main/files/non-compiling/checks/aws/AwsConsumerBuilderUsageCheckSample.java @@ -3,32 +3,32 @@ import java.util.function.Consumer; import software.amazon.awssdk.services.sesv2.model.Destination; -public class AwsConsumerBuilderUsageCheck { +public class AwsConsumerBuilderUsageCheckSample { public void test() { - AwsConsumerBuilderUsageCheck.builder() + AwsConsumerBuilderUsageCheckSample.builder() .validDestination(Destination.builder() // Noncompliant [[sc=8;ec=24]] {{Consider using the Consumer Builder method instead of creating this nested builder.}} .toAddresses("to-email@domain.com") .bccAddresses("bcc-email@domain.com") .build()) .build(); - AwsConsumerBuilderUsageCheck.builder() + AwsConsumerBuilderUsageCheckSample.builder() .validDestination("Not a Destination object") // Compliant, wrong argument type .build(); - AwsConsumerBuilderUsageCheck.builder() + AwsConsumerBuilderUsageCheckSample.builder() .validDestination(new UnknownType()) // Compliant, unknown argument type .build(); - AwsConsumerBuilderUsageCheck.builder() + AwsConsumerBuilderUsageCheckSample.builder() .testUnknownReturnType(Destination.builder() // Compliant, unknown return type .toAddresses("to-email@domain.com") .bccAddresses("bcc-email@domain.com") .build()) .build(); - AwsConsumerBuilderUsageCheck.builder() + AwsConsumerBuilderUsageCheckSample.builder() .testInvalidConsumerType(Destination.builder() // Compliant, unknown return type .toAddresses("to-email@domain.com") .bccAddresses("bcc-email@domain.com") diff --git a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsConsumerBuilderUsageCheck.java b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsConsumerBuilderUsageCheckSample.java similarity index 98% rename from java-checks-test-sources/aws/src/main/java/checks/aws/AwsConsumerBuilderUsageCheck.java rename to java-checks-test-sources/aws/src/main/java/checks/aws/AwsConsumerBuilderUsageCheckSample.java index 6d9e3a983fa..5097e5c1dc2 100644 --- a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsConsumerBuilderUsageCheck.java +++ b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsConsumerBuilderUsageCheckSample.java @@ -8,7 +8,7 @@ import software.amazon.awssdk.services.sesv2.model.Message; import software.amazon.awssdk.services.sesv2.model.SendEmailRequest; -public class AwsConsumerBuilderUsageCheck { +public class AwsConsumerBuilderUsageCheckSample { Destination destinationField = Destination.builder() .toAddresses("to-email@domain.com") diff --git a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheck.java b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheckSample.java similarity index 93% rename from java-checks-test-sources/aws/src/main/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheck.java rename to java-checks-test-sources/aws/src/main/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheckSample.java index ad377be310c..1b2f39166a3 100644 --- a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheck.java +++ b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsCredentialsShouldBeSetExplicitlyCheckSample.java @@ -8,7 +8,7 @@ import software.amazon.awssdk.services.s3.S3Client; import software.amazon.awssdk.services.s3.S3ClientBuilder; -public class AwsCredentialsShouldBeSetExplicitlyCheck { +public class AwsCredentialsShouldBeSetExplicitlyCheckSample { public static final AwsClientBuilder BUILDER = S3Client.builder(); // Compliant FN - Could be configured closer to build call void nonCompliant() { @@ -40,13 +40,13 @@ void compliant(AwsClientBuilder builderArgument) { AwsClientBuilder locallyCraftedBuilder = getABuilder(); // Compliant FN S3Client otherClient = (S3Client) locallyCraftedBuilder.build(); - AwsClientBuilder remotelyCraftedBuilder = AwsRegionShouldBeSetExplicitlyCheck.getABuilder(); // Compliant FN + AwsClientBuilder remotelyCraftedBuilder = AwsRegionShouldBeSetExplicitlyCheckSample.getABuilder(); // Compliant FN S3Client yetAnotherClient = (S3Client) remotelyCraftedBuilder.build(); - AwsClientBuilder remotelyPreCraftedBuilder = AwsRegionShouldBeSetExplicitlyCheck.BUILDER; // Compliant FN + AwsClientBuilder remotelyPreCraftedBuilder = AwsRegionShouldBeSetExplicitlyCheckSample.BUILDER; // Compliant FN S3Client stillAnotherClient = (S3Client) remotelyPreCraftedBuilder.build(); - S3Client sourceDirectlyFromBuilder = (S3Client) AwsRegionShouldBeSetExplicitlyCheck.BUILDER.build(); // Compliant FN + S3Client sourceDirectlyFromBuilder = (S3Client) AwsRegionShouldBeSetExplicitlyCheckSample.BUILDER.build(); // Compliant FN S3Client clientOutOfNowhere = (S3Client) BUILDER.build(); // Compliant FN diff --git a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsLambdaSyncCallCheck.java b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsLambdaSyncCallCheckSample.java similarity index 99% rename from java-checks-test-sources/aws/src/main/java/checks/aws/AwsLambdaSyncCallCheck.java rename to java-checks-test-sources/aws/src/main/java/checks/aws/AwsLambdaSyncCallCheckSample.java index 3b3d72b4496..fa8f7d3a5db 100644 --- a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsLambdaSyncCallCheck.java +++ b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsLambdaSyncCallCheckSample.java @@ -15,7 +15,7 @@ import static checks.aws.AwsLambdaSyncCallCheckHelper.REQUEST_IN_DIFFERENT_FILE; -public class AwsLambdaSyncCallCheck { +public class AwsLambdaSyncCallCheckSample { public static final String MY_FUNCTION = "myFunction"; diff --git a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsLongTermAccessKeysCheck.java b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsLongTermAccessKeysCheckSample.java similarity index 92% rename from java-checks-test-sources/aws/src/main/java/checks/aws/AwsLongTermAccessKeysCheck.java rename to java-checks-test-sources/aws/src/main/java/checks/aws/AwsLongTermAccessKeysCheckSample.java index 27f7068a243..76c61c31bf5 100644 --- a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsLongTermAccessKeysCheck.java +++ b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsLongTermAccessKeysCheckSample.java @@ -3,7 +3,7 @@ import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.auth.BasicSessionCredentials; -public class AwsLongTermAccessKeysCheck { +public class AwsLongTermAccessKeysCheckSample { void noncompliant() { BasicAWSCredentials foo = new BasicAWSCredentials("", ""); // Noncompliant [[sc=35;ec=54]] {{Make sure using a long-term access key is safe here.}} } diff --git a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionSetterCheck.java b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionSetterCheckSample.java similarity index 96% rename from java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionSetterCheck.java rename to java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionSetterCheckSample.java index 3f862c8fa67..cba8dce63d0 100644 --- a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionSetterCheck.java +++ b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionSetterCheckSample.java @@ -4,7 +4,7 @@ import com.amazonaws.services.lambda.AWSLambdaClientBuilder; import com.amazonaws.services.s3.AmazonS3ClientBuilder; -public class AwsRegionSetterCheck { +public class AwsRegionSetterCheckSample { public static final String CONST = "const"; private static final String EU_WEST_1 = "EU_WEST_1"; diff --git a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheck.java b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheckSample.java similarity index 98% rename from java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheck.java rename to java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheckSample.java index 71a9ced98fd..6db79b74a35 100644 --- a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheck.java +++ b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsRegionShouldBeSetExplicitlyCheckSample.java @@ -7,7 +7,7 @@ import software.amazon.awssdk.services.s3.S3Client; import software.amazon.awssdk.services.s3.S3ClientBuilder; -public class AwsRegionShouldBeSetExplicitlyCheck { +public class AwsRegionShouldBeSetExplicitlyCheckSample { public static final AwsClientBuilder BUILDER = getABuilder(); void nonCompliantChained() { diff --git a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsReusableResourcesInitializedOnceCheck.java b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsReusableResourcesInitializedOnceCheckSample.java similarity index 99% rename from java-checks-test-sources/aws/src/main/java/checks/aws/AwsReusableResourcesInitializedOnceCheck.java rename to java-checks-test-sources/aws/src/main/java/checks/aws/AwsReusableResourcesInitializedOnceCheckSample.java index bbfc9ec86c3..ad71b383ad2 100644 --- a/java-checks-test-sources/aws/src/main/java/checks/aws/AwsReusableResourcesInitializedOnceCheck.java +++ b/java-checks-test-sources/aws/src/main/java/checks/aws/AwsReusableResourcesInitializedOnceCheckSample.java @@ -14,7 +14,7 @@ import software.amazon.awssdk.services.machinelearning.MachineLearningClient; import software.amazon.awssdk.services.s3.S3Client; -public class AwsReusableResourcesInitializedOnceCheck { +public class AwsReusableResourcesInitializedOnceCheckSample { class RequestHandlerImpl implements RequestHandler { diff --git a/java-checks-test-sources/aws/src/main/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheck.java b/java-checks-test-sources/aws/src/main/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheckSample.java similarity index 99% rename from java-checks-test-sources/aws/src/main/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheck.java rename to java-checks-test-sources/aws/src/main/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheckSample.java index 074ca2b7879..06c713aea92 100644 --- a/java-checks-test-sources/aws/src/main/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheck.java +++ b/java-checks-test-sources/aws/src/main/java/checks/security/HardCodedCredentialsShouldNotBeUsedCheckSample.java @@ -30,7 +30,7 @@ import static java.lang.System.getProperty; -public class HardCodedCredentialsShouldNotBeUsedCheck { +public class HardCodedCredentialsShouldNotBeUsedCheckSample { static final String FINAL_SECRET_STRING = "hunter2"; static final byte[] FINAL_SECRET_BYTE_ARRAY = FINAL_SECRET_STRING.getBytes(StandardCharsets.UTF_8); private static String secretStringField = "hunter2"; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheck_java9.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample_java9.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheck_java9.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample_java9.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheck_no_version.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample_no_version.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheck_no_version.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample_no_version.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AccessibilityChangeCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AccessibilityChangeCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/AccessibilityChangeCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/AccessibilityChangeCheckSample.java index b41e20515de..227a4982772 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AccessibilityChangeCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AccessibilityChangeCheckSample.java @@ -2,7 +2,7 @@ import java.lang.reflect.Field; -class AccessibilityChangeCheck { +class AccessibilityChangeCheckSample { record Person(String name, int age) { } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AnnotationDefaultArgumentCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AnnotationDefaultArgumentCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/AnnotationDefaultArgumentCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/AnnotationDefaultArgumentCheckSample.java index 5c573c1a567..8d8bc4fc9c9 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AnnotationDefaultArgumentCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AnnotationDefaultArgumentCheckSample.java @@ -6,7 +6,7 @@ String myName() default "myName"; int myInteger() default 0; } -class AnnotationDefaultArgumentCheck { +class AnnotationDefaultArgumentCheckSample { @MyUnknownAnnotation("value") void unknownAnnotation() { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AnonymousClassShouldBeLambdaCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AnonymousClassShouldBeLambdaCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/AnonymousClassShouldBeLambdaCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/AnonymousClassShouldBeLambdaCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ArrayForVarArgCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ArrayForVarArgCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ArrayForVarArgCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ArrayForVarArgCheckSample.java index 590cd3770eb..5a3841de2bd 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ArrayForVarArgCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ArrayForVarArgCheckSample.java @@ -2,7 +2,7 @@ class ArrayForVarArgCheckBar {} class ArrayForVarArgCheckFoo extends ArrayForVarArgCheckBar {} -class ArrayForVarArgCheck { +class ArrayForVarArgCheckSample { public void callTheThing(String s) { ArrayForVarArgCheckFoo foo = new ArrayForVarArgCheckFoo(); diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AtLeastOneConstructorCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AtLeastOneConstructorCheckSample.java similarity index 87% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/AtLeastOneConstructorCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/AtLeastOneConstructorCheckSample.java index d79f54f88ad..382956e28db 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/AtLeastOneConstructorCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/AtLeastOneConstructorCheckSample.java @@ -1,4 +1,4 @@ -class AtLeastOneConstructorCheck { +class AtLeastOneConstructorCheckSample { @EJB private MyObject foo; // Compliant, unknown annotation, could be from javax.ejb. @Resource diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/BooleanMethodReturnCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/BooleanMethodReturnCheckSample.java similarity index 77% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/BooleanMethodReturnCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/BooleanMethodReturnCheckSample.java index 0a01e7171bb..d9d24731a17 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/BooleanMethodReturnCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/BooleanMethodReturnCheckSample.java @@ -1,6 +1,6 @@ package checks; -class BooleanMethodReturnCheckA { +class BooleanMethodReturnCheckSampleA { @UnknownAnnotation public Boolean foo() { return null; // Compliant, UnknownAnnotation could be Nullable diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/DeadStoreCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/DeadStoreCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/DeadStoreCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/DeadStoreCheckSample.java index 82eecb1bfe3..7fc7005bd49 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/DeadStoreCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/DeadStoreCheckSample.java @@ -1,6 +1,6 @@ package checks; -abstract class DeadStoreCheck { +abstract class DeadStoreCheckSample { void lambdas_not_resolved(UnknnownFunction lambda) { int a = 42; // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/DoubleCheckedLockingCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/DoubleCheckedLockingCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/DoubleCheckedLockingCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/DoubleCheckedLockingCheckSample.java index 2ddf1b2be6d..ddcff096c2b 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/DoubleCheckedLockingCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/DoubleCheckedLockingCheckSample.java @@ -1,6 +1,6 @@ package checks; -class DoubleCheckedLockingCheck { +class DoubleCheckedLockingCheckSample { private UnknownType unknownType; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/EnumMutableFieldCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/EnumMutableFieldCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/EnumMutableFieldCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/EnumMutableFieldCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/EqualsNotOverriddenInSubclassCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/EqualsNotOverriddenInSubclassCheckSample.java similarity index 85% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/EqualsNotOverriddenInSubclassCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/EqualsNotOverriddenInSubclassCheckSample.java index 9694013cd93..ff17578236e 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/EqualsNotOverriddenInSubclassCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/EqualsNotOverriddenInSubclassCheckSample.java @@ -1,6 +1,6 @@ package checks; -class EqualsNotOverriddenInSubclassCheck { +class EqualsNotOverriddenInSubclassCheckSample { class A { public boolean equals(Object obj) { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/EscapedUnicodeCharactersTextBlocksCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/EscapedUnicodeCharactersTextBlocksCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/EscapedUnicodeCharactersTextBlocksCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/EscapedUnicodeCharactersTextBlocksCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/FinalizeFieldsSetCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/FinalizeFieldsSetCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/FinalizeFieldsSetCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/FinalizeFieldsSetCheckSample.java index 60ca94b91d0..b990f8d4ed0 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/FinalizeFieldsSetCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/FinalizeFieldsSetCheckSample.java @@ -1,6 +1,6 @@ package checks; -class FinalizeFieldsSetCheck { +class FinalizeFieldsSetCheckSample { Integer myInteger; private boolean myMethod() { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopFalseConditionCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopFalseConditionCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopFalseConditionCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopFalseConditionCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopIncrementAndUpdateCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopIncrementAndUpdateCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopIncrementAndUpdateCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopIncrementAndUpdateCheckSample.java index c67bdf3751b..e680cc5790e 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopIncrementAndUpdateCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopIncrementAndUpdateCheckSample.java @@ -2,7 +2,7 @@ import scala.reflect.ManifestFactory.IntManifest; -class ForLoopIncrementAndUpdateCheck { +class ForLoopIncrementAndUpdateCheckSample { Object foo() { int i = 0, j = 0, k = 0, l = 0; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopVariableTypeCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopVariableTypeCheckSample.java similarity index 85% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopVariableTypeCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopVariableTypeCheckSample.java index e6d3682a097..1f3182cd34f 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopVariableTypeCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ForLoopVariableTypeCheckSample.java @@ -2,7 +2,7 @@ //Type is missing: import java.lang.reflect.Constructor; -class ForLoopVariableTypeCheck { +class ForLoopVariableTypeCheckSample { private static void f(Class c) { for (Constructor ctor : c.getConstructors()) { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/GarbageCollectorCalledCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/GarbageCollectorCalledCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/GarbageCollectorCalledCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/GarbageCollectorCalledCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/HardCodedPasswordCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/HardCodedPasswordCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/HardCodedPasswordCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/HardCodedPasswordCheckSample.java index cb80658d151..38b75557e2b 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/HardCodedPasswordCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/HardCodedPasswordCheckSample.java @@ -5,7 +5,7 @@ import java.sql.SQLException; import javax.naming.Context; -class HardCodedPasswordCheck { +class HardCodedPasswordCheckSample { private void a(char[] pwd, String var) throws SQLException { MyUnknownClass.myUnknownMethod("password", "xxxxx"); // Noncompliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/IdenticalCasesInSwitchCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/IdenticalCasesInSwitchCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/IdenticalCasesInSwitchCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/IdenticalCasesInSwitchCheckSample.java index 70e70c8d689..a1248dd3c48 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/IdenticalCasesInSwitchCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/IdenticalCasesInSwitchCheckSample.java @@ -1,6 +1,6 @@ package checks; -class IdenticalCasesInSwitchCheck { +class IdenticalCasesInSwitchCheckSample { void foo(WeekendDay weekendDay){ int i = switch (weekendDay) { case SATURDAY: diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediateReverseBoxingCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediateReverseBoxingCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediateReverseBoxingCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediateReverseBoxingCheckSample.java index c67abe5dcd8..8dae3dca9cd 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediateReverseBoxingCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediateReverseBoxingCheckSample.java @@ -1,6 +1,6 @@ package checks; -abstract class ImmediateReverseBoxingCheck { +abstract class ImmediateReverseBoxingCheckSample { void intBoxingAndUnboxing(int int1, Integer integer1, String string, Double double1) { int int2 = new Integer(1); // Noncompliant Integer.valueOf(double1); // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediatelyReturnedVariableCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediatelyReturnedVariableCheckSample.java similarity index 80% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediatelyReturnedVariableCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediatelyReturnedVariableCheckSample.java index 15b87d48348..5b0ba6d0ea7 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediatelyReturnedVariableCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ImmediatelyReturnedVariableCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ImmediatelyReturnedVariableCheck { +class ImmediatelyReturnedVariableCheckSample { Object emptyInitializer() { // Does not compile (variable o not initialized), but the rule should not raise an Exception anyway. diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/InterfaceOrSuperclassShadowingCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/InterfaceOrSuperclassShadowingCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/InterfaceOrSuperclassShadowingCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/InterfaceOrSuperclassShadowingCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/InterruptedExceptionCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/InterruptedExceptionCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/InterruptedExceptionCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/InterruptedExceptionCheckSample.java index 1228c1e622e..f121a8d6993 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/InterruptedExceptionCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/InterruptedExceptionCheckSample.java @@ -9,7 +9,7 @@ interface Log { void log(Level level, String s, Exception e); } -public class InterruptedExceptionCheck { +public class InterruptedExceptionCheckSample { static final Log LOGGER = null; public void run1 () { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/IsInstanceMethodCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/IsInstanceMethodCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/IsInstanceMethodCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/IsInstanceMethodCheckSample.java index d7ebaa03c94..966df4f28d4 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/IsInstanceMethodCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/IsInstanceMethodCheckSample.java @@ -1,6 +1,6 @@ package java.lang; -public class IsInstanceMethodCheck { +public class IsInstanceMethodCheckSample { int compliant(Number n) { if (n instanceof String) { // Compile-time error diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/IteratorNextExceptionCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/IteratorNextExceptionCheckSample.java similarity index 76% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/IteratorNextExceptionCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/IteratorNextExceptionCheckSample.java index 92238edb5ea..6b4aced7405 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/IteratorNextExceptionCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/IteratorNextExceptionCheckSample.java @@ -3,7 +3,7 @@ import java.util.Iterator; import java.util.NoSuchElementException; -class IteratorNextExceptionCheckA implements Iterator { +class IteratorNextExceptionCheckSampleA implements Iterator { public String next() { unknownMethod(); @@ -20,7 +20,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckB implements Iterator { +class IteratorNextExceptionCheckSampleB implements Iterator { public String next() { // Noncompliant if (!hasNext()){ @@ -34,7 +34,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckC implements Unknown { +class IteratorNextExceptionCheckSampleC implements Unknown { public String next() { // Compliant, Unknown parent of enclosing class if (!hasNext()){ @@ -48,7 +48,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckD implements Iterator { +class IteratorNextExceptionCheckSampleD implements Iterator { public String next() { // Compliant, unknown method call in the body could throw the exception unknownMethod(); @@ -61,7 +61,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckD2 implements Iterator { +class IteratorNextExceptionCheckSampleD2 implements Iterator { Iterator delegate; @@ -76,7 +76,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckE implements Iterator { +class IteratorNextExceptionCheckSampleE implements Iterator { public String next() { // Compliant throw new SomethingUnknown(); @@ -88,7 +88,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckF implements Iterator { +class IteratorNextExceptionCheckSampleF implements Iterator { public String next() { // Compliant foo(); diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/LazyArgEvaluationCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/LazyArgEvaluationCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/LazyArgEvaluationCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/LazyArgEvaluationCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/LeastSpecificTypeCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/LeastSpecificTypeCheckSample.java similarity index 80% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/LeastSpecificTypeCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/LeastSpecificTypeCheckSample.java index 774b365e6cb..5b6c3bdc4dd 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/LeastSpecificTypeCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/LeastSpecificTypeCheckSample.java @@ -5,7 +5,7 @@ import javax.inject.Inject; import org.springframework.beans.factory.annotation.Autowired; -class LeastSpecificTypeCheck { +class LeastSpecificTypeCheckSample { @SomethingUnknown public void resourceAnnotatedMethod1(List list) { // Compliant - Unknown annotation, could be Spring, we do not report anything for (Object o : list) { @@ -57,16 +57,16 @@ interface Inner {} static class T extends T2 implements IMB, IMA {} - public static void bla(T t) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheck.I1' here; it is a more general type than 'T'.}} + public static void bla(T t) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheckSample.I1' here; it is a more general type than 'T'.}} t.m(); } - public static void foo(T t) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheck.T1' here; it is a more general type than 'T'.}} + public static void foo(T t) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheckSample.T1' here; it is a more general type than 'T'.}} t.m(); t.mt1(); } - public static void ma(T t) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheck.IMA' here; it is a more general type than 'T'.}} + public static void ma(T t) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheckSample.IMA' here; it is a more general type than 'T'.}} // defined in both T2 and IMA, interface is preferred t.ma(); } @@ -76,7 +76,7 @@ public static void ma_1(T t) { // Compliant - ambiguous as Unknown type is unkno t.ma_1(null); } - public static void ma_2(T t) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheck.IMB' here; it is a more general type than 'T'.}} + public static void ma_2(T t) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheckSample.IMB' here; it is a more general type than 'T'.}} // defined in both T2 and IMA, but call is ambiguous t.ma_2(null); } @@ -93,7 +93,7 @@ class GImplSub extends GImpl { } - public static void generics(GImplSub s) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheck.GImpl' here; it is a more general type than 'GImplSub'.}} + public static void generics(GImplSub s) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheckSample.GImpl' here; it is a more general type than 'GImplSub'.}} s.get(); } @@ -101,7 +101,7 @@ class Generic implements IG { } - public static void generics2(Generic g) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheck.IG' here; it is a more general type than 'Generic'.}} + public static void generics2(Generic g) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheckSample.IG' here; it is a more general type than 'Generic'.}} g.get(); } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/LeftCurlyBraceEndLineCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/LeftCurlyBraceEndLineCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/LeftCurlyBraceEndLineCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/LeftCurlyBraceEndLineCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/LeftCurlyBraceStartLineCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/LeftCurlyBraceStartLineCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/LeftCurlyBraceStartLineCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/LeftCurlyBraceStartLineCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/LongBitsToDoubleOnIntCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/LongBitsToDoubleOnIntCheckSample.java similarity index 79% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/LongBitsToDoubleOnIntCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/LongBitsToDoubleOnIntCheckSample.java index eacbd9b0bfc..18401638332 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/LongBitsToDoubleOnIntCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/LongBitsToDoubleOnIntCheckSample.java @@ -1,6 +1,6 @@ package checks; -class LongBitsToDoubleOnIntCheck { +class LongBitsToDoubleOnIntCheckSample { public static double getDouble() { return Double.longBitsToDouble(Unknown.getSomething()); // Compliant, getSomething can return Long } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/MapKeyNotComparableCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/MapKeyNotComparableCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/MapKeyNotComparableCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/MapKeyNotComparableCheckSample.java index fbb68487e22..d0f13e332b5 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/MapKeyNotComparableCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/MapKeyNotComparableCheckSample.java @@ -4,7 +4,7 @@ import java.util.Map; import org.jetbrains.annotations.NotNull; -public class MapKeyNotComparableCheck { +public class MapKeyNotComparableCheckSample { static class NonComparable { @Override public String toString() { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodOnlyCallsSuperCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodOnlyCallsSuperCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodOnlyCallsSuperCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodOnlyCallsSuperCheckSample.java index df1f6d4b1d7..d163dbd310c 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodOnlyCallsSuperCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodOnlyCallsSuperCheckSample.java @@ -1,6 +1,6 @@ package checks; -class MethodOnlyCallsSuperCheck { +class MethodOnlyCallsSuperCheckSample { abstract class A extends Unknown { // When the parent method is Unknown, we should not report anything private int f4() { // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodWithExcessiveReturnsCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodWithExcessiveReturnsCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodWithExcessiveReturnsCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/MethodWithExcessiveReturnsCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/MutableMembersUsageCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/MutableMembersUsageCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/MutableMembersUsageCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/MutableMembersUsageCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedBlocksCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedBlocksCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedBlocksCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedBlocksCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedIfStatementsCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedIfStatementsCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedIfStatementsCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedIfStatementsCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedSwitchExpressionCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedSwitchExpressionCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedSwitchExpressionCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedSwitchExpressionCheckSample.java index bc0766f22bf..7d715c392e7 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedSwitchExpressionCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/NestedSwitchExpressionCheckSample.java @@ -1,6 +1,6 @@ package checks; -class NestedSwitchExpressionCheck { +class NestedSwitchExpressionCheckSample { void foo() { int myVar = 0; int i = switch (myVar) { // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/NoTestInTestClassCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/NoTestInTestClassCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/NoTestInTestClassCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/NoTestInTestClassCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/OverrideAnnotationCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/OverrideAnnotationCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/OverrideAnnotationCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/OverrideAnnotationCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ParameterReassignedToCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ParameterReassignedToCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ParameterReassignedToCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ParameterReassignedToCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/PreparedStatementAndResultSetCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/PreparedStatementAndResultSetCheckSample.java similarity index 89% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/PreparedStatementAndResultSetCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/PreparedStatementAndResultSetCheckSample.java index fa1fd096276..d871cfcb4f9 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/PreparedStatementAndResultSetCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/PreparedStatementAndResultSetCheckSample.java @@ -4,7 +4,7 @@ import java.sql.ResultSet; import java.sql.SQLException; -abstract class PreparedStatementAndResultSetCheck extends UnknownClassFromSamePackage { +abstract class PreparedStatementAndResultSetCheckSample extends UnknownClassFromSamePackage { abstract PreparedStatement getPreparedStatement(String s); void unknownQuery() throws SQLException { PreparedStatement ps = getPreparedStatement(UNKNOWN_QUERY_FROM_UNKNOWN_PARENT); // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/PrivateFieldUsedLocallyCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/PrivateFieldUsedLocallyCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/PrivateFieldUsedLocallyCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/PrivateFieldUsedLocallyCheckSample.java index 472b3e7b29c..578d262a594 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/PrivateFieldUsedLocallyCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/PrivateFieldUsedLocallyCheckSample.java @@ -304,7 +304,7 @@ public static A lookup(int indexValue) { } } -record PrivateFieldUsedLocallyCheckRecord() { +record PrivateFieldUsedLocallyCheckSampleRecord() { static String s = OtherClass.f + ""; static class OtherClass { private static int f = 12; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/PublicStaticMutableMembersCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/PublicStaticMutableMembersCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/PublicStaticMutableMembersCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/PublicStaticMutableMembersCheckSample.java index 79f515fa9b3..ab2d5d7c66b 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/PublicStaticMutableMembersCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/PublicStaticMutableMembersCheckSample.java @@ -9,7 +9,7 @@ import java.util.Map; import java.util.Set; -public class PublicStaticMutableMembersCheck { +public class PublicStaticMutableMembersCheckSample { public static final List UNKNOWN_LIST = unknownMethod("a"); // Compliant public static final List noInitializer; // we don't know the type of foo diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RawExceptionCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RawExceptionCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/RawExceptionCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/RawExceptionCheckSample.java index 3cc83e806ab..ce4ec32541b 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RawExceptionCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RawExceptionCheckSample.java @@ -1,6 +1,6 @@ package checks; -class RawExceptionCheck { +class RawExceptionCheckSample { void foo() throws Exception { // Noncompliant doSomething(); } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RawTypeCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RawTypeCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/RawTypeCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/RawTypeCheckSample.java index 59c8b777793..171b052a420 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RawTypeCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RawTypeCheckSample.java @@ -1,6 +1,6 @@ package checks; -class RawTypeCheck { +class RawTypeCheckSample { class KnownParent { public void method(Comparable arg1, String arg2) {} // Noncompliant } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RecordInsteadOfClassCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RecordInsteadOfClassCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/RecordInsteadOfClassCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/RecordInsteadOfClassCheckSample.java index c20c398538a..fda58f989e3 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RecordInsteadOfClassCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RecordInsteadOfClassCheckSample.java @@ -4,7 +4,7 @@ import java.util.Map; import org.jetbrains.annotations.NotNull; -public class RecordInsteadOfClassCheck { +public class RecordInsteadOfClassCheckSample { public final class NotCompiling extends Unknown { // Compliant because it inherits private final int i; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantAbstractMethodCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantAbstractMethodCheckSample.java similarity index 56% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantAbstractMethodCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantAbstractMethodCheckSample.java index ac3c36f929e..95b1c56b8bf 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantAbstractMethodCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantAbstractMethodCheckSample.java @@ -1,6 +1,6 @@ package checks; -abstract class RedundantAbstractMethodCheck implements UnknownInterface { +abstract class RedundantAbstractMethodCheckSample implements UnknownInterface { @Override public abstract void foo(); // Compliant - we don't actually know } @@ -8,6 +8,6 @@ interface MyInterface { public void foo(); } -abstract class RedundantAbstractMethodCheck2 implements MyInterface { +abstract class RedundantAbstractMethodCheckSample2 implements MyInterface { @Override public abstract void foo(); // Noncompliant } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantCloseCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantCloseCheckSample.java similarity index 79% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantCloseCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantCloseCheckSample.java index 458c161b663..4cb9ac7038d 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantCloseCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantCloseCheckSample.java @@ -1,6 +1,6 @@ package checks; -class RedundantCloseCheck { +class RedundantCloseCheckSample { void foo() throws Exception { try(unknownVariable) { unknownVariable.close(); // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantThrowsDeclarationCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantThrowsDeclarationCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantThrowsDeclarationCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantThrowsDeclarationCheckSample.java index 00d9f18398f..690c4e51bdd 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantThrowsDeclarationCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantThrowsDeclarationCheckSample.java @@ -3,7 +3,7 @@ import java.io.IOException; import java.text.ParseException; -public class RedundantThrowsDeclarationCheck { +public class RedundantThrowsDeclarationCheckSample { } abstract class MySuperClass { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantTypeCastCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantTypeCastCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantTypeCastCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/RedundantTypeCastCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReflectionOnNonRuntimeAnnotationCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReflectionOnNonRuntimeAnnotationCheckSample.java similarity index 84% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ReflectionOnNonRuntimeAnnotationCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ReflectionOnNonRuntimeAnnotationCheckSample.java index 5b799ef51c9..6570716715f 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReflectionOnNonRuntimeAnnotationCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReflectionOnNonRuntimeAnnotationCheckSample.java @@ -2,7 +2,7 @@ import java.lang.reflect.Method; -class ReflectionOnNonRuntimeAnnotationCheck { +class ReflectionOnNonRuntimeAnnotationCheckSample { void foo(Method m, Class c) { m.isAnnotationPresent(UnknownAnnotation.class); // Compliant, unable to retrieve annotation c.isAnnotationPresent(UnknownAnnotation.class); // Compliant, unable to retrieve annotation diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReplaceLambdaByMethodRefCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReplaceLambdaByMethodRefCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ReplaceLambdaByMethodRefCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ReplaceLambdaByMethodRefCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RestrictedIdentifiersUsageCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RestrictedIdentifiersUsageCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/RestrictedIdentifiersUsageCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/RestrictedIdentifiersUsageCheckSample.java index 1d8fc047a26..c42f6fa56f4 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RestrictedIdentifiersUsageCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RestrictedIdentifiersUsageCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class RestrictedIdentifiersUsageCheck { +public class RestrictedIdentifiersUsageCheckSample { void noncompliant() { String var = "var"; // Noncompliant [[sc=12;ec=15]]{{Rename this variable to not match a restricted identifier.}} diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReturnEmptyArrayNotNullCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReturnEmptyArrayNotNullCheckSample.java similarity index 80% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ReturnEmptyArrayNotNullCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ReturnEmptyArrayNotNullCheckSample.java index 54182a237a4..7471e1114c1 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReturnEmptyArrayNotNullCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ReturnEmptyArrayNotNullCheckSample.java @@ -4,9 +4,9 @@ import org.eclipse.draw2d.geometry.Vector; -class ReturnEmptyArrayNotNullCheck { +class ReturnEmptyArrayNotNullCheckSample { - public ReturnEmptyArrayNotNullCheck() { + public ReturnEmptyArrayNotNullCheckSample() { return null; } @@ -15,14 +15,14 @@ public int f11() { } } -class ReturnEmptyArrayNotNullCheckB { +class ReturnEmptyArrayNotNullCheckSampleB { @Unknown public int[] gul() { return null; // Compliant, Unknown annotation... } } -class ReturnEmptyArrayNotNullCheckC implements SomethingUnknown { +class ReturnEmptyArrayNotNullCheckSampleC implements SomethingUnknown { @Override public List process(Integer integer) throws Exception { return Collections.emptyList(); @@ -46,7 +46,7 @@ public UnknownList f4() { } } -class ReturnEmptyArrayNotNullCheckD implements ItemProcessor> { +class ReturnEmptyArrayNotNullCheckSampleD implements ItemProcessor> { @Override public List process(Integer i) { return null; // Compliant: even when ItemProcessor is not imported (unknown) diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RunFinalizersCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RunFinalizersCheckSample.java similarity index 86% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/RunFinalizersCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/RunFinalizersCheckSample.java index f5150b46daf..9d5b9d9f56b 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/RunFinalizersCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/RunFinalizersCheckSample.java @@ -1,6 +1,6 @@ package checks; -class RunFinalizersCheck { +class RunFinalizersCheckSample { void foo(){ Runtime.runFinalizersOnExit(true); // Noncompliant [[sc=13;ec=32]] {{Remove this call to "Runtime.runFinalizersOnExit()".}} System.runFinalizersOnExit(false); // Noncompliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/S2201_IgnoredReturnValueCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/S2201_IgnoredReturnValueCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/S2201_IgnoredReturnValueCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/S2201_IgnoredReturnValueCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ServletInstanceFieldCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ServletInstanceFieldCheckSample.java similarity index 84% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ServletInstanceFieldCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ServletInstanceFieldCheckSample.java index 841e9ebb916..5085e4beb81 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ServletInstanceFieldCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ServletInstanceFieldCheckSample.java @@ -10,7 +10,7 @@ class MyServlet extends HttpServlet { private MyObject myObject; } -public class ServletInstanceFieldCheck extends HttpServlet { +public class ServletInstanceFieldCheckSample extends HttpServlet { @javax.annotation.Resource private javax.sql.DataSource myDB; // compliant annotated with Resource } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SillyEqualsCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SillyEqualsCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SillyEqualsCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SillyEqualsCheckSample.java index b311f5d57b9..4b206bf1461 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SillyEqualsCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SillyEqualsCheckSample.java @@ -2,7 +2,7 @@ import lombok.val; -public class SillyEqualsCheck { +public class SillyEqualsCheckSample { public void method(Object object) { // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SimpleClassNameCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SimpleClassNameCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SimpleClassNameCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SimpleClassNameCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticFieldUpateCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticFieldUpateCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticFieldUpateCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticFieldUpateCheckSample.java index 245af117b83..27d349154e7 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticFieldUpateCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticFieldUpateCheckSample.java @@ -1,6 +1,6 @@ package checks; -class StaticFieldUpateCheck { +class StaticFieldUpateCheckSample { public static int staticValue = 0; private int value; private static int[] staticArray; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticMethodCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticMethodCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticMethodCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/StaticMethodCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/StringLiteralInsideEqualsCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/StringLiteralInsideEqualsCheckSample.java similarity index 86% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/StringLiteralInsideEqualsCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/StringLiteralInsideEqualsCheckSample.java index 0697e7e892f..ad9abb5c1c5 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/StringLiteralInsideEqualsCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/StringLiteralInsideEqualsCheckSample.java @@ -1,6 +1,6 @@ package checks; -class StringLiteralInsideEqualsCheck { +class StringLiteralInsideEqualsCheckSample { void foo() { unknown.equals("qux"); // Noncompliant "foo".equals(unknown); diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/StringToPrimitiveConversionCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/StringToPrimitiveConversionCheckSample.java similarity index 63% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/StringToPrimitiveConversionCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/StringToPrimitiveConversionCheckSample.java index 6dcf3ee08a8..7145f6e02f7 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/StringToPrimitiveConversionCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/StringToPrimitiveConversionCheckSample.java @@ -1,6 +1,6 @@ package checks; -class StringToPrimitiveConversionCheck { +class StringToPrimitiveConversionCheckSample { void ints(Integer integerParam) { int i11 = unknown; } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/StrongCipherAlgorithmCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/StrongCipherAlgorithmCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/StrongCipherAlgorithmCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/StrongCipherAlgorithmCheckSample.java index 0474155c73b..2381b170349 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/StrongCipherAlgorithmCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/StrongCipherAlgorithmCheckSample.java @@ -4,7 +4,7 @@ import javax.crypto.NoSuchPaddingException; import java.security.NoSuchAlgorithmException; -class StrongCipherAlgorithmCheck { +class StrongCipherAlgorithmCheckSample { private static final String DES_STRING = "DES"; private static final String DES_TEXT_BLOCK = """ DES"""; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SunPackagesUsedCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SunPackagesUsedCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SunPackagesUsedCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SunPackagesUsedCheckSample.java index 2c44fbf7030..24529c847b9 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SunPackagesUsedCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SunPackagesUsedCheckSample.java @@ -1,6 +1,6 @@ import java.util.ArrayList; -class SunPackagesUsedCheck { +class SunPackagesUsedCheckSample { private void f() { java.util.List a; sun.Foo b; // Noncompliant [[secondary=+1]] diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCaseTooBigCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCaseTooBigCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCaseTooBigCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCaseTooBigCheckSample.java index 2d6c3910a32..607f9e2db4d 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCaseTooBigCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCaseTooBigCheckSample.java @@ -1,6 +1,6 @@ package checks; -class SwitchCaseTooBigCheck { +class SwitchCaseTooBigCheckSample { void f(int myVariable) { int i = switch (myVariable) { case 0: diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCasesShouldBeCommaSeparatedCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCasesShouldBeCommaSeparatedCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCasesShouldBeCommaSeparatedCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCasesShouldBeCommaSeparatedCheckSample.java index ca38a7e6fdf..bf1792bef0e 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCasesShouldBeCommaSeparatedCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchCasesShouldBeCommaSeparatedCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class SwitchCasesShouldBeCommaSeparatedCheck { +public class SwitchCasesShouldBeCommaSeparatedCheckSample { public void nonCompliant(String mode) { // Switch Expression diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchDefaultLastCaseCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchDefaultLastCaseCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchDefaultLastCaseCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchDefaultLastCaseCheckSample.java index 170256c25e5..b64c218cdea 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchDefaultLastCaseCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchDefaultLastCaseCheckSample.java @@ -1,6 +1,6 @@ package checks; -class SwitchDefaultLastCaseCheck { +class SwitchDefaultLastCaseCheckSample { void foo(WeekendDay weekendDay) { int i = switch (0) { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchInsteadOfIfSequenceCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchInsteadOfIfSequenceCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchInsteadOfIfSequenceCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchInsteadOfIfSequenceCheckSample.java index f2ba8ebf156..51fc42d3846 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchInsteadOfIfSequenceCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchInsteadOfIfSequenceCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class SwitchInsteadOfIfSequenceCheck { +public class SwitchInsteadOfIfSequenceCheckSample { String choice; String choice2; Object choice3; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchLastCaseIsDefaultCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchLastCaseIsDefaultCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchLastCaseIsDefaultCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchLastCaseIsDefaultCheckSample.java index 33bd3e3c020..d8426e3476a 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchLastCaseIsDefaultCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchLastCaseIsDefaultCheckSample.java @@ -2,7 +2,7 @@ import org.apache.commons.io.FileSystem; -class SwitchLastCaseIsDefaultCheck { +class SwitchLastCaseIsDefaultCheckSample { void function(MyEnum myEnum) { switch (myEnum) { // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchWithLabelsCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchWithLabelsCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchWithLabelsCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SwitchWithLabelsCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/SynchronizationOnStringOrBoxedCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/SynchronizationOnStringOrBoxedCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/SynchronizationOnStringOrBoxedCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/SynchronizationOnStringOrBoxedCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/TextBlocksDuplicatedCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/TextBlocksDuplicatedCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/TextBlocksDuplicatedCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/TextBlocksDuplicatedCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ThreadOverridesRunCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ThreadOverridesRunCheckSample.java similarity index 88% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/ThreadOverridesRunCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/ThreadOverridesRunCheckSample.java index 8f41442e4bd..fe773fdfb8b 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/ThreadOverridesRunCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/ThreadOverridesRunCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ThreadOverridesRunCheck { +class ThreadOverridesRunCheckSample { void foo(Runnable r) { Thread t1 = new Thread(r) { // Compliant void doSomething() { /* do nothing */ } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyMethodsCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyMethodsCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyMethodsCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyMethodsCheckSample.java index eec239808a1..d75a3874fc5 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyMethodsCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyMethodsCheckSample.java @@ -3,7 +3,7 @@ class WithParentUnknown implements Unknown { } -class TooManyMethodsCheck { +class TooManyMethodsCheckSample { WithParentUnknown withParentUnknown1 = new WithParentUnknown() { // Compliant due to unknown hierarchy public void method1() {} public void method2() {} diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyParametersCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyParametersCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyParametersCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/TooManyParametersCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/TransientFieldInNonSerializableCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/TransientFieldInNonSerializableCheckSample.java similarity index 70% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/TransientFieldInNonSerializableCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/TransientFieldInNonSerializableCheckSample.java index 767e727b1e2..8f84043fa25 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/TransientFieldInNonSerializableCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/TransientFieldInNonSerializableCheckSample.java @@ -2,7 +2,7 @@ import java.io.Serializable; -class TransientFieldInNonSerializableCheck { +class TransientFieldInNonSerializableCheckSample { class C extends Unknown { transient String x; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/TypeUpperBoundNotFinalCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/TypeUpperBoundNotFinalCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/TypeUpperBoundNotFinalCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/TypeUpperBoundNotFinalCheckSample.java index 938643f9afc..33b6e410595 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/TypeUpperBoundNotFinalCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/TypeUpperBoundNotFinalCheckSample.java @@ -1,7 +1,7 @@ package checks; -public class TypeUpperBoundNotFinalCheck { +public class TypeUpperBoundNotFinalCheckSample { public static class FinalBound { } // Noncompliant public static class UnknownBound { } // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/naming/MethodNamedHashcodeOrEqualCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/naming/MethodNamedHashcodeOrEqualCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/naming/MethodNamedHashcodeOrEqualCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/naming/MethodNamedHashcodeOrEqualCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/regex/EmptyLineRegexCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/regex/EmptyLineRegexCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/regex/EmptyLineRegexCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/regex/EmptyLineRegexCheckSample.java index 637d01e2772..cdd14d4cb9f 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/regex/EmptyLineRegexCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/regex/EmptyLineRegexCheckSample.java @@ -2,7 +2,7 @@ import java.util.regex.Pattern; -public class EmptyLineRegexCheck { +public class EmptyLineRegexCheckSample { private static final int MY_FLAG = 0x10; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DebugFeatureEnabledCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DebugFeatureEnabledCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DebugFeatureEnabledCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DebugFeatureEnabledCheckSample.java index 57ec8af72eb..a31f26cdda9 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DebugFeatureEnabledCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DebugFeatureEnabledCheckSample.java @@ -3,7 +3,7 @@ import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; // Tests for @EnableWebSecurity. -// Tests for printStackTrace are in java/checks/security/DebugFeatureEnabledCheck.java +// Tests for printStackTrace are in java/checks/security/DebugFeatureEnabledCheckSample.java @EnableWebSecurity(debug = true) // Noncompliant [[sc=20;ec=32]] {{Make sure this debug feature is deactivated before delivering the code in production.}} @EnableWebSecurity(unknown = true, debug = Boolean.TRUE) // Noncompliant [[sc=36;ec=56]] @EnableWebSecurity(debug = false) diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DisableAutoEscapingCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DisableAutoEscapingCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DisableAutoEscapingCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DisableAutoEscapingCheckSample.java index 367e2dac9a8..c24df7dc33e 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DisableAutoEscapingCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/DisableAutoEscapingCheckSample.java @@ -2,7 +2,7 @@ import com.samskivert.mustache.Mustache; -public class DisableAutoEscapingCheck { +public class DisableAutoEscapingCheckSample { private String template = "{{foo}}"; private Object context = new Object() { String foo = ""; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/HardCodedCredentialsShouldNotBeUsedCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/HardCodedCredentialsShouldNotBeUsedCheckSample.java similarity index 88% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/security/HardCodedCredentialsShouldNotBeUsedCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/security/HardCodedCredentialsShouldNotBeUsedCheckSample.java index 8a8d046582d..96293e26fc0 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/HardCodedCredentialsShouldNotBeUsedCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/HardCodedCredentialsShouldNotBeUsedCheckSample.java @@ -1,4 +1,4 @@ -class HardCodedCredentialsShouldNotBeUsedCheck { +class HardCodedCredentialsShouldNotBeUsedCheckSample { void test_unknow_identifier() { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/SecureCookieCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/SecureCookieCheckSample.java similarity index 83% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/security/SecureCookieCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/security/SecureCookieCheckSample.java index 1909fa184ae..fe801dfc0ef 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/SecureCookieCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/SecureCookieCheckSample.java @@ -4,7 +4,7 @@ import java.util.Date; import javax.servlet.http.Cookie; -class SecureCookieCheck { +class SecureCookieCheckSample { Cookie field4; HttpCookie field6; @@ -23,8 +23,8 @@ HttpCookie getHttpCookie() { } -class SecureCookieCheckB extends Cookie { - public SecureCookieCheckB(String name, String value) { +class SecureCookieCheckSampleB extends Cookie { + public SecureCookieCheckSampleB(String name, String value) { super(name, value); } diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/ServerCertificatesCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/security/ServerCertificatesCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/security/ServerCertificatesCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/security/ServerCertificatesCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerialVersionUidInRecordCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerialVersionUidInRecordCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerialVersionUidInRecordCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerialVersionUidInRecordCheckSample.java index 0903177b69b..a21c52a68ea 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerialVersionUidInRecordCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerialVersionUidInRecordCheckSample.java @@ -5,7 +5,7 @@ import org.sonar.somepackage.SomeUnknownClass; -public class SerialVersionUidInRecordCheck { +public class SerialVersionUidInRecordCheckSample { record NotInitialized(String name, int age) implements Serializable { @Serial private static final long serialVersionUID; // Compliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerializableFieldInSerializableClassCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerializableFieldInSerializableClassCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerializableFieldInSerializableClassCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerializableFieldInSerializableClassCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerializableSuperConstructorCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerializableSuperConstructorCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerializableSuperConstructorCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/serialization/SerializableSuperConstructorCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/SpringIncompatibleTransactionalCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/SpringIncompatibleTransactionalCheckSample.java similarity index 89% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/SpringIncompatibleTransactionalCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/SpringIncompatibleTransactionalCheckSample.java index f535f9391ba..e3a7b091b1e 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/SpringIncompatibleTransactionalCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/SpringIncompatibleTransactionalCheckSample.java @@ -3,7 +3,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -class SpringIncompatibleTransactionalCheckAbstractClass { +class SpringIncompatibleTransactionalCheckSampleAbstractClass { @Transactional(propagation = Propagation.REQUIRES_NEW) public void methodA() { @@ -21,7 +21,7 @@ public void methodB() { * We report an issue when a symbol is in the "methodsPropagationMap", and the propagation is incompatible with the one from the current method. * It means that we have to make sure a method dealing with unknown types (annotations, ...) is not added to the map. (The same way we do not add private method) */ -class SpringIncompatibleTransactionalCheckUnknownTypes { +class SpringIncompatibleTransactionalCheckSampleUnknownTypes { @Transactional(propagation = Propagation.NEVER) public void methodA() { @@ -56,7 +56,7 @@ public void methodE() { } @Transactional(propagation = Propagation.UNKNOWN) -class SpringIncompatibleTransactionalCheckClassAnnotatedUnknown { +class SpringIncompatibleTransactionalCheckSampleClassAnnotatedUnknown { @Transactional(propagation = Propagation.REQUIRES_NEW) public void methodA() { @@ -69,7 +69,7 @@ public void methodB() { } -class SpringIncompatibleTransactionalCheckSupportJavaxTransactional { +class SpringIncompatibleTransactionalCheckSampleSupportJavaxTransactional { public void nonTransactional() { javaxTransactionalDefault(); // Noncompliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/TransactionalMethodVisibilityCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/TransactionalMethodVisibilityCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/TransactionalMethodVisibilityCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/TransactionalMethodVisibilityCheckSample.java index 3daec021998..239dd334f1e 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/TransactionalMethodVisibilityCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/spring/TransactionalMethodVisibilityCheckSample.java @@ -2,7 +2,7 @@ import org.springframework.transaction.annotation.Transactional; -class TransactionalMethodVisibilityCheck { +class TransactionalMethodVisibilityCheckSample { // Cannot compile because a Transactional method should be overridable @org.springframework.transaction.annotation.Transactional private void privateTransactionalMethod() {} // Noncompliant [[sc=16;ec=42]] {{Make this method "public" or remove the "@Transactional" annotation.}} diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertJAssertionsInConsumerCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertJAssertionsInConsumerCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertJAssertionsInConsumerCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertJAssertionsInConsumerCheckSample.java index c18c4761d72..321c7fa7863 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertJAssertionsInConsumerCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertJAssertionsInConsumerCheckSample.java @@ -5,7 +5,7 @@ import static org.assertj.core.api.Assertions.assertThat; -public abstract class AssertJAssertionsInConsumerCheck { +public abstract class AssertJAssertionsInConsumerCheckSample { private static final Consumer classRequirements = s -> assertThat(s).isEqualTo("b"); diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertionsCompletenessCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertionsCompletenessCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertionsCompletenessCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertionsCompletenessCheckSample.java index 9ffd58571bb..30fcd3bb047 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertionsCompletenessCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/AssertionsCompletenessCheckSample.java @@ -17,7 +17,7 @@ import org.junit.jupiter.api.extension.ExtensionContext; import org.mockito.Mockito; -public class AssertionsCompletenessCheck { +public class AssertionsCompletenessCheckSample { @Test void assertj_java6_abstract_standard_soft_assertions() { diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit45MethodAnnotationCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit45MethodAnnotationCheckSample.java similarity index 59% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit45MethodAnnotationCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit45MethodAnnotationCheckSample.java index a3f281088fa..b16de846033 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit45MethodAnnotationCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit45MethodAnnotationCheckSample.java @@ -1,12 +1,12 @@ -class JUnit45MethodAnnotationCheck_JUnit4_Extends_Unknown extends Unknown { +class JUnit45MethodAnnotationCheckSample_JUnit4_Extends_Unknown extends Unknown { @org.junit.Test void test() { } @Override public void setUp() { } // Compliant } -class JUnit45MethodAnnotationCheck_JUnit4_Extends_Unknown_FP extends Unknown { +class JUnit45MethodAnnotationCheckSample_JUnit4_Extends_Unknown_FP extends Unknown { @org.junit.Test void test() { } // Due to incomplete semantic, no way to know if this is an override or not. diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckSample.java similarity index 81% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckSample.java index 927c5e86686..99c7bd36d74 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckSample.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; -class JUnit5SilentlyIgnoreClassAndMethodCheck { +class JUnit5SilentlyIgnoreClassAndMethodCheckSample { @Test int testReturningInt() { return 0; } // Noncompliant diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/MockitoEqSimplificationCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/MockitoEqSimplificationCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/MockitoEqSimplificationCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/MockitoEqSimplificationCheckSample.java index 70740258ffc..d4f1486fedf 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/MockitoEqSimplificationCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/MockitoEqSimplificationCheckSample.java @@ -18,7 +18,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class MockitoEqSimplificationCheck { +public class MockitoEqSimplificationCheckSample { @Captor ArgumentCaptor captor; diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/TooManyAssertionsCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/TooManyAssertionsCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/TooManyAssertionsCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/checks/tests/TooManyAssertionsCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/DivisionByZeroCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/DivisionByZeroCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/DivisionByZeroCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/DivisionByZeroCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/LocksNotUnlockedCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/LocksNotUnlockedCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/LocksNotUnlockedCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/LocksNotUnlockedCheckSample.java index 05e095c52cf..a44f55fba72 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/LocksNotUnlockedCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/LocksNotUnlockedCheckSample.java @@ -3,7 +3,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -abstract class LocksNotUnlockedCheck { +abstract class LocksNotUnlockedCheckSample { public void while_statement() { Lock lock = new ReentrantLock(); diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheckSample.java diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/NonNullSetToNullCheck.java b/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/NonNullSetToNullCheckSample.java similarity index 86% rename from java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/NonNullSetToNullCheck.java rename to java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/NonNullSetToNullCheckSample.java index 7921c5c09da..43b6476ecdc 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/NonNullSetToNullCheck.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/NonNullSetToNullCheckSample.java @@ -2,7 +2,7 @@ import javax.annotation.Nonnull; -class NonNullSetToNullCheck { +class NonNullSetToNullCheckSample { @Nonnull private String primary; @@ -13,7 +13,7 @@ class NonNullSetToNullCheck { private static final Integer STATIC_FIELD_NO_ANNOTATION; // ============ 1.1 Fields not initialized in constructor ============ - public NonNullSetToNullCheck(@Nonnull String color, String other) { + public NonNullSetToNullCheckSample(@Nonnull String color, String other) { primary = color; secondary = other; unknownTestObject = new Object(); diff --git a/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/S3959_SwitchExpression.java b/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/S3959_SwitchExpressionSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/S3959_SwitchExpression.java rename to java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/S3959_SwitchExpressionSample.java index fcb9088c1a7..26ffdc97871 100644 --- a/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/S3959_SwitchExpression.java +++ b/java-checks-test-sources/default/src/main/files/non-compiling/symbolicexecution/checks/S3959_SwitchExpressionSample.java @@ -4,7 +4,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -public class S3959_SwitchExpression { +public class S3959_SwitchExpressionSample { List foo(MyEnum e, Stream stream) { return switch (e) { case SOME_TYPE -> stream.collect(Collectors.toList()); diff --git a/java-checks-test-sources/default/src/main/java/SpringScanDefaultPackageCheck.java b/java-checks-test-sources/default/src/main/java/SpringScanDefaultPackageCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/SpringScanDefaultPackageCheck.java rename to java-checks-test-sources/default/src/main/java/SpringScanDefaultPackageCheckSample.java index 65125948295..112a1099e76 100644 --- a/java-checks-test-sources/default/src/main/java/SpringScanDefaultPackageCheck.java +++ b/java-checks-test-sources/default/src/main/java/SpringScanDefaultPackageCheckSample.java @@ -4,7 +4,7 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -class SpringScanDefaultPackageCheck { +class SpringScanDefaultPackageCheckSample { @Configuration @ComponentScan // Noncompliant [[sc=4;ec=17]] {{Remove the annotation "@ComponentScan" or move the annotated class out of the default package.}} @SpringBootApplication // Noncompliant [[sc=4;ec=25]] {{Remove the annotation "@SpringBootApplication" or move the annotated class out of the default package.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/AbstractClassNoFieldShouldBeInterfaceCheck.java b/java-checks-test-sources/default/src/main/java/checks/AbstractClassNoFieldShouldBeInterfaceCheck.java deleted file mode 100644 index a5713fcd8b0..00000000000 --- a/java-checks-test-sources/default/src/main/java/checks/AbstractClassNoFieldShouldBeInterfaceCheck.java +++ /dev/null @@ -1,98 +0,0 @@ -package checks; - -import com.google.auto.value.AutoOneOf; -import com.google.auto.value.AutoValue; -import org.immutables.value.Value; - -abstract class AbstractClassNoFieldShouldBeInterfaceCheckA { - private int b; - - abstract void method(); -} -abstract class AbstractClassNoFieldShouldBeInterfaceCheckB { // Noncompliant [[sc=16;ec=59]] {{Convert the abstract class "AbstractClassNoFieldShouldBeInterfaceCheckB" into an interface.}} - int method(){ - return 1; - } - class AbstractClassNoFieldShouldBeInterfaceCheckF {} -} -class AbstractClassNoFieldShouldBeInterfaceCheckC { - int method(){ - return 1; - } -} - -abstract class AbstractClassNoFieldShouldBeInterfaceCheckD { - protected void method() { - - } -} - -abstract class AbstractClassNoFieldShouldBeInterfaceCheckE extends AbstractClassNoFieldShouldBeInterfaceCheckA { -} - -abstract class AbstractClassNoFieldShouldBeInterfaceCheckF { - public abstract double v(); - - @Override - public String toString() { - return ":"; - } -} - -abstract class AbstractClassNoFieldShouldBeInterfaceCheckG { - public abstract double v(); - - public String toString() { - return ":"; - } -} - -abstract class AbstractClassNoFieldShouldBeInterfaceCheckCar { // Compliant - has private methods - public void start() { - turnOnLights(); - startEngine(); - } - - public abstract void stop(); - - private void turnOnLights() {} - private void startEngine() {} -} - -// Issue will be filtered by GoogleAutoFilter -@AutoValue -abstract class AbstractClassNoFieldShouldBeInterfaceCheckFoo { // Noncompliant - static AbstractClassNoFieldShouldBeInterfaceCheckFoo create(String name) { - return new AbstractClassNoFieldShouldBeInterfaceCheckFooImplem(); - } - abstract String name(); - @AutoValue.Builder - abstract static class Builder { // Noncompliant - abstract Builder namer(String name); - } -} - -class AbstractClassNoFieldShouldBeInterfaceCheckFooImplem extends AbstractClassNoFieldShouldBeInterfaceCheckFoo { - @Override - String name() { - return null; - } -} - -// Issue will be filtered by GoogleAutoFilter -@AutoOneOf(AbstractClassNoFieldShouldBeInterfaceCheckStringOrInteger.Kind.class) -abstract class AbstractClassNoFieldShouldBeInterfaceCheckStringOrInteger { // Noncompliant - public enum Kind { - STRING, INTEGER - } -} - -@Value.Immutable -abstract class AbstractClassNoFieldShouldBeInterfaceCheckBar { // Compliant - abstract String name(); -} - -@org.immutables.value.Value.Immutable -abstract class AbstractClassNoFieldShouldBeInterfaceCheckWithFullAnnotation { // Compliant - abstract String name(); -} diff --git a/java-checks-test-sources/default/src/main/java/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample.java b/java-checks-test-sources/default/src/main/java/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample.java new file mode 100644 index 00000000000..ef1ecc6a444 --- /dev/null +++ b/java-checks-test-sources/default/src/main/java/checks/AbstractClassNoFieldShouldBeInterfaceCheckSample.java @@ -0,0 +1,98 @@ +package checks; + +import com.google.auto.value.AutoOneOf; +import com.google.auto.value.AutoValue; +import org.immutables.value.Value; + +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleA { + private int b; + + abstract void method(); +} +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleB { // Noncompliant [[sc=16;ec=65]] {{Convert the abstract class "AbstractClassNoFieldShouldBeInterfaceCheckSampleB" into an interface.}} + int method(){ + return 1; + } + class AbstractClassNoFieldShouldBeInterfaceCheckSampleF {} +} +class AbstractClassNoFieldShouldBeInterfaceCheckSampleC { + int method(){ + return 1; + } +} + +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleD { + protected void method() { + + } +} + +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleE extends AbstractClassNoFieldShouldBeInterfaceCheckSampleA { +} + +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleF { + public abstract double v(); + + @Override + public String toString() { + return ":"; + } +} + +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleG { + public abstract double v(); + + public String toString() { + return ":"; + } +} + +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleCar { // Compliant - has private methods + public void start() { + turnOnLights(); + startEngine(); + } + + public abstract void stop(); + + private void turnOnLights() {} + private void startEngine() {} +} + +// Issue will be filtered by GoogleAutoFilter +@AutoValue +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleFoo { // Noncompliant + static AbstractClassNoFieldShouldBeInterfaceCheckSampleFoo create(String name) { + return new AbstractClassNoFieldShouldBeInterfaceCheckSampleFooImplem(); + } + abstract String name(); + @AutoValue.Builder + abstract static class Builder { // Noncompliant + abstract Builder namer(String name); + } +} + +class AbstractClassNoFieldShouldBeInterfaceCheckSampleFooImplem extends AbstractClassNoFieldShouldBeInterfaceCheckSampleFoo { + @Override + String name() { + return null; + } +} + +// Issue will be filtered by GoogleAutoFilter +@AutoOneOf(AbstractClassNoFieldShouldBeInterfaceCheckSampleStringOrInteger.Kind.class) +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleStringOrInteger { // Noncompliant + public enum Kind { + STRING, INTEGER + } +} + +@Value.Immutable +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleBar { // Compliant + abstract String name(); +} + +@org.immutables.value.Value.Immutable +abstract class AbstractClassNoFieldShouldBeInterfaceCheckSampleWithFullAnnotation { // Compliant + abstract String name(); +} diff --git a/java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeCheck.java b/java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeCheck.java rename to java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeCheckSample.java index 4ef7260bec6..884e1a8a948 100644 --- a/java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeCheckSample.java @@ -2,7 +2,7 @@ import java.lang.reflect.Field; -class AccessibilityChangeCheck { +class AccessibilityChangeCheckSample { void makeItPublic(String methodName, java.lang.reflect.AccessibleObject[] arr, boolean someBool) throws NoSuchMethodException { this.getClass().getMethod(methodName).setAccessible(true); // Noncompliant {{This accessibility update should be removed.}} this.getClass().getMethod(methodName).setAccessible(arr, true); // Noncompliant {{This accessibility update should be removed.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeOnRecordsCheck.java b/java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeOnRecordsCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeOnRecordsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeOnRecordsCheckSample.java index 45dde753411..dae499a05f1 100644 --- a/java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeOnRecordsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/AccessibilityChangeOnRecordsCheckSample.java @@ -3,7 +3,7 @@ import java.lang.reflect.AccessibleObject; import java.lang.reflect.Field; -public class AccessibilityChangeOnRecordsCheck { +public class AccessibilityChangeOnRecordsCheckSample { record Person(String name, int age) { } diff --git a/java-checks-test-sources/default/src/main/java/checks/AnnotationDefaultArgumentCheck.java b/java-checks-test-sources/default/src/main/java/checks/AnnotationDefaultArgumentCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/AnnotationDefaultArgumentCheck.java rename to java-checks-test-sources/default/src/main/java/checks/AnnotationDefaultArgumentCheckSample.java index cae44217a0a..7f207bdf486 100644 --- a/java-checks-test-sources/default/src/main/java/checks/AnnotationDefaultArgumentCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/AnnotationDefaultArgumentCheckSample.java @@ -12,7 +12,7 @@ @interface MyAnnotationDefaultCheck3 { int myHexaInteger() default 0x000; } -class AnnotationDefaultArgumentCheck { +class AnnotationDefaultArgumentCheckSample { private static final String FIELD_VALUE = "field1Default"; private static final int FIELD_VALUE_INT = 0; diff --git a/java-checks-test-sources/default/src/main/java/checks/AnonymousClassShouldBeLambdaCheck.java b/java-checks-test-sources/default/src/main/java/checks/AnonymousClassShouldBeLambdaCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/AnonymousClassShouldBeLambdaCheck.java rename to java-checks-test-sources/default/src/main/java/checks/AnonymousClassShouldBeLambdaCheckSample.java index 1837a71779e..439d8236b15 100644 --- a/java-checks-test-sources/default/src/main/java/checks/AnonymousClassShouldBeLambdaCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/AnonymousClassShouldBeLambdaCheckSample.java @@ -3,7 +3,7 @@ import com.google.common.base.Function; import java.util.Date; -class AnonymousClassShouldBeLambdaCheck { +class AnonymousClassShouldBeLambdaCheckSample { enum Foo { FOO { @@ -100,7 +100,7 @@ public String handle() { (){ @Override public String handle() { - return AnonymousClassShouldBeLambdaCheck.this.toString(); + return AnonymousClassShouldBeLambdaCheckSample.this.toString(); } }; diff --git a/java-checks-test-sources/default/src/main/java/checks/ArrayCopyLoopCheck.java b/java-checks-test-sources/default/src/main/java/checks/ArrayCopyLoopCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/ArrayCopyLoopCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ArrayCopyLoopCheckSample.java index aa8d709331b..b7a8678c03a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ArrayCopyLoopCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ArrayCopyLoopCheckSample.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.Set; -abstract class ArrayCopyLoopCheck implements Collection { +abstract class ArrayCopyLoopCheckSample implements Collection { int x; diff --git a/java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorAfterTypeCheck.java b/java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorAfterTypeCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorAfterTypeCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorAfterTypeCheckSample.java index 79465530c46..3cfbaa2074d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorAfterTypeCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorAfterTypeCheckSample.java @@ -2,7 +2,7 @@ import java.util.List; -class ArrayDesignatorAfterTypeCheck { +class ArrayDesignatorAfterTypeCheckSample { public int getVector()[] { return new int[0]; } // Noncompliant [[sc=25;ec=27;quickfixes=qf1]] {{Move the array designators [] to the end of the return type.}} // fix@qf1 {{Move [] to the return type}} diff --git a/java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorOnVariableCheck.java b/java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorOnVariableCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorOnVariableCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorOnVariableCheckSample.java index 994b7a49c43..c64b7783234 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorOnVariableCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ArrayDesignatorOnVariableCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ArrayDesignatorOnVariableCheck { +class ArrayDesignatorOnVariableCheckSample { int[] a, b, c[][][][][], // Noncompliant [[sc=9;ec=20;quickfixes=!]] {{Move the array designators [][][][][] to the type.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/ArrayForVarArgCheck.java b/java-checks-test-sources/default/src/main/java/checks/ArrayForVarArgCheckSample.java similarity index 65% rename from java-checks-test-sources/default/src/main/java/checks/ArrayForVarArgCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ArrayForVarArgCheckSample.java index 54b8bcdc629..34d8bcf4e69 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ArrayForVarArgCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ArrayForVarArgCheckSample.java @@ -2,19 +2,19 @@ import java.io.IOException; -class ArrayForVarArgCheckBar {} -class ArrayForVarArgCheckFoo extends ArrayForVarArgCheckBar {} -class ArrayForVarArgCheck { - ArrayForVarArgCheckFoo foo = new ArrayForVarArgCheckFoo(); +class ArrayForVarArgCheckSampleBar {} +class ArrayForVarArgCheckSampleFoo extends ArrayForVarArgCheckSampleBar {} +class ArrayForVarArgCheckSample { + ArrayForVarArgCheckSampleFoo foo = new ArrayForVarArgCheckSampleFoo(); - ArrayForVarArgCheck(String ... params) { } - ArrayForVarArgCheck(int i, X ... xs) { } + ArrayForVarArgCheckSample(String ... params) { } + ArrayForVarArgCheckSample(int i, X ... xs) { } public void callTheThing(String s) throws IOException { doTrickyThing(new String[][]{new String[]{"hello", "world"}}); // Noncompliant {{Remove this array creation and simply pass the elements.}} doTrickyThing(new String[]{"hello", "world"}); // Compliant - doTrickyThing(new ArrayForVarArgCheckFoo[][]{new ArrayForVarArgCheckFoo[]{foo, foo}}); // Noncompliant {{Remove this array creation and simply pass the elements.}} - doTrickyThing(new ArrayForVarArgCheckFoo[]{foo, foo}); // Compliant + doTrickyThing(new ArrayForVarArgCheckSampleFoo[][]{new ArrayForVarArgCheckSampleFoo[]{foo, foo}}); // Noncompliant {{Remove this array creation and simply pass the elements.}} + doTrickyThing(new ArrayForVarArgCheckSampleFoo[]{foo, foo}); // Compliant doTheThing(new String[] { "s1", "s2"}); // Noncompliant {{Remove this array creation and simply pass the elements.}} [[sc=16;ec=42]] doTheThing(new String[12]); @@ -22,21 +22,21 @@ public void callTheThing(String s) throws IOException { doTheThing(new String[] {}); // Noncompliant {{Remove this array creation.}} doTheThing("s1", "s2"); doTheThing("s1"); - doTheThing2(new ArrayForVarArgCheckFoo[] {foo, foo}); // Noncompliant {{Remove this array creation and simply pass the elements.}} - doTheThing2(new ArrayForVarArgCheckFoo[12]); - doTheThing2(new ArrayForVarArgCheckFoo[0]); // Noncompliant {{Remove this array creation.}} - doTheThing2(new ArrayForVarArgCheckFoo(), new ArrayForVarArgCheckBar()); + doTheThing2(new ArrayForVarArgCheckSampleFoo[] {foo, foo}); // Noncompliant {{Remove this array creation and simply pass the elements.}} + doTheThing2(new ArrayForVarArgCheckSampleFoo[12]); + doTheThing2(new ArrayForVarArgCheckSampleFoo[0]); // Noncompliant {{Remove this array creation.}} + doTheThing2(new ArrayForVarArgCheckSampleFoo(), new ArrayForVarArgCheckSampleBar()); callTheThing(""); - new ArrayForVarArgCheck(); - new ArrayForVarArgCheck(new String[0]); // Noncompliant {{Remove this array creation.}} - new ArrayForVarArgCheck(new String[1 - 1]); - new ArrayForVarArgCheck(new String[12]); - new ArrayForVarArgCheck(new String[] { "s1", "s2"}); // Noncompliant {{Remove this array creation and simply pass the elements.}} + new ArrayForVarArgCheckSample(); + new ArrayForVarArgCheckSample(new String[0]); // Noncompliant {{Remove this array creation.}} + new ArrayForVarArgCheckSample(new String[1 - 1]); + new ArrayForVarArgCheckSample(new String[12]); + new ArrayForVarArgCheckSample(new String[] { "s1", "s2"}); // Noncompliant {{Remove this array creation and simply pass the elements.}} java.util.List items = java.util.Arrays.asList(new String[]{"hello", "world"}); // Noncompliant {{Remove this array creation and simply pass the elements.}} foo(new String[]{"hello", "world"}); // Noncompliant {{Remove this array creation and simply pass the elements.}} - new ArrayForVarArgCheck(14, new String[]{"hello", "world"}); // Noncompliant {{Remove this array creation and simply pass the elements.}} + new ArrayForVarArgCheckSample(14, new String[]{"hello", "world"}); // Noncompliant {{Remove this array creation and simply pass the elements.}} arrayThenVarargs(new int[0]); // Compliant, not the varargs argument arrayThenVarargs(new int[]{1,2,3}); @@ -56,11 +56,11 @@ public void callTheThing(String s) throws IOException { public void doTrickyThing(String[]... args) { } - public void doTrickyThing(ArrayForVarArgCheckBar[]... args) { + public void doTrickyThing(ArrayForVarArgCheckSampleBar[]... args) { } public void doTheThing (String ... args) { } - public void doTheThing2 (ArrayForVarArgCheckBar... args) { + public void doTheThing2 (ArrayForVarArgCheckSampleBar... args) { } public void arrayThenVarargs (int[] array, String... args) { } diff --git a/java-checks-test-sources/default/src/main/java/checks/ArrayHashCodeAndToStringCheck.java b/java-checks-test-sources/default/src/main/java/checks/ArrayHashCodeAndToStringCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/ArrayHashCodeAndToStringCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ArrayHashCodeAndToStringCheckSample.java index d6cce7cd569..95de9e69619 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ArrayHashCodeAndToStringCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ArrayHashCodeAndToStringCheckSample.java @@ -2,7 +2,7 @@ import java.util.Arrays; -class ArrayHashCodeAndToStringCheck { +class ArrayHashCodeAndToStringCheckSample { Foo foo; diff --git a/java-checks-test-sources/default/src/main/java/checks/ArraysAsListOfPrimitiveToStreamCheck.java b/java-checks-test-sources/default/src/main/java/checks/ArraysAsListOfPrimitiveToStreamCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/ArraysAsListOfPrimitiveToStreamCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ArraysAsListOfPrimitiveToStreamCheckSample.java index 23e54f96f55..ee0438acbf4 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ArraysAsListOfPrimitiveToStreamCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ArraysAsListOfPrimitiveToStreamCheckSample.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Set; -class ArraysAsListOfPrimitiveToStreamCheck { +class ArraysAsListOfPrimitiveToStreamCheckSample { void foo(Set s) { Arrays.asList("a1", "a2", "b1", "c2", "c1").stream().close(); // Compliant Arrays.asList(1.0, 2, 3L).stream().close(); // Compliant diff --git a/java-checks-test-sources/default/src/main/java/checks/AssertOnBooleanVariableCheck.java b/java-checks-test-sources/default/src/main/java/checks/AssertOnBooleanVariableCheckSample.java similarity index 87% rename from java-checks-test-sources/default/src/main/java/checks/AssertOnBooleanVariableCheck.java rename to java-checks-test-sources/default/src/main/java/checks/AssertOnBooleanVariableCheckSample.java index 182b2c566da..1e1b4f1299c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/AssertOnBooleanVariableCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/AssertOnBooleanVariableCheckSample.java @@ -3,8 +3,8 @@ import java.util.Collections; import java.util.List; -public class AssertOnBooleanVariableCheck { - void foo(AssertOnBooleanVariableCheck a, boolean b, List myList) { +public class AssertOnBooleanVariableCheckSample { + void foo(AssertOnBooleanVariableCheckSample a, boolean b, List myList) { assert myList.remove(myList.get(0)); // Noncompliant [[sc=19;ec=25]] {{Move this "assert" side effect to another statement.}} assert myList.remove(myList.remove(1)); // Noncompliant [[sc=19;ec=25]] {{Move this "assert" side effect to another statement.}} @@ -18,7 +18,7 @@ void foo(AssertOnBooleanVariableCheck a, boolean b, List myList) { assert bar() > 1 ? doNothing() : deleteStuff(); // Noncompliant [[sc=38;ec=49]] assert bar() == 0; // Compliant - assert new AssertOnBooleanVariableCheck() { // Compliant + assert new AssertOnBooleanVariableCheckSample() { // Compliant @Override boolean deleteStuff() { // do nothing diff --git a/java-checks-test-sources/default/src/main/java/checks/AssertionsInProductionCodeCheck.java b/java-checks-test-sources/default/src/main/java/checks/AssertionsInProductionCodeCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/java/checks/AssertionsInProductionCodeCheck.java rename to java-checks-test-sources/default/src/main/java/checks/AssertionsInProductionCodeCheckSample.java index fe62ee31cd0..21c412202ce 100644 --- a/java-checks-test-sources/default/src/main/java/checks/AssertionsInProductionCodeCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/AssertionsInProductionCodeCheckSample.java @@ -2,7 +2,7 @@ import static org.junit.Assert.assertEquals; -public class AssertionsInProductionCodeCheck { +public class AssertionsInProductionCodeCheckSample { void method_with_forbidden_assertions() { assertEquals(0, 0); // Noncompliant [[sc=5;ec=23;secondary=9,10,11,12,13,14,15]] {{Remove this assertion from production code.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/AssertsOnParametersOfPublicMethodCheck.java b/java-checks-test-sources/default/src/main/java/checks/AssertsOnParametersOfPublicMethodCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/AssertsOnParametersOfPublicMethodCheck.java rename to java-checks-test-sources/default/src/main/java/checks/AssertsOnParametersOfPublicMethodCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/AssignmentInSubExpressionCheck.java b/java-checks-test-sources/default/src/main/java/checks/AssignmentInSubExpressionCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/AssignmentInSubExpressionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/AssignmentInSubExpressionCheckSample.java index b2dbd63c138..6cd40b5dca1 100644 --- a/java-checks-test-sources/default/src/main/java/checks/AssignmentInSubExpressionCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/AssignmentInSubExpressionCheckSample.java @@ -4,18 +4,18 @@ import java.util.Set; import java.util.function.Consumer; -abstract class AssignmentInSubExpressionCheck { +abstract class AssignmentInSubExpressionCheckSample { int b, i, index, node; Integer plop, something; int[] foo, _stack; - AssignmentInSubExpressionCheck obj; + AssignmentInSubExpressionCheckSample obj; @interface MyAnnotation { String value(); } - AssignmentInSubExpressionCheck foo() { + AssignmentInSubExpressionCheckSample foo() { int a = 0; // Compliant a = 0; // Compliant System.out.println(a); // Compliant diff --git a/java-checks-test-sources/default/src/main/java/checks/AtLeastOneConstructorCheck.java b/java-checks-test-sources/default/src/main/java/checks/AtLeastOneConstructorCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/AtLeastOneConstructorCheck.java rename to java-checks-test-sources/default/src/main/java/checks/AtLeastOneConstructorCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/BasicAuthCheck.java b/java-checks-test-sources/default/src/main/java/checks/BasicAuthCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/BasicAuthCheck.java rename to java-checks-test-sources/default/src/main/java/checks/BasicAuthCheckSample.java index 562c1135cca..d172478ef28 100644 --- a/java-checks-test-sources/default/src/main/java/checks/BasicAuthCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/BasicAuthCheckSample.java @@ -6,7 +6,7 @@ import java.nio.charset.StandardCharsets; import java.util.Base64; -class BasicAuthCheck { +class BasicAuthCheckSample { void foo(String authent, URL url) throws IOException, URISyntaxException { String encoding = Base64.getEncoder().encodeToString("login:passwd".getBytes(StandardCharsets.UTF_8)); org.apache.http.client.methods.HttpPost httppost = new org.apache.http.client.methods.HttpPost(url.toURI()); diff --git a/java-checks-test-sources/default/src/main/java/checks/BigDecimalDoubleConstructorCheck.java b/java-checks-test-sources/default/src/main/java/checks/BigDecimalDoubleConstructorCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/BigDecimalDoubleConstructorCheck.java rename to java-checks-test-sources/default/src/main/java/checks/BigDecimalDoubleConstructorCheckSample.java index 9f3263b2e65..90156532fd7 100644 --- a/java-checks-test-sources/default/src/main/java/checks/BigDecimalDoubleConstructorCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/BigDecimalDoubleConstructorCheckSample.java @@ -4,7 +4,7 @@ import java.math.BigInteger; import java.math.MathContext; -class BigDecimalDoubleConstructorCheck { +class BigDecimalDoubleConstructorCheckSample { MathContext mc; BigDecimal bd1 = new BigDecimal("1"); BigDecimal bd1_1 = new BigDecimal("2", mc); diff --git a/java-checks-test-sources/default/src/main/java/checks/BooleanLiteralCheck.java b/java-checks-test-sources/default/src/main/java/checks/BooleanLiteralCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/BooleanLiteralCheck.java rename to java-checks-test-sources/default/src/main/java/checks/BooleanLiteralCheckSample.java index 272fcfad0e1..ef33bb92f8a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/BooleanLiteralCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/BooleanLiteralCheckSample.java @@ -1,6 +1,6 @@ package checks; -class BooleanLiteralCheck { +class BooleanLiteralCheckSample { public void f(boolean var, boolean foo) { boolean[] tests = { diff --git a/java-checks-test-sources/default/src/main/java/checks/BooleanMethodReturnCheck.java b/java-checks-test-sources/default/src/main/java/checks/BooleanMethodReturnCheckSample.java similarity index 81% rename from java-checks-test-sources/default/src/main/java/checks/BooleanMethodReturnCheck.java rename to java-checks-test-sources/default/src/main/java/checks/BooleanMethodReturnCheckSample.java index b91aaa4e230..2168a755f85 100644 --- a/java-checks-test-sources/default/src/main/java/checks/BooleanMethodReturnCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/BooleanMethodReturnCheckSample.java @@ -4,7 +4,7 @@ import javax.annotation.CheckForNull; import javax.annotation.Nullable; -class BooleanMethodReturnCheckA { +class BooleanMethodReturnCheckSampleA { public Boolean myMethod() { return null; // Noncompliant {{Null is returned but a "Boolean" is expected.}} } @@ -13,7 +13,7 @@ public Boolean myOtherMethod() { return Boolean.TRUE; // Compliant } - BooleanMethodReturnCheckA() { + BooleanMethodReturnCheckSampleA() { // constructor (with null return type) are not covered by the rule return; } @@ -29,7 +29,7 @@ public Boolean bar() { } } -class BooleanMethodReturnCheckB { +class BooleanMethodReturnCheckSampleB { private class Boolean { } @@ -38,11 +38,11 @@ public Boolean myMethod() { } public java.lang.Boolean myOtherMethod() { - class BooleanMethodReturnCheckC { + class BooleanMethodReturnCheckSampleC { private java.lang.Boolean myInnerMethod() { return null; // Noncompliant {{Null is returned but a "Boolean" is expected.}} } - private BooleanMethodReturnCheckC foo() { + private BooleanMethodReturnCheckSampleC foo() { return null; // Compliant } } @@ -55,9 +55,9 @@ public java.lang.Boolean myMethod2() { } } -class BooleanMethodReturnCheckD { +class BooleanMethodReturnCheckSampleD { public Boolean foo() { - class BooleanMethodReturnCheckE { + class BooleanMethodReturnCheckSampleE { void bar() { return; } diff --git a/java-checks-test-sources/default/src/main/java/checks/BoxedBooleanExpressionsCheck.java b/java-checks-test-sources/default/src/main/java/checks/BoxedBooleanExpressionsCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/BoxedBooleanExpressionsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/BoxedBooleanExpressionsCheckSample.java index 6aaab8888e5..d57f8f17051 100644 --- a/java-checks-test-sources/default/src/main/java/checks/BoxedBooleanExpressionsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/BoxedBooleanExpressionsCheckSample.java @@ -5,7 +5,7 @@ import javax.annotation.Nonnull; import javax.validation.constraints.NotNull; -class BoxedBooleanExpressionsCheck { +class BoxedBooleanExpressionsCheckSample { String foo(Object value) { if (value == null) return ""; diff --git a/java-checks-test-sources/default/src/main/java/checks/BrainMethodCheck.java b/java-checks-test-sources/default/src/main/java/checks/BrainMethodCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/BrainMethodCheck.java rename to java-checks-test-sources/default/src/main/java/checks/BrainMethodCheckSample.java index 59024bbcf27..93bffa474bf 100644 --- a/java-checks-test-sources/default/src/main/java/checks/BrainMethodCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/BrainMethodCheckSample.java @@ -1,6 +1,6 @@ package checks; -class BrainMethodCheck { +class BrainMethodCheckSample { void foo() { // Noncompliant [[sc=8;ec=11]] {{A "Brain Method" was detected. Refactor it to reduce at least one of the following metrics: LOC from 66 to 64, Complexity from 17 to 14, Nesting Level from 3 to 2, Number of Variables from 12 to 6.}} String a = "a"; diff --git a/java-checks-test-sources/default/src/main/java/checks/DanglingElseStatementsCheck.java b/java-checks-test-sources/default/src/main/java/checks/DanglingElseStatementsCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/DanglingElseStatementsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DanglingElseStatementsCheckSample.java index 2d07fb8ea35..4449c45edfe 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DanglingElseStatementsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DanglingElseStatementsCheckSample.java @@ -1,6 +1,6 @@ package checks; -class DanglingElseStatementsCheck { +class DanglingElseStatementsCheckSample { void f() { boolean a = true, b = false; int d = 0, e = 0; diff --git a/java-checks-test-sources/default/src/main/java/checks/DateFormatWeekYearCheck.java b/java-checks-test-sources/default/src/main/java/checks/DateFormatWeekYearCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/DateFormatWeekYearCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DateFormatWeekYearCheckSample.java index 71506f0c313..188db22143b 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DateFormatWeekYearCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DateFormatWeekYearCheckSample.java @@ -11,7 +11,7 @@ import java.util.Locale; -class DateFormatWeekYearCheck { +class DateFormatWeekYearCheckSample { private static final String COMPLIANT_DATE_FORMAT = "yyyy/MM/dd"; private static final String COMPLIANT_PATTERN = "Y-ww"; private static final String NON_COMPLIANT_PATTERN = "YYYY/MM/dd"; diff --git a/java-checks-test-sources/default/src/main/java/checks/DateUtilsTruncateCheck.java b/java-checks-test-sources/default/src/main/java/checks/DateUtilsTruncateCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/java/checks/DateUtilsTruncateCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DateUtilsTruncateCheckSample.java index ceb2413112a..8d0b70fe34a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DateUtilsTruncateCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DateUtilsTruncateCheckSample.java @@ -6,7 +6,7 @@ import static org.apache.commons.lang.time.DateUtils.truncate; -class DateUtilsTruncateCheck { +class DateUtilsTruncateCheckSample { public void foo(Date date, Calendar calendar, Object object, int field) { DateUtils.truncate(date, field); // Noncompliant [[sc=15;ec=23]] {{Use "ZonedDateTime.truncatedTo" instead.}} DateUtils.truncate(calendar, field); // Noncompliant @@ -17,7 +17,7 @@ public void foo(Date date, Calendar calendar, Object object, int field) { } } -class DateUtilsTruncateCheckB { +class DateUtilsTruncateCheckSampleB { public void truncate(Date date, int field) { } diff --git a/java-checks-test-sources/default/src/main/java/checks/DeadStoreCheck.java b/java-checks-test-sources/default/src/main/java/checks/DeadStoreCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/DeadStoreCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DeadStoreCheckSample.java index 9c1e6b4ccb7..c8b268ac648 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DeadStoreCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DeadStoreCheckSample.java @@ -6,7 +6,7 @@ import java.io.*; import java.util.function.IntFunction; -class DeadStoreCheck { +class DeadStoreCheckSample { int var; @@ -231,7 +231,7 @@ private void foo3(int y) { } } -class DeadStoreCheckStuff { +class DeadStoreCheckSampleStuff { void foo(boolean b1, boolean b2) { boolean x = false; // Compliant x = b1 && b2; // Noncompliant @@ -245,7 +245,7 @@ void assertStatement(boolean x) { } -class DeadStoreCheckNoIssueOnInitializers { +class DeadStoreCheckSampleNoIssueOnInitializers { // no issue if variable initializer is 'true' or 'false' boolean testBoolean(boolean arg0) { @@ -312,7 +312,7 @@ int testIntLiterals() { return 0; } } -class DeadStoreCheckB { +class DeadStoreCheckSampleB { void foo() { int attemptNumber = 0; while (true) { @@ -329,7 +329,7 @@ void foo() { static class MyException extends Exception { } } -abstract class DeadStoreCheckC { +abstract class DeadStoreCheckSampleC { public void testCodeWithForLoop2() { RuntimeException e = null; diff --git a/java-checks-test-sources/default/src/main/java/checks/DefaultEncodingUsageCheck.java b/java-checks-test-sources/default/src/main/java/checks/DefaultEncodingUsageCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/DefaultEncodingUsageCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DefaultEncodingUsageCheckSample.java index 99432df041b..4f1080c645c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DefaultEncodingUsageCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DefaultEncodingUsageCheckSample.java @@ -20,7 +20,7 @@ import org.apache.commons.io.IOUtils; import org.checkerframework.common.reflection.qual.UnknownClass; -public class DefaultEncodingUsageCheck { +public class DefaultEncodingUsageCheckSample { void myMethod(byte[] bytes, java.io.File file, OutputStream outputStream, java.io.FileDescriptor fileDescriptor) throws IOException { new String(bytes); // Noncompliant {{Remove this use of constructor "String(byte[])".}} new String(bytes, 0, 1); // Noncompliant {{Remove this use of constructor "String(byte[],int,int)".}} diff --git a/java-checks-test-sources/default/src/main/java/checks/DefaultInitializedFieldCheck.java b/java-checks-test-sources/default/src/main/java/checks/DefaultInitializedFieldCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/DefaultInitializedFieldCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DefaultInitializedFieldCheckSample.java index e7b352c479a..401de3aae21 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DefaultInitializedFieldCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DefaultInitializedFieldCheckSample.java @@ -1,6 +1,6 @@ package checks; -class DefaultInitializedFieldCheck { +class DefaultInitializedFieldCheckSample { byte b = 0; // Noncompliant {{Remove this initialization to "0", the compiler will do that for you.}} byte b2; short s = 0; // Noncompliant {{Remove this initialization to "0", the compiler will do that for you.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/DeprecatedArgumentsCheck.java b/java-checks-test-sources/default/src/main/java/checks/DeprecatedArgumentsCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/DeprecatedArgumentsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DeprecatedArgumentsCheckSample.java index c739d23c709..66bf0e8ea22 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DeprecatedArgumentsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DeprecatedArgumentsCheckSample.java @@ -1,6 +1,6 @@ package checks; -class DeprecatedArgumentsCheck { +class DeprecatedArgumentsCheckSample { @Deprecated // Noncompliant [[sc=3;ec=14]] {{Add 'since' and/or 'forRemoval' arguments to the @Deprecated annotation.}} public int lim; diff --git a/java-checks-test-sources/default/src/main/java/checks/DepthOfInheritanceTreeCheck.java b/java-checks-test-sources/default/src/main/java/checks/DepthOfInheritanceTreeCheckSample.java similarity index 56% rename from java-checks-test-sources/default/src/main/java/checks/DepthOfInheritanceTreeCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DepthOfInheritanceTreeCheckSample.java index ab9c2a360a6..2cb12115e9e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DepthOfInheritanceTreeCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DepthOfInheritanceTreeCheckSample.java @@ -1,9 +1,9 @@ package checks; -public class DepthOfInheritanceTreeCheck extends One { // Noncompliant {{This class has 3 parents which is greater than 2 authorized.}} +public class DepthOfInheritanceTreeCheckSample extends One { // Noncompliant {{This class has 3 parents which is greater than 2 authorized.}} void foo() { - Object o = new DepthOfInheritanceTreeCheck() {}; // Noncompliant {{This class has 4 parents which is greater than 2 authorized.}} + Object o = new DepthOfInheritanceTreeCheckSample() {}; // Noncompliant {{This class has 4 parents which is greater than 2 authorized.}} } } diff --git a/java-checks-test-sources/default/src/main/java/checks/DoubleBraceInitializationCheck.java b/java-checks-test-sources/default/src/main/java/checks/DoubleBraceInitializationCheck.java deleted file mode 100644 index b7f7eb11bd1..00000000000 --- a/java-checks-test-sources/default/src/main/java/checks/DoubleBraceInitializationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -package checks; - -import java.util.HashMap; -import java.util.Map; - -class DoubleBraceInitializationCheck { - Map source = new HashMap() {{ // Noncompliant [[sc=46;el=+3;ec=5]] {{Use another way to initialize this instance.}} - put("firstName", "John"); - put("lastName", "Smith"); - }}; - - DoubleBraceInitializationCheckB b0 = new DoubleBraceInitializationCheckB(); - DoubleBraceInitializationCheckB b1 = new DoubleBraceInitializationCheckB() {{ bar("hello"); }}; // Noncompliant [[sc=78;ec=97]] {{Use another way to initialize this instance.}} - DoubleBraceInitializationCheckB b2 = new DoubleBraceInitializationCheckB() {{ - field = -1; - } - @Override - void foo() {}; - }; - DoubleBraceInitializationCheckB b3 = new DoubleBraceInitializationCheckB() { - @Override - void foo() {} - }; -} - -class DoubleBraceInitializationCheckB { - int field; - void foo() {} - void bar(String s) {} -} diff --git a/java-checks-test-sources/default/src/main/java/checks/DoubleBraceInitializationCheckSample.java b/java-checks-test-sources/default/src/main/java/checks/DoubleBraceInitializationCheckSample.java new file mode 100644 index 00000000000..527e85ed8ef --- /dev/null +++ b/java-checks-test-sources/default/src/main/java/checks/DoubleBraceInitializationCheckSample.java @@ -0,0 +1,30 @@ +package checks; + +import java.util.HashMap; +import java.util.Map; + +class DoubleBraceInitializationCheckSample { + Map source = new HashMap() {{ // Noncompliant [[sc=46;el=+3;ec=5]] {{Use another way to initialize this instance.}} + put("firstName", "John"); + put("lastName", "Smith"); + }}; + + DoubleBraceInitializationCheckSampleB b0 = new DoubleBraceInitializationCheckSampleB(); + DoubleBraceInitializationCheckSampleB b1 = new DoubleBraceInitializationCheckSampleB() {{ bar("hello"); }}; // Noncompliant [[sc=90;ec=109]] {{Use another way to initialize this instance.}} + DoubleBraceInitializationCheckSampleB b2 = new DoubleBraceInitializationCheckSampleB() {{ + field = -1; + } + @Override + void foo() {}; + }; + DoubleBraceInitializationCheckSampleB b3 = new DoubleBraceInitializationCheckSampleB() { + @Override + void foo() {} + }; +} + +class DoubleBraceInitializationCheckSampleB { + int field; + void foo() {} + void bar(String s) {} +} diff --git a/java-checks-test-sources/default/src/main/java/checks/DoubleCheckedLockingCheck.java b/java-checks-test-sources/default/src/main/java/checks/DoubleCheckedLockingCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/DoubleCheckedLockingCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DoubleCheckedLockingCheckSample.java index cfc0ff1d9f6..211f1321e2b 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DoubleCheckedLockingCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DoubleCheckedLockingCheckSample.java @@ -1,5 +1,5 @@ package checks; -class DoubleCheckedLockingCheck { +class DoubleCheckedLockingCheckSample { private Helper helper = null; public Helper classicCase() { @@ -93,7 +93,7 @@ interface HelperInterface { } } // after java 5 volatile keyword will guarantee correct read/write ordering with memory barriers -class DoubleCheckedLockingCheckVolatile { +class DoubleCheckedLockingCheckSampleVolatile { private volatile Helper helper = null; public Helper classicCase() { @@ -108,7 +108,7 @@ public Helper classicCase() { static class Helper { } } -class DoubleCheckedLockingCheckNestedIfs { +class DoubleCheckedLockingCheckSampleNestedIfs { private Helper helper = null; private boolean sunIsUp, sunIsDown; @@ -136,7 +136,7 @@ void doSomething() { } void doSomethingElse() { } } -class DoubleCheckedLockingCheckCompliant { +class DoubleCheckedLockingCheckSampleCompliant { private Helper helper = null; private int primitiveField = 0; @@ -226,6 +226,6 @@ public synchronized Helper synchronizedClassicCase() { static class Helper { } } -class DoubleCheckedLockingCheckStringResource { +class DoubleCheckedLockingCheckSampleStringResource { final String field = ""; } diff --git a/java-checks-test-sources/default/src/main/java/checks/DuplicateConditionIfElseIfCheck.java b/java-checks-test-sources/default/src/main/java/checks/DuplicateConditionIfElseIfCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/DuplicateConditionIfElseIfCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DuplicateConditionIfElseIfCheckSample.java index 08e37ed5a04..6c2efeed938 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DuplicateConditionIfElseIfCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DuplicateConditionIfElseIfCheckSample.java @@ -1,6 +1,6 @@ package checks; -class DuplicateConditionIfElseIfCheck { +class DuplicateConditionIfElseIfCheckSample { void example(boolean condition1, boolean condition2, boolean condition3, int i1, int i2) { if (condition1) { } else if (condition1) { // Noncompliant [[sc=16;ec=26;secondary=-1]] {{This branch can not be reached because the condition duplicates a previous condition in the same sequence of "if/else if" statements}} diff --git a/java-checks-test-sources/default/src/main/java/checks/DynamicClassLoadCheck.java b/java-checks-test-sources/default/src/main/java/checks/DynamicClassLoadCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/DynamicClassLoadCheck.java rename to java-checks-test-sources/default/src/main/java/checks/DynamicClassLoadCheckSample.java index 1e716d7b7dc..e17f3b3f76f 100644 --- a/java-checks-test-sources/default/src/main/java/checks/DynamicClassLoadCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/DynamicClassLoadCheckSample.java @@ -1,6 +1,6 @@ package checks; -class DynamicClassLoadCheck { +class DynamicClassLoadCheckSample { public void method() throws ClassNotFoundException, IllegalAccessException, InstantiationException { String className = System.getProperty("messageClassName"); diff --git a/java-checks-test-sources/default/src/main/java/checks/EmptyMethodsCheck.java b/java-checks-test-sources/default/src/main/java/checks/EmptyMethodsCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/EmptyMethodsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/EmptyMethodsCheckSample.java index 7bfd5f6c02e..7ce4db5dfac 100644 --- a/java-checks-test-sources/default/src/main/java/checks/EmptyMethodsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/EmptyMethodsCheckSample.java @@ -3,7 +3,7 @@ import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; -class EmptyMethodsCheck { +class EmptyMethodsCheckSample { class A { // Compliant - there is other constructors public A() { diff --git a/java-checks-test-sources/default/src/main/java/checks/EmptyStatementUsageCheck.java b/java-checks-test-sources/default/src/main/java/checks/EmptyStatementUsageCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/EmptyStatementUsageCheck.java rename to java-checks-test-sources/default/src/main/java/checks/EmptyStatementUsageCheckSample.java index 15f1da2dc3e..cccb712f539 100644 --- a/java-checks-test-sources/default/src/main/java/checks/EmptyStatementUsageCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/EmptyStatementUsageCheckSample.java @@ -11,12 +11,12 @@ // fix@qf2 {{Remove this empty statement}} // edit@qf2 [[sl=-4;sc=30;el=+0;ec=2]] {{}} -abstract class EmptyStatementUsageCheck { +abstract class EmptyStatementUsageCheckSample { int a; // Compliant int b;; // Noncompliant {{Remove this empty statement.}} ; // Noncompliant {{Remove this empty statement.}} - public EmptyStatementUsageCheck() { + public EmptyStatementUsageCheckSample() { ; // Noncompliant {{Remove this empty statement.}} } @@ -73,7 +73,7 @@ void somethingAfter() { } } -class EmptyStatementUsageCheckBar { +class EmptyStatementUsageCheckSampleBar { public enum MyEnum { APPLICATION, HANDLER }; // Noncompliant {{Remove this empty statement.}} Closeable c = new Closeable() { diff --git a/java-checks-test-sources/default/src/main/java/checks/EnumMapCheck.java b/java-checks-test-sources/default/src/main/java/checks/EnumMapCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/java/checks/EnumMapCheck.java rename to java-checks-test-sources/default/src/main/java/checks/EnumMapCheckSample.java index 36630b11036..bf7c63c690a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/EnumMapCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/EnumMapCheckSample.java @@ -5,7 +5,7 @@ import java.util.Map; import java.util.LinkedHashMap; -class EnumMapCheck { +class EnumMapCheckSample { public enum COLOR { RED, GREEN, BLUE, ORANGE; @@ -16,7 +16,7 @@ public void noncompliant() { Map moodMap = new HashMap(); // Noncompliant [[sc=34;ec=62]] new HashMap(); // Noncompliant Map moodMap2 = new HashMap<>(); // Noncompliant - Map moodMap3 = new HashMap(); // Noncompliant + Map moodMap3 = new HashMap(); // Noncompliant Map moodMap4 = (new HashMap()); // Noncompliant Map map; diff --git a/java-checks-test-sources/default/src/main/java/checks/EnumMutableFieldCheck.java b/java-checks-test-sources/default/src/main/java/checks/EnumMutableFieldCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/EnumMutableFieldCheck.java rename to java-checks-test-sources/default/src/main/java/checks/EnumMutableFieldCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/EnumSetCheck.java b/java-checks-test-sources/default/src/main/java/checks/EnumSetCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/EnumSetCheck.java rename to java-checks-test-sources/default/src/main/java/checks/EnumSetCheckSample.java index 5a78361cb59..0fd913d1573 100644 --- a/java-checks-test-sources/default/src/main/java/checks/EnumSetCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/EnumSetCheckSample.java @@ -10,7 +10,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; -class EnumSetCheck { +class EnumSetCheckSample { public enum COLOR { RED, GREEN, BLUE, ORANGE; diff --git a/java-checks-test-sources/default/src/main/java/checks/EqualsNotOverriddenInSubclassCheck.java b/java-checks-test-sources/default/src/main/java/checks/EqualsNotOverriddenInSubclassCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/EqualsNotOverriddenInSubclassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/EqualsNotOverriddenInSubclassCheckSample.java index 4b1bd13a083..70ca8e208a9 100644 --- a/java-checks-test-sources/default/src/main/java/checks/EqualsNotOverriddenInSubclassCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/EqualsNotOverriddenInSubclassCheckSample.java @@ -1,6 +1,6 @@ package checks; -class EqualsNotOverriddenInSubclassCheck { +class EqualsNotOverriddenInSubclassCheckSample { static final String CONST = "constant"; static String staticMember = "static member"; diff --git a/java-checks-test-sources/default/src/main/java/checks/EqualsOnAtomicClassCheck.java b/java-checks-test-sources/default/src/main/java/checks/EqualsOnAtomicClassCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/EqualsOnAtomicClassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/EqualsOnAtomicClassCheckSample.java index d3af96feb6a..fbb94360d82 100644 --- a/java-checks-test-sources/default/src/main/java/checks/EqualsOnAtomicClassCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/EqualsOnAtomicClassCheckSample.java @@ -4,7 +4,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -class EqualsOnAtomicClassCheck { +class EqualsOnAtomicClassCheckSample { void method() { boolean isEqual = false; diff --git a/java-checks-test-sources/default/src/main/java/checks/EqualsParametersMarkedNonNullCheck.java b/java-checks-test-sources/default/src/main/java/checks/EqualsParametersMarkedNonNullCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/EqualsParametersMarkedNonNullCheck.java rename to java-checks-test-sources/default/src/main/java/checks/EqualsParametersMarkedNonNullCheckSample.java index ce37dfb088a..df9f4276e81 100644 --- a/java-checks-test-sources/default/src/main/java/checks/EqualsParametersMarkedNonNullCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/EqualsParametersMarkedNonNullCheckSample.java @@ -2,7 +2,7 @@ import javax.annotation.Nonnull; -public class EqualsParametersMarkedNonNullCheck { +public class EqualsParametersMarkedNonNullCheckSample { static class A { public boolean equals(@Nonnull Object obj) { // Noncompliant [[sc=27;ec=35;quickfixes=qf1]] {{"equals" method parameters should not be marked "@Nonnull".}} diff --git a/java-checks-test-sources/default/src/main/java/checks/ErrorClassExtendedCheck.java b/java-checks-test-sources/default/src/main/java/checks/ErrorClassExtendedCheck.java deleted file mode 100644 index d0a61bcc940..00000000000 --- a/java-checks-test-sources/default/src/main/java/checks/ErrorClassExtendedCheck.java +++ /dev/null @@ -1,31 +0,0 @@ -package checks; - -class ErrorClassExtendedCheckA extends Error { // Noncompliant [[sc=40;ec=45]] {{Extend "java.lang.Exception" or one of its subclasses.}} -} - -class ErrorClassExtendedCheckB extends java.lang.Error { // Noncompliant [[sc=40;ec=55]] -} - -class ErrorClassExtendedCheckC { // Compliant -} - -class ErrorClassExtendedCheckD extends Exception { // Compliant -} - -class ErrorClassExtendedCheckF extends java.lang.Exception { // Compliant -} - -class ErrorClassExtendedCheckG extends java.lang.OutOfMemoryError { // Noncompliant -} - -class ErrorClassExtendedCheckH extends OutOfMemoryError { // Noncompliant -} - -class ErrorClassExtendedCheckI extends StackOverflowError { // Noncompliant -} - -class ErrorClassExtendedCheckJ extends IllegalStateException { // Compliant -} - -class ErrorClassExtendedCheckK extends java.lang.IllegalStateException { // Compliant -} diff --git a/java-checks-test-sources/default/src/main/java/checks/ErrorClassExtendedCheckSample.java b/java-checks-test-sources/default/src/main/java/checks/ErrorClassExtendedCheckSample.java new file mode 100644 index 00000000000..c774b5a5951 --- /dev/null +++ b/java-checks-test-sources/default/src/main/java/checks/ErrorClassExtendedCheckSample.java @@ -0,0 +1,31 @@ +package checks; + +class ErrorClassExtendedCheckSampleA extends Error { // Noncompliant [[sc=46;ec=51]] {{Extend "java.lang.Exception" or one of its subclasses.}} +} + +class ErrorClassExtendedCheckSampleB extends java.lang.Error { // Noncompliant [[sc=46;ec=61]] +} + +class ErrorClassExtendedCheckSampleC { // Compliant +} + +class ErrorClassExtendedCheckSampleD extends Exception { // Compliant +} + +class ErrorClassExtendedCheckSampleF extends java.lang.Exception { // Compliant +} + +class ErrorClassExtendedCheckSampleG extends java.lang.OutOfMemoryError { // Noncompliant +} + +class ErrorClassExtendedCheckSampleH extends OutOfMemoryError { // Noncompliant +} + +class ErrorClassExtendedCheckSampleI extends StackOverflowError { // Noncompliant +} + +class ErrorClassExtendedCheckSampleJ extends IllegalStateException { // Compliant +} + +class ErrorClassExtendedCheckSampleK extends java.lang.IllegalStateException { // Compliant +} diff --git a/java-checks-test-sources/default/src/main/java/checks/EscapedUnicodeCharactersCheck.java b/java-checks-test-sources/default/src/main/java/checks/EscapedUnicodeCharactersCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/EscapedUnicodeCharactersCheck.java rename to java-checks-test-sources/default/src/main/java/checks/EscapedUnicodeCharactersCheckSample.java index e064791a824..e53e0806adc 100644 --- a/java-checks-test-sources/default/src/main/java/checks/EscapedUnicodeCharactersCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/EscapedUnicodeCharactersCheckSample.java @@ -1,6 +1,6 @@ package checks; -class EscapedUnicodeCharactersCheck { +class EscapedUnicodeCharactersCheckSample { void method() { String prefix = "n\uuuu00E9e"; // Noncompliant [[sc=21;ec=34]] {{Remove this Unicode escape sequence and use the character instead.}} String prefix2= "n\\\uuuu00E9e"; // Noncompliant [[sc=21;ec=36]] {{Remove this Unicode escape sequence and use the character instead.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/ExpressionComplexityCheck.java b/java-checks-test-sources/default/src/main/java/checks/ExpressionComplexityCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/ExpressionComplexityCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ExpressionComplexityCheckSample.java index 7a276775ac3..a8ba2bf5a9f 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ExpressionComplexityCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ExpressionComplexityCheckSample.java @@ -2,7 +2,7 @@ import java.util.function.Supplier; -class ExpressionComplexityCheck { +class ExpressionComplexityCheckSample { int a = false ? (true ? (false ? 1 : 0) : 0) : 1; int b = false ? (true ? (false ? (true ? 1 : 0) : 0) : 0) : 1; // Noncompliant [[sc=11;ec=64;effortToFix=1]] {{Reduce the number of conditional operators (4) used in the expression (maximum allowed 3).}} @@ -17,7 +17,7 @@ void f() { } void g() { - new ExpressionComplexityCheck() { + new ExpressionComplexityCheckSample() { boolean a = true && true; boolean b = true && true; boolean c = true && true; @@ -28,7 +28,7 @@ void g() { void h() { boolean foo = true && true && true && // Noncompliant [[sc=19;ec=11;effortToFix=1]] - new ExpressionComplexityCheck() { + new ExpressionComplexityCheckSample() { boolean a = true && true && true && false && false; // Noncompliant [[effortToFix=1]] boolean a2 = true && true && true; }.someThing() && @@ -66,7 +66,7 @@ Runnable lambda() { boolean c = true || false || true; c = true || false || true; boolean a = true && true && true && false && false; // Noncompliant - new ExpressionComplexityCheck() { + new ExpressionComplexityCheckSample() { boolean a = true && true && true && false && false; // Noncompliant boolean a2 = true && true && true; }.someThing(); diff --git a/java-checks-test-sources/default/src/main/java/checks/FinalizeFieldsSetCheck.java b/java-checks-test-sources/default/src/main/java/checks/FinalizeFieldsSetCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/FinalizeFieldsSetCheck.java rename to java-checks-test-sources/default/src/main/java/checks/FinalizeFieldsSetCheckSample.java index d6c8139ebb5..802d1968f02 100644 --- a/java-checks-test-sources/default/src/main/java/checks/FinalizeFieldsSetCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/FinalizeFieldsSetCheckSample.java @@ -1,6 +1,6 @@ package checks; -class FinalizeFieldsSetCheck { +class FinalizeFieldsSetCheckSample { class A { private String myString; private Integer myInteger; diff --git a/java-checks-test-sources/default/src/main/java/checks/FixmeTagPresenceCheck.java b/java-checks-test-sources/default/src/main/java/checks/FixmeTagPresenceCheckSample.java similarity index 88% rename from java-checks-test-sources/default/src/main/java/checks/FixmeTagPresenceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/FixmeTagPresenceCheckSample.java index 5036aab927d..96b7237e41d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/FixmeTagPresenceCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/FixmeTagPresenceCheckSample.java @@ -3,7 +3,7 @@ // Noncompliant@+1 {{Take the required action to fix the issue indicated by this comment.}} // fixME -class FixmeTagPresenceCheck { +class FixmeTagPresenceCheckSample { // Noncompliant@+5 // Noncompliant@+3 /* diff --git a/java-checks-test-sources/default/src/main/java/checks/ForLoopFalseConditionCheck.java b/java-checks-test-sources/default/src/main/java/checks/ForLoopFalseConditionCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/ForLoopFalseConditionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ForLoopFalseConditionCheckSample.java index 32ba732cd5a..ce84f29af2d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ForLoopFalseConditionCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ForLoopFalseConditionCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class ForLoopFalseConditionCheck { +public class ForLoopFalseConditionCheckSample { void myMethod(int x, int y, int z) { for(int i = 0; i < ZERO; i++) {} // Noncompliant diff --git a/java-checks-test-sources/default/src/main/java/checks/ForLoopIncrementAndUpdateCheck.java b/java-checks-test-sources/default/src/main/java/checks/ForLoopIncrementAndUpdateCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/ForLoopIncrementAndUpdateCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ForLoopIncrementAndUpdateCheckSample.java index a524797627b..c460e6fec65 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ForLoopIncrementAndUpdateCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ForLoopIncrementAndUpdateCheckSample.java @@ -2,7 +2,7 @@ import java.util.Enumeration; -class ForLoopIncrementAndUpdateCheck { +class ForLoopIncrementAndUpdateCheckSample { Object foo() { int i = 0, j = 0, k = 0, l = 0; diff --git a/java-checks-test-sources/default/src/main/java/checks/ForLoopVariableTypeCheck.java b/java-checks-test-sources/default/src/main/java/checks/ForLoopVariableTypeCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/ForLoopVariableTypeCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ForLoopVariableTypeCheckSample.java index 51fe8265b49..98646b9e926 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ForLoopVariableTypeCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ForLoopVariableTypeCheckSample.java @@ -11,7 +11,7 @@ import java.util.stream.Stream; import org.jetbrains.annotations.NotNull; -class ForLoopVariableTypeCheck { +class ForLoopVariableTypeCheckSample { static class A { } diff --git a/java-checks-test-sources/default/src/main/java/checks/GarbageCollectorCalledCheck.java b/java-checks-test-sources/default/src/main/java/checks/GarbageCollectorCalledCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/GarbageCollectorCalledCheck.java rename to java-checks-test-sources/default/src/main/java/checks/GarbageCollectorCalledCheckSample.java index dde74aa6374..2e1b92fc0f6 100644 --- a/java-checks-test-sources/default/src/main/java/checks/GarbageCollectorCalledCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/GarbageCollectorCalledCheckSample.java @@ -1,6 +1,6 @@ package checks; -class GarbageCollectorCalledCheck { +class GarbageCollectorCalledCheckSample { Object o; Foo foo; diff --git a/java-checks-test-sources/default/src/main/java/checks/GetClassLoaderCheck.java b/java-checks-test-sources/default/src/main/java/checks/GetClassLoaderCheckSample.java similarity index 85% rename from java-checks-test-sources/default/src/main/java/checks/GetClassLoaderCheck.java rename to java-checks-test-sources/default/src/main/java/checks/GetClassLoaderCheckSample.java index 50cff638f3b..4e21836b5fb 100644 --- a/java-checks-test-sources/default/src/main/java/checks/GetClassLoaderCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/GetClassLoaderCheckSample.java @@ -1,6 +1,6 @@ package checks; -class GetClassLoaderCheck { +class GetClassLoaderCheckSample { void foo(){ ClassLoader cl = this.getClass() .getClassLoader(); // Noncompliant [[sc=8;ec=22]] {{Use "Thread.currentThread().getContextClassLoader()" instead.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/GetRequestedSessionIdCheck.java b/java-checks-test-sources/default/src/main/java/checks/GetRequestedSessionIdCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/java/checks/GetRequestedSessionIdCheck.java rename to java-checks-test-sources/default/src/main/java/checks/GetRequestedSessionIdCheckSample.java index 83d65a215e4..a0dbb4d678e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/GetRequestedSessionIdCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/GetRequestedSessionIdCheckSample.java @@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -public class GetRequestedSessionIdCheck extends HttpServlet { +public class GetRequestedSessionIdCheckSample extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String sessionId = request.getRequestedSessionId(); // Noncompliant [[sc=32;ec=53]] {{Remove use of this unsecured "getRequestedSessionId()" method}} } diff --git a/java-checks-test-sources/default/src/main/java/checks/HardCodedPasswordCheck.java b/java-checks-test-sources/default/src/main/java/checks/HardCodedPasswordCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/HardCodedPasswordCheck.java rename to java-checks-test-sources/default/src/main/java/checks/HardCodedPasswordCheckSample.java index 2d0bbb3c2cb..9a23d9bd4ed 100644 --- a/java-checks-test-sources/default/src/main/java/checks/HardCodedPasswordCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/HardCodedPasswordCheckSample.java @@ -17,7 +17,7 @@ * - 4.3 Setting password * - 5. Constructors */ -class HardCodedPasswordCheck { +class HardCodedPasswordCheckSample { String fieldNameWithPasswordInIt = retrievePassword(); diff --git a/java-checks-test-sources/default/src/main/java/checks/HardCodedSecretCheck.java b/java-checks-test-sources/default/src/main/java/checks/HardCodedSecretCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/HardCodedSecretCheck.java rename to java-checks-test-sources/default/src/main/java/checks/HardCodedSecretCheckSample.java index 9b16f9b0ebb..019347a9b13 100644 --- a/java-checks-test-sources/default/src/main/java/checks/HardCodedSecretCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/HardCodedSecretCheckSample.java @@ -11,7 +11,7 @@ * - 4.1 Equals * - 4.2 Setting secrets */ -class HardCodedSecretCheck { +class HardCodedSecretCheckSample { String fieldNameWithSecretInIt = retrieveSecret(); diff --git a/java-checks-test-sources/default/src/main/java/checks/HardcodedIpCheck.java b/java-checks-test-sources/default/src/main/java/checks/HardcodedIpCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/HardcodedIpCheck.java rename to java-checks-test-sources/default/src/main/java/checks/HardcodedIpCheckSample.java index cd171ddef04..25e7729fe92 100644 --- a/java-checks-test-sources/default/src/main/java/checks/HardcodedIpCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/HardcodedIpCheckSample.java @@ -1,6 +1,6 @@ package checks; -class HardcodedIpCheck { +class HardcodedIpCheckSample { String ip = "10.0.0.0"; // Noncompliant [[sc=15;ec=25]] {{Make sure using this hardcoded IP address is safe here.}} String ipAndPort = "10.0.0.0:0"; // Noncompliant [[sc=22;ec=34]] {{Make sure using this hardcoded IP address is safe here.}} String url = "http://192.168.0.1/admin.html"; // Noncompliant {{Make sure using this hardcoded IP address is safe here.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/HardcodedURICheck.java b/java-checks-test-sources/default/src/main/java/checks/HardcodedURICheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/HardcodedURICheck.java rename to java-checks-test-sources/default/src/main/java/checks/HardcodedURICheckSample.java index 053fd45d12a..94021e13337 100644 --- a/java-checks-test-sources/default/src/main/java/checks/HardcodedURICheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/HardcodedURICheckSample.java @@ -4,7 +4,7 @@ import java.net.URI; import java.net.URISyntaxException; -class HardcodedURICheck { +class HardcodedURICheckSample { public static @interface MyAnnotation { String stuff() default "none"; diff --git a/java-checks-test-sources/default/src/main/java/checks/HasNextCallingNextCheck.java b/java-checks-test-sources/default/src/main/java/checks/HasNextCallingNextCheckSample.java similarity index 66% rename from java-checks-test-sources/default/src/main/java/checks/HasNextCallingNextCheck.java rename to java-checks-test-sources/default/src/main/java/checks/HasNextCallingNextCheckSample.java index 1055ccfedbc..18e1311eae9 100644 --- a/java-checks-test-sources/default/src/main/java/checks/HasNextCallingNextCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/HasNextCallingNextCheckSample.java @@ -2,7 +2,7 @@ import java.util.Iterator; -class HasNextCallingNextCheck implements Iterator { +class HasNextCallingNextCheckSample implements Iterator { private Iterator other; @@ -27,9 +27,9 @@ public void remove() {} } // Not Iterator -class HasNextCallingNextCheck_B { +class HasNextCallingNextCheckSample_B { - private HasNextCallingNextCheck iterator; + private HasNextCallingNextCheckSample iterator; public boolean hasNext() { boolean b = false; @@ -42,13 +42,13 @@ public boolean hasNext() { public void remove() {} } -class HasNextCallingNextCheck_C implements Iterator { +class HasNextCallingNextCheckSample_C implements Iterator { public boolean hasNext() { return true; } public String next() { return "a"; } public void remove() {} } -class HasNextCallingNextCheck_D extends HasNextCallingNextCheck_C { +class HasNextCallingNextCheckSample_D extends HasNextCallingNextCheckSample_C { public boolean hasNext() { boolean b = false; b = next() != null; // Noncompliant @@ -56,9 +56,9 @@ public boolean hasNext() { } } -class HasNextCallingNextCheck_E extends HasNextCallingNextCheck_C { +class HasNextCallingNextCheckSample_E extends HasNextCallingNextCheckSample_C { public boolean hasNext() { - class Internal extends HasNextCallingNextCheck_C { + class Internal extends HasNextCallingNextCheckSample_C { public void myMethod() { next(); } @@ -67,15 +67,15 @@ public void myMethod() { } } -abstract class HasNextCallingNextCheck_F implements Iterator { +abstract class HasNextCallingNextCheckSample_F implements Iterator { public abstract boolean hasNext(); public String next() { return "a"; } public void remove() {} } -abstract class HasNextCallingNextCheck_FirstIterator implements Iterator { +abstract class HasNextCallingNextCheckSample_FirstIterator implements Iterator { - private HasNextCallingNextCheck_OtherIterator otherIterator; + private HasNextCallingNextCheckSample_OtherIterator otherIterator; @Override public boolean hasNext() { @@ -86,7 +86,7 @@ public boolean hasNext() { } } -abstract class HasNextCallingNextCheck_OtherIterator implements Iterator { +abstract class HasNextCallingNextCheckSample_OtherIterator implements Iterator { @Override public abstract String next(); diff --git a/java-checks-test-sources/default/src/main/java/checks/HiddenFieldCheck.java b/java-checks-test-sources/default/src/main/java/checks/HiddenFieldCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/HiddenFieldCheck.java rename to java-checks-test-sources/default/src/main/java/checks/HiddenFieldCheckSample.java index 4d966ea046d..b576e61dd5d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/HiddenFieldCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/HiddenFieldCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class HiddenFieldCheck extends MyBaseClass { +public class HiddenFieldCheckSample extends MyBaseClass { private int foo; public int bar; @@ -11,7 +11,7 @@ public class HiddenFieldCheck extends MyBaseClass { System.out.println(foo + ok); } - public HiddenFieldCheck(int foo) { // Compliant + public HiddenFieldCheckSample(int foo) { // Compliant this.foo = foo; } diff --git a/java-checks-test-sources/default/src/main/java/checks/IdenticalCasesInSwitchCheck.java b/java-checks-test-sources/default/src/main/java/checks/IdenticalCasesInSwitchCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/IdenticalCasesInSwitchCheck.java rename to java-checks-test-sources/default/src/main/java/checks/IdenticalCasesInSwitchCheckSample.java index a3968898cf3..d951804c7cb 100644 --- a/java-checks-test-sources/default/src/main/java/checks/IdenticalCasesInSwitchCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/IdenticalCasesInSwitchCheckSample.java @@ -1,6 +1,6 @@ package checks; -class IdenticalCasesInSwitchCheck { +class IdenticalCasesInSwitchCheckSample { void foo(){ switch (1) { case 1: diff --git a/java-checks-test-sources/default/src/main/java/checks/IgnoredStreamReturnValueCheck.java b/java-checks-test-sources/default/src/main/java/checks/IgnoredStreamReturnValueCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/IgnoredStreamReturnValueCheck.java rename to java-checks-test-sources/default/src/main/java/checks/IgnoredStreamReturnValueCheckSample.java index f69329a66df..50c73ac6b05 100644 --- a/java-checks-test-sources/default/src/main/java/checks/IgnoredStreamReturnValueCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/IgnoredStreamReturnValueCheckSample.java @@ -3,7 +3,7 @@ import java.io.FileInputStream; import java.io.InputStream; -class IgnoredStreamReturnValueCheck { +class IgnoredStreamReturnValueCheckSample { class A { public void foo() throws Exception { diff --git a/java-checks-test-sources/default/src/main/java/checks/ImmediateReverseBoxingCheck.java b/java-checks-test-sources/default/src/main/java/checks/ImmediateReverseBoxingCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/ImmediateReverseBoxingCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ImmediateReverseBoxingCheckSample.java index 4064e089e15..8be9f49e17f 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ImmediateReverseBoxingCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ImmediateReverseBoxingCheckSample.java @@ -1,6 +1,6 @@ package checks; -abstract class ImmediateReverseBoxingCheck { +abstract class ImmediateReverseBoxingCheckSample { public void processInt(String s, int a) {} public void processInteger(String s, Integer... a) {} diff --git a/java-checks-test-sources/default/src/main/java/checks/ImmediatelyReturnedVariableCheck.java b/java-checks-test-sources/default/src/main/java/checks/ImmediatelyReturnedVariableCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/ImmediatelyReturnedVariableCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ImmediatelyReturnedVariableCheckSample.java index 1ac8c189185..e295bf130b1 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ImmediatelyReturnedVariableCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ImmediatelyReturnedVariableCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ImmediatelyReturnedVariableCheck { +class ImmediatelyReturnedVariableCheckSample { public long computeDurationInMilliseconds(long hours, long minutes, long seconds) { long duration = (((hours * 60) + minutes) * 60 + seconds ) * 1000 ; // Noncompliant {{Immediately return this expression instead of assigning it to the temporary variable "duration".}} diff --git a/java-checks-test-sources/default/src/main/java/checks/ImplementsEnumerationCheck.java b/java-checks-test-sources/default/src/main/java/checks/ImplementsEnumerationCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/ImplementsEnumerationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ImplementsEnumerationCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/InappropriateRegexpCheck.java b/java-checks-test-sources/default/src/main/java/checks/InappropriateRegexpCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/InappropriateRegexpCheck.java rename to java-checks-test-sources/default/src/main/java/checks/InappropriateRegexpCheckSample.java index 0037d3375f9..4d1e6f6ceb1 100644 --- a/java-checks-test-sources/default/src/main/java/checks/InappropriateRegexpCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/InappropriateRegexpCheckSample.java @@ -2,7 +2,7 @@ import java.io.File; -class InappropriateRegexpCheck { +class InappropriateRegexpCheckSample { private static final String MY_REGEX = "."; diff --git a/java-checks-test-sources/default/src/main/java/checks/IncorrectOrderOfMembersCheck.java b/java-checks-test-sources/default/src/main/java/checks/IncorrectOrderOfMembersCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/IncorrectOrderOfMembersCheck.java rename to java-checks-test-sources/default/src/main/java/checks/IncorrectOrderOfMembersCheckSample.java index 48336fa3f10..b295df016d8 100644 --- a/java-checks-test-sources/default/src/main/java/checks/IncorrectOrderOfMembersCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/IncorrectOrderOfMembersCheckSample.java @@ -1,6 +1,6 @@ package checks; -class IncorrectOrderOfMembersCheck { +class IncorrectOrderOfMembersCheckSample { class FieldAfterConstructor { FieldAfterConstructor() { } diff --git a/java-checks-test-sources/default/src/main/java/checks/IndentationAfterConditionalCheck.java b/java-checks-test-sources/default/src/main/java/checks/IndentationAfterConditionalCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/IndentationAfterConditionalCheck.java rename to java-checks-test-sources/default/src/main/java/checks/IndentationAfterConditionalCheckSample.java index 39a31f375cc..d05b5a9ae11 100644 --- a/java-checks-test-sources/default/src/main/java/checks/IndentationAfterConditionalCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/IndentationAfterConditionalCheckSample.java @@ -4,7 +4,7 @@ import java.io.IOException; import java.util.List; -class IndentationAfterConditionalCheck { +class IndentationAfterConditionalCheckSample { public int foo() throws IOException { int i = 0; if (i <= 1) // Noncompliant [[sc=5;ec=16;secondary=11]] {{Use indentation to denote the code conditionally executed by this "if".}} diff --git a/java-checks-test-sources/default/src/main/java/checks/InnerClassOfNonSerializableCheck.java b/java-checks-test-sources/default/src/main/java/checks/InnerClassOfNonSerializableCheckSample.java similarity index 86% rename from java-checks-test-sources/default/src/main/java/checks/InnerClassOfNonSerializableCheck.java rename to java-checks-test-sources/default/src/main/java/checks/InnerClassOfNonSerializableCheckSample.java index 165263ad520..0503d120c59 100644 --- a/java-checks-test-sources/default/src/main/java/checks/InnerClassOfNonSerializableCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/InnerClassOfNonSerializableCheckSample.java @@ -2,7 +2,7 @@ import java.io.Serializable; -class InnerClassOfNonSerializableCheck implements Serializable { +class InnerClassOfNonSerializableCheckSample implements Serializable { class A1 implements Serializable {} @@ -11,7 +11,7 @@ class X1 implements Serializable {} } } -class InnerClassOfNonSerializableCheckB { +class InnerClassOfNonSerializableCheckSampleB { Serializable Anon = new Serializable() {}; // Noncompliant [[sc=27;ec=39]] {{Make this inner class static}} diff --git a/java-checks-test-sources/default/src/main/java/checks/InnerClassOfSerializableCheck.java b/java-checks-test-sources/default/src/main/java/checks/InnerClassOfSerializableCheckSample.java similarity index 84% rename from java-checks-test-sources/default/src/main/java/checks/InnerClassOfSerializableCheck.java rename to java-checks-test-sources/default/src/main/java/checks/InnerClassOfSerializableCheckSample.java index 0127df84ccb..df842098d83 100644 --- a/java-checks-test-sources/default/src/main/java/checks/InnerClassOfSerializableCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/InnerClassOfSerializableCheckSample.java @@ -2,7 +2,7 @@ import java.io.Serializable; -class InnerClassOfSerializableCheck { +class InnerClassOfSerializableCheckSample { class A1 implements Serializable {} @@ -11,7 +11,7 @@ class X1 implements Serializable {} } } -class InnerClassOfSerializableCheckB implements Serializable { +class InnerClassOfSerializableCheckSampleB implements Serializable { class B1 {} class B2 implements Cloneable {} diff --git a/java-checks-test-sources/default/src/main/java/checks/InputStreamReadCheck.java b/java-checks-test-sources/default/src/main/java/checks/InputStreamReadCheckSample.java similarity index 85% rename from java-checks-test-sources/default/src/main/java/checks/InputStreamReadCheck.java rename to java-checks-test-sources/default/src/main/java/checks/InputStreamReadCheckSample.java index 204f28fe991..2dd7ebc2116 100644 --- a/java-checks-test-sources/default/src/main/java/checks/InputStreamReadCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/InputStreamReadCheckSample.java @@ -4,7 +4,7 @@ import java.io.InputStream; import java.util.function.Supplier; -class InputStreamReadCheck extends InputStream { +class InputStreamReadCheckSample extends InputStream { public int pos; public byte currentByte; @@ -33,7 +33,7 @@ public int read(boolean b) throws IOException { } } -class InputStreamReadCheckB extends InputStreamReadCheck { +class InputStreamReadCheckSampleB extends InputStreamReadCheckSample { @Override public int read() throws IOException { return currentByte & 0xFF; // Compliant - return an int @@ -45,7 +45,7 @@ public int read(boolean b) throws IOException { } } -abstract class InputStreamReadCheckC extends InputStream { +abstract class InputStreamReadCheckSampleC extends InputStream { @Override public abstract int read(); } diff --git a/java-checks-test-sources/default/src/main/java/checks/InsecureCreateTempFileCheck.java b/java-checks-test-sources/default/src/main/java/checks/InsecureCreateTempFileCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/java/checks/InsecureCreateTempFileCheck.java rename to java-checks-test-sources/default/src/main/java/checks/InsecureCreateTempFileCheckSample.java index b18b5cec6f0..f806ae429f9 100644 --- a/java-checks-test-sources/default/src/main/java/checks/InsecureCreateTempFileCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/InsecureCreateTempFileCheckSample.java @@ -5,7 +5,7 @@ import java.nio.file.Files; import java.nio.file.Path; -class InsecureCreateTempFileCheck { +class InsecureCreateTempFileCheckSample { private static class A {} @@ -65,7 +65,7 @@ private void compliant() throws IOException { file.mkdir(); int a = 5; a = 6; - InsecureCreateTempFileCheck.b = File.createTempFile("", "."); + InsecureCreateTempFileCheckSample.b = File.createTempFile("", "."); b().mkdir(); } } diff --git a/java-checks-test-sources/default/src/main/java/checks/InstanceofUsedOnExceptionCheck.java b/java-checks-test-sources/default/src/main/java/checks/InstanceofUsedOnExceptionCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/InstanceofUsedOnExceptionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/InstanceofUsedOnExceptionCheckSample.java index cd0cba9896b..e0c4fc227bd 100644 --- a/java-checks-test-sources/default/src/main/java/checks/InstanceofUsedOnExceptionCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/InstanceofUsedOnExceptionCheckSample.java @@ -2,7 +2,7 @@ import java.io.IOException; -class InstanceofUsedOnExceptionCheck { +class InstanceofUsedOnExceptionCheckSample { private void withEalseIf() { try { } catch (Exception e) { diff --git a/java-checks-test-sources/default/src/main/java/checks/InterfaceAsConstantContainerCheck.java b/java-checks-test-sources/default/src/main/java/checks/InterfaceAsConstantContainerCheck.java deleted file mode 100644 index 0bd50217c49..00000000000 --- a/java-checks-test-sources/default/src/main/java/checks/InterfaceAsConstantContainerCheck.java +++ /dev/null @@ -1,52 +0,0 @@ -package checks; - -interface InterfaceAsConstantContainerCheck { -} - -interface InterfaceAsConstantContainerCheckA { // Noncompliant [[sc=11;ec=45;secondary=7,8]] {{Move constants defined in this interfaces to another class or enum.}} - int a = 0; - int b = 0; -} - -interface InterfaceAsConstantContainerCheckB { - void f(); -} - -interface InterfaceAsConstantContainerCheckC { // Compliant - int a = 0; - void f(); -} - -interface InterfaceAsConstantContainerCheckD { // Compliant - void f(); - int a = 0; -} - -interface InterfaceAsConstantContainerCheckE { - int f(); - void g(); -} - -interface InterfaceAsConstantContainerCheckF { - int f(); - - interface InterfaceAsConstantContainerCheckG { // Compliant - void f(); - int a = 0; - } - - interface InterfaceAsConstantContainerCheckH { // Noncompliant - int a = 0; - ; - int b = 0; - } -} - -interface InterfaceAsConstantContainerCheckI { - ; -} - -interface InterfaceAsConstantContainerCheckWithParent extends InterfaceAsConstantContainerCheckB { // Compliant - // If the interface has a parent, you will be forced to implement methods, the interface represents more than a set of constants, it is therefore a legitimate use case. - int a = 0; -} diff --git a/java-checks-test-sources/default/src/main/java/checks/InterfaceAsConstantContainerCheckSample.java b/java-checks-test-sources/default/src/main/java/checks/InterfaceAsConstantContainerCheckSample.java new file mode 100644 index 00000000000..bc193cdf6fe --- /dev/null +++ b/java-checks-test-sources/default/src/main/java/checks/InterfaceAsConstantContainerCheckSample.java @@ -0,0 +1,52 @@ +package checks; + +interface InterfaceAsConstantContainerCheckSample { +} + +interface InterfaceAsConstantContainerCheckSampleA { // Noncompliant [[sc=11;ec=51;secondary=7,8]] {{Move constants defined in this interfaces to another class or enum.}} + int a = 0; + int b = 0; +} + +interface InterfaceAsConstantContainerCheckSampleB { + void f(); +} + +interface InterfaceAsConstantContainerCheckSampleC { // Compliant + int a = 0; + void f(); +} + +interface InterfaceAsConstantContainerCheckSampleD { // Compliant + void f(); + int a = 0; +} + +interface InterfaceAsConstantContainerCheckSampleE { + int f(); + void g(); +} + +interface InterfaceAsConstantContainerCheckSampleF { + int f(); + + interface InterfaceAsConstantContainerCheckSampleG { // Compliant + void f(); + int a = 0; + } + + interface InterfaceAsConstantContainerCheckSampleH { // Noncompliant + int a = 0; + ; + int b = 0; + } +} + +interface InterfaceAsConstantContainerCheckSampleI { + ; +} + +interface InterfaceAsConstantContainerCheckSampleWithParent extends InterfaceAsConstantContainerCheckSampleB { // Compliant + // If the interface has a parent, you will be forced to implement methods, the interface represents more than a set of constants, it is therefore a legitimate use case. + int a = 0; +} diff --git a/java-checks-test-sources/default/src/main/java/checks/InterfaceOrSuperclassShadowingCheck.java b/java-checks-test-sources/default/src/main/java/checks/InterfaceOrSuperclassShadowingCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/InterfaceOrSuperclassShadowingCheck.java rename to java-checks-test-sources/default/src/main/java/checks/InterfaceOrSuperclassShadowingCheckSample.java index b574c82d6b6..ce4e7cafcda 100644 --- a/java-checks-test-sources/default/src/main/java/checks/InterfaceOrSuperclassShadowingCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/InterfaceOrSuperclassShadowingCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class InterfaceOrSuperclassShadowingCheck { +public class InterfaceOrSuperclassShadowingCheckSample { interface Closeable extends java.io.Closeable {} // Compliant - inner class } diff --git a/java-checks-test-sources/default/src/main/java/checks/InterruptedExceptionCheck.java b/java-checks-test-sources/default/src/main/java/checks/InterruptedExceptionCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/InterruptedExceptionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/InterruptedExceptionCheckSample.java index 09e3e66a91d..e32b0f87140 100644 --- a/java-checks-test-sources/default/src/main/java/checks/InterruptedExceptionCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/InterruptedExceptionCheckSample.java @@ -12,7 +12,7 @@ interface Log { void log(Level level, String s, Throwable e); } -public class InterruptedExceptionCheck { +public class InterruptedExceptionCheckSample { static final Log LOGGER = null; public void run1 () { diff --git a/java-checks-test-sources/default/src/main/java/checks/InvalidDateValuesCheck.java b/java-checks-test-sources/default/src/main/java/checks/InvalidDateValuesCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/InvalidDateValuesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/InvalidDateValuesCheckSample.java index d2f6a0a3515..10d4765cf5e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/InvalidDateValuesCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/InvalidDateValuesCheckSample.java @@ -3,7 +3,7 @@ import java.util.*; import static java.util.Calendar.MONTH; -class InvalidDateValuesCheck { +class InvalidDateValuesCheckSample { public final static int MINUTE = Calendar.MINUTE; boolean b; @@ -42,7 +42,7 @@ int foo() { cal.set(Calendar.HOUR_OF_DAY, 24);// Noncompliant {{"24" is not a valid value for setting "HOUR_OF_DAY".}} cal.set(Calendar.MINUTE, 59); cal.set(Calendar.MINUTE, 61);// Noncompliant {{"61" is not a valid value for setting "MINUTE".}} - cal.set(InvalidDateValuesCheck.MINUTE, 61);// support only Calendar members + cal.set(InvalidDateValuesCheckSample.MINUTE, 61);// support only Calendar members cal.set(Calendar.SECOND, 61); cal.set(Calendar.SECOND, 63);// Noncompliant {{"63" is not a valid value for setting "SECOND".}} cal.set(Calendar.HOUR_OF_DAY, -2);// Noncompliant {{"-2" is not a valid value for setting "HOUR_OF_DAY".}} diff --git a/java-checks-test-sources/default/src/main/java/checks/IsInstanceMethodCheck.java b/java-checks-test-sources/default/src/main/java/checks/IsInstanceMethodCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/IsInstanceMethodCheck.java rename to java-checks-test-sources/default/src/main/java/checks/IsInstanceMethodCheckSample.java index f5f7663cb79..8b66a161699 100644 --- a/java-checks-test-sources/default/src/main/java/checks/IsInstanceMethodCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/IsInstanceMethodCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class IsInstanceMethodCheck { +public class IsInstanceMethodCheckSample { int noncompliant1(Object o) { if (String.class.isInstance(o)) { // Noncompliant [[sc=9;ec=35]]{{Replace this usage of "String.class.isInstance()" with "instanceof String".}} return 42; diff --git a/java-checks-test-sources/default/src/main/java/checks/IterableIteratorCheck.java b/java-checks-test-sources/default/src/main/java/checks/IterableIteratorCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/IterableIteratorCheck.java rename to java-checks-test-sources/default/src/main/java/checks/IterableIteratorCheckSample.java index e6059e13b8e..68151b935ff 100644 --- a/java-checks-test-sources/default/src/main/java/checks/IterableIteratorCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/IterableIteratorCheckSample.java @@ -2,7 +2,7 @@ import java.util.Iterator; -class IterableIteratorCheck implements Iterator, Iterable { +class IterableIteratorCheckSample implements Iterator, Iterable { private S4348_Foo[] seq; private int idx = 0; public boolean hasNext() { diff --git a/java-checks-test-sources/default/src/main/java/checks/IteratorNextExceptionCheck.java b/java-checks-test-sources/default/src/main/java/checks/IteratorNextExceptionCheckSample.java similarity index 76% rename from java-checks-test-sources/default/src/main/java/checks/IteratorNextExceptionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/IteratorNextExceptionCheckSample.java index 096aeb776a5..be76533554a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/IteratorNextExceptionCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/IteratorNextExceptionCheckSample.java @@ -7,7 +7,7 @@ import java.util.Optional; import java.util.PrimitiveIterator; -class IteratorNextExceptionCheckA implements Iterator { +class IteratorNextExceptionCheckSampleA implements Iterator { public String next() { // Noncompliant [[sc=17;ec=21]] {{Add a "NoSuchElementException" for iteration beyond the end of the collection.}} if (!hasNext()){ @@ -21,7 +21,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckB implements Iterator { +class IteratorNextExceptionCheckSampleB implements Iterator { public String next() { // Noncompliant if (!hasNext()){ @@ -35,7 +35,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckC implements Iterator { +class IteratorNextExceptionCheckSampleC implements Iterator { public String next() { if (!hasNext()){ @@ -59,7 +59,7 @@ public boolean hasNext() { } -class IteratorNextExceptionCheckD implements Iterator { +class IteratorNextExceptionCheckSampleD implements Iterator { public String next() { // Noncompliant if (!hasNext()){ @@ -76,7 +76,7 @@ public boolean hasNext() { } -class IteratorNextExceptionCheckE { // Not an iterator +class IteratorNextExceptionCheckSampleE { // Not an iterator public String next() { if (!hasNext()){ @@ -91,11 +91,11 @@ public boolean hasNext() { } -abstract class IteratorNextExceptionCheckF implements Iterator{ +abstract class IteratorNextExceptionCheckSampleF implements Iterator{ public abstract String next(); } -class IteratorNextExceptionCheckG implements Iterator { +class IteratorNextExceptionCheckSampleG implements Iterator { private Iterator iter; @@ -110,7 +110,7 @@ public boolean hasNext() { } -class IteratorNextExceptionCheckI implements Iterator { +class IteratorNextExceptionCheckSampleI implements Iterator { public String next() { // Noncompliant return throwsIndexOutOfBoundsException(); @@ -127,7 +127,7 @@ public boolean hasNext() { } -class IteratorNextExceptionCheckJ implements Iterator { +class IteratorNextExceptionCheckSampleJ implements Iterator { public String next() { if (!hasNext()){ throw new NoSuchElementException(); @@ -139,8 +139,8 @@ public boolean hasNext() { return false; } } -class IteratorNextExceptionCheckK implements Iterator { - IteratorNextExceptionCheckJ a; +class IteratorNextExceptionCheckSampleK implements Iterator { + IteratorNextExceptionCheckSampleJ a; public String next() { return a.next(); // Compliant } @@ -150,7 +150,7 @@ public boolean hasNext() { } } -abstract class IteratorNextExceptionCheckL implements Iterator { +abstract class IteratorNextExceptionCheckSampleL implements Iterator { @Override public String next() { // Compliant return getOptional().orElseThrow(NoSuchElementException::new); @@ -161,7 +161,7 @@ Optional getOptional() { } } -class IteratorNextExceptionCheckM implements Iterator { +class IteratorNextExceptionCheckSampleM implements Iterator { ListIterator a; public String next() { return a.previous(); // Compliant @@ -172,7 +172,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckM2 implements PrimitiveIterator.OfInt { +class IteratorNextExceptionCheckSampleM2 implements PrimitiveIterator.OfInt { Iterator iterator; @Override public int nextInt() { @@ -189,7 +189,7 @@ public boolean hasNext() { * FALSE POSITIVE below. We currently are not able to tell which methods outside of this file (like `removeFirst`) * can throw `NoSuchElementException`. The case below is actually compliant. */ -class IteratorNextExceptionCheckM3 implements Iterator { +class IteratorNextExceptionCheckSampleM3 implements Iterator { LinkedList list; @Override public String next() { // Noncompliant @@ -202,7 +202,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckN implements Iterator { +class IteratorNextExceptionCheckSampleN implements Iterator { PrimitiveIterator.OfDouble a; public Double next() { return a.nextDouble(); // Compliant @@ -213,7 +213,7 @@ public boolean hasNext() { } } -class IteratorNextExceptionCheckO implements Iterator { +class IteratorNextExceptionCheckSampleO implements Iterator { private int count = 10; public String next() { // Compliant @@ -239,12 +239,12 @@ public boolean hasNext() { } -class IteratorNextExceptionCheckP implements Iterator { +class IteratorNextExceptionCheckSampleP implements Iterator { private T elem; public T next() { // Compliant if (!hasNext()) { - IteratorNextExceptionCheckO.justThrow(); + IteratorNextExceptionCheckSampleO.justThrow(); } return elem; } @@ -256,7 +256,7 @@ public boolean hasNext() { } -class IteratorNextExceptionCheckQ implements Iterator { +class IteratorNextExceptionCheckSampleQ implements Iterator { private T elem; public T next() { // Compliant @@ -274,7 +274,7 @@ public boolean hasNext() { } -class IteratorNextExceptionCheckR implements Iterator { +class IteratorNextExceptionCheckSampleR implements Iterator { public T next() { // Noncompliant return recurseA(); } @@ -294,7 +294,7 @@ public boolean hasNext() { } -class IteratorNextExceptionCheckS implements Iterator { +class IteratorNextExceptionCheckSampleS implements Iterator { private T elem; public T next() { // Compliant @@ -328,7 +328,7 @@ public boolean hasNext() { * FALSE NEGATIVE below. We currently do not handle try-catch statements. In the example below, the expected exception * is caught when it should not be. The example is actually non-compliant */ -class IteratorNextExceptionCheckT implements Iterator { +class IteratorNextExceptionCheckSampleT implements Iterator { private T elem; public T next() { // Compliant, FN diff --git a/java-checks-test-sources/default/src/main/java/checks/JacksonDeserializationCheck.java b/java-checks-test-sources/default/src/main/java/checks/JacksonDeserializationCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/JacksonDeserializationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/JacksonDeserializationCheckSample.java index 28cfd4ad80d..226e35c9c1c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/JacksonDeserializationCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/JacksonDeserializationCheckSample.java @@ -6,7 +6,7 @@ import static com.fasterxml.jackson.annotation.JsonTypeInfo.Id.MINIMAL_CLASS; -class JacksonDeserializationCheck { +class JacksonDeserializationCheckSample { public void enableDefaultTyping() { ObjectMapper mapper = new ObjectMapper(); diff --git a/java-checks-test-sources/default/src/main/java/checks/JdbcDriverExplicitLoadingCheck.java b/java-checks-test-sources/default/src/main/java/checks/JdbcDriverExplicitLoadingCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/JdbcDriverExplicitLoadingCheck.java rename to java-checks-test-sources/default/src/main/java/checks/JdbcDriverExplicitLoadingCheckSample.java index 006d536da30..fa0f21c62af 100644 --- a/java-checks-test-sources/default/src/main/java/checks/JdbcDriverExplicitLoadingCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/JdbcDriverExplicitLoadingCheckSample.java @@ -1,6 +1,6 @@ package checks; -class JdbcDriverExplicitLoadingCheck { +class JdbcDriverExplicitLoadingCheckSample { private static final String DRIVER = "com.mysql.jdbc.Driver"; void doStuff() throws ClassNotFoundException { diff --git a/java-checks-test-sources/default/src/main/java/checks/LabelsShouldNotBeUsedCheck.java b/java-checks-test-sources/default/src/main/java/checks/LabelsShouldNotBeUsedCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/LabelsShouldNotBeUsedCheck.java rename to java-checks-test-sources/default/src/main/java/checks/LabelsShouldNotBeUsedCheckSample.java index aac97917c03..a3456f10d12 100644 --- a/java-checks-test-sources/default/src/main/java/checks/LabelsShouldNotBeUsedCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/LabelsShouldNotBeUsedCheckSample.java @@ -1,6 +1,6 @@ package checks; -class LabelsShouldNotBeUsedCheck { +class LabelsShouldNotBeUsedCheckSample { void foo() { int matrix[][] = { {1, 2, 3}, diff --git a/java-checks-test-sources/default/src/main/java/checks/LambdaTooBigCheck.java b/java-checks-test-sources/default/src/main/java/checks/LambdaTooBigCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/LambdaTooBigCheck.java rename to java-checks-test-sources/default/src/main/java/checks/LambdaTooBigCheckSample.java index 2dc935c9105..a3bffcdf1b0 100644 --- a/java-checks-test-sources/default/src/main/java/checks/LambdaTooBigCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/LambdaTooBigCheckSample.java @@ -2,7 +2,7 @@ import java.util.concurrent.Callable; -class LambdaTooBigCheckA { +class LambdaTooBigCheckSampleA { Callable c1 = () -> { // Noncompliant [[sc=26;ec=31;secondary=17]] {{Reduce this lambda expression number of lines from 11 to at most 10.}} System.out.println(); diff --git a/java-checks-test-sources/default/src/main/java/checks/LazyArgEvaluationCheck.java b/java-checks-test-sources/default/src/main/java/checks/LazyArgEvaluationCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/LazyArgEvaluationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/LazyArgEvaluationCheckSample.java index 11eb235f899..d0a3b2641e2 100644 --- a/java-checks-test-sources/default/src/main/java/checks/LazyArgEvaluationCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/LazyArgEvaluationCheckSample.java @@ -13,9 +13,9 @@ import static com.google.common.base.Preconditions.checkState; @SuppressWarnings("java:S139") -class LazyArgEvaluationCheck { +class LazyArgEvaluationCheckSample { - public static final Logger slf4j = LoggerFactory.getLogger(LazyArgEvaluationCheck.class); + public static final Logger slf4j = LoggerFactory.getLogger(LazyArgEvaluationCheckSample.class); public static final java.util.logging.Logger logger = java.util.logging.Logger.getGlobal(); public static final org.apache.logging.log4j.Logger log4j = org.apache.logging.log4j.LogManager.getLogger(); @@ -48,7 +48,7 @@ public static void main(String[] args) { checkState(System.currentTimeMillis() > 0, "message: %s", formatMessage()); // Noncompliant {{Invoke method(s) only conditionally. }} - checkState(System.currentTimeMillis() > 0, "message: %s", LazyArgEvaluationCheck.formatMessage()); // Noncompliant {{Invoke method(s) only conditionally. }} + checkState(System.currentTimeMillis() > 0, "message: %s", LazyArgEvaluationCheckSample.formatMessage()); // Noncompliant {{Invoke method(s) only conditionally. }} } public static void cachingOnDisk(File path) { diff --git a/java-checks-test-sources/default/src/main/java/checks/LeastSpecificTypeCheck.java b/java-checks-test-sources/default/src/main/java/checks/LeastSpecificTypeCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/LeastSpecificTypeCheck.java rename to java-checks-test-sources/default/src/main/java/checks/LeastSpecificTypeCheckSample.java index f91d477e308..47a5b546e77 100644 --- a/java-checks-test-sources/default/src/main/java/checks/LeastSpecificTypeCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/LeastSpecificTypeCheckSample.java @@ -12,7 +12,7 @@ import javax.inject.Inject; import org.springframework.beans.factory.annotation.Autowired; -class LeastSpecificTypeCheck { +class LeastSpecificTypeCheckSample { public void test1(ArrayList list) { // Noncompliant {{Use 'java.util.Collection' here; it is a more general type than 'ArrayList'.}} System.out.println(list.size()); @@ -146,7 +146,7 @@ public class S implements IA, IB { public class C extends S { } - public void test4(C arg) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheck.S' here; it is a more general type than 'C'.}} + public void test4(C arg) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheckSample.S' here; it is a more general type than 'C'.}} arg.a(); arg.b(); } @@ -244,7 +244,7 @@ static class PackageClass extends ProtectedClass { } - public static void coverage(PrivateClass c) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheck.IBase' here; it is a more general type than 'PrivateClass'.}} + public static void coverage(PrivateClass c) { // Noncompliant {{Use 'checks.LeastSpecificTypeCheckSample.IBase' here; it is a more general type than 'PrivateClass'.}} c.b2(); } diff --git a/java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceEndLineCheck.java b/java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceEndLineCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceEndLineCheck.java rename to java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceEndLineCheckSample.java index 01544385638..686f1391973 100644 --- a/java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceEndLineCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceEndLineCheckSample.java @@ -7,7 +7,7 @@ import java.util.List; import org.sonar.api.Properties; -class LeftCurlyBraceEndLineCheck { +class LeftCurlyBraceEndLineCheckSample { private static final int MY_CONST; static @@ -32,7 +32,7 @@ public enum MyEnum { } } - public LeftCurlyBraceEndLineCheck() { // Compliant + public LeftCurlyBraceEndLineCheckSample() { // Compliant } public void bar() throws Exception @@ -137,10 +137,10 @@ public void foo() { } } -class LeftCurlyBraceEndLineCheckBar extends LeftCurlyBraceEndLineCheck { // Compliant +class LeftCurlyBraceEndLineCheckSampleBar extends LeftCurlyBraceEndLineCheckSample { // Compliant } -class LeftCurlyBraceEndLineCheckReBar extends checks.LeftCurlyBraceEndLineCheck { // Compliant +class LeftCurlyBraceEndLineCheckSampleReBar extends checks.LeftCurlyBraceEndLineCheckSample { // Compliant } abstract class Dul implements Closeable diff --git a/java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceStartLineCheck.java b/java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceStartLineCheckSample.java similarity index 81% rename from java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceStartLineCheck.java rename to java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceStartLineCheckSample.java index 7ccb88096d7..aff27b16ab7 100644 --- a/java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceStartLineCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/LeftCurlyBraceStartLineCheckSample.java @@ -2,7 +2,7 @@ import org.sonar.api.Properties; -class LeftCurlyBraceStartLineCheck { // Noncompliant [[sc=36;ec=37]] {{Move this left curly brace to the beginning of next line of code.}} +class LeftCurlyBraceStartLineCheckSample { // Noncompliant [[sc=42;ec=43]] {{Move this left curly brace to the beginning of next line of code.}} class Gul { // Compliant diff --git a/java-checks-test-sources/default/src/main/java/checks/LoggedRethrownExceptionsCheck.java b/java-checks-test-sources/default/src/main/java/checks/LoggedRethrownExceptionsCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/LoggedRethrownExceptionsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/LoggedRethrownExceptionsCheckSample.java index ab26fde0724..8c8dda1ab33 100644 --- a/java-checks-test-sources/default/src/main/java/checks/LoggedRethrownExceptionsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/LoggedRethrownExceptionsCheckSample.java @@ -5,8 +5,8 @@ import java.util.logging.Logger; import org.slf4j.LoggerFactory; -class LoggedRethrownExceptionsCheck { - static final org.slf4j.Logger slf4jLogger = LoggerFactory.getLogger(LoggedRethrownExceptionsCheck.class); +class LoggedRethrownExceptionsCheckSample { + static final org.slf4j.Logger slf4jLogger = LoggerFactory.getLogger(LoggedRethrownExceptionsCheckSample.class); Object contextInfo; boolean flag; int foo; diff --git a/java-checks-test-sources/default/src/main/java/checks/LongBitsToDoubleOnIntCheck.java b/java-checks-test-sources/default/src/main/java/checks/LongBitsToDoubleOnIntCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/LongBitsToDoubleOnIntCheck.java rename to java-checks-test-sources/default/src/main/java/checks/LongBitsToDoubleOnIntCheckSample.java index 8dd6da560ca..c1d3b94fcc5 100644 --- a/java-checks-test-sources/default/src/main/java/checks/LongBitsToDoubleOnIntCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/LongBitsToDoubleOnIntCheckSample.java @@ -1,6 +1,6 @@ package checks; -class LongBitsToDoubleOnIntCheck { +class LongBitsToDoubleOnIntCheckSample { void foo() { byte b = 1; short s = 1; diff --git a/java-checks-test-sources/default/src/main/java/checks/MapKeyNotComparableCheck.java b/java-checks-test-sources/default/src/main/java/checks/MapKeyNotComparableCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/java/checks/MapKeyNotComparableCheck.java rename to java-checks-test-sources/default/src/main/java/checks/MapKeyNotComparableCheckSample.java index aa45c8e4516..f01ec88f8bc 100644 --- a/java-checks-test-sources/default/src/main/java/checks/MapKeyNotComparableCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/MapKeyNotComparableCheckSample.java @@ -7,7 +7,7 @@ import java.util.function.Function; import org.jetbrains.annotations.NotNull; -public class MapKeyNotComparableCheck { +public class MapKeyNotComparableCheckSample { static class MyComparable implements Comparable { @Override public int compareTo(@NotNull Object o) { @@ -47,7 +47,7 @@ static class FieldDecl { Map nonComparable = new HashMap<>(); // Noncompliant {{The key type should implement Comparable.}} Map comparable = new HashMap<>(); // compliant Map, Object> parametrizedNonComparable = new HashMap<>(); // Noncompliant {{The key type should implement Comparable.}} - Map memberSelect = new HashMap<>(); // Noncompliant {{The key type should implement Comparable.}} + Map memberSelect = new HashMap<>(); // Noncompliant {{The key type should implement Comparable.}} Map wildCard = new HashMap<>(); ThreeTypeParams threeTypeParams = null; // compliant HashMap nonInterface = new HashMap<>(); // Noncompliant [[sc=13;ec=26]] {{The key type should implement Comparable.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/MathOnFloatCheck.java b/java-checks-test-sources/default/src/main/java/checks/MathOnFloatCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/MathOnFloatCheck.java rename to java-checks-test-sources/default/src/main/java/checks/MathOnFloatCheckSample.java index b83cb3359ed..f062eeb4096 100644 --- a/java-checks-test-sources/default/src/main/java/checks/MathOnFloatCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/MathOnFloatCheckSample.java @@ -1,6 +1,6 @@ package checks; -class MathOnFloatCheck { +class MathOnFloatCheckSample { void myMethod() { float a = 16777216.0f; diff --git a/java-checks-test-sources/default/src/main/java/checks/MembersDifferOnlyByCapitalizationCheck.java b/java-checks-test-sources/default/src/main/java/checks/MembersDifferOnlyByCapitalizationCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/MembersDifferOnlyByCapitalizationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/MembersDifferOnlyByCapitalizationCheckSample.java index 22227651b3d..dc70fd2f0f3 100644 --- a/java-checks-test-sources/default/src/main/java/checks/MembersDifferOnlyByCapitalizationCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/MembersDifferOnlyByCapitalizationCheckSample.java @@ -1,6 +1,6 @@ package checks; -class MembersDifferOnlyByCapitalizationCheck { +class MembersDifferOnlyByCapitalizationCheckSample { abstract class A implements MyInterface { private static final long var1 = -9215047833775013803L; // Compliant @@ -18,7 +18,7 @@ public void stuff(int i) {} // Noncompliant [[secondary=14]] {{Rename method "st public void foo(int i) {} // Compliant public void foo(boolean i) {} // Compliant - public void myOtherMethoD() {} // Noncompliant [[secondary=41]] {{Rename method "myOtherMethoD" to prevent any misunderstanding/clash with method "myOtherMethod" defined in interface "checks.MembersDifferOnlyByCapitalizationCheck$MyInterface".}} + public void myOtherMethoD() {} // Noncompliant [[secondary=41]] {{Rename method "myOtherMethoD" to prevent any misunderstanding/clash with method "myOtherMethod" defined in interface "checks.MembersDifferOnlyByCapitalizationCheckSample$MyInterface".}} private static void gUl() {} // Noncompliant [[secondary=24]] {{Rename method "gUl" to prevent any misunderstanding/clash with method "gul".}} public void gul() {} // Compliant @@ -48,7 +48,7 @@ abstract class B extends A { public void var2() {}; // Noncompliant [[secondary=7]] public void vAr2() {}; // Noncompliant [[secondary=48]] - public void myMethoD() {} // Noncompliant [[secondary=12]] {{Rename method "myMethoD" to prevent any misunderstanding/clash with method "myMethod" defined in superclass "checks.MembersDifferOnlyByCapitalizationCheck$A".}} + public void myMethoD() {} // Noncompliant [[secondary=12]] {{Rename method "myMethoD" to prevent any misunderstanding/clash with method "myMethod" defined in superclass "checks.MembersDifferOnlyByCapitalizationCheckSample$A".}} public Object qix; // Compliant diff --git a/java-checks-test-sources/default/src/main/java/checks/MethodOnlyCallsSuperCheck.java b/java-checks-test-sources/default/src/main/java/checks/MethodOnlyCallsSuperCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/java/checks/MethodOnlyCallsSuperCheck.java rename to java-checks-test-sources/default/src/main/java/checks/MethodOnlyCallsSuperCheckSample.java index 7069365aa45..e3ae155db20 100644 --- a/java-checks-test-sources/default/src/main/java/checks/MethodOnlyCallsSuperCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/MethodOnlyCallsSuperCheckSample.java @@ -1,6 +1,6 @@ package checks; -class MethodOnlyCallsSuperCheck{ +class MethodOnlyCallsSuperCheckSample{ class ParentA { public void f2() { } public int f255() { return 0; } @@ -205,8 +205,8 @@ protected void bar2() { // Noncompliant } } -class MethodOnlyCallsSuperCheckD { - MethodOnlyCallsSuperCheckD(Object o) {} +class MethodOnlyCallsSuperCheckSampleD { + MethodOnlyCallsSuperCheckSampleD(Object o) {} int foo1() { return 0; } int foo2() { return 0; } @@ -216,8 +216,8 @@ class MethodOnlyCallsSuperCheckD { static int staticMethod() { return 0; } } -class MethodOnlyCallsSuperCheckE extends MethodOnlyCallsSuperCheckD { - MethodOnlyCallsSuperCheckE(Object o) { +class MethodOnlyCallsSuperCheckSampleE extends MethodOnlyCallsSuperCheckSampleD { + MethodOnlyCallsSuperCheckSampleE(Object o) { super(o); } @@ -233,12 +233,12 @@ int foo2() { // Compliant - do not call same method @Override int foo3() { // Compliant - return new MethodOnlyCallsSuperCheckE(new Object()).foo3(); + return new MethodOnlyCallsSuperCheckSampleE(new Object()).foo3(); } @Override int foo4() { // Compliant - return MethodOnlyCallsSuperCheckD.staticMethod(); + return MethodOnlyCallsSuperCheckSampleD.staticMethod(); } @Override diff --git a/java-checks-test-sources/default/src/main/java/checks/MethodWithExcessiveReturnsCheck.java b/java-checks-test-sources/default/src/main/java/checks/MethodWithExcessiveReturnsCheckSample.java similarity index 85% rename from java-checks-test-sources/default/src/main/java/checks/MethodWithExcessiveReturnsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/MethodWithExcessiveReturnsCheckSample.java index bcf62562b21..260ea181728 100644 --- a/java-checks-test-sources/default/src/main/java/checks/MethodWithExcessiveReturnsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/MethodWithExcessiveReturnsCheckSample.java @@ -2,7 +2,7 @@ import java.util.Objects; -class MethodWithExcessiveReturnsCheck { +class MethodWithExcessiveReturnsCheckSample { boolean foo1() { // Compliant if (false) return true; return false; @@ -19,7 +19,7 @@ void foo3() { // Noncompliant {{This method has 4 returns, which is more than th if (false) return; if (false) return; - new MethodWithExcessiveReturnsCheck() { + new MethodWithExcessiveReturnsCheckSample() { public void f() { // Noncompliant [[sc=19;ec=20;secondary=24,25,26,27,28]] {{This method has 5 returns, which is more than the 3 allowed.}} if (false) return; if (false) return; @@ -53,11 +53,11 @@ public boolean equals(Object obj) { // Compliant because equals method is excemp if (getClass() != obj.getClass()) { return false; } - MethodWithExcessiveReturnsCheck other = (MethodWithExcessiveReturnsCheck) obj; + MethodWithExcessiveReturnsCheckSample other = (MethodWithExcessiveReturnsCheckSample) obj; return intMember == other.intMember && Objects.equals(stringMember, other.stringMember); } - public boolean equals(MethodWithExcessiveReturnsCheck obj) { // Noncompliant because this is not a proper equals method + public boolean equals(MethodWithExcessiveReturnsCheckSample obj) { // Noncompliant because this is not a proper equals method if (this == obj) { return true; } diff --git a/java-checks-test-sources/default/src/main/java/checks/MissingDeprecatedCheck.java b/java-checks-test-sources/default/src/main/java/checks/MissingDeprecatedCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/java/checks/MissingDeprecatedCheck.java rename to java-checks-test-sources/default/src/main/java/checks/MissingDeprecatedCheckSample.java index 2cf6fe20c10..cbb24e2315a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/MissingDeprecatedCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/MissingDeprecatedCheckSample.java @@ -3,7 +3,7 @@ import java.lang.reflect.Method; import org.junit.Ignore; -class MissingDeprecatedCheck { +class MissingDeprecatedCheckSample { @Deprecated public int foo; // Noncompliant [[sc=14;ec=17]] {{Add the missing @deprecated Javadoc tag.}} @@ -84,7 +84,7 @@ public int foo11() { // Compliant } -interface MissingDeprecatedCheck_Bar { +interface MissingDeprecatedCheckSample_Bar { @Deprecated int foo(); // Noncompliant @@ -94,7 +94,7 @@ interface MissingDeprecatedCheck_Bar { /** * @deprecated */ -class MissingDeprecatedCheck_Qix { // Noncompliant +class MissingDeprecatedCheckSample_Qix { // Noncompliant /** * @deprecated diff --git a/java-checks-test-sources/default/src/main/java/checks/MissingOverridesInRecordWithArrayComponentCheck.java b/java-checks-test-sources/default/src/main/java/checks/MissingOverridesInRecordWithArrayComponentCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/MissingOverridesInRecordWithArrayComponentCheck.java rename to java-checks-test-sources/default/src/main/java/checks/MissingOverridesInRecordWithArrayComponentCheckSample.java index 469a8d8adc5..0ae52f7b720 100644 --- a/java-checks-test-sources/default/src/main/java/checks/MissingOverridesInRecordWithArrayComponentCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/MissingOverridesInRecordWithArrayComponentCheckSample.java @@ -2,7 +2,7 @@ import java.util.Arrays; -public class MissingOverridesInRecordWithArrayComponentCheck { +public class MissingOverridesInRecordWithArrayComponentCheckSample { record IrrelevantRecord(int value) { // Compliant } diff --git a/java-checks-test-sources/default/src/main/java/checks/ModifiersOrderCheck.java b/java-checks-test-sources/default/src/main/java/checks/ModifiersOrderCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/ModifiersOrderCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ModifiersOrderCheckSample.java index aa2a94e4fc6..5e1c0dcb8e8 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ModifiersOrderCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ModifiersOrderCheckSample.java @@ -3,7 +3,7 @@ import java.util.List; import java.util.Map; -class ModifiersOrderCheck { +class ModifiersOrderCheckSample { public static void main(String[] args) { } diff --git a/java-checks-test-sources/default/src/main/java/checks/ModulusEqualityCheck.java b/java-checks-test-sources/default/src/main/java/checks/ModulusEqualityCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/ModulusEqualityCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ModulusEqualityCheckSample.java index 4c8ea625b9d..9190fd417d8 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ModulusEqualityCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ModulusEqualityCheckSample.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Queue; -class ModulusEqualityCheck { +class ModulusEqualityCheckSample { boolean b; diff --git a/java-checks-test-sources/default/src/main/java/checks/MutableMembersUsageCheck.java b/java-checks-test-sources/default/src/main/java/checks/MutableMembersUsageCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/MutableMembersUsageCheck.java rename to java-checks-test-sources/default/src/main/java/checks/MutableMembersUsageCheckSample.java index 5428f6fc4a4..92426a8319e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/MutableMembersUsageCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/MutableMembersUsageCheckSample.java @@ -9,9 +9,9 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; -import static checks.MutableMembersUsageCheck.CustomImmutableList.staticallyImportedMethod; +import static checks.MutableMembersUsageCheckSample.CustomImmutableList.staticallyImportedMethod; -class MutableMembersUsageCheck { +class MutableMembersUsageCheckSample { private String[] strings; public String[] properties; @@ -120,7 +120,7 @@ public List getAsList() { return AS_LIST; } - public MutableMembersUsageCheck () { + public MutableMembersUsageCheckSample () { strings = new String[]{"first", "second"}; properties = new String[]{"a"}; } @@ -246,10 +246,10 @@ public List foo2() { } } -class MutableMembersUsageCheck2 { +class MutableMembersUsageCheckSample2 { private String [] strings; - public MutableMembersUsageCheck2 () { + public MutableMembersUsageCheckSample2 () { strings = new String[]{"first", "second"}; } @@ -330,7 +330,7 @@ private Hashtable getValuesOK(){ } } -class MutableMembersUsageCheckFields { +class MutableMembersUsageCheckSampleFields { private static final List UNMODIFIABLE = Collections.unmodifiableList(Arrays.asList("A", "B", "C")); private static final List UNMODIFIABLE2; private static final Object UNMODIFIABLE_OBJECT; @@ -433,7 +433,7 @@ public List foo3() { } } -class MutableMembersUsageCheckEmptyArrayExample { +class MutableMembersUsageCheckSampleEmptyArrayExample { private static final int[] EMPTY = new int[0]; private static final int[][][] EMPTY_SEVERAL_DIMS = new int[0][0][0]; @@ -466,7 +466,7 @@ private static int foo() { } } -class MutableMembersUsageCheckCollectionSingleton { +class MutableMembersUsageCheckSampleCollectionSingleton { private final static Set singletonSet = Collections.singleton("Test"); public Set getSet() { @@ -474,16 +474,16 @@ public Set getSet() { } } -class MutableMembersUsageCheckImmutableInsideConstructors { +class MutableMembersUsageCheckSampleImmutableInsideConstructors { private final List list; private final Collection collection; - MutableMembersUsageCheckImmutableInsideConstructors(List list) { + MutableMembersUsageCheckSampleImmutableInsideConstructors(List list) { this.list = Collections.unmodifiableList(list); this.collection = getImmutableCollection(); } - MutableMembersUsageCheckImmutableInsideConstructors(String element) { + MutableMembersUsageCheckSampleImmutableInsideConstructors(String element) { this(Arrays.asList(element)); } diff --git a/java-checks-test-sources/default/src/main/java/checks/NPEThrowCheck.java b/java-checks-test-sources/default/src/main/java/checks/NPEThrowCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/NPEThrowCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NPEThrowCheckSample.java index e4c2b83a2b3..b199a92b117 100644 --- a/java-checks-test-sources/default/src/main/java/checks/NPEThrowCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/NPEThrowCheckSample.java @@ -1,6 +1,6 @@ package checks; -class NPEThrowCheck { +class NPEThrowCheckSample { void foo() throws NullPointerException { // Noncompliant [[sc=21;ec=41]] {{Throw some other exception here, such as "IllegalArgumentException".}} } void bar() { diff --git a/java-checks-test-sources/default/src/main/java/checks/NestedBlocksCheck.java b/java-checks-test-sources/default/src/main/java/checks/NestedBlocksCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/NestedBlocksCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NestedBlocksCheckSample.java index 2a7e1d4cf41..c9ec141e57f 100644 --- a/java-checks-test-sources/default/src/main/java/checks/NestedBlocksCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/NestedBlocksCheckSample.java @@ -1,6 +1,6 @@ package checks; -class NestedBlocksCheck { +class NestedBlocksCheckSample { private void f(String s, boolean b) { if (false) { { // Noncompliant [[sc=7;ec=8]] {{Extract this nested code block into a method.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/NestedIfStatementsCheck.java b/java-checks-test-sources/default/src/main/java/checks/NestedIfStatementsCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/NestedIfStatementsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NestedIfStatementsCheckSample.java index d829a25f090..908e809ca9a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/NestedIfStatementsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/NestedIfStatementsCheckSample.java @@ -1,6 +1,6 @@ package checks; -class NestedIfStatementsCheck { +class NestedIfStatementsCheckSample { private void f(int foo, boolean cond) { if (false) { // Compliant - 1 } diff --git a/java-checks-test-sources/default/src/main/java/checks/NestedSwitchStatementCheck.java b/java-checks-test-sources/default/src/main/java/checks/NestedSwitchStatementCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/java/checks/NestedSwitchStatementCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NestedSwitchStatementCheckSample.java index 279a56aa117..4d6722d1a90 100644 --- a/java-checks-test-sources/default/src/main/java/checks/NestedSwitchStatementCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/NestedSwitchStatementCheckSample.java @@ -2,7 +2,7 @@ import java.util.List; -class NestedSwitchStatementCheck { +class NestedSwitchStatementCheckSample { void foo() { int myVar = 0; switch (myVar) { // Compliant @@ -56,7 +56,7 @@ void foo() { } } -class NestedSwitchStatementCheckB { +class NestedSwitchStatementCheckSampleB { List list; void foo2() { int i = 0; @@ -105,7 +105,7 @@ void foo3(int i) { switch (i) { case 0: case 42: - class NestedSwitchStatementCheckC { // nested class + class NestedSwitchStatementCheckSampleC { // nested class void bar(int j) { switch (j) { // Compliant case 42: @@ -118,7 +118,7 @@ void bar(int j) { } } } - new NestedSwitchStatementCheckC().bar(i); + new NestedSwitchStatementCheckSampleC().bar(i); break; default: break; diff --git a/java-checks-test-sources/default/src/main/java/checks/NestedTernaryOperatorsCheck.java b/java-checks-test-sources/default/src/main/java/checks/NestedTernaryOperatorsCheckSample.java similarity index 78% rename from java-checks-test-sources/default/src/main/java/checks/NestedTernaryOperatorsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NestedTernaryOperatorsCheckSample.java index 0feca5b42da..9825ffbf6af 100644 --- a/java-checks-test-sources/default/src/main/java/checks/NestedTernaryOperatorsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/NestedTernaryOperatorsCheckSample.java @@ -1,6 +1,6 @@ package checks; -class NestedTernaryOperatorsCheck { +class NestedTernaryOperatorsCheckSample { void foo(boolean b) { String res; res = b ? "yo" : "lo"; @@ -9,12 +9,12 @@ void foo(boolean b) { res = b ? "yo" : b ? "lo" : "yolo"; // Noncompliant [[sc=22;ec=39]] res = b ? "yo" : "lo" + (b ? "ba" : "lo"); // Noncompliant [[sc=30;ec=45]] - NestedTernaryOperatorsCheck a = b ? new NestedTernaryOperatorsCheck() { + NestedTernaryOperatorsCheckSample a = b ? new NestedTernaryOperatorsCheckSample() { @Override void foo(boolean arg0) { String res = b ? "yo" : "lo"; // Compliant - not really nested res = b ? "yo" : b ? "lo" : "yolo"; // Noncompliant } - } : new NestedTernaryOperatorsCheck(); + } : new NestedTernaryOperatorsCheckSample(); } } diff --git a/java-checks-test-sources/default/src/main/java/checks/NestedTryCatchCheck.java b/java-checks-test-sources/default/src/main/java/checks/NestedTryCatchCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/NestedTryCatchCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NestedTryCatchCheckSample.java index da2c7e0ee07..97d1dc52721 100644 --- a/java-checks-test-sources/default/src/main/java/checks/NestedTryCatchCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/NestedTryCatchCheckSample.java @@ -3,7 +3,7 @@ import java.io.Closeable; import java.io.IOException; -class NestedTryCatchCheck { +class NestedTryCatchCheckSample { public void f() throws Exception { try { } finally { diff --git a/java-checks-test-sources/default/src/main/java/checks/NoCheckstyleTagPresenceCheck.java b/java-checks-test-sources/default/src/main/java/checks/NoCheckstyleTagPresenceCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/NoCheckstyleTagPresenceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NoCheckstyleTagPresenceCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/NoPmdTagPresenceCheck.java b/java-checks-test-sources/default/src/main/java/checks/NoPmdTagPresenceCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/NoPmdTagPresenceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NoPmdTagPresenceCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/NonStaticClassInitializerCheck.java b/java-checks-test-sources/default/src/main/java/checks/NonStaticClassInitializerCheckSample.java similarity index 79% rename from java-checks-test-sources/default/src/main/java/checks/NonStaticClassInitializerCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NonStaticClassInitializerCheckSample.java index 17bd6976090..f8c0cf5b8bf 100644 --- a/java-checks-test-sources/default/src/main/java/checks/NonStaticClassInitializerCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/NonStaticClassInitializerCheckSample.java @@ -1,6 +1,6 @@ package checks; -class NonStaticClassInitializerCheck { +class NonStaticClassInitializerCheckSample { static { } @@ -8,7 +8,7 @@ class NonStaticClassInitializerCheck { System.out.println(); } - public NonStaticClassInitializerCheck() { + public NonStaticClassInitializerCheckSample() { System.out.println(); new Runnable() { diff --git a/java-checks-test-sources/default/src/main/java/checks/NotifyCheck.java b/java-checks-test-sources/default/src/main/java/checks/NotifyCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/NotifyCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NotifyCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/NullCheckWithInstanceofCheck.java b/java-checks-test-sources/default/src/main/java/checks/NullCheckWithInstanceofCheckSample.java similarity index 76% rename from java-checks-test-sources/default/src/main/java/checks/NullCheckWithInstanceofCheck.java rename to java-checks-test-sources/default/src/main/java/checks/NullCheckWithInstanceofCheckSample.java index cb2f572d1fd..0bc58b1bebe 100644 --- a/java-checks-test-sources/default/src/main/java/checks/NullCheckWithInstanceofCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/NullCheckWithInstanceofCheckSample.java @@ -3,7 +3,7 @@ import java.util.Map; import java.util.Map.Entry; -class NullCheckWithInstanceofCheck { +class NullCheckWithInstanceofCheckSample { private Integer a = 0; Object c = new A(); @@ -28,33 +28,33 @@ void foo1(Object x) { } // coverage - NullCheckWithInstanceofCheck alpha = new NullCheckWithInstanceofCheck(); - if (alpha.a != null && !(alpha instanceof NullCheckWithInstanceofCheck)) { // Compliant + NullCheckWithInstanceofCheckSample alpha = new NullCheckWithInstanceofCheckSample(); + if (alpha.a != null && !(alpha instanceof NullCheckWithInstanceofCheckSample)) { // Compliant } - if (alpha.a == null && (alpha instanceof NullCheckWithInstanceofCheck)) { // Compliant + if (alpha.a == null && (alpha instanceof NullCheckWithInstanceofCheckSample)) { // Compliant } - if (alpha.a == 1 && (alpha instanceof NullCheckWithInstanceofCheck)) { // Compliant + if (alpha.a == 1 && (alpha instanceof NullCheckWithInstanceofCheckSample)) { // Compliant } } - void foo2(NullCheckWithInstanceofCheck a) { - if (a.c == null || a.c instanceof NullCheckWithInstanceofCheck) { // Compliant + void foo2(NullCheckWithInstanceofCheckSample a) { + if (a.c == null || a.c instanceof NullCheckWithInstanceofCheckSample) { // Compliant } else if (a.c != null) { // Compliant - } else if (a != null && a.c instanceof NullCheckWithInstanceofCheck) { // Compliant - } else if (null != a && a instanceof NullCheckWithInstanceofCheck) { // Noncompliant - } else if (null == a || !(a instanceof NullCheckWithInstanceofCheck)) { // Noncompliant [[sc=16;ec=25]] {{Remove this unnecessary null check; "instanceof" returns false for nulls.}} - } else if (a.c != null && a.c instanceof NullCheckWithInstanceofCheck) { // Noncompliant + } else if (a != null && a.c instanceof NullCheckWithInstanceofCheckSample) { // Compliant + } else if (null != a && a instanceof NullCheckWithInstanceofCheckSample) { // Noncompliant + } else if (null == a || !(a instanceof NullCheckWithInstanceofCheckSample)) { // Noncompliant [[sc=16;ec=25]] {{Remove this unnecessary null check; "instanceof" returns false for nulls.}} + } else if (a.c != null && a.c instanceof NullCheckWithInstanceofCheckSample) { // Noncompliant } - while (a != null && a instanceof NullCheckWithInstanceofCheck) { // Noncompliant + while (a != null && a instanceof NullCheckWithInstanceofCheckSample) { // Noncompliant // ... } } - void foo3(NullCheckWithInstanceofCheck a) { + void foo3(NullCheckWithInstanceofCheckSample a) { new Thread() { @Override public void run() { - if (a != null && a instanceof NullCheckWithInstanceofCheck) { // Noncompliant + if (a != null && a instanceof NullCheckWithInstanceofCheckSample) { // Noncompliant System.out.println("blah"); } } diff --git a/java-checks-test-sources/default/src/main/java/checks/ObjectCreatedOnlyToCallGetClassCheck.java b/java-checks-test-sources/default/src/main/java/checks/ObjectCreatedOnlyToCallGetClassCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/ObjectCreatedOnlyToCallGetClassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ObjectCreatedOnlyToCallGetClassCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeCheck.java b/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeCheckSample.java index 690990c9533..71311e6c799 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ObjectFinalizeCheck { +class ObjectFinalizeCheckSample { public static class Foo { int[] finalize; diff --git a/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenCallsSuperFinalizeCheck.java b/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenCallsSuperFinalizeCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenCallsSuperFinalizeCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenCallsSuperFinalizeCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenNotPublicCheck.java b/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenNotPublicCheckSample.java similarity index 71% rename from java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenNotPublicCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenNotPublicCheckSample.java index 2b6ad22053a..aa4aafcaa43 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenNotPublicCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ObjectFinalizeOverridenNotPublicCheckSample.java @@ -1,12 +1,12 @@ package checks; -class ObjectFinalizeOverridenNotPublicCheck_Noncompliant { +class ObjectFinalizeOverridenNotPublicCheckSample_Noncompliant { @Override public void finalize() throws Throwable { // Noncompliant [[sc=15;ec=23]] {{Make this finalize() method protected.}} } } -class ObjectFinalizeOverridenNotPublicCheck_Compliant_1 { +class ObjectFinalizeOverridenNotPublicCheckSample_Compliant_1 { @Override protected void finalize() throws Throwable { // Compliant @@ -21,7 +21,7 @@ abstract class ClassWithFinalize { public abstract void finalize(String arg) throws Throwable; // Compliant } -class ObjectFinalizeOverridenNotPublicCheck_Extends_ClassWithFinalize extends ClassWithFinalize { +class ObjectFinalizeOverridenNotPublicCheckSample_Extends_ClassWithFinalize extends ClassWithFinalize { @Override public void finalize(String arg) throws Throwable { // Compliant diff --git a/java-checks-test-sources/default/src/main/java/checks/OmitPermittedTypesCheck/OmitPermittedTypesCheck.java b/java-checks-test-sources/default/src/main/java/checks/OmitPermittedTypesCheck/OmitPermittedTypesCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/OmitPermittedTypesCheck/OmitPermittedTypesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/OmitPermittedTypesCheck/OmitPermittedTypesCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/OneDeclarationPerLineCheck.java b/java-checks-test-sources/default/src/main/java/checks/OneDeclarationPerLineCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/OneDeclarationPerLineCheck.java rename to java-checks-test-sources/default/src/main/java/checks/OneDeclarationPerLineCheckSample.java index df89d9ab627..dcc191a3862 100644 --- a/java-checks-test-sources/default/src/main/java/checks/OneDeclarationPerLineCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/OneDeclarationPerLineCheckSample.java @@ -2,7 +2,7 @@ import java.util.Collections; -class OneDeclarationPerLineCheck { +class OneDeclarationPerLineCheckSample { interface MyInterface { int a = 1, b = 1; // Noncompliant [[sc=16;ec=17]] {{Declare "b" on a separate line.}} @@ -42,7 +42,7 @@ enum MyEnum { private String s1; // Compliant, only one on the line - OneDeclarationPerLineCheck(){ + OneDeclarationPerLineCheckSample(){ int const1,const2; // Noncompliant {{Declare "const2" on a separate line.}} } diff --git a/java-checks-test-sources/default/src/main/java/checks/OptionalAsParameterCheck.java b/java-checks-test-sources/default/src/main/java/checks/OptionalAsParameterCheckSample.java similarity index 71% rename from java-checks-test-sources/default/src/main/java/checks/OptionalAsParameterCheck.java rename to java-checks-test-sources/default/src/main/java/checks/OptionalAsParameterCheckSample.java index cf95a0208fa..7a467f1aa47 100644 --- a/java-checks-test-sources/default/src/main/java/checks/OptionalAsParameterCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/OptionalAsParameterCheckSample.java @@ -11,19 +11,19 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; -class OptionalAsParameterCheck { +class OptionalAsParameterCheckSample { @GetMapping("/{id}") ResponseEntity getFoo(@PathVariable Optional id, @RequestParam(value = "name") Optional name, @RequestParam(value = "bar") Optional bar) { // Compliant return new ResponseEntity<>(new Foo(), HttpStatus.OK); } - void foo(@Nullable OptionalAsParameterCheck a) {} // Compliant + void foo(@Nullable OptionalAsParameterCheckSample a) {} // Compliant - void foo(Optional a) {} // Noncompliant [[sc=12;ec=46]] {{Specify a "OptionalAsParameterCheck" parameter instead.}} + void foo(Optional a) {} // Noncompliant [[sc=12;ec=52]] {{Specify a "OptionalAsParameterCheckSample" parameter instead.}} void bar(Optional o) {} // Noncompliant [[sc=12;ec=20]] {{Specify a type instead.}} - void foo(com.google.common.base.Optional a) {} // Noncompliant [[sc=12;ec=69]] {{Specify a "OptionalAsParameterCheck" parameter instead.}} + void foo(com.google.common.base.Optional a) {} // Noncompliant [[sc=12;ec=75]] {{Specify a "OptionalAsParameterCheckSample" parameter instead.}} void bar(com.google.common.base.Optional o) {} // Noncompliant [[sc=12;ec=43]] {{Specify a type instead.}} void foo(OptionalInt i) {} // Noncompliant [[sc=12;ec=23]] {{Specify a "int" parameter instead.}} @@ -31,9 +31,9 @@ void foo(@Nullable OptionalAsParameterCheck a) {} // Compliant void foo(OptionalDouble d) {} // Noncompliant [[sc=12;ec=26]] {{Specify a "double" parameter instead.}} } -class Child extends OptionalAsParameterCheck { +class Child extends OptionalAsParameterCheckSample { @Override - void foo(Optional a) {} // Compliant, as this method is overriding. + void foo(Optional a) {} // Compliant, as this method is overriding. void bar(Optional o) {} // Compliant, as this method is overriding. } diff --git a/java-checks-test-sources/default/src/main/java/checks/OutputStreamOverrideWriteCheck.java b/java-checks-test-sources/default/src/main/java/checks/OutputStreamOverrideWriteCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/OutputStreamOverrideWriteCheck.java rename to java-checks-test-sources/default/src/main/java/checks/OutputStreamOverrideWriteCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/PopulateBeansCheck.java b/java-checks-test-sources/default/src/main/java/checks/PopulateBeansCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/PopulateBeansCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PopulateBeansCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/PredictableSeedCheck.java b/java-checks-test-sources/default/src/main/java/checks/PredictableSeedCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/PredictableSeedCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PredictableSeedCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/PreparedStatementAndResultSetCheck.java b/java-checks-test-sources/default/src/main/java/checks/PreparedStatementAndResultSetCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/PreparedStatementAndResultSetCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PreparedStatementAndResultSetCheckSample.java index 8e77e053850..abe7b87fe7c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/PreparedStatementAndResultSetCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/PreparedStatementAndResultSetCheckSample.java @@ -10,7 +10,7 @@ import java.util.HashMap; import java.util.Map; -abstract class PreparedStatementAndResultSetCheck { +abstract class PreparedStatementAndResultSetCheckSample { private static final int INDEX_42 = 42; private static final int INDEX_1 = 1; diff --git a/java-checks-test-sources/default/src/main/java/checks/PrimitiveWrappersInTernaryOperatorCheck.java b/java-checks-test-sources/default/src/main/java/checks/PrimitiveWrappersInTernaryOperatorCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/java/checks/PrimitiveWrappersInTernaryOperatorCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PrimitiveWrappersInTernaryOperatorCheckSample.java index 21f8d5fcfc3..c8f432b2b8d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/PrimitiveWrappersInTernaryOperatorCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/PrimitiveWrappersInTernaryOperatorCheckSample.java @@ -1,6 +1,6 @@ package checks; -class PrimitiveWrappersInTernaryOperatorCheck { +class PrimitiveWrappersInTernaryOperatorCheckSample { void foo() { long l = 123456789123456789L; Integer i1 = 123456789; diff --git a/java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheck.java b/java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheckSample.java index c893ebbe3f4..b1ecccfd69d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheckSample.java @@ -11,7 +11,7 @@ @interface MyCheckForNull { } -abstract class PrimitivesMarkedNullableCheck { +abstract class PrimitivesMarkedNullableCheckSample { @CheckForNull abstract int getInt0(); // Noncompliant [[sc=12;ec=15;secondary=-1]] {{"@CheckForNull" annotation should not be used on primitive types}} @@ -62,7 +62,7 @@ abstract class PrimitivesMarkedNullableCheck { @CheckForNull Object containsAnonymousClass() { - return new PrimitivesMarkedNullableCheckParent() { + return new PrimitivesMarkedNullableCheckSampleParent() { int getInt0() { return 0; } @@ -71,7 +71,7 @@ int getInt0() { } -abstract class PrimitivesMarkedNullableCheckChild extends PrimitivesMarkedNullableCheckParent { +abstract class PrimitivesMarkedNullableCheckSampleChild extends PrimitivesMarkedNullableCheckSampleParent { abstract int getInt0(); // Compliant, not directly marked as CheckForNull, an issue will be on the parent if needed. diff --git a/java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheckParent.java b/java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheckSampleParent.java similarity index 66% rename from java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheckParent.java rename to java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheckSampleParent.java index ff5f99b2fc0..bacfb71c5af 100644 --- a/java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheckParent.java +++ b/java-checks-test-sources/default/src/main/java/checks/PrimitivesMarkedNullableCheckSampleParent.java @@ -2,7 +2,7 @@ import javax.annotation.CheckForNull; -abstract class PrimitivesMarkedNullableCheckParent { +abstract class PrimitivesMarkedNullableCheckSampleParent { @CheckForNull abstract int getInt0(); // Noncompliant diff --git a/java-checks-test-sources/default/src/main/java/checks/PrintfFailCheck.java b/java-checks-test-sources/default/src/main/java/checks/PrintfFailCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/PrintfFailCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PrintfFailCheckSample.java index ff0f0a13726..a1cf736f23a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/PrintfFailCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/PrintfFailCheckSample.java @@ -10,7 +10,7 @@ import java.util.Locale; import java.util.stream.IntStream; -public class PrintfFailCheck { +public class PrintfFailCheckSample { void foo(Calendar c) throws java.io.IOException { Object myObject = new Object(); Object[] objs = new Object[]{14}; diff --git a/java-checks-test-sources/default/src/main/java/checks/PrintfMisuseCheck.java b/java-checks-test-sources/default/src/main/java/checks/PrintfMisuseCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/PrintfMisuseCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PrintfMisuseCheckSample.java index 5b408341790..46913f7de3b 100644 --- a/java-checks-test-sources/default/src/main/java/checks/PrintfMisuseCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/PrintfMisuseCheckSample.java @@ -13,7 +13,7 @@ import java.util.stream.IntStream; import org.apache.logging.log4j.LogManager; -public class PrintfMisuseCheck { +public class PrintfMisuseCheckSample { // used inside the tested file public static final String COMPILE_TIME_CONSTANT = "message"; @@ -322,7 +322,7 @@ void foo(Calendar c) throws IOException { try { } catch (Exception e) { - org.slf4j.LoggerFactory.getLogger(PrintfMisuseCheck.class).error("there is an error", e); + org.slf4j.LoggerFactory.getLogger(PrintfMisuseCheckSample.class).error("there is an error", e); } slf4jLog.info("message {} - {}", 1, 2); diff --git a/java-checks-test-sources/default/src/main/java/checks/PrivateFieldUsedLocallyCheck.java b/java-checks-test-sources/default/src/main/java/checks/PrivateFieldUsedLocallyCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/PrivateFieldUsedLocallyCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PrivateFieldUsedLocallyCheckSample.java index 56f56a69710..e34f55b12f4 100644 --- a/java-checks-test-sources/default/src/main/java/checks/PrivateFieldUsedLocallyCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/PrivateFieldUsedLocallyCheckSample.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Locale; -public class PrivateFieldUsedLocallyCheck { +public class PrivateFieldUsedLocallyCheckSample { class UseLocallyWithThis { diff --git a/java-checks-test-sources/default/src/main/java/checks/PseudoRandomCheck.java b/java-checks-test-sources/default/src/main/java/checks/PseudoRandomCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/PseudoRandomCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PseudoRandomCheckSample.java index c2d5bccd183..45063ac30b6 100644 --- a/java-checks-test-sources/default/src/main/java/checks/PseudoRandomCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/PseudoRandomCheckSample.java @@ -10,7 +10,7 @@ import static org.apache.commons.lang.RandomStringUtils.random; -class PseudoRandomCheck { +class PseudoRandomCheckSample { void fun() { int i = nextInt(); diff --git a/java-checks-test-sources/default/src/main/java/checks/PublicConstructorInAbstractClassCheck.java b/java-checks-test-sources/default/src/main/java/checks/PublicConstructorInAbstractClassCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/PublicConstructorInAbstractClassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PublicConstructorInAbstractClassCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/PublicStaticMutableMembersCheck.java b/java-checks-test-sources/default/src/main/java/checks/PublicStaticMutableMembersCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/java/checks/PublicStaticMutableMembersCheck.java rename to java-checks-test-sources/default/src/main/java/checks/PublicStaticMutableMembersCheckSample.java index 4eb79d498ae..67c9982de49 100644 --- a/java-checks-test-sources/default/src/main/java/checks/PublicStaticMutableMembersCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/PublicStaticMutableMembersCheckSample.java @@ -23,7 +23,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -public class PublicStaticMutableMembersCheck { +public class PublicStaticMutableMembersCheckSample { public static String [] strings1 = {"first","second"}; // Noncompliant [[sc=27;ec=35]] {{Make this member "protected".}} public static String [] strings2 = {"first","second"}; // Noncompliant @@ -113,7 +113,7 @@ public static int getDim() { public static List otherEmptyList = Arrays.asList(); public void changeEmptyList() { emptyList = new ArrayList(); // Noncompliant {{Make member "emptyList" "protected".}} - PublicStaticMutableMembersCheck.otherEmptyList = new ArrayList(); // Noncompliant {{Make member "otherEmptyList" "protected".}} + PublicStaticMutableMembersCheckSample.otherEmptyList = new ArrayList(); // Noncompliant {{Make member "otherEmptyList" "protected".}} } enum E { @@ -180,7 +180,7 @@ private static List customUnmodifiableList() { public static final List AS_LIST = Lists.asList("ABC", new String[] {"", ""}); } -interface PublicStaticMutableMembersCheck_I { +interface PublicStaticMutableMembersCheckSample_I { public static String[] MY_ARRAY = null; // Noncompliant {{Move "MY_ARRAY" to a class and lower its visibility}} public static Collection MY_COLLECTION = null; // Noncompliant {{Move "MY_COLLECTION" to a class and lower its visibility}} public static Collection MY_2ND_COLLECTION = null; // Noncompliant {{Move "MY_2ND_COLLECTION" to a class and lower its visibility}} @@ -188,8 +188,8 @@ interface PublicStaticMutableMembersCheck_I { public static List MY_2ND_LIST = null; // Noncompliant {{Move "MY_2ND_LIST" to a class and lower its visibility}} public static Date MY_DATE = null; // Noncompliant {{Move "MY_DATE" to a class and lower its visibility}} public static int MY_INT = 0; // Compliant - public static PublicStaticMutableMembersCheckB MY_PARAMETRIC_TYPE = null; // Compliant - public static PublicStaticMutableMembersCheckC MY_FIELD = null; // Compliant + public static PublicStaticMutableMembersCheckSampleB MY_PARAMETRIC_TYPE = null; // Compliant + public static PublicStaticMutableMembersCheckSampleC MY_FIELD = null; // Compliant public Collection myCollection = null; // Noncompliant public Collection my2ndCollection = null; // Noncompliant @@ -197,8 +197,8 @@ interface PublicStaticMutableMembersCheck_I { public List my2ndList = null; // Noncompliant public Date myDate = null; // Noncompliant public int myInt = 0; // Compliant - public PublicStaticMutableMembersCheckB myParametricType = null; // Compliant - public PublicStaticMutableMembersCheckC myField = null; // Compliant + public PublicStaticMutableMembersCheckSampleB myParametricType = null; // Compliant + public PublicStaticMutableMembersCheckSampleC myField = null; // Compliant public void doSomething(); // not a field @@ -215,10 +215,10 @@ interface PublicStaticMutableMembersCheck_I { public static final List EMPTY_LIST = Arrays.asList(); } -class PublicStaticMutableMembersCheckB { +class PublicStaticMutableMembersCheckSampleB { } -class PublicStaticMutableMembersCheckC { +class PublicStaticMutableMembersCheckSampleC { } class Java9 { diff --git a/java-checks-test-sources/default/src/main/java/checks/RandomFloatToIntCheck.java b/java-checks-test-sources/default/src/main/java/checks/RandomFloatToIntCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/RandomFloatToIntCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RandomFloatToIntCheckSample.java index f8515a6c22b..d356370d041 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RandomFloatToIntCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RandomFloatToIntCheckSample.java @@ -6,7 +6,7 @@ import org.apache.commons.lang.math.JVMRandom; import org.apache.commons.lang.math.RandomUtils; -class RandomFloatToIntCheck { +class RandomFloatToIntCheckSample { //java.util.Random Random r = new Random(); int rand = (int) r.nextDouble() * 50; // Noncompliant {{Use "nextInt()" instead.}} @@ -17,7 +17,7 @@ class RandomFloatToIntCheck { // java.lang.Math int rand6 = (int) Math.random() * 50; // Noncompliant {{Use "java.util.Random.nextInt()" instead.}} - int rand7 = (int) new RandomFloatToIntCheckFoo() { + int rand7 = (int) new RandomFloatToIntCheckSampleFoo() { int foo() { int a = (int) Math.random() * 50; // Noncompliant return a; @@ -60,6 +60,6 @@ void testLong(){ } -class RandomFloatToIntCheckFoo { +class RandomFloatToIntCheckSampleFoo { } diff --git a/java-checks-test-sources/default/src/main/java/checks/RawByteBitwiseOperationsCheck.java b/java-checks-test-sources/default/src/main/java/checks/RawByteBitwiseOperationsCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/java/checks/RawByteBitwiseOperationsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RawByteBitwiseOperationsCheckSample.java index d07e7a8a4ff..bd669c27367 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RawByteBitwiseOperationsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RawByteBitwiseOperationsCheckSample.java @@ -1,10 +1,10 @@ package checks; -class RawByteBitwiseOperationsCheck { +class RawByteBitwiseOperationsCheckSample { byte b = 100; void foo() { - RawByteBitwiseOperationsCheck a = new RawByteBitwiseOperationsCheck(); + RawByteBitwiseOperationsCheckSample a = new RawByteBitwiseOperationsCheckSample(); int value = 1; long longValue = 1L; byte b = 100; diff --git a/java-checks-test-sources/default/src/main/java/checks/RawExceptionCheck.java b/java-checks-test-sources/default/src/main/java/checks/RawExceptionCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/RawExceptionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RawExceptionCheckSample.java index f118bd786dc..9545a98448a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RawExceptionCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RawExceptionCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class RawExceptionCheck { +public class RawExceptionCheckSample { public void throws_Throwable() throws Throwable { // Noncompliant [[sc=41;ec=50]] throw new Throwable(); // Noncompliant @@ -56,7 +56,7 @@ public void exception() { } } - public RawExceptionCheck() throws + public RawExceptionCheckSample() throws Throwable, // Noncompliant Error, // Noncompliant Exception { // Noncompliant {{Define and throw a dedicated exception instead of using a generic one.}} @@ -79,7 +79,7 @@ void forcedException() throws Exception { // Compliant - Nested() can throw Exce new Nested(); } } -class SubClass extends RawExceptionCheck { +class SubClass extends RawExceptionCheckSample { public SubClass() throws Error, Throwable, diff --git a/java-checks-test-sources/default/src/main/java/checks/RawTypeCheck.java b/java-checks-test-sources/default/src/main/java/checks/RawTypeCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/java/checks/RawTypeCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RawTypeCheckSample.java index 4d87c453289..2486fe374d3 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RawTypeCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RawTypeCheckSample.java @@ -2,17 +2,17 @@ import java.util.Optional; -public class RawTypeCheck { +public class RawTypeCheckSample { void foo() { GenericClass v; // Noncompliant [[sc=5;ec=17]] {{Provide the parametrized type for this generic.}} v = new GenericClass(); // Noncompliant [[sc=13;ec=25]] {{Provide the parametrized type for this generic.}} - v = new RawTypeCheck.GenericClass(); // Noncompliant [[sc=26;ec=38]] + v = new RawTypeCheckSample.GenericClass(); // Noncompliant [[sc=32;ec=44]] v = new GenericClass<>(); // Compliant v = new GenericClass(); // Compliant - RawTypeCheck t; + RawTypeCheckSample t; @SuppressWarnings("rawtypes") Optional o2; // Noncompliant - should be handled by SONARJAVA-2410 and filtered out diff --git a/java-checks-test-sources/default/src/main/java/checks/RecordDuplicatedGetterCheck.java b/java-checks-test-sources/default/src/main/java/checks/RecordDuplicatedGetterCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/RecordDuplicatedGetterCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RecordDuplicatedGetterCheckSample.java index 3eb50a61e2e..73d23c4d138 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RecordDuplicatedGetterCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RecordDuplicatedGetterCheckSample.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Locale; -public class RecordDuplicatedGetterCheck { +public class RecordDuplicatedGetterCheckSample { record Being(String name, int age, double size, int friends, List ancestors, boolean alive, Color color, int tentacles) { diff --git a/java-checks-test-sources/default/src/main/java/checks/RecordInsteadOfClassCheck.java b/java-checks-test-sources/default/src/main/java/checks/RecordInsteadOfClassCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/RecordInsteadOfClassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RecordInsteadOfClassCheckSample.java index 42b846abbe9..efb141bf570 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RecordInsteadOfClassCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RecordInsteadOfClassCheckSample.java @@ -2,7 +2,7 @@ import java.util.Optional; -public class RecordInsteadOfClassCheck { +public class RecordInsteadOfClassCheckSample { public final class DefinitelyFinal { // Noncompliant private final int i; diff --git a/java-checks-test-sources/default/src/main/java/checks/RedundantAbstractMethodCheck.java b/java-checks-test-sources/default/src/main/java/checks/RedundantAbstractMethodCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/RedundantAbstractMethodCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RedundantAbstractMethodCheckSample.java index 857c190b9d9..5cf7968d4fd 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RedundantAbstractMethodCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RedundantAbstractMethodCheckSample.java @@ -1,6 +1,6 @@ package checks; -class RedundantAbstractMethodCheck { +class RedundantAbstractMethodCheckSample { interface I { void foo(); } diff --git a/java-checks-test-sources/default/src/main/java/checks/RedundantCloseCheck.java b/java-checks-test-sources/default/src/main/java/checks/RedundantCloseCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/RedundantCloseCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RedundantCloseCheckSample.java index 908c52f6301..a05ad22a193 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RedundantCloseCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RedundantCloseCheckSample.java @@ -1,6 +1,6 @@ package checks; -abstract class RedundantCloseCheck { +abstract class RedundantCloseCheckSample { final MyCloseable mc3 = new MyCloseable(); void foo(MyCloseable mc2) throws Exception { diff --git a/java-checks-test-sources/default/src/main/java/checks/RedundantModifierCheck.java b/java-checks-test-sources/default/src/main/java/checks/RedundantModifierCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/RedundantModifierCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RedundantModifierCheckSample.java index 0e19d002d40..b98823a9473 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RedundantModifierCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RedundantModifierCheckSample.java @@ -16,7 +16,7 @@ static final class InnerClass {} // Noncompliant {{"static" is redundant in this public final class InnerClass2 {} // Noncompliant {{"public" is redundant in this context.}} } -public @interface RedundantModifierCheck { +public @interface RedundantModifierCheckSample { String method1(); public String method2(); // Noncompliant // Noncompliant@+1 diff --git a/java-checks-test-sources/default/src/main/java/checks/RedundantRecordMethodsCheck.java b/java-checks-test-sources/default/src/main/java/checks/RedundantRecordMethodsCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/RedundantRecordMethodsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RedundantRecordMethodsCheckSample.java index 7dba48897c0..55c9b8d93c7 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RedundantRecordMethodsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RedundantRecordMethodsCheckSample.java @@ -3,7 +3,7 @@ import java.util.Locale; import java.util.Random; -public class RedundantRecordMethodsCheck { +public class RedundantRecordMethodsCheckSample { record RedundantConstructorAndGetters(String name, int age) { static Object variable = null; diff --git a/java-checks-test-sources/default/src/main/java/checks/RedundantThrowsDeclarationCheck.java b/java-checks-test-sources/default/src/main/java/checks/RedundantThrowsDeclarationCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/RedundantThrowsDeclarationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RedundantThrowsDeclarationCheckSample.java index 4809b67dd4d..0e5bf361f31 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RedundantThrowsDeclarationCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RedundantThrowsDeclarationCheckSample.java @@ -3,7 +3,7 @@ import java.io.IOException; import java.text.ParseException; -public class RedundantThrowsDeclarationCheck { +public class RedundantThrowsDeclarationCheckSample { public void foo1() { } @@ -26,7 +26,7 @@ public void foo6() throws IllegalArgumentException { // Compliant public void foo7() throws MyRuntimeException { // Compliant } - public void foo8() throws MyException, Exception { // Noncompliant [[sc=29;ec=40;quickfixes=qf_first]] {{Remove the declaration of thrown exception 'checks.RedundantThrowsDeclarationCheck$MyException' which is a subclass of 'java.lang.Exception'.}} + public void foo8() throws MyException, Exception { // Noncompliant [[sc=29;ec=40;quickfixes=qf_first]] {{Remove the declaration of thrown exception 'checks.RedundantThrowsDeclarationCheckSample$MyException' which is a subclass of 'java.lang.Exception'.}} // fix@qf_first {{Remove "MyException"}} // edit@qf_first [[sc=29;ec=42]] {{}} } @@ -34,13 +34,13 @@ public void foo7() throws MyRuntimeException { // Compliant public void foo9() throws Error, Throwable { // Noncompliant {{Remove the declaration of thrown exception 'java.lang.Error' which is a subclass of 'java.lang.Throwable'.}} } - public void foo11() throws MyException, MyException { // Noncompliant {{Remove the redundant 'checks.RedundantThrowsDeclarationCheck$MyException' thrown exception declaration(s).}} + public void foo11() throws MyException, MyException { // Noncompliant {{Remove the redundant 'checks.RedundantThrowsDeclarationCheckSample$MyException' thrown exception declaration(s).}} } - public void foo12() throws MyException, MyException, Throwable { // Noncompliant {{Remove the declaration of thrown exception 'checks.RedundantThrowsDeclarationCheck$MyException' which is a subclass of 'java.lang.Throwable'.}} + public void foo12() throws MyException, MyException, Throwable { // Noncompliant {{Remove the declaration of thrown exception 'checks.RedundantThrowsDeclarationCheckSample$MyException' which is a subclass of 'java.lang.Throwable'.}} } - public void foo13() throws MyRuntimeException, MyRuntimeException { // Noncompliant {{Remove the redundant 'checks.RedundantThrowsDeclarationCheck$MyRuntimeException' thrown exception declaration(s).}} + public void foo13() throws MyRuntimeException, MyRuntimeException { // Noncompliant {{Remove the redundant 'checks.RedundantThrowsDeclarationCheckSample$MyRuntimeException' thrown exception declaration(s).}} } public void foo14() throws MyRuntimeException, Throwable { // Compliant - being explicit with the runtime diff --git a/java-checks-test-sources/default/src/main/java/checks/RedundantTypeCastCheck.java b/java-checks-test-sources/default/src/main/java/checks/RedundantTypeCastCheckSample.java similarity index 83% rename from java-checks-test-sources/default/src/main/java/checks/RedundantTypeCastCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RedundantTypeCastCheckSample.java index 3dcfb617f54..0cc5172d5ee 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RedundantTypeCastCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RedundantTypeCastCheckSample.java @@ -98,19 +98,19 @@ String[] fun2(){ } } -class RedundantTypeCastCheck_D { +class RedundantTypeCastCheckSample_D { List genericCast() { List objectList = null; return (List) objectList; } } -class RedundantTypeCastCheck_E { +class RedundantTypeCastCheckSample_E { Map> secondTypeChangeCast(Map multimap) { return (Map>) (Map) multimap; // Compliant } - RedundantTypeCastCheck_E> typeChangeCast(RedundantTypeCastCheck_E> list) { - return (RedundantTypeCastCheck_E>) (RedundantTypeCastCheck_E) list; // Compliant + RedundantTypeCastCheckSample_E> typeChangeCast(RedundantTypeCastCheckSample_E> list) { + return (RedundantTypeCastCheckSample_E>) (RedundantTypeCastCheckSample_E) list; // Compliant } } interface Dto {} @@ -127,7 +127,7 @@ public K get(Class clazz){ } -class RedundantTypeCastCheck_F { +class RedundantTypeCastCheckSample_F { class Inner { J fun(T t) { return (J) t; @@ -152,14 +152,14 @@ public java.util.Iterator> iterator() { return null; } } -class RedundantTypeCastCheck_G { +class RedundantTypeCastCheckSample_G { - private RedundantTypeCastCheck_G resolveSupertype() { + private RedundantTypeCastCheckSample_G resolveSupertype() { return null; } void foo() { - RedundantTypeCastCheck_G plop = (RedundantTypeCastCheck_G) resolveSupertype(); // this works but there is an issue in the returned type of resolveSupertype which returns raw type RedundantTypeCastCheck_G instead of RedundantTypeCastCheck_G + RedundantTypeCastCheckSample_G plop = (RedundantTypeCastCheckSample_G) resolveSupertype(); // this works but there is an issue in the returned type of resolveSupertype which returns raw type RedundantTypeCastCheckSample_G instead of RedundantTypeCastCheckSample_G } private int unsafeCompare(Object k1, Object k2) { @@ -221,53 +221,53 @@ void fun() { } } -interface RedundantTypeCastCheck_J { +interface RedundantTypeCastCheckSample_J { default void foo() { } default void bar() { } - interface K extends RedundantTypeCastCheck_J { + interface K extends RedundantTypeCastCheckSample_J { void foo(); } - interface L extends RedundantTypeCastCheck_J { + interface L extends RedundantTypeCastCheckSample_J { void foobar(); } static void test() { - RedundantTypeCastCheck_J j1 = (K) () -> { }; // compliant : cast is needed for it to be used as a lambda expression - RedundantTypeCastCheck_J j2 = (L) () -> { }; // compliant : cast is needed for it to be used as a lambda expression + RedundantTypeCastCheckSample_J j1 = (K) () -> { }; // compliant : cast is needed for it to be used as a lambda expression + RedundantTypeCastCheckSample_J j2 = (L) () -> { }; // compliant : cast is needed for it to be used as a lambda expression } } -interface RedundantTypeCastCheck_M { +interface RedundantTypeCastCheckSample_M { default void foo() { } default void bar() { } void foobar(); - interface N extends RedundantTypeCastCheck_M { + interface N extends RedundantTypeCastCheckSample_M { default void foobar() { } void foo(); } - interface O extends RedundantTypeCastCheck_M { } + interface O extends RedundantTypeCastCheckSample_M { } - interface P extends RedundantTypeCastCheck_M { + interface P extends RedundantTypeCastCheckSample_M { void foobar(); } - interface Q extends RedundantTypeCastCheck_M { + interface Q extends RedundantTypeCastCheckSample_M { default void foo() { } } static void test() { - RedundantTypeCastCheck_M m1 = () -> { }; - RedundantTypeCastCheck_M m2 = (RedundantTypeCastCheck_M) () -> { }; // FN because we now allow all casts on lambdas to avoid FPs - RedundantTypeCastCheck_M m3 = (N) () -> { }; // compliant : cast changes method associated to lambda expression - RedundantTypeCastCheck_M m6 = (Q) () -> { }; // compliant : cast changes default definition of method foo + RedundantTypeCastCheckSample_M m1 = () -> { }; + RedundantTypeCastCheckSample_M m2 = (RedundantTypeCastCheckSample_M) () -> { }; // FN because we now allow all casts on lambdas to avoid FPs + RedundantTypeCastCheckSample_M m3 = (N) () -> { }; // compliant : cast changes method associated to lambda expression + RedundantTypeCastCheckSample_M m6 = (Q) () -> { }; // compliant : cast changes default definition of method foo } } -class RedundantTypeCastCheck_T { +class RedundantTypeCastCheckSample_T { Predicate methodReferenceCastNeeded() { return ((Predicate) Objects::nonNull).negate(); // Compliant : cannot call Predicate#negate() without casting it first } diff --git a/java-checks-test-sources/default/src/main/java/checks/ReflectionOnNonRuntimeAnnotationCheck.java b/java-checks-test-sources/default/src/main/java/checks/ReflectionOnNonRuntimeAnnotationCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/ReflectionOnNonRuntimeAnnotationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ReflectionOnNonRuntimeAnnotationCheckSample.java index 9130e168a4f..10c5764f955 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ReflectionOnNonRuntimeAnnotationCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ReflectionOnNonRuntimeAnnotationCheckSample.java @@ -8,7 +8,7 @@ import static java.lang.annotation.RetentionPolicy.SOURCE; -class ReflectionOnNonRuntimeAnnotationCheck { +class ReflectionOnNonRuntimeAnnotationCheckSample { private Class annotation; void foo(Method m, Class c) { m.isAnnotationPresent(Override.class); // Noncompliant [[sc=27;ec=41]] {{"@Override" is not available at runtime and cannot be seen with reflection.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/RegexPatternsNeedlesslyCheck.java b/java-checks-test-sources/default/src/main/java/checks/RegexPatternsNeedlesslyCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/java/checks/RegexPatternsNeedlesslyCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RegexPatternsNeedlesslyCheckSample.java index 326f0bd88c7..42ddaee746a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RegexPatternsNeedlesslyCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RegexPatternsNeedlesslyCheckSample.java @@ -2,7 +2,7 @@ import java.util.regex.Pattern; -class RegexPatternsNeedlesslyCheck { +class RegexPatternsNeedlesslyCheckSample { private static final String STRCONST = "constant"; private static final String ONE_CHAR_STRCONST = "a"; @@ -29,16 +29,16 @@ void foo(String param) { Pattern.compile(param); Pattern.compile(finalField); // Compliant Pattern.compile(staticNotFinal); // Compliant - Pattern.compile(RegexPatternsNeedlesslyCheck.STRCONST); // Noncompliant + Pattern.compile(RegexPatternsNeedlesslyCheckSample.STRCONST); // Noncompliant Pattern.compile(this.finalField); // Compliant - Pattern.compile(RegexPatternsNeedlesslyCheck.staticNotFinal); // Compliant + Pattern.compile(RegexPatternsNeedlesslyCheckSample.staticNotFinal); // Compliant Pattern regex3 = Pattern.compile(param); // Compliant Pattern regex4 = Pattern.compile(param.toString()); // Compliant param.matches(param); // Compliant param.matches("myRegex2"); // Noncompliant param.matches(STRCONST); // Noncompliant - param.matches(RegexPatternsNeedlesslyCheck.STRCONST); // Noncompliant + param.matches(RegexPatternsNeedlesslyCheckSample.STRCONST); // Noncompliant param.matches(finalField); // Compliant param.matches(staticNotFinal); // Compliant diff --git a/java-checks-test-sources/default/src/main/java/checks/ReplaceGuavaWithJavaCheck.java b/java-checks-test-sources/default/src/main/java/checks/ReplaceGuavaWithJavaCheckSample.java similarity index 75% rename from java-checks-test-sources/default/src/main/java/checks/ReplaceGuavaWithJavaCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ReplaceGuavaWithJavaCheckSample.java index 9f4fadd10ea..a99d7c08b77 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ReplaceGuavaWithJavaCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ReplaceGuavaWithJavaCheckSample.java @@ -6,15 +6,15 @@ import com.google.common.io.Files; import java.io.IOException; -class ReplaceGuavaWithJavaCheck { - ReplaceGuavaWithJavaCheck(com.google.common.base.Predicate p) {} // Noncompliant [[sc=29;ec=61]] {{Use "java.util.function.Predicate" instead.}} - ReplaceGuavaWithJavaCheck(com.google.common.base.Function f) {} // Noncompliant {{Use "java.util.function.Function" instead.}} - ReplaceGuavaWithJavaCheck(com.google.common.base.Supplier s) {} // Noncompliant {{Use "java.util.function.Supplier" instead.}} - ReplaceGuavaWithJavaCheck(com.google.common.base.Optional o) {} // Noncompliant {{Use "java.util.Optional" instead.}} - ReplaceGuavaWithJavaCheck(java.util.function.Predicate p) {} - ReplaceGuavaWithJavaCheck(java.util.function.Function f) {} - ReplaceGuavaWithJavaCheck(java.util.function.Supplier s) {} - ReplaceGuavaWithJavaCheck(java.util.Optional o) {} +class ReplaceGuavaWithJavaCheckSample { + ReplaceGuavaWithJavaCheckSample(com.google.common.base.Predicate p) {} // Noncompliant [[sc=35;ec=67]] {{Use "java.util.function.Predicate" instead.}} + ReplaceGuavaWithJavaCheckSample(com.google.common.base.Function f) {} // Noncompliant {{Use "java.util.function.Function" instead.}} + ReplaceGuavaWithJavaCheckSample(com.google.common.base.Supplier s) {} // Noncompliant {{Use "java.util.function.Supplier" instead.}} + ReplaceGuavaWithJavaCheckSample(com.google.common.base.Optional o) {} // Noncompliant {{Use "java.util.Optional" instead.}} + ReplaceGuavaWithJavaCheckSample(java.util.function.Predicate p) {} + ReplaceGuavaWithJavaCheckSample(java.util.function.Function f) {} + ReplaceGuavaWithJavaCheckSample(java.util.function.Supplier s) {} + ReplaceGuavaWithJavaCheckSample(java.util.Optional o) {} void doX() { com.google.common.base.Predicate p; // Noncompliant {{Use "java.util.function.Predicate" instead.}} com.google.common.base.Function f; // Noncompliant {{Use "java.util.function.Function" instead.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/ReplaceLambdaByMethodRefCheck.java b/java-checks-test-sources/default/src/main/java/checks/ReplaceLambdaByMethodRefCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/ReplaceLambdaByMethodRefCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ReplaceLambdaByMethodRefCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/RestrictedIdentifiersUsageCheck.java b/java-checks-test-sources/default/src/main/java/checks/RestrictedIdentifiersUsageCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/java/checks/RestrictedIdentifiersUsageCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RestrictedIdentifiersUsageCheckSample.java index 1a1f1877ad0..a379923f1c7 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RestrictedIdentifiersUsageCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RestrictedIdentifiersUsageCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class RestrictedIdentifiersUsageCheck { +public class RestrictedIdentifiersUsageCheckSample { void noncompliant() { var var = "var"; // Noncompliant: compiles but this code is confusing diff --git a/java-checks-test-sources/default/src/main/java/checks/ResultSetIsLastCheck.java b/java-checks-test-sources/default/src/main/java/checks/ResultSetIsLastCheckSample.java similarity index 87% rename from java-checks-test-sources/default/src/main/java/checks/ResultSetIsLastCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ResultSetIsLastCheckSample.java index f3f5d647e42..71988a1fb7b 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ResultSetIsLastCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ResultSetIsLastCheckSample.java @@ -2,7 +2,7 @@ import java.sql.ResultSet; -class ResultSetIsLastCheck { +class ResultSetIsLastCheckSample { void foo(ResultSet rs) throws Exception { rs.isLast(); // Noncompliant [[sc=8;ec=14]] {{Remove this call to "isLast()".}} rs.afterLast(); diff --git a/java-checks-test-sources/default/src/main/java/checks/ReturnEmptyArrayNotNullCheck.java b/java-checks-test-sources/default/src/main/java/checks/ReturnEmptyArrayNotNullCheckSample.java similarity index 82% rename from java-checks-test-sources/default/src/main/java/checks/ReturnEmptyArrayNotNullCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ReturnEmptyArrayNotNullCheckSample.java index e1fef47d7fb..ace8a0f2945 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ReturnEmptyArrayNotNullCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ReturnEmptyArrayNotNullCheckSample.java @@ -9,9 +9,9 @@ import javax.annotation.Nullable; import org.springframework.batch.item.ItemProcessor; -class ReturnEmptyArrayNotNullCheckA { +class ReturnEmptyArrayNotNullCheckSampleA { - public ReturnEmptyArrayNotNullCheckA() { + public ReturnEmptyArrayNotNullCheckSampleA() { return; } @@ -32,7 +32,7 @@ public Object f4()[] { } public int[] f5(boolean cond) { - new ReturnEmptyArrayNotNullCheckB() { + new ReturnEmptyArrayNotNullCheckSampleB() { public Object g1() { return null; } @@ -71,7 +71,7 @@ public java.util.Collection f10() { } } -interface ReturnEmptyArrayNotNullCheckB{ +interface ReturnEmptyArrayNotNullCheckSampleB{ default int[] a(){ return null; // Noncompliant } @@ -97,7 +97,7 @@ default int[] f(){ } } -class ReturnEmptyArrayNotNullCheckC { +class ReturnEmptyArrayNotNullCheckSampleC { @SuppressWarnings("Something") public int[] gul() { return null; // Noncompliant @@ -140,7 +140,7 @@ private static Object takeLambda(Function o) { } } -class ReturnEmptyArrayNotNullCheckD implements ItemProcessor> { +class ReturnEmptyArrayNotNullCheckSampleD implements ItemProcessor> { @Override public List process(Integer i) { return null; // Compliant: ItemProcessor requires to return null value to stop the processing @@ -151,18 +151,18 @@ public List process2(Integer i) { } } -interface ReturnEmptyArrayNotNullCheckE { +interface ReturnEmptyArrayNotNullCheckSampleE { List bar(); } -class ReturnEmptyArrayNotNullCheckF implements ReturnEmptyArrayNotNullCheckE { +class ReturnEmptyArrayNotNullCheckSampleF implements ReturnEmptyArrayNotNullCheckSampleE { @Override public List bar() { return null; // Noncompliant } } -class ReturnEmptyArrayNotNullCheckG implements ItemProcessor>, ReturnEmptyArrayNotNullCheckE { +class ReturnEmptyArrayNotNullCheckSampleG implements ItemProcessor>, ReturnEmptyArrayNotNullCheckSampleE { @Override public List bar() { return null; // Noncompliant @@ -174,7 +174,7 @@ public List process(Integer integer) throws Exception { } } -class ReturnEmptyArrayNotNullCheckH implements ItemProcessor { +class ReturnEmptyArrayNotNullCheckSampleH implements ItemProcessor { @Override public Integer[] process(Integer a) { return null; // Compliant diff --git a/java-checks-test-sources/default/src/main/java/checks/ReuseRandomCheck.java b/java-checks-test-sources/default/src/main/java/checks/ReuseRandomCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/ReuseRandomCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ReuseRandomCheckSample.java index 62bf1dc86e6..5c1d59968a5 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ReuseRandomCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ReuseRandomCheckSample.java @@ -2,12 +2,12 @@ import java.util.Random; -public class ReuseRandomCheck { +public class ReuseRandomCheckSample { static Random staticField = new Random(); // Compliant for static field Random field = new Random(); // Compliant for field - ReuseRandomCheck() { + ReuseRandomCheckSample() { Random localVar = new Random(); // Compliant in constructor new Random(); } diff --git a/java-checks-test-sources/default/src/main/java/checks/RightCurlyBraceSameLineAsNextBlockCheck.java b/java-checks-test-sources/default/src/main/java/checks/RightCurlyBraceSameLineAsNextBlockCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/RightCurlyBraceSameLineAsNextBlockCheck.java rename to java-checks-test-sources/default/src/main/java/checks/RightCurlyBraceSameLineAsNextBlockCheckSample.java index 1e1e116d00e..a000e5ef64c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/RightCurlyBraceSameLineAsNextBlockCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/RightCurlyBraceSameLineAsNextBlockCheckSample.java @@ -1,6 +1,6 @@ package checks; -class RightCurlyBraceSameLineAsNextBlockCheck { +class RightCurlyBraceSameLineAsNextBlockCheckSample { public void myMethod(boolean something, boolean somethingElse) { if(something) { executeTask(); diff --git a/java-checks-test-sources/default/src/main/java/checks/S2201_IgnoredReturnValueCheck.java b/java-checks-test-sources/default/src/main/java/checks/S2201_IgnoredReturnValueCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/S2201_IgnoredReturnValueCheck.java rename to java-checks-test-sources/default/src/main/java/checks/S2201_IgnoredReturnValueCheckSample.java index f94300df50c..b32841b29b3 100644 --- a/java-checks-test-sources/default/src/main/java/checks/S2201_IgnoredReturnValueCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/S2201_IgnoredReturnValueCheckSample.java @@ -31,7 +31,7 @@ import java.util.stream.Stream; import org.checkerframework.checker.nullness.qual.Nullable; -class S2201_IgnoredReturnValueCheck { +class S2201_IgnoredReturnValueCheckSample { List list; HashSet set; Map map; @@ -42,8 +42,8 @@ void foo() { int a = intMethod(); //Compliant intMethod(); //Compliant voidMethod(); //Compliant - new S2201_IgnoredReturnValueCheck().intMethod();// Compliant - new S2201_IgnoredReturnValueCheck().voidMethod();// Compliant + new S2201_IgnoredReturnValueCheckSample().intMethod();// Compliant + new S2201_IgnoredReturnValueCheckSample().voidMethod();// Compliant Integer.valueOf("1").byteValue(); // Noncompliant {{The return value of "byteValue" must be used.}} "plop".replace('p', 'b'); // Noncompliant [[sc=12;ec=19]] {{The return value of "replace" must be used.}} new RuntimeException("plop").getStackTrace()[0].getClassName(); // Noncompliant {{The return value of "getClassName" must be used.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/ScheduledThreadPoolExecutorZeroCheck.java b/java-checks-test-sources/default/src/main/java/checks/ScheduledThreadPoolExecutorZeroCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/java/checks/ScheduledThreadPoolExecutorZeroCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ScheduledThreadPoolExecutorZeroCheckSample.java index 58fa0d3bdc3..5541daf81c3 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ScheduledThreadPoolExecutorZeroCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ScheduledThreadPoolExecutorZeroCheckSample.java @@ -2,7 +2,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; -class ScheduledThreadPoolExecutorZeroCheck { +class ScheduledThreadPoolExecutorZeroCheckSample { private static final int POOL_SIZE = 42; public void foo() { ScheduledThreadPoolExecutor stpe1 = new ScheduledThreadPoolExecutor(0); // Noncompliant [[sc=73;ec=74]] {{Increase the "corePoolSize".}} diff --git a/java-checks-test-sources/default/src/main/java/checks/SelfAssignementCheck.java b/java-checks-test-sources/default/src/main/java/checks/SelfAssignementCheckSample.java similarity index 89% rename from java-checks-test-sources/default/src/main/java/checks/SelfAssignementCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SelfAssignementCheckSample.java index 6b1faefcd25..b5a3e7e785b 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SelfAssignementCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SelfAssignementCheckSample.java @@ -1,6 +1,6 @@ package checks; -class SelfAssignementCheck { +class SelfAssignementCheckSample { static int staticField = 0; static { @@ -29,7 +29,7 @@ void method() { b[fun()] = b[fun()]; // Noncompliant } - void method2(SelfAssignementCheck c, int a) { + void method2(SelfAssignementCheckSample c, int a) { this.a = c.a; this.a = a; } @@ -39,13 +39,13 @@ int fun() { } } -class SelfAssignementCheckB { +class SelfAssignementCheckSampleB { static int b; int foo; - class SelfAssignementCheckC { + class SelfAssignementCheckSampleC { void fun() { - SelfAssignementCheckB.b = b; // Noncompliant + SelfAssignementCheckSampleB.b = b; // Noncompliant } } @@ -53,7 +53,7 @@ void setFoo(int foo) { this.foo = foo; } - SelfAssignementCheckB(SelfAssignementCheckB bInstance) { + SelfAssignementCheckSampleB(SelfAssignementCheckSampleB bInstance) { foo = bInstance.foo; } } diff --git a/java-checks-test-sources/default/src/main/java/checks/ServletInstanceFieldCheck.java b/java-checks-test-sources/default/src/main/java/checks/ServletInstanceFieldCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/ServletInstanceFieldCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ServletInstanceFieldCheckSample.java index c9fc62607cd..0a032a46b40 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ServletInstanceFieldCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ServletInstanceFieldCheckSample.java @@ -56,7 +56,7 @@ class HttpServletD extends HttpServlet { private static String staticVar; } -public class ServletInstanceFieldCheck extends HttpServlet { +public class ServletInstanceFieldCheckSample extends HttpServlet { @org.springframework.beans.factory.annotation.Autowired private javax.sql.DataSource myDB; // Noncompliant - filtered by the SpringFilter } diff --git a/java-checks-test-sources/default/src/main/java/checks/ServletMethodsExceptionsThrownCheck.java b/java-checks-test-sources/default/src/main/java/checks/ServletMethodsExceptionsThrownCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/ServletMethodsExceptionsThrownCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ServletMethodsExceptionsThrownCheckSample.java index a71bbc2e164..4748fd08e5c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ServletMethodsExceptionsThrownCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ServletMethodsExceptionsThrownCheckSample.java @@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -class ServletMethodsExceptionsThrownCheck extends HttpServlet { +class ServletMethodsExceptionsThrownCheckSample extends HttpServlet { private static boolean var = staticMethod(); @@ -49,7 +49,7 @@ protected void doPut(HttpServletRequest request, HttpServletResponse response) t } -class JakartaServletMethodsExceptionsThrownCheck extends jakarta.servlet.http.HttpServlet { +class JakartaServletMethodsExceptionsThrownCheckSample extends jakarta.servlet.http.HttpServlet { private static boolean var = staticMethod(); diff --git a/java-checks-test-sources/default/src/main/java/checks/ShiftOnIntOrLongCheck.java b/java-checks-test-sources/default/src/main/java/checks/ShiftOnIntOrLongCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/ShiftOnIntOrLongCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ShiftOnIntOrLongCheckSample.java index e8a4ea4b9fd..eec52a9d23a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ShiftOnIntOrLongCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ShiftOnIntOrLongCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ShiftOnIntOrLongCheck { +class ShiftOnIntOrLongCheckSample { byte value; void ignoreZeroWhenAligned() { diff --git a/java-checks-test-sources/default/src/main/java/checks/SillyEqualsCheck.java b/java-checks-test-sources/default/src/main/java/checks/SillyEqualsCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/SillyEqualsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SillyEqualsCheckSample.java index 8a208a0b30c..527698b0cf2 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SillyEqualsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SillyEqualsCheckSample.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -public class SillyEqualsCheck { +public class SillyEqualsCheckSample { public enum MyEnum1 { VALUE; @@ -26,7 +26,7 @@ public interface Interface { java.io.File file; java.io.Serializable serializable; Interface intf; - SillyEqualsCheck my; + SillyEqualsCheckSample my; MyEnum1 myEnum1; MyEnum2 myEnum2; diff --git a/java-checks-test-sources/default/src/main/java/checks/SillyStringOperationsCheck.java b/java-checks-test-sources/default/src/main/java/checks/SillyStringOperationsCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/SillyStringOperationsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SillyStringOperationsCheckSample.java index 16e4b599ea8..2bfb4bf3f6a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SillyStringOperationsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SillyStringOperationsCheckSample.java @@ -1,6 +1,6 @@ package checks; -class SillyStringOperationsCheck { +class SillyStringOperationsCheckSample { void f(String str, String other, int from, int to) { "".contains("str"); diff --git a/java-checks-test-sources/default/src/main/java/checks/SimpleClassNameCheck.java b/java-checks-test-sources/default/src/main/java/checks/SimpleClassNameCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/SimpleClassNameCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SimpleClassNameCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/SimpleStringLiteralForSingleLineStringsCheck.java b/java-checks-test-sources/default/src/main/java/checks/SimpleStringLiteralForSingleLineStringsCheckSample.java similarity index 89% rename from java-checks-test-sources/default/src/main/java/checks/SimpleStringLiteralForSingleLineStringsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SimpleStringLiteralForSingleLineStringsCheckSample.java index 98c59f44723..8c40d3d60cb 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SimpleStringLiteralForSingleLineStringsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SimpleStringLiteralForSingleLineStringsCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class SimpleStringLiteralForSingleLineStringsCheck { +public class SimpleStringLiteralForSingleLineStringsCheckSample { public void str() { // Noncompliant@+1 [[sc=23;endColumn=43]]{{Use simple literal for a single-line string.}} String question = """ diff --git a/java-checks-test-sources/default/src/main/java/checks/SpecializedFunctionalInterfacesCheck.java b/java-checks-test-sources/default/src/main/java/checks/SpecializedFunctionalInterfacesCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/SpecializedFunctionalInterfacesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SpecializedFunctionalInterfacesCheckSample.java index 31b21749d68..1376447ab34 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SpecializedFunctionalInterfacesCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SpecializedFunctionalInterfacesCheckSample.java @@ -18,7 +18,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -public class SpecializedFunctionalInterfacesCheck { +public class SpecializedFunctionalInterfacesCheckSample { static class A implements Supplier { // Noncompliant [[sc=16;ec=17]] {{Refactor this code to use the more specialised Functional Interface 'IntSupplier'}} @Override diff --git a/java-checks-test-sources/default/src/main/java/checks/StandardCharsetsConstantsCheck.java b/java-checks-test-sources/default/src/main/java/checks/StandardCharsetsConstantsCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/StandardCharsetsConstantsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StandardCharsetsConstantsCheckSample.java index 6eb6509a22a..6b753ca6611 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StandardCharsetsConstantsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StandardCharsetsConstantsCheckSample.java @@ -14,7 +14,7 @@ import java.nio.file.Path; import java.util.Collection; -class StandardCharsetsConstantsCheck { +class StandardCharsetsConstantsCheckSample { private Charset charset; private byte[] bytes; private char[] chars; diff --git a/java-checks-test-sources/default/src/main/java/checks/StaticFieldUpateCheck.java b/java-checks-test-sources/default/src/main/java/checks/StaticFieldUpateCheckSample.java similarity index 89% rename from java-checks-test-sources/default/src/main/java/checks/StaticFieldUpateCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StaticFieldUpateCheckSample.java index 183b2632342..c1d5ed9d85c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StaticFieldUpateCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StaticFieldUpateCheckSample.java @@ -3,7 +3,7 @@ import java.util.function.Consumer; -class StaticFieldUpateCheck { +class StaticFieldUpateCheckSample { public static int staticValue = 0; private static final int CONST = staticValue++; // Compliant private int value; @@ -14,9 +14,9 @@ public void nonCompliantAssignments() { staticValue += value; // Noncompliant {{Make the enclosing method "static" or remove this set.}} staticValue++; // Noncompliant {{Make the enclosing method "static" or remove this set.}} ++staticValue; // Noncompliant {{Make the enclosing method "static" or remove this set.}} - StaticFieldUpateCheck.staticValue++; // Noncompliant {{Make the enclosing method "static" or remove this set.}} + StaticFieldUpateCheckSample.staticValue++; // Noncompliant {{Make the enclosing method "static" or remove this set.}} this.staticValue--; // Noncompliant {{Make the enclosing method "static" or remove this set.}} - StaticFieldUpateCheck myA = new StaticFieldUpateCheck(); + StaticFieldUpateCheckSample myA = new StaticFieldUpateCheckSample(); myA.staticValue = 1; // Noncompliant {{Make the enclosing method "static" or remove this set.}} myA.staticArray[0] = 1; // Noncompliant {{Make the enclosing method "static" or remove this set.}} myA.toString(); @@ -45,7 +45,7 @@ public static void compliantStaticMethod() { public void compliantCode() { value++; // Compliant - StaticFieldUpateCheck myA = new StaticFieldUpateCheck(); + StaticFieldUpateCheckSample myA = new StaticFieldUpateCheckSample(); myA.value = value++; // Compliant int variable; @@ -58,7 +58,7 @@ public void compliantCode() { } } -class StaticFieldUpateCheckB { +class StaticFieldUpateCheckSampleB { private static int value; private static Comparable myComparator; diff --git a/java-checks-test-sources/default/src/main/java/checks/StaticFieldUpdateInConstructorCheck.java b/java-checks-test-sources/default/src/main/java/checks/StaticFieldUpdateInConstructorCheckSample.java similarity index 70% rename from java-checks-test-sources/default/src/main/java/checks/StaticFieldUpdateInConstructorCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StaticFieldUpdateInConstructorCheckSample.java index 3c53c086c4e..5af605d98af 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StaticFieldUpdateInConstructorCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StaticFieldUpdateInConstructorCheckSample.java @@ -1,15 +1,15 @@ package checks; -class StaticFieldUpdateInConstructorCheck { +class StaticFieldUpdateInConstructorCheckSample { String field; static String staticField; static String[] words = {"yolo", "fun"}; static int value = 14; - StaticFieldUpdateInConstructorCheck() { + StaticFieldUpdateInConstructorCheckSample() { field = "world"; // Compliant staticField = "hello"; // Noncompliant [[sc=5;ec=16;secondary=5]] {{Remove this assignment of "staticField".}} - StaticFieldUpdateInConstructorCheck.staticField = "again"; // Noncompliant [[sc=41;ec=52;secondary=5]] {{Remove this assignment of "staticField".}} + StaticFieldUpdateInConstructorCheckSample.staticField = "again"; // Noncompliant [[sc=47;ec=58;secondary=5]] {{Remove this assignment of "staticField".}} words[0] = "noFun"; // Noncompliant [[sc=5;ec=10;secondary=6]] {{Remove this assignment of "words".}} value = 42; // Noncompliant [[sc=5;ec=10;secondary=7]] {{Remove this assignment of "value".}} value += 1; // Noncompliant [[sc=5;ec=10;secondary=7]] {{Remove this assignment of "value".}} @@ -22,17 +22,17 @@ class StaticFieldUpdateInConstructorCheck { getA().field = "beer"; // Compliant getA().staticField = "garden"; // Noncompliant - (StaticFieldUpdateInConstructorCheck.staticField) = "hello"; // Noncompliant + (StaticFieldUpdateInConstructorCheckSample.staticField) = "hello"; // Noncompliant (words)[1] = "polo"; // Noncompliant - StaticFieldUpdateInConstructorCheck.values()[1] = 14; // Compliant + StaticFieldUpdateInConstructorCheckSample.values()[1] = 14; // Compliant synchronized (new Object()) { field = "reworld"; // Compliant - synchronized block } } - static StaticFieldUpdateInConstructorCheck getA() { + static StaticFieldUpdateInConstructorCheckSample getA() { return null; } diff --git a/java-checks-test-sources/default/src/main/java/checks/StaticMembersAccessCheck.java b/java-checks-test-sources/default/src/main/java/checks/StaticMembersAccessCheck.java deleted file mode 100644 index e19577df57e..00000000000 --- a/java-checks-test-sources/default/src/main/java/checks/StaticMembersAccessCheck.java +++ /dev/null @@ -1,92 +0,0 @@ -package checks; - -import java.nio.file.Path; -import java.nio.file.Paths; - -class StaticMembersAccessCheckA { - public static int counter = 0; - public int nonStaticCounter = 0; - public StaticMembersAccessCheckC c = new StaticMembersAccessCheckC(); - public StaticMembersAccessCheckD d = new StaticMembersAccessCheckD(); - public class StaticMembersAccessCheckC { - public int counter = 0; - public StaticMembersAccessCheckD d = new StaticMembersAccessCheckD(); - } - public static class StaticMembersAccessCheckD { - public static int counter = 0; - public static class StaticMembersAccessCheckE { - public static int counter = 0; - } - } - public static int method() { - return 0; - } - public StaticMembersAccessCheckD d() { - return d; - } -} - -class StaticMembersAccessCheckB { - private StaticMembersAccessCheckA first = new StaticMembersAccessCheckA(); - private StaticMembersAccessCheckA second = new StaticMembersAccessCheckA(); - private StaticMembersAccessCheckA.StaticMembersAccessCheckD third = new StaticMembersAccessCheckA.StaticMembersAccessCheckD(); - - public StaticMembersAccessCheckA.StaticMembersAccessCheckD d() { - return third; - } - - public void noncompliant() { - first.counter ++; // Noncompliant [[sc=5;ec=10;quickfixes=qf1]] {{Change this instance-reference to a static reference.}} - // fix@qf1 {{Replace "first" by "StaticMembersAccessCheckA"}} - // edit@qf1 [[sc=5;ec=10]] {{StaticMembersAccessCheckA}} - second.counter ++; // Noncompliant - second.method(); // Noncompliant [[sc=5;ec=11;quickfixes=qf2]] - // fix@qf2 {{Replace "second" by "StaticMembersAccessCheckA"}} - // edit@qf2 [[sc=5;ec=11]] {{StaticMembersAccessCheckA}} - third.counter ++; // Noncompliant - first.d.counter++; // Noncompliant - first.c.d.counter++; // Noncompliant [[sc=5;ec=14;quickfixes=qf3]] - // fix@qf3 {{Replace the expression by "StaticMembersAccessCheckD"}} - // edit@qf3 [[sc=5;ec=14]] {{StaticMembersAccessCheckD}} - first.d().counter++; // Noncompliant [[sc=5;ec=14;quickfixes=qf4]] - // fix@qf4 {{Replace the expression by "StaticMembersAccessCheckD"}} - // edit@qf4 [[sc=5;ec=14]] {{StaticMembersAccessCheckD}} - d().counter++; // Noncompliant - // Noncompliant@+1 [[sc=5;el=+3;ec=6;quickfixes=qf5]] - ( - (StaticMembersAccessCheckA.StaticMembersAccessCheckD) d() - ).counter++; - // fix@qf5 {{Replace the expression by "StaticMembersAccessCheckD"}} - // edit@qf5 [[sc=5;el=+2;ec=6]] {{StaticMembersAccessCheckD}} - (d()).counter++; // Noncompliant - StaticMembersAccessCheckA.StaticMembersAccessCheckD[] darray = new StaticMembersAccessCheckA.StaticMembersAccessCheckD[1]; - darray[0].counter++; // Noncompliant [[sc=5;ec=14;quickfixes=qf6]] - // fix@qf6 {{Replace the expression by "StaticMembersAccessCheckD"}} - // edit@qf6 [[sc=5;ec=14]] {{StaticMembersAccessCheckD}} - Path path = Paths.get("abc"); - char separator = path.toFile().separatorChar; // Noncompliant [[sc=22;ec=35;quickfixes=qf7]] - // fix@qf7 {{Replace the expression by "File"}} - // edit@qf7 [[sc=22;ec=35]] {{File}} - // edit@qf7 [[sl=3;sc=1;el=3;ec=1]] {{import java.io.File;\n}} - } - - public void compliant() { - StaticMembersAccessCheckA.counter ++; - StaticMembersAccessCheckA.StaticMembersAccessCheckD.counter ++; - StaticMembersAccessCheckA.StaticMembersAccessCheckD.StaticMembersAccessCheckE.counter ++; - first.nonStaticCounter ++; - first.c.counter ++; - } -} -abstract class StaticMembersAccessCheckTest { - - void test(java.util.function.Supplier s) { - this.call(Object::new); - this.call(() -> new Object()); - this.call(s); - } - - static void call(java.util.Set o) {} - - abstract void call(java.util.function.Supplier supplier); -} diff --git a/java-checks-test-sources/default/src/main/java/checks/StaticMembersAccessCheckSample.java b/java-checks-test-sources/default/src/main/java/checks/StaticMembersAccessCheckSample.java new file mode 100644 index 00000000000..6973aaacea4 --- /dev/null +++ b/java-checks-test-sources/default/src/main/java/checks/StaticMembersAccessCheckSample.java @@ -0,0 +1,92 @@ +package checks; + +import java.nio.file.Path; +import java.nio.file.Paths; + +class StaticMembersAccessCheckSampleA { + public static int counter = 0; + public int nonStaticCounter = 0; + public StaticMembersAccessCheckSampleC c = new StaticMembersAccessCheckSampleC(); + public StaticMembersAccessCheckSampleD d = new StaticMembersAccessCheckSampleD(); + public class StaticMembersAccessCheckSampleC { + public int counter = 0; + public StaticMembersAccessCheckSampleD d = new StaticMembersAccessCheckSampleD(); + } + public static class StaticMembersAccessCheckSampleD { + public static int counter = 0; + public static class StaticMembersAccessCheckSampleE { + public static int counter = 0; + } + } + public static int method() { + return 0; + } + public StaticMembersAccessCheckSampleD d() { + return d; + } +} + +class StaticMembersAccessCheckSampleB { + private StaticMembersAccessCheckSampleA first = new StaticMembersAccessCheckSampleA(); + private StaticMembersAccessCheckSampleA second = new StaticMembersAccessCheckSampleA(); + private StaticMembersAccessCheckSampleA.StaticMembersAccessCheckSampleD third = new StaticMembersAccessCheckSampleA.StaticMembersAccessCheckSampleD(); + + public StaticMembersAccessCheckSampleA.StaticMembersAccessCheckSampleD d() { + return third; + } + + public void noncompliant() { + first.counter ++; // Noncompliant [[sc=5;ec=10;quickfixes=qf1]] {{Change this instance-reference to a static reference.}} + // fix@qf1 {{Replace "first" by "StaticMembersAccessCheckSampleA"}} + // edit@qf1 [[sc=5;ec=10]] {{StaticMembersAccessCheckSampleA}} + second.counter ++; // Noncompliant + second.method(); // Noncompliant [[sc=5;ec=11;quickfixes=qf2]] + // fix@qf2 {{Replace "second" by "StaticMembersAccessCheckSampleA"}} + // edit@qf2 [[sc=5;ec=11]] {{StaticMembersAccessCheckSampleA}} + third.counter ++; // Noncompliant + first.d.counter++; // Noncompliant + first.c.d.counter++; // Noncompliant [[sc=5;ec=14;quickfixes=qf3]] + // fix@qf3 {{Replace the expression by "StaticMembersAccessCheckSampleD"}} + // edit@qf3 [[sc=5;ec=14]] {{StaticMembersAccessCheckSampleD}} + first.d().counter++; // Noncompliant [[sc=5;ec=14;quickfixes=qf4]] + // fix@qf4 {{Replace the expression by "StaticMembersAccessCheckSampleD"}} + // edit@qf4 [[sc=5;ec=14]] {{StaticMembersAccessCheckSampleD}} + d().counter++; // Noncompliant + // Noncompliant@+1 [[sc=5;el=+3;ec=6;quickfixes=qf5]] + ( + (StaticMembersAccessCheckSampleA.StaticMembersAccessCheckSampleD) d() + ).counter++; + // fix@qf5 {{Replace the expression by "StaticMembersAccessCheckSampleD"}} + // edit@qf5 [[sc=5;el=+2;ec=6]] {{StaticMembersAccessCheckSampleD}} + (d()).counter++; // Noncompliant + StaticMembersAccessCheckSampleA.StaticMembersAccessCheckSampleD[] darray = new StaticMembersAccessCheckSampleA.StaticMembersAccessCheckSampleD[1]; + darray[0].counter++; // Noncompliant [[sc=5;ec=14;quickfixes=qf6]] + // fix@qf6 {{Replace the expression by "StaticMembersAccessCheckSampleD"}} + // edit@qf6 [[sc=5;ec=14]] {{StaticMembersAccessCheckSampleD}} + Path path = Paths.get("abc"); + char separator = path.toFile().separatorChar; // Noncompliant [[sc=22;ec=35;quickfixes=qf7]] + // fix@qf7 {{Replace the expression by "File"}} + // edit@qf7 [[sc=22;ec=35]] {{File}} + // edit@qf7 [[sl=3;sc=1;el=3;ec=1]] {{import java.io.File;\n}} + } + + public void compliant() { + StaticMembersAccessCheckSampleA.counter ++; + StaticMembersAccessCheckSampleA.StaticMembersAccessCheckSampleD.counter ++; + StaticMembersAccessCheckSampleA.StaticMembersAccessCheckSampleD.StaticMembersAccessCheckSampleE.counter ++; + first.nonStaticCounter ++; + first.c.counter ++; + } +} +abstract class StaticMembersAccessCheckSampleTest { + + void test(java.util.function.Supplier s) { + this.call(Object::new); + this.call(() -> new Object()); + this.call(s); + } + + static void call(java.util.Set o) {} + + abstract void call(java.util.function.Supplier supplier); +} diff --git a/java-checks-test-sources/default/src/main/java/checks/StaticMethodCheck.java b/java-checks-test-sources/default/src/main/java/checks/StaticMethodCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/StaticMethodCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StaticMethodCheckSample.java index bf7acdde8df..9745778e1ad 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StaticMethodCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StaticMethodCheckSample.java @@ -311,7 +311,7 @@ final SomeEnum getOne() { } } -class StaticMethodCheckQuickFix { +class StaticMethodCheckSampleQuickFix { private static String magicWord = "magic"; private String getMagicWord() { // Noncompliant [[sc=18;ec=30;quickfixes=qf_private]] diff --git a/java-checks-test-sources/default/src/main/java/checks/StreamPeekCheck.java b/java-checks-test-sources/default/src/main/java/checks/StreamPeekCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/StreamPeekCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StreamPeekCheckSample.java index 3340813971b..84a34296a86 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StreamPeekCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StreamPeekCheckSample.java @@ -5,7 +5,7 @@ import java.util.stream.LongStream; import java.util.stream.Stream; -class StreamPeekCheck { +class StreamPeekCheckSample { void foo(){ Stream.of("one", "two", "three", "four") .filter(e -> e.length() > 3) diff --git a/java-checks-test-sources/default/src/main/java/checks/StringBufferAndBuilderWithCharCheck.java b/java-checks-test-sources/default/src/main/java/checks/StringBufferAndBuilderWithCharCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/main/java/checks/StringBufferAndBuilderWithCharCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StringBufferAndBuilderWithCharCheckSample.java index 3637ea03442..e359e7d100b 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StringBufferAndBuilderWithCharCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StringBufferAndBuilderWithCharCheckSample.java @@ -1,6 +1,6 @@ package checks; -class StringBufferAndBuilderWithCharCheck { +class StringBufferAndBuilderWithCharCheckSample { public void f() { StringBuffer foo = new java.lang.StringBuffer('x'); // Noncompliant [[sc=51;ec=54]] {{Replace the constructor character parameter 'x' with string parameter "x".}} diff --git a/java-checks-test-sources/default/src/main/java/checks/StringConcatToTextBlockCheck.java b/java-checks-test-sources/default/src/main/java/checks/StringConcatToTextBlockCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/StringConcatToTextBlockCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StringConcatToTextBlockCheckSample.java index 62dfd05ea1a..4b49cf76508 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StringConcatToTextBlockCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StringConcatToTextBlockCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class StringConcatToTextBlockCheck { +public class StringConcatToTextBlockCheckSample { private static final int SOME_INT = 5; diff --git a/java-checks-test-sources/default/src/main/java/checks/StringConcatenationInLoopCheck.java b/java-checks-test-sources/default/src/main/java/checks/StringConcatenationInLoopCheckSample.java similarity index 86% rename from java-checks-test-sources/default/src/main/java/checks/StringConcatenationInLoopCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StringConcatenationInLoopCheckSample.java index 1c7b6601138..5da6dfddf53 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StringConcatenationInLoopCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StringConcatenationInLoopCheckSample.java @@ -1,6 +1,6 @@ package checks; -class StringConcatenationInLoopCheck { +class StringConcatenationInLoopCheckSample { static class Inner { public String s1; @@ -48,8 +48,8 @@ void method(String[] array, java.util.List list) { } } - StringConcatenationInLoopCheck[] foo() { - return new StringConcatenationInLoopCheck[0]; + StringConcatenationInLoopCheckSample[] foo() { + return new StringConcatenationInLoopCheckSample[0]; } static class MyObject { @@ -60,12 +60,12 @@ static MyObject newInstance() { } } - void foo(StringConcatenationInLoopCheck p, Object o) { + void foo(StringConcatenationInLoopCheckSample p, Object o) { while (true) { (this).field += "abc"; // Noncompliant (p = this).field += "abc"; // not supported... unclear how to handle it - ((StringConcatenationInLoopCheck) o).field += "abc"; // not supported... unclear how to handle it + ((StringConcatenationInLoopCheckSample) o).field += "abc"; // not supported... unclear how to handle it } } } diff --git a/java-checks-test-sources/default/src/main/java/checks/StringLiteralDuplicatedCheck.java b/java-checks-test-sources/default/src/main/java/checks/StringLiteralDuplicatedCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/StringLiteralDuplicatedCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StringLiteralDuplicatedCheckSample.java index 045a5cc5fe7..0bee87c8efe 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StringLiteralDuplicatedCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StringLiteralDuplicatedCheckSample.java @@ -2,7 +2,7 @@ import javax.annotation.Nullable; -public class StringLiteralDuplicatedCheck { +public class StringLiteralDuplicatedCheckSample { public void f() { System.out.println("aaaaa"); diff --git a/java-checks-test-sources/default/src/main/java/checks/StringLiteralInsideEqualsCheck.java b/java-checks-test-sources/default/src/main/java/checks/StringLiteralInsideEqualsCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/StringLiteralInsideEqualsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StringLiteralInsideEqualsCheckSample.java index f6bfafcb515..f4d8a94ff04 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StringLiteralInsideEqualsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StringLiteralInsideEqualsCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class StringLiteralInsideEqualsCheck { +public class StringLiteralInsideEqualsCheckSample { public String foo(String param, String foo, String bar) { foo.equals("qux"); // Noncompliant [[sc=16;ec=21]] {{Move the "qux" string literal on the left side of this string comparison.}} @@ -31,7 +31,7 @@ class Covrg { } } -class StringLiteralInsideEqualsCheckQF{ +class StringLiteralInsideEqualsCheckSampleQF{ void goo(String foooo) { foooo.equals("bar"); // Noncompliant [[sc=18;ec=23;quickfixes=qf1]] // fix@qf1 {{Move "bar" on the left side of .equals}} diff --git a/java-checks-test-sources/default/src/main/java/checks/StringMethodsWithLocaleCheck.java b/java-checks-test-sources/default/src/main/java/checks/StringMethodsWithLocaleCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/StringMethodsWithLocaleCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StringMethodsWithLocaleCheckSample.java index 67cf9fb3301..ebbde22efe9 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StringMethodsWithLocaleCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StringMethodsWithLocaleCheckSample.java @@ -2,7 +2,7 @@ import static java.lang.String.format; -class StringMethodsWithLocaleCheck { +class StringMethodsWithLocaleCheckSample { private static final String MY_TEMPLATE = "%t"; diff --git a/java-checks-test-sources/default/src/main/java/checks/StringOffsetMethodsCheck.java b/java-checks-test-sources/default/src/main/java/checks/StringOffsetMethodsCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/StringOffsetMethodsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StringOffsetMethodsCheckSample.java index 707f4d7b20a..2857e8baa95 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StringOffsetMethodsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StringOffsetMethodsCheckSample.java @@ -1,6 +1,6 @@ package checks; -class StringOffsetMethodsCheck { +class StringOffsetMethodsCheckSample { String field; void test(String str, char char1, int beginIndex, String str2) { str.substring(beginIndex).indexOf(char1); // Noncompliant [[sc=9;ec=45]] {{Replace "indexOf" with the overload that accepts an offset parameter.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/StringPrimitiveConstructorCheck.java b/java-checks-test-sources/default/src/main/java/checks/StringPrimitiveConstructorCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/StringPrimitiveConstructorCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StringPrimitiveConstructorCheckSample.java index 259b9ae4e64..0659f77b380 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StringPrimitiveConstructorCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StringPrimitiveConstructorCheckSample.java @@ -3,7 +3,7 @@ import java.math.BigDecimal; import java.math.BigInteger; -class StringPrimitiveConstructorCheck { +class StringPrimitiveConstructorCheckSample { void bar(char[] chars, String str) { String empty = new String(); // Noncompliant [[sc=24;ec=30]] {{Remove this "String" constructor}} diff --git a/java-checks-test-sources/default/src/main/java/checks/StringToPrimitiveConversionCheck.java b/java-checks-test-sources/default/src/main/java/checks/StringToPrimitiveConversionCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/StringToPrimitiveConversionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StringToPrimitiveConversionCheckSample.java index f66228e62a8..af0710ed1f2 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StringToPrimitiveConversionCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StringToPrimitiveConversionCheckSample.java @@ -2,7 +2,7 @@ import static java.lang.Integer.MAX_VALUE; -class StringToPrimitiveConversionCheck { +class StringToPrimitiveConversionCheckSample { void ints(Integer integerParam) { int i1 = new Integer("42").intValue(); // Noncompliant [[sc=14;ec=31]] {{Use "Integer.parseInt" for this string-to-int conversion.}} new Integer("42").intValue(); // Noncompliant diff --git a/java-checks-test-sources/default/src/main/java/checks/StrongCipherAlgorithmCheck.java b/java-checks-test-sources/default/src/main/java/checks/StrongCipherAlgorithmCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/StrongCipherAlgorithmCheck.java rename to java-checks-test-sources/default/src/main/java/checks/StrongCipherAlgorithmCheckSample.java index 80ba9a52d2a..33c5456e1da 100644 --- a/java-checks-test-sources/default/src/main/java/checks/StrongCipherAlgorithmCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/StrongCipherAlgorithmCheckSample.java @@ -12,7 +12,7 @@ public MyCipher() { } } -class StrongCipherAlgorithmCheck { +class StrongCipherAlgorithmCheckSample { private final static String DES = "DES"; void foo() throws NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException { diff --git a/java-checks-test-sources/default/src/main/java/checks/SubClassStaticReferenceCheck.java b/java-checks-test-sources/default/src/main/java/checks/SubClassStaticReferenceCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/SubClassStaticReferenceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SubClassStaticReferenceCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/SwitchCaseTooBigCheck.java b/java-checks-test-sources/default/src/main/java/checks/SwitchCaseTooBigCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/SwitchCaseTooBigCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SwitchCaseTooBigCheckSample.java index 83cf5ae22c3..eafcacfdaae 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SwitchCaseTooBigCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SwitchCaseTooBigCheckSample.java @@ -1,6 +1,6 @@ package checks; -class SwitchCaseTooBigCheck { +class SwitchCaseTooBigCheckSample { void f(int myVariable) { switch (myVariable) { case 0: diff --git a/java-checks-test-sources/default/src/main/java/checks/SwitchCasesShouldBeCommaSeparatedCheck.java b/java-checks-test-sources/default/src/main/java/checks/SwitchCasesShouldBeCommaSeparatedCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/SwitchCasesShouldBeCommaSeparatedCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SwitchCasesShouldBeCommaSeparatedCheckSample.java index 063a25f5382..128fb3bf78e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SwitchCasesShouldBeCommaSeparatedCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SwitchCasesShouldBeCommaSeparatedCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class SwitchCasesShouldBeCommaSeparatedCheck { +public class SwitchCasesShouldBeCommaSeparatedCheckSample { public void nonCompliant(String mode) { // Switch Statement diff --git a/java-checks-test-sources/default/src/main/java/checks/SwitchDefaultLastCaseCheck.java b/java-checks-test-sources/default/src/main/java/checks/SwitchDefaultLastCaseCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/SwitchDefaultLastCaseCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SwitchDefaultLastCaseCheckSample.java index c833b42e574..1166f634864 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SwitchDefaultLastCaseCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SwitchDefaultLastCaseCheckSample.java @@ -1,6 +1,6 @@ package checks; -class SwitchDefaultLastCaseCheck { +class SwitchDefaultLastCaseCheckSample { void foo() { switch (0) { diff --git a/java-checks-test-sources/default/src/main/java/checks/SwitchInsteadOfIfSequenceCheck.java b/java-checks-test-sources/default/src/main/java/checks/SwitchInsteadOfIfSequenceCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/SwitchInsteadOfIfSequenceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SwitchInsteadOfIfSequenceCheckSample.java index 50144a73015..667c5dceee5 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SwitchInsteadOfIfSequenceCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SwitchInsteadOfIfSequenceCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class SwitchInsteadOfIfSequenceCheck { +public class SwitchInsteadOfIfSequenceCheckSample { String choice; String choice2; Object choice3; diff --git a/java-checks-test-sources/default/src/main/java/checks/SwitchLastCaseIsDefaultCheck.java b/java-checks-test-sources/default/src/main/java/checks/SwitchLastCaseIsDefaultCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/SwitchLastCaseIsDefaultCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SwitchLastCaseIsDefaultCheckSample.java index 1f260810c4a..194f95a4b4c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SwitchLastCaseIsDefaultCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SwitchLastCaseIsDefaultCheckSample.java @@ -2,7 +2,7 @@ import java.time.DayOfWeek; -class SwitchLastCaseIsDefaultCheck { +class SwitchLastCaseIsDefaultCheckSample { void foo(MyEnum myEnum, DayOfWeek dow) { switch (myEnum) { // Compliant diff --git a/java-checks-test-sources/default/src/main/java/checks/SwitchRedundantKeywordCheck.java b/java-checks-test-sources/default/src/main/java/checks/SwitchRedundantKeywordCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/SwitchRedundantKeywordCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SwitchRedundantKeywordCheckSample.java index e95f2b15a0d..9b2437c81b9 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SwitchRedundantKeywordCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SwitchRedundantKeywordCheckSample.java @@ -1,6 +1,6 @@ package checks; -public class SwitchRedundantKeywordCheck { +public class SwitchRedundantKeywordCheckSample { int switchExpression(String mode) { int nonCompliant = switch (mode) { diff --git a/java-checks-test-sources/default/src/main/java/checks/SwitchWithLabelsCheck.java b/java-checks-test-sources/default/src/main/java/checks/SwitchWithLabelsCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/SwitchWithLabelsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SwitchWithLabelsCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/SwitchWithTooManyCasesCheck.java b/java-checks-test-sources/default/src/main/java/checks/SwitchWithTooManyCasesCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/SwitchWithTooManyCasesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SwitchWithTooManyCasesCheckSample.java index e750bc6d64d..c8cb6dfc728 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SwitchWithTooManyCasesCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SwitchWithTooManyCasesCheckSample.java @@ -1,6 +1,6 @@ package checks; -class SwitchWithTooManyCasesCheck { +class SwitchWithTooManyCasesCheckSample { void foo() { switch (1) { // Noncompliant [[sc=5;ec=11]] {{Reduce the number of non-empty switch cases from 35 to at most 30.}} case 1: diff --git a/java-checks-test-sources/default/src/main/java/checks/SyncGetterAndSetterCheck.java b/java-checks-test-sources/default/src/main/java/checks/SyncGetterAndSetterCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/SyncGetterAndSetterCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SyncGetterAndSetterCheckSample.java index bed8a78d36e..357b7dde765 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SyncGetterAndSetterCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SyncGetterAndSetterCheckSample.java @@ -1,6 +1,6 @@ package checks; -public abstract class SyncGetterAndSetterCheck { +public abstract class SyncGetterAndSetterCheckSample { String name; int age; String address; @@ -71,7 +71,7 @@ public synchronized int getAge(int age) { // not a getter } } -class SyncGetterAndSetterCheck2 { +class SyncGetterAndSetterCheckSample2 { String name; int age; boolean old; diff --git a/java-checks-test-sources/default/src/main/java/checks/SynchronizationOnStringOrBoxedCheck.java b/java-checks-test-sources/default/src/main/java/checks/SynchronizationOnStringOrBoxedCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/SynchronizationOnStringOrBoxedCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SynchronizationOnStringOrBoxedCheckSample.java index 96c34b85665..cb7957c06b0 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SynchronizationOnStringOrBoxedCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SynchronizationOnStringOrBoxedCheckSample.java @@ -7,7 +7,7 @@ import java.util.OptionalInt; import java.util.OptionalLong; -public class SynchronizationOnStringOrBoxedCheck { +public class SynchronizationOnStringOrBoxedCheckSample { private final Boolean bLock = Boolean.FALSE; private final Integer iLock = Integer.valueOf(0); diff --git a/java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageByAPICheck.java b/java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageByAPICheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageByAPICheck.java rename to java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageByAPICheckSample.java index 0805d446328..0f99c09b95d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageByAPICheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageByAPICheckSample.java @@ -11,7 +11,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -class SynchronizedClassUsageByAPICheck { +class SynchronizedClassUsageByAPICheckSample { class Foo { diff --git a/java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageCheck.java b/java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageCheckSample.java index 30a67ca70d2..38e25d0c4d4 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SynchronizedClassUsageCheckSample.java @@ -9,9 +9,9 @@ import java.util.Stack; // Compliant import java.util.Vector; // Compliant -public class SynchronizedClassUsageCheck { +public class SynchronizedClassUsageCheckSample { - public SynchronizedClassUsageCheck() {} + public SynchronizedClassUsageCheckSample() {} interface IA { // Noncompliant@+2 {{Replace the synchronized class "Vector" by an unsynchronized one such as "ArrayList" or "LinkedList".}} diff --git a/java-checks-test-sources/default/src/main/java/checks/SynchronizedLockCheck.java b/java-checks-test-sources/default/src/main/java/checks/SynchronizedLockCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/SynchronizedLockCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SynchronizedLockCheckSample.java index 2d073cfbd42..fd773387b47 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SynchronizedLockCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SynchronizedLockCheckSample.java @@ -4,7 +4,7 @@ import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; -class SynchronizedLockCheck { +class SynchronizedLockCheckSample { void foo() { Lock lock = new MyLockImpl(); synchronized (lock) { // Noncompliant [[sc=19;ec=23]] {{Synchronize on this "Lock" object using "acquire/release".}} diff --git a/java-checks-test-sources/default/src/main/java/checks/SynchronizedOverrideCheck.java b/java-checks-test-sources/default/src/main/java/checks/SynchronizedOverrideCheckSample.java similarity index 69% rename from java-checks-test-sources/default/src/main/java/checks/SynchronizedOverrideCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SynchronizedOverrideCheckSample.java index 2f260267b95..fbb0a12f4d6 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SynchronizedOverrideCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SynchronizedOverrideCheckSample.java @@ -1,12 +1,12 @@ package checks; -class SynchronizedOverrideCheck { +class SynchronizedOverrideCheckSample { public synchronized void f1(){} public void f2(){} public synchronized void f3(){} } -class SynchronizedOverrideCheck_B extends SynchronizedOverrideCheck { +class SynchronizedOverrideCheckSample_B extends SynchronizedOverrideCheckSample { @Override public void f1(){} // Noncompliant [[sc=15;ec=17]] {{Make this method "synchronized" to match the parent class implementation.}} @@ -16,12 +16,12 @@ public void f2(){} // Compliant public void f3(){} // Noncompliant [[secondary=6]] {{Make this method "synchronized" to match the parent class implementation.}} } -class SynchronizedOverrideCheck_C extends SynchronizedOverrideCheck_B { +class SynchronizedOverrideCheckSample_C extends SynchronizedOverrideCheckSample_B { @Override public void f1(){} // Compliant } -class SynchronizedOverrideCheck_D extends java.lang.Throwable { +class SynchronizedOverrideCheckSample_D extends java.lang.Throwable { @Override public Throwable getCause() { return null; } // Noncompliant {{Make this method "synchronized" to match the parent class implementation.}} } diff --git a/java-checks-test-sources/default/src/main/java/checks/SystemOutOrErrUsageCheck.java b/java-checks-test-sources/default/src/main/java/checks/SystemOutOrErrUsageCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/SystemOutOrErrUsageCheck.java rename to java-checks-test-sources/default/src/main/java/checks/SystemOutOrErrUsageCheckSample.java index 47be5b79f20..447145f52ca 100644 --- a/java-checks-test-sources/default/src/main/java/checks/SystemOutOrErrUsageCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/SystemOutOrErrUsageCheckSample.java @@ -2,7 +2,7 @@ import java.io.PrintStream; -class SystemOutOrErrUsageCheck { +class SystemOutOrErrUsageCheckSample { void f() { System.out.println(""); // Noncompliant {{Replace this use of System.out by a logger.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/TextBlocksInComplexExpressionsCheck.java b/java-checks-test-sources/default/src/main/java/checks/TextBlocksInComplexExpressionsCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/TextBlocksInComplexExpressionsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TextBlocksInComplexExpressionsCheckSample.java index 87b4db2c454..42304baeed2 100644 --- a/java-checks-test-sources/default/src/main/java/checks/TextBlocksInComplexExpressionsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/TextBlocksInComplexExpressionsCheckSample.java @@ -3,7 +3,7 @@ import java.util.List; import java.util.function.Supplier; -class TextBlocksInComplexExpressionsCheck { +class TextBlocksInComplexExpressionsCheckSample { // Compliant Supplier supplier = () -> """ diff --git a/java-checks-test-sources/default/src/main/java/checks/ThreadAsRunnableArgumentCheck.java b/java-checks-test-sources/default/src/main/java/checks/ThreadAsRunnableArgumentCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/ThreadAsRunnableArgumentCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ThreadAsRunnableArgumentCheckSample.java index 22a911b7228..795eacbc611 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ThreadAsRunnableArgumentCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ThreadAsRunnableArgumentCheckSample.java @@ -2,9 +2,9 @@ import java.util.function.Supplier; -class ThreadAsRunnableArgumentCheck { +class ThreadAsRunnableArgumentCheckSample { - ThreadAsRunnableArgumentCheck (int i) { + ThreadAsRunnableArgumentCheckSample (int i) { } public void foo() { @@ -24,7 +24,7 @@ public void run() { }; new Thread(r).start(); // Compliant - new ThreadAsRunnableArgumentCheck (0); + new ThreadAsRunnableArgumentCheckSample (0); MyClass m = new MyClass(myThread); // Noncompliant m.foo(myThread); // Noncompliant diff --git a/java-checks-test-sources/default/src/main/java/checks/ThreadOverridesRunCheck.java b/java-checks-test-sources/default/src/main/java/checks/ThreadOverridesRunCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/ThreadOverridesRunCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ThreadOverridesRunCheckSample.java index 07e8398f45f..a94cc70a5a8 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ThreadOverridesRunCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ThreadOverridesRunCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ThreadOverridesRunCheck { +class ThreadOverridesRunCheckSample { class A extends Thread{ // Noncompliant [[sc=7;ec=8]] {{Don't extend "Thread", since the "run" method is not overridden.}} int run; diff --git a/java-checks-test-sources/default/src/main/java/checks/ThreadRunCheck.java b/java-checks-test-sources/default/src/main/java/checks/ThreadRunCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/ThreadRunCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ThreadRunCheckSample.java index 5c2fcee4073..3ccfb4850ce 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ThreadRunCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ThreadRunCheckSample.java @@ -2,7 +2,7 @@ import java.io.Serializable; -class ThreadRunCheck { +class ThreadRunCheckSample { { Thread t = new Thread(new B()); diff --git a/java-checks-test-sources/default/src/main/java/checks/ThreadSleepCheck.java b/java-checks-test-sources/default/src/main/java/checks/ThreadSleepCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/ThreadSleepCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ThreadSleepCheckSample.java index a4b08604ef7..d5bf9305c76 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ThreadSleepCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ThreadSleepCheckSample.java @@ -3,7 +3,7 @@ import java.util.Random; import java.util.function.Consumer; -class ThreadSleepCheck { +class ThreadSleepCheckSample { class A { Object monitor; diff --git a/java-checks-test-sources/default/src/main/java/checks/ThreadWaitCallCheck.java b/java-checks-test-sources/default/src/main/java/checks/ThreadWaitCallCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/ThreadWaitCallCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ThreadWaitCallCheckSample.java index 22f12365323..24ad1044933 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ThreadWaitCallCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ThreadWaitCallCheckSample.java @@ -3,7 +3,7 @@ import java.lang.Override; import java.lang.Thread; -class ThreadWaitCallCheck { +class ThreadWaitCallCheckSample { void foo() throws InterruptedException { new A().wait(); diff --git a/java-checks-test-sources/default/src/main/java/checks/ThrowsFromFinallyCheck.java b/java-checks-test-sources/default/src/main/java/checks/ThrowsFromFinallyCheckSample.java similarity index 89% rename from java-checks-test-sources/default/src/main/java/checks/ThrowsFromFinallyCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ThrowsFromFinallyCheckSample.java index a95841336a0..5506c2f8744 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ThrowsFromFinallyCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ThrowsFromFinallyCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ThrowsFromFinallyCheck { +class ThrowsFromFinallyCheckSample { { if (foo()) { @@ -8,7 +8,7 @@ class ThrowsFromFinallyCheck { } } - public ThrowsFromFinallyCheck() { + public ThrowsFromFinallyCheckSample() { throw new IllegalAccessError(); } @@ -40,7 +40,7 @@ public void g() { throw new IllegalAccessError(); // Noncompliant } - new ThrowsFromFinallyCheck() { + new ThrowsFromFinallyCheckSample() { public void f() { throw new IllegalAccessError(); } diff --git a/java-checks-test-sources/default/src/main/java/checks/ToArrayCheck.java b/java-checks-test-sources/default/src/main/java/checks/ToArrayCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/ToArrayCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ToArrayCheckSample.java index 1a9d4fdf415..63e7a81a6de 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ToArrayCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ToArrayCheckSample.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Set; -class ToArrayCheck { +class ToArrayCheckSample { Object[] foo(List listOfString, List listOfNumber, Set rawSet, Collection col) { String[] a1 = (String[]) listOfString.toArray(); // Noncompliant [[sc=30;ec=52;quickfixes=qf1]] {{Pass "new String[0]" as argument to "toArray".}} // fix@qf1 {{Pass "new String[0]" as argument}} diff --git a/java-checks-test-sources/default/src/main/java/checks/ToStringReturningNullCheck.java b/java-checks-test-sources/default/src/main/java/checks/ToStringReturningNullCheckSample.java similarity index 87% rename from java-checks-test-sources/default/src/main/java/checks/ToStringReturningNullCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ToStringReturningNullCheckSample.java index db5019ed373..63dface90eb 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ToStringReturningNullCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ToStringReturningNullCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ToStringReturningNullCheck { +class ToStringReturningNullCheckSample { public String toString() { return ""; } @@ -12,19 +12,19 @@ public String notToString() { } } -class ToStringReturningNullCheckB { +class ToStringReturningNullCheckSampleB { public String toString() { return null; // Noncompliant {{Return empty string instead.}} } } -class ToStringReturningNullCheckC { +class ToStringReturningNullCheckSampleC { public String toString() { return (null); // Noncompliant [[sc=13;ec=17]] } } -class ToStringReturningNullCheckD { +class ToStringReturningNullCheckSampleD { protected Object clone() { return null; // Noncompliant [[sc=12;ec=16;quickfixes=!]] {{Return a non null object.}} } diff --git a/java-checks-test-sources/default/src/main/java/checks/ToStringUsingBoxingCheck.java b/java-checks-test-sources/default/src/main/java/checks/ToStringUsingBoxingCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/ToStringUsingBoxingCheck.java rename to java-checks-test-sources/default/src/main/java/checks/ToStringUsingBoxingCheckSample.java index 8d0be01aa55..d20f9cd6c3e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/ToStringUsingBoxingCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/ToStringUsingBoxingCheckSample.java @@ -1,6 +1,6 @@ package checks; -class ToStringUsingBoxingCheck { +class ToStringUsingBoxingCheckSample { private void f() { new Byte((byte) 12).toString(); // Noncompliant [[sc=5;ec=35]] {{Call the static method Byte.toString(...) instead of instantiating a temporary object.}} new Short((short) 0).toString(); // Noncompliant {{Call the static method Short.toString(...) instead of instantiating a temporary object.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/TodoTagPresenceCheck.java b/java-checks-test-sources/default/src/main/java/checks/TodoTagPresenceCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/TodoTagPresenceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TodoTagPresenceCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/TooManyMethodsCheck.java b/java-checks-test-sources/default/src/main/java/checks/TooManyMethodsCheckSample.java similarity index 54% rename from java-checks-test-sources/default/src/main/java/checks/TooManyMethodsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TooManyMethodsCheckSample.java index 2ae329d63b9..261673e1e14 100644 --- a/java-checks-test-sources/default/src/main/java/checks/TooManyMethodsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/TooManyMethodsCheckSample.java @@ -1,7 +1,7 @@ package checks; -class TooManyMethodsCheck { // Noncompliant [[sc=7;ec=26;secondary=+1,+2,+3,+4,+5,+6]] {{class "TooManyMethodsCheck" has 6 methods, which is greater than the 4 authorized. Split it into smaller classes.}} - TooManyMethodsCheck () {} +class TooManyMethodsCheckSample { // Noncompliant [[sc=7;ec=32;secondary=+1,+2,+3,+4,+5,+6]] {{class "TooManyMethodsCheckSample" has 6 methods, which is greater than the 4 authorized. Split it into smaller classes.}} + TooManyMethodsCheckSample () {} void method1() {} public void method2() {} void method3() {} @@ -18,15 +18,15 @@ void m4() {} void m5() {} } -class TooManyMethodsCheckA { +class TooManyMethodsCheckSampleA { void method1() {} public void method2() {} void method3() {} public void method4() {} } -enum TooManyMethodsCheckB { // Noncompliant {{enum "TooManyMethodsCheckB" has 5 methods, which is greater than the 4 authorized. Split it into smaller enums.}} - TooManyMethodsCheckA; +enum TooManyMethodsCheckSampleB { // Noncompliant {{enum "TooManyMethodsCheckSampleB" has 5 methods, which is greater than the 4 authorized. Split it into smaller enums.}} + TooManyMethodsCheckSampleA; void method1() {} public void method2() {} void method3() {} @@ -34,7 +34,7 @@ public void method4() {} public void method5() {} } -interface TooManyMethodsCheckC { // Noncompliant {{interface "TooManyMethodsCheckC" has 5 methods, which is greater than the 4 authorized. Split it into smaller interfaces.}} +interface TooManyMethodsCheckSampleC { // Noncompliant {{interface "TooManyMethodsCheckSampleC" has 5 methods, which is greater than the 4 authorized. Split it into smaller interfaces.}} void method1(); void method2(); void method3(); @@ -42,8 +42,8 @@ interface TooManyMethodsCheckC { // Noncompliant {{interface "TooManyMethodsChec void method5(); } -class TooManyMethodsCheckE { - TooManyMethodsCheckC c = new TooManyMethodsCheckC() { // Noncompliant {{Anonymous class "TooManyMethodsCheckC" has 10 methods, which is greater than the 4 authorized. Split it into smaller classes.}} +class TooManyMethodsCheckSampleE { + TooManyMethodsCheckSampleC c = new TooManyMethodsCheckSampleC() { // Noncompliant {{Anonymous class "TooManyMethodsCheckSampleC" has 10 methods, which is greater than the 4 authorized. Split it into smaller classes.}} @Override public void method1() {} @Override public void method2() {} public void method3() {} // override, but without annotation @@ -56,7 +56,7 @@ public void method9() {} public void method10() {} }; - TooManyMethodsCheckC c2 = new TooManyMethodsCheckC() { // compliant : only overriden methods, some without annotation + TooManyMethodsCheckSampleC c2 = new TooManyMethodsCheckSampleC() { // compliant : only overriden methods, some without annotation /* @Override */ public void method1() {} /* @Override */ public void method2() {} @Override public void method3() {} @@ -65,7 +65,7 @@ public void method10() {} }; } -@interface TooManyMethodsCheckD { // Noncompliant {{interface "TooManyMethodsCheckD" has 5 methods, which is greater than the 4 authorized. Split it into smaller interfaces.}} +@interface TooManyMethodsCheckSampleD { // Noncompliant {{interface "TooManyMethodsCheckSampleD" has 5 methods, which is greater than the 4 authorized. Split it into smaller interfaces.}} String method1(); public String method2(); String method3(); diff --git a/java-checks-test-sources/default/src/main/java/checks/TooManyParametersCheck.java b/java-checks-test-sources/default/src/main/java/checks/TooManyParametersCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/java/checks/TooManyParametersCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TooManyParametersCheckSample.java index f4579e4078a..d3405a52cdd 100644 --- a/java-checks-test-sources/default/src/main/java/checks/TooManyParametersCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/TooManyParametersCheckSample.java @@ -12,8 +12,8 @@ import java.lang.annotation.ElementType; import java.lang.annotation.Target; -public class TooManyParametersCheck { - TooManyParametersCheck(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) { // Noncompliant {{Constructor has 8 parameters, which is greater than 7 authorized.}} +public class TooManyParametersCheckSample { + TooManyParametersCheckSample(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) { // Noncompliant {{Constructor has 8 parameters, which is greater than 7 authorized.}} } void method(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) { // Noncompliant [[sc=8;ec=14]] {{Method has 8 parameters, which is greater than 7 authorized.}} @@ -27,7 +27,7 @@ static void staticMethod(int p1, int p2, int p3, int p4, int p5, int p6, int p7, void customAnnotatedMethod(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {} // Noncompliant } -class TooManyParametersExtended extends TooManyParametersCheck { +class TooManyParametersExtended extends TooManyParametersCheckSample { TooManyParametersExtended(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) { super(p1, p2, p3, p4, p5, p6, p7, p8); } diff --git a/java-checks-test-sources/default/src/main/java/checks/TrailingCommentCheck.java b/java-checks-test-sources/default/src/main/java/checks/TrailingCommentCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/TrailingCommentCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TrailingCommentCheckSample.java index 89bfbd46be6..cd8d573ca5f 100644 --- a/java-checks-test-sources/default/src/main/java/checks/TrailingCommentCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/TrailingCommentCheckSample.java @@ -1,6 +1,6 @@ package checks; -class TrailingCommentCheck { +class TrailingCommentCheckSample { int i = 0, j = 0, // Noncompliant {{Move this trailing comment on the previous empty line.}} k = 0; diff --git a/java-checks-test-sources/default/src/main/java/checks/TransientFieldInNonSerializableCheck.java b/java-checks-test-sources/default/src/main/java/checks/TransientFieldInNonSerializableCheckSample.java similarity index 85% rename from java-checks-test-sources/default/src/main/java/checks/TransientFieldInNonSerializableCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TransientFieldInNonSerializableCheckSample.java index 92466536ca3..8cd7cc284cc 100644 --- a/java-checks-test-sources/default/src/main/java/checks/TransientFieldInNonSerializableCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/TransientFieldInNonSerializableCheckSample.java @@ -2,7 +2,7 @@ import java.io.Serializable; -class TransientFieldInNonSerializableCheck { +class TransientFieldInNonSerializableCheckSample { class A implements Serializable { transient String x; diff --git a/java-checks-test-sources/default/src/main/java/checks/TryWithResourcesCheck.java b/java-checks-test-sources/default/src/main/java/checks/TryWithResourcesCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/TryWithResourcesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TryWithResourcesCheckSample.java index edf458a9a30..9d5c256b42e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/TryWithResourcesCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/TryWithResourcesCheckSample.java @@ -4,7 +4,7 @@ import java.io.FileReader; import java.io.IOException; -class TryWithResourcesCheck { +class TryWithResourcesCheckSample { String foo(String fileName) { FileReader fr = null; BufferedReader br = null; diff --git a/java-checks-test-sources/default/src/main/java/checks/TwoLocksWaitCheck.java b/java-checks-test-sources/default/src/main/java/checks/TwoLocksWaitCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/java/checks/TwoLocksWaitCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TwoLocksWaitCheckSample.java index 5de48a1e410..273d68294be 100644 --- a/java-checks-test-sources/default/src/main/java/checks/TwoLocksWaitCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/TwoLocksWaitCheckSample.java @@ -1,10 +1,10 @@ package checks; -class TwoLocksWaitCheck { +class TwoLocksWaitCheckSample { Object mon1; Object mon2; - public TwoLocksWaitCheck() throws Exception { + public TwoLocksWaitCheckSample() throws Exception { synchronized (this.mon1) { System.out.println("Hello"); synchronized (this.mon2) { diff --git a/java-checks-test-sources/default/src/main/java/checks/TypeParametersShadowingCheck.java b/java-checks-test-sources/default/src/main/java/checks/TypeParametersShadowingCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/TypeParametersShadowingCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TypeParametersShadowingCheckSample.java index f8b0c5783ce..b1673b636f1 100644 --- a/java-checks-test-sources/default/src/main/java/checks/TypeParametersShadowingCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/TypeParametersShadowingCheckSample.java @@ -3,7 +3,7 @@ import java.util.List; import java.util.function.Function; -public class TypeParametersShadowingCheck { +public class TypeParametersShadowingCheckSample { class TypeParameterHidesAnotherType { public class Inner { // Noncompliant [[sc=24;ec=25;secondary=-1]] {{Rename "T" which hides a type parameter from the outer scope.}} //... diff --git a/java-checks-test-sources/default/src/main/java/checks/TypeUpperBoundNotFinalCheck.java b/java-checks-test-sources/default/src/main/java/checks/TypeUpperBoundNotFinalCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/TypeUpperBoundNotFinalCheck.java rename to java-checks-test-sources/default/src/main/java/checks/TypeUpperBoundNotFinalCheckSample.java index 888ee0ce312..c5672b9a9ae 100644 --- a/java-checks-test-sources/default/src/main/java/checks/TypeUpperBoundNotFinalCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/TypeUpperBoundNotFinalCheckSample.java @@ -8,7 +8,7 @@ import java.util.Set; import javax.annotation.Nullable; -public class TypeUpperBoundNotFinalCheck { +public class TypeUpperBoundNotFinalCheckSample { public static class NonExtendableTypeParam { } // Noncompliant {{Replace this type parametrization by the 'final' type `FinalClass`.}} public static void methodTypeParameter() { } // Noncompliant diff --git a/java-checks-test-sources/default/src/main/java/checks/naming/BooleanMethodNameCheck.java b/java-checks-test-sources/default/src/main/java/checks/naming/BooleanMethodNameCheckSample.java similarity index 76% rename from java-checks-test-sources/default/src/main/java/checks/naming/BooleanMethodNameCheck.java rename to java-checks-test-sources/default/src/main/java/checks/naming/BooleanMethodNameCheckSample.java index d8ff9ddabf3..0d7b6f5ed7c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/naming/BooleanMethodNameCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/naming/BooleanMethodNameCheckSample.java @@ -1,6 +1,6 @@ package checks.naming; -class BooleanMethodNameCheck { +class BooleanMethodNameCheckSample { boolean foo() { return true; } // Compliant boolean getFoo() { return true; } // Noncompliant {{Rename this method to start with "is" or "has".}} boolean isFoo() { return true; } // Compliant @@ -11,12 +11,12 @@ class BooleanMethodNameCheck { int bar() { return 0; } } -class BooleanMethodNameCheckB extends BooleanMethodNameCheck implements BooleanMethodNameCheckI { +class BooleanMethodNameCheckSampleB extends BooleanMethodNameCheckSample implements BooleanMethodNameCheckSampleI { @Override boolean foo() { return false; } // Compliant - overrides are not taken into account public boolean getOk() { return false; } // Compliant - overrides are not taken into account (even without the annotation) } -interface BooleanMethodNameCheckI { +interface BooleanMethodNameCheckSampleI { boolean getOk(); // Noncompliant } diff --git a/java-checks-test-sources/default/src/main/java/checks/naming/FieldNameMatchingTypeNameCheck.java b/java-checks-test-sources/default/src/main/java/checks/naming/FieldNameMatchingTypeNameCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/naming/FieldNameMatchingTypeNameCheck.java rename to java-checks-test-sources/default/src/main/java/checks/naming/FieldNameMatchingTypeNameCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/naming/MethodNamedHashcodeOrEqualCheck.java b/java-checks-test-sources/default/src/main/java/checks/naming/MethodNamedHashcodeOrEqualCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/naming/MethodNamedHashcodeOrEqualCheck.java rename to java-checks-test-sources/default/src/main/java/checks/naming/MethodNamedHashcodeOrEqualCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/AbstractRegexCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/AbstractRegexCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/regex/AbstractRegexCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/AbstractRegexCheckSample.java index 76d7c622750..00d30fe3118 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/AbstractRegexCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/AbstractRegexCheckSample.java @@ -5,7 +5,7 @@ import javax.validation.constraints.Pattern.Flag; import org.apache.commons.lang3.RegExUtils; -public abstract class AbstractRegexCheck { +public abstract class AbstractRegexCheckSample { public static final String CONST = "const"; diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/AnchorPrecedenceCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/AnchorPrecedenceCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/regex/AnchorPrecedenceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/AnchorPrecedenceCheckSample.java index e2b8f2025ea..e729f34479d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/AnchorPrecedenceCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/AnchorPrecedenceCheckSample.java @@ -2,7 +2,7 @@ import javax.validation.constraints.Email; -public class AnchorPrecedenceCheck { +public class AnchorPrecedenceCheckSample { @Email(regexp = "^a|b|c$") // Noncompliant [[sc=20;ec=27]] String email; diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/DuplicatesInCharacterClassCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/DuplicatesInCharacterClassCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/regex/DuplicatesInCharacterClassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/DuplicatesInCharacterClassCheckSample.java index 138f7c7ea41..434fb651832 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/DuplicatesInCharacterClassCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/DuplicatesInCharacterClassCheckSample.java @@ -1,6 +1,6 @@ package checks.regex; -public class DuplicatesInCharacterClassCheck { +public class DuplicatesInCharacterClassCheckSample { void nonCompliant() { String str = "123"; diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/EmptyLineRegexCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/EmptyLineRegexCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/regex/EmptyLineRegexCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/EmptyLineRegexCheckSample.java index beaf856a38d..ad065e5af8d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/EmptyLineRegexCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/EmptyLineRegexCheckSample.java @@ -2,7 +2,7 @@ import java.util.regex.Pattern; -public class EmptyLineRegexCheck { +public class EmptyLineRegexCheckSample { private static final int MY_FLAG = 0x10; diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/EmptyRegexGroupCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/EmptyRegexGroupCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/regex/EmptyRegexGroupCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/EmptyRegexGroupCheckSample.java index 6762a4be647..6d179d0cb9d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/EmptyRegexGroupCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/EmptyRegexGroupCheckSample.java @@ -2,7 +2,7 @@ import java.util.regex.Pattern; -public class EmptyRegexGroupCheck { +public class EmptyRegexGroupCheckSample { void nonCompliant() { Pattern.compile("foo()bar"); // Noncompliant [[sc=25;ec=27]] {{Remove this empty group.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/EmptyStringRepetitionCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/EmptyStringRepetitionCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/regex/EmptyStringRepetitionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/EmptyStringRepetitionCheckSample.java index 12ea5f83fc1..52982726be0 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/EmptyStringRepetitionCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/EmptyStringRepetitionCheckSample.java @@ -2,7 +2,7 @@ import org.hibernate.validator.constraints.URL; -class EmptyStringRepetitionCheck { +class EmptyStringRepetitionCheckSample { private static final String REPLACEMENT = "empty"; diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/EscapeSequenceControlCharacterCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/EscapeSequenceControlCharacterCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/regex/EscapeSequenceControlCharacterCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/EscapeSequenceControlCharacterCheckSample.java index ae53ac596ec..22db4e1cf13 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/EscapeSequenceControlCharacterCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/EscapeSequenceControlCharacterCheckSample.java @@ -3,7 +3,7 @@ import java.util.regex.Pattern; import javax.validation.constraints.Email; -public class EscapeSequenceControlCharacterCheck { +public class EscapeSequenceControlCharacterCheckSample { void nonCompliant() { Pattern.compile("\\ca"); // Noncompliant [[sc=22;ec=26]] {{Remove or replace this problematic use of \c.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/GraphemeClustersInClassesCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/GraphemeClustersInClassesCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/regex/GraphemeClustersInClassesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/GraphemeClustersInClassesCheckSample.java index f5a37336925..4e6cab2d3a0 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/GraphemeClustersInClassesCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/GraphemeClustersInClassesCheckSample.java @@ -2,7 +2,7 @@ import java.util.regex.Pattern; -public class GraphemeClustersInClassesCheck { +public class GraphemeClustersInClassesCheckSample { void noncompliant(String str) { Pattern.compile("[aaaèaaa]"); // Noncompliant [[sc=22;ec=32;secondary=8]] {{Extract 1 Grapheme Cluster(s) from this character class.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBackReferenceCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBackReferenceCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBackReferenceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBackReferenceCheckSample.java index b804f72221b..d27320788b2 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBackReferenceCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBackReferenceCheckSample.java @@ -1,6 +1,6 @@ package checks.regex; -public class ImpossibleBackReferenceCheck { +public class ImpossibleBackReferenceCheckSample { void noncompliant(String str) { str.matches("\\1" + // Noncompliant [[sc=18;ec=21;secondary=7]] {{Fix this backreference, so that it refers to a group that can be matched before it.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBoundariesCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBoundariesCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBoundariesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBoundariesCheckSample.java index 12146450190..c592e55126d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBoundariesCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/ImpossibleBoundariesCheckSample.java @@ -3,7 +3,7 @@ import javax.validation.constraints.Email; import java.util.regex.Pattern; -public class ImpossibleBoundariesCheck { +public class ImpossibleBoundariesCheckSample { @Email(regexp = "$USER") // Noncompliant [[sc=20;ec=21]] {{Remove or replace this boundary that will never match because it appears before mandatory input.}} String email; diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/InvalidRegexCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/InvalidRegexCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/regex/InvalidRegexCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/InvalidRegexCheckSample.java index c06fbea9267..640b5029e11 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/InvalidRegexCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/InvalidRegexCheckSample.java @@ -2,7 +2,7 @@ import java.util.regex.Pattern; -public class InvalidRegexCheck { +public class InvalidRegexCheckSample { void noncompliant(String str) { Pattern.compile("("); // Noncompliant [[sc=23;ec=24;secondary=8]] {{Fix the syntax error inside this regex.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/MultipleWhitespaceCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/MultipleWhitespaceCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/java/checks/regex/MultipleWhitespaceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/MultipleWhitespaceCheckSample.java index 4011559b041..d5616bb2574 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/MultipleWhitespaceCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/MultipleWhitespaceCheckSample.java @@ -2,7 +2,7 @@ import java.util.regex.Pattern; -public class MultipleWhitespaceCheck { +public class MultipleWhitespaceCheckSample { void noncompliant() { Pattern.compile("Hello, world!"); // Noncompliant [[sc=29;ec=31]] {{Replace spaces with quantifier `{3}`.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/PossessiveQuantifierContinuationCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/PossessiveQuantifierContinuationCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/regex/PossessiveQuantifierContinuationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/PossessiveQuantifierContinuationCheckSample.java index 5cdc21aefbb..3482ffda5c2 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/PossessiveQuantifierContinuationCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/PossessiveQuantifierContinuationCheckSample.java @@ -4,7 +4,7 @@ import static java.util.regex.Pattern.compile; -public class PossessiveQuantifierContinuationCheck { +public class PossessiveQuantifierContinuationCheckSample { public void f(Pattern pattern) { f(compile("a+abc")); diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/RedosCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/RedosCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/regex/RedosCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/RedosCheckSample.java index 0e975f964d1..c1f440a8f27 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/RedosCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/RedosCheckSample.java @@ -3,7 +3,7 @@ import java.util.regex.Pattern; import javax.validation.constraints.Email; -public class RedosCheck { +public class RedosCheckSample { @Email(regexp = "(.*-)*@.*") // Noncompliant [[sc=4;ec=9]] {{Make sure the regex used here, which is vulnerable to polynomial runtime due to backtracking, cannot lead to denial of service.}} String email; diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/RedundantRegexAlternativesCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/RedundantRegexAlternativesCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/regex/RedundantRegexAlternativesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/RedundantRegexAlternativesCheckSample.java index b0b35f8e0fd..e0e667a6bae 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/RedundantRegexAlternativesCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/RedundantRegexAlternativesCheckSample.java @@ -4,7 +4,7 @@ import static java.util.regex.Pattern.compile; -public class RedundantRegexAlternativesCheck { +public class RedundantRegexAlternativesCheckSample { public void f(Pattern pattern) { f(compile("" + diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/RegexComplexityCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/RegexComplexityCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/regex/RegexComplexityCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/RegexComplexityCheckSample.java index 7d58d6876bc..2aace05ef39 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/RegexComplexityCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/RegexComplexityCheckSample.java @@ -3,7 +3,7 @@ import java.util.regex.Pattern; import javax.validation.constraints.Email; -public class RegexComplexityCheck { +public class RegexComplexityCheckSample { // Since this check is sensitive to comments, all comments that mark a regex as non-compliant or that explain // why it is (non-)compliant should not be on the same line as the regex or on the line before it. diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/RegexLookaheadCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/RegexLookaheadCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/regex/RegexLookaheadCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/RegexLookaheadCheckSample.java index 72f788095c2..50539f9758d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/RegexLookaheadCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/RegexLookaheadCheckSample.java @@ -5,7 +5,7 @@ import static java.util.regex.Pattern.compile; -public class RegexLookaheadCheck { +public class RegexLookaheadCheckSample { public void test(String str) { // Positive lookahead diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierCheckSample.java index 625fa6e82b0..dfa89312819 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierCheckSample.java @@ -2,7 +2,7 @@ import org.hibernate.validator.constraints.URL; -public class ReluctantQuantifierCheck { +public class ReluctantQuantifierCheckSample { @URL(regexp = "<.+?>") // Noncompliant [[sc=19;ec=22]] {{Replace this use of a reluctant quantifier with "[^>]++".}} String url; diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheckSample.java index fd255516ad2..6ade5070b8c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheckSample.java @@ -5,7 +5,7 @@ import javax.validation.constraints.Email; import org.apache.commons.lang3.RegExUtils; -public class ReluctantQuantifierWithEmptyContinuationCheck { +public class ReluctantQuantifierWithEmptyContinuationCheckSample { void noncompliant(String str) { // ====== Reluctant quantifier that will only ever match the empty string ====== diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/SingleCharCharacterClassCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/SingleCharCharacterClassCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/regex/SingleCharCharacterClassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/SingleCharCharacterClassCheckSample.java index ad7fe55990e..8d0d575dfcd 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/SingleCharCharacterClassCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/SingleCharCharacterClassCheckSample.java @@ -2,7 +2,7 @@ import java.util.regex.Pattern; -public class SingleCharCharacterClassCheck { +public class SingleCharCharacterClassCheckSample { void nonCompliant() { Pattern.compile("[0]"); // Noncompliant {{Replace this character class by the character itself.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/SingleCharacterAlternationCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/SingleCharacterAlternationCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/regex/SingleCharacterAlternationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/SingleCharacterAlternationCheckSample.java index 02323708664..178a844621e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/SingleCharacterAlternationCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/SingleCharacterAlternationCheckSample.java @@ -2,7 +2,7 @@ import javax.validation.constraints.Pattern; -public class SingleCharacterAlternationCheck { +public class SingleCharacterAlternationCheckSample { @Pattern(regexp = "x|y|z") // Noncompliant [[sc=22;ec=27]] {{Replace this alternation with a character class.}} String pattern; diff --git a/java-checks-test-sources/default/src/main/java/checks/regex/SuperfluousCurlyBraceCheck.java b/java-checks-test-sources/default/src/main/java/checks/regex/SuperfluousCurlyBraceCheckSample.java similarity index 92% rename from java-checks-test-sources/default/src/main/java/checks/regex/SuperfluousCurlyBraceCheck.java rename to java-checks-test-sources/default/src/main/java/checks/regex/SuperfluousCurlyBraceCheckSample.java index 8d57093f74f..d5793d8a479 100644 --- a/java-checks-test-sources/default/src/main/java/checks/regex/SuperfluousCurlyBraceCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/regex/SuperfluousCurlyBraceCheckSample.java @@ -2,7 +2,7 @@ import static java.util.regex.Pattern.compile; -public class SuperfluousCurlyBraceCheck { +public class SuperfluousCurlyBraceCheckSample { void noncompliant() { compile("ab{1,1}c"); // Noncompliant [[sc=16;ec=21]] {{Remove this unnecessary quantifier.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/security/AndroidBiometricAuthWithoutCryptoCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/AndroidBiometricAuthWithoutCryptoCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/security/AndroidBiometricAuthWithoutCryptoCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/AndroidBiometricAuthWithoutCryptoCheckSample.java index 4ed2e6ce04d..2e412dedf28 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/AndroidBiometricAuthWithoutCryptoCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/AndroidBiometricAuthWithoutCryptoCheckSample.java @@ -5,7 +5,7 @@ import java.util.concurrent.Executor; -class AndroidBiometricAuthWithoutCryptoCheck { +class AndroidBiometricAuthWithoutCryptoCheckSample { void android_no_crypto( BiometricPrompt bp, CancellationSignal cancel, diff --git a/java-checks-test-sources/default/src/main/java/checks/security/AndroidBroadcastingCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/AndroidBroadcastingCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/security/AndroidBroadcastingCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/AndroidBroadcastingCheckSample.java index cbf047eb4f3..152f5b84982 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/AndroidBroadcastingCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/AndroidBroadcastingCheckSample.java @@ -8,7 +8,7 @@ import android.os.Handler; import android.os.UserHandle; -public class AndroidBroadcastingCheck { +public class AndroidBroadcastingCheckSample { public void broadcast(Intent intent, Context context, UserHandle user, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras, diff --git a/java-checks-test-sources/default/src/main/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheckSample.java index 7517ffba765..6ddb6437c5d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheckSample.java @@ -5,7 +5,7 @@ import net.sqlcipher.database.SQLiteDatabase; import net.sqlcipher.database.SQLiteDatabaseHook; -class AndroidMobileDatabaseEncryptionKeysCheck { +class AndroidMobileDatabaseEncryptionKeysCheckSample { byte[] a = new byte[0]; diff --git a/java-checks-test-sources/default/src/main/java/checks/security/AndroidNonAuthenticatedUsersCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/AndroidNonAuthenticatedUsersCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/security/AndroidNonAuthenticatedUsersCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/AndroidNonAuthenticatedUsersCheckSample.java index 3bcace266b8..165c9431698 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/AndroidNonAuthenticatedUsersCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/AndroidNonAuthenticatedUsersCheckSample.java @@ -3,7 +3,7 @@ import android.security.keystore.KeyGenParameterSpec; import android.security.keystore.KeyProperties; -public class AndroidNonAuthenticatedUsersCheck { +public class AndroidNonAuthenticatedUsersCheckSample { KeyGenParameterSpec.Builder builderField; diff --git a/java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedDatabaseCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedDatabaseCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedDatabaseCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedDatabaseCheckSample.java index 89917d17bc1..6462ac503ed 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedDatabaseCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedDatabaseCheckSample.java @@ -8,7 +8,7 @@ import io.realm.RealmConfiguration; import java.io.File; -public class AndroidUnencryptedDatabaseCheck { +public class AndroidUnencryptedDatabaseCheckSample { RealmConfiguration.Builder builderAsField; diff --git a/java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedFilesCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedFilesCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedFilesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedFilesCheckSample.java index c3e4d54b4b0..8111c702bd6 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedFilesCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/AndroidUnencryptedFilesCheckSample.java @@ -9,7 +9,7 @@ import java.nio.file.Files; import java.nio.file.Path; -public class AndroidUnencryptedFilesCheck { +public class AndroidUnencryptedFilesCheckSample { void fileWrite(Path path) throws IOException { Files.write(path, "content".getBytes()); // Noncompliant [[sc=11;ec=16]] {{Make sure using unencrypted files is safe here.}} } diff --git a/java-checks-test-sources/default/src/main/java/checks/security/AuthorizationsStrongDecisionsCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/AuthorizationsStrongDecisionsCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/security/AuthorizationsStrongDecisionsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/AuthorizationsStrongDecisionsCheckSample.java index b0826a8cae8..d9297a02421 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/AuthorizationsStrongDecisionsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/AuthorizationsStrongDecisionsCheckSample.java @@ -9,7 +9,7 @@ import org.springframework.security.access.PermissionEvaluator; import org.springframework.security.core.Authentication; -public class AuthorizationsStrongDecisionsCheck { +public class AuthorizationsStrongDecisionsCheckSample { // AccessDecisionVoter ================================================= diff --git a/java-checks-test-sources/default/src/main/java/checks/security/DataHashingCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/DataHashingCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/security/DataHashingCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/DataHashingCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/security/DebugFeatureEnabledCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/DebugFeatureEnabledCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/java/checks/security/DebugFeatureEnabledCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/DebugFeatureEnabledCheckSample.java index edb20134608..1e84268b6b6 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/DebugFeatureEnabledCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/DebugFeatureEnabledCheckSample.java @@ -7,8 +7,8 @@ import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer; // Tests for printStackTrace. -// Tests for @EnableWebSecurity are in files/non-compiling/checks/security/DebugFeatureEnabledCheck.java -public class DebugFeatureEnabledCheck { +// Tests for @EnableWebSecurity are in files/non-compiling/checks/security/DebugFeatureEnabledCheckSample.java +public class DebugFeatureEnabledCheckSample { private void f(Throwable e, MyException e1) { e.printStackTrace(); // Noncompliant e.printStackTrace(System.out); // Compliant - forcing the stream @@ -34,7 +34,7 @@ void fun(MyException e) { void fun(CustomException e) { e.printStackTrace(); //Compliant : e is not extending Throwable - DebugFeatureEnabledCheck.CustomException.printStackTrace(); //compliant : CustomException is not extending Throwable + DebugFeatureEnabledCheckSample.CustomException.printStackTrace(); //compliant : CustomException is not extending Throwable } void fun(InvocationTargetException ite) { diff --git a/java-checks-test-sources/default/src/main/java/checks/security/DisableAutoEscapingCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/DisableAutoEscapingCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/security/DisableAutoEscapingCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/DisableAutoEscapingCheckSample.java index 0a07533b557..1cace899887 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/DisableAutoEscapingCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/DisableAutoEscapingCheckSample.java @@ -11,7 +11,7 @@ import static freemarker.template.Configuration.ENABLE_IF_DEFAULT_AUTO_ESCAPING_POLICY; import static freemarker.template.Configuration.ENABLE_IF_SUPPORTED_AUTO_ESCAPING_POLICY; -public class DisableAutoEscapingCheck { +public class DisableAutoEscapingCheckSample { private String template = "{{foo}}"; private Object context = new Object() { String foo = ""; diff --git a/java-checks-test-sources/default/src/main/java/checks/security/EmptyDatabasePasswordCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/EmptyDatabasePasswordCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/security/EmptyDatabasePasswordCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/EmptyDatabasePasswordCheckSample.java index 1df4e11e82a..59a48586989 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/EmptyDatabasePasswordCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/EmptyDatabasePasswordCheckSample.java @@ -8,7 +8,7 @@ import static checks.security.EmptyDatabasePasswordCheckVariables.EMPTY_PASSWORD; import static checks.security.EmptyDatabasePasswordCheckVariables.NON_EMPTY_PASSWORD; -class EmptyDatabasePasswordCheck { +class EmptyDatabasePasswordCheckSample { void foo(Properties connectionProps, String unknown) throws SQLException { DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "AppLogin", ""); // Noncompliant [[sc=5;ec=86]] {{Add password protection to this database.}} DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "AppLogin", "Foo"); diff --git a/java-checks-test-sources/default/src/main/java/checks/security/EncryptionAlgorithmCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/EncryptionAlgorithmCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/security/EncryptionAlgorithmCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/EncryptionAlgorithmCheckSample.java index 94cdfd7e383..199e99d164e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/EncryptionAlgorithmCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/EncryptionAlgorithmCheckSample.java @@ -4,7 +4,7 @@ import static java.io.File.separator; -abstract class EncryptionAlgorithmCheck { +abstract class EncryptionAlgorithmCheckSample { static final String RSA = "RSA"; static final String NO_PADDING = "/NONE/NoPadding"; diff --git a/java-checks-test-sources/default/src/main/java/checks/security/ExcessiveContentRequestCheck/ExcessiveContentRequestCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/ExcessiveContentRequestCheck/ExcessiveContentRequestCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/security/ExcessiveContentRequestCheck/ExcessiveContentRequestCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/ExcessiveContentRequestCheck/ExcessiveContentRequestCheckSample.java index ce4bf01618b..bae07183e18 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/ExcessiveContentRequestCheck/ExcessiveContentRequestCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/ExcessiveContentRequestCheck/ExcessiveContentRequestCheckSample.java @@ -6,7 +6,7 @@ /** * 8 MB = 8388608 bytes */ -public class ExcessiveContentRequestCheck { +public class ExcessiveContentRequestCheckSample { private static final int MAX_SIZE_COMPLIANT = 8_388_608; private static final int MAX_SIZE_NON_COMPLIANT = 8_388_609; diff --git a/java-checks-test-sources/default/src/main/java/checks/security/FilePermissionsCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/FilePermissionsCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/security/FilePermissionsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/FilePermissionsCheckSample.java index 6ed6d4f1dab..23988be2087 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/FilePermissionsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/FilePermissionsCheckSample.java @@ -8,7 +8,7 @@ import java.util.HashSet; import java.util.Set; -class FilePermissionsCheck { +class FilePermissionsCheckSample { // using PosixFilePermission to set file permissions 757 public void setPermissions(Path filePath) throws Exception { diff --git a/java-checks-test-sources/default/src/main/java/checks/security/IntegerToHexStringCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/IntegerToHexStringCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/security/IntegerToHexStringCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/IntegerToHexStringCheckSample.java index b0e456f705b..90948458567 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/IntegerToHexStringCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/IntegerToHexStringCheckSample.java @@ -2,7 +2,7 @@ import java.util.StringJoiner; -class IntegerToHexStringCheck { +class IntegerToHexStringCheckSample { public void foo(StringBuilder sb, byte b, int c) { sb.append(Integer.toHexString( b & 0xFF )); // Noncompliant {{Use String.format( "%02X", ...) instead.}} System.out.println(Integer.toHexString( b & 0xFF )); diff --git a/java-checks-test-sources/default/src/main/java/checks/security/LDAPAuthenticatedConnectionCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/LDAPAuthenticatedConnectionCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/security/LDAPAuthenticatedConnectionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/LDAPAuthenticatedConnectionCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/security/LDAPDeserializationCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/LDAPDeserializationCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/security/LDAPDeserializationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/LDAPDeserializationCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/security/LogConfigurationCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/LogConfigurationCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/security/LogConfigurationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/LogConfigurationCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/security/OpenSAML2AuthenticationBypassCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/OpenSAML2AuthenticationBypassCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/checks/security/OpenSAML2AuthenticationBypassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/OpenSAML2AuthenticationBypassCheckSample.java index f68c6492bde..4d3b8f91b2c 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/OpenSAML2AuthenticationBypassCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/OpenSAML2AuthenticationBypassCheckSample.java @@ -3,7 +3,7 @@ import org.opensaml.xml.parse.BasicParserPool; import org.opensaml.xml.parse.StaticBasicParserPool; -class OpenSAML2AuthenticationBypassCheck { +class OpenSAML2AuthenticationBypassCheckSample { public void foo() { new StaticBasicParserPool().setIgnoreComments(false); // Noncompliant {{Change "setIgnoreComments" to "true" or remove the call to "setIgnoreComments" to prevent the authentication bypass.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/security/ReceivingIntentsCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/ReceivingIntentsCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/security/ReceivingIntentsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/ReceivingIntentsCheckSample.java index 05174e76462..cda623c0f95 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/ReceivingIntentsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/ReceivingIntentsCheckSample.java @@ -6,7 +6,7 @@ import android.content.IntentFilter; import android.os.Handler; -public class ReceivingIntentsCheck { +public class ReceivingIntentsCheckSample { public void register(Context context, BroadcastReceiver receiver, IntentFilter filter, diff --git a/java-checks-test-sources/default/src/main/java/checks/security/SecureCookieCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/SecureCookieCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/security/SecureCookieCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/SecureCookieCheckSample.java index 17535926705..e9d760eda7e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/security/SecureCookieCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/security/SecureCookieCheckSample.java @@ -10,7 +10,7 @@ import play.mvc.Http; import play.mvc.Http.CookieBuilder; -class SecureCookieCheck { +class SecureCookieCheckSample { Cookie field1 = new Cookie("name", "value"); // Noncompliant HttpCookie field2 = new HttpCookie("name", "value"); @@ -176,10 +176,10 @@ Http.CookieBuilder getC7() { } } -class SecureCookieCheckB extends Cookie { +class SecureCookieCheckSampleB extends Cookie { public Cookie c; - public SecureCookieCheckB(String name, String value) { + public SecureCookieCheckSampleB(String name, String value) { super(name, value); } @@ -196,7 +196,7 @@ void baz() { return; // code coverage } Date codeCoverage(Cookie cookie) { - SecureCookieCheck a = new SecureCookieCheck(); + SecureCookieCheckSample a = new SecureCookieCheckSample(); a.foo(cookie); Date d1 = new Date(); Date d2; diff --git a/java-checks-test-sources/default/src/main/java/checks/security/ServerCertificatesCheck.java b/java-checks-test-sources/default/src/main/java/checks/security/ServerCertificatesCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/security/ServerCertificatesCheck.java rename to java-checks-test-sources/default/src/main/java/checks/security/ServerCertificatesCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/serialization/ExternalizableClassConstructorCheck.java b/java-checks-test-sources/default/src/main/java/checks/serialization/ExternalizableClassConstructorCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/serialization/ExternalizableClassConstructorCheck.java rename to java-checks-test-sources/default/src/main/java/checks/serialization/ExternalizableClassConstructorCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/serialization/NonSerializableWriteCheck.java b/java-checks-test-sources/default/src/main/java/checks/serialization/NonSerializableWriteCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/checks/serialization/NonSerializableWriteCheck.java rename to java-checks-test-sources/default/src/main/java/checks/serialization/NonSerializableWriteCheckSample.java index cd7ac66fcb9..bd47b697097 100644 --- a/java-checks-test-sources/default/src/main/java/checks/serialization/NonSerializableWriteCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/serialization/NonSerializableWriteCheckSample.java @@ -24,7 +24,7 @@ import java.util.TreeMap; import java.util.TreeSet; -class NonSerializableWriteCheck { +class NonSerializableWriteCheckSample { void myMethod(ObjectOutputStream out, Object x, byte[] array) throws IOException { out.writeObject(new Object()); out.writeObject("x"); diff --git a/java-checks-test-sources/default/src/main/java/checks/serialization/RecordSerializationIgnoredMembersCheck.java b/java-checks-test-sources/default/src/main/java/checks/serialization/RecordSerializationIgnoredMembersCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/serialization/RecordSerializationIgnoredMembersCheck.java rename to java-checks-test-sources/default/src/main/java/checks/serialization/RecordSerializationIgnoredMembersCheckSample.java index 3bf7d4bb913..07698c33052 100644 --- a/java-checks-test-sources/default/src/main/java/checks/serialization/RecordSerializationIgnoredMembersCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/serialization/RecordSerializationIgnoredMembersCheckSample.java @@ -10,7 +10,7 @@ import java.io.ObjectStreamField; import java.io.Serializable; -public class RecordSerializationIgnoredMembersCheck { +public class RecordSerializationIgnoredMembersCheckSample { record NoncompliantRecord() implements Serializable, Externalizable { private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0]; // Noncompliant [[sc=46;ec=68]] {{Remove this field that will be ignored during record serialization.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidCheck.java b/java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidCheckSample.java similarity index 53% rename from java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidCheck.java rename to java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidCheckSample.java index 0526798e112..f58e2f6c27b 100644 --- a/java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidCheckSample.java @@ -3,40 +3,40 @@ import java.io.Serial; import java.io.Serializable; -class SerialVersionUidCheckA implements Cloneable {} -class SerialVersionUidCheckB implements Serializable { +class SerialVersionUidCheckSampleA implements Cloneable {} +class SerialVersionUidCheckSampleB implements Serializable { private static final long serialVersionUID = 1L; } -class SerialVersionUidCheckC implements Serializable {} // Noncompliant [[sc=7;ec=29]] {{Add a "static final long serialVersionUID" field to this class.}} -class SerialVersionUidCheckD extends SerialVersionUidCheckC {} // Noncompliant {{Add a "static final long serialVersionUID" field to this class.}} -class SerialVersionUidCheckE implements Serializable { +class SerialVersionUidCheckSampleC implements Serializable {} // Noncompliant [[sc=7;ec=35]] {{Add a "static final long serialVersionUID" field to this class.}} +class SerialVersionUidCheckSampleD extends SerialVersionUidCheckSampleC {} // Noncompliant {{Add a "static final long serialVersionUID" field to this class.}} +class SerialVersionUidCheckSampleE implements Serializable { private final long serialVersionUID = 1L; // Noncompliant {{Make this "serialVersionUID" field "static".}} } -class SerialVersionUidCheckF implements Serializable { +class SerialVersionUidCheckSampleF implements Serializable { private static long serialVersionUID = 1L; // Noncompliant [[sc=23;ec=39]] {{Make this "serialVersionUID" field "final".}} } -class SerialVersionUidCheckG implements Serializable { +class SerialVersionUidCheckSampleG implements Serializable { private static int serialVersionUID = 1; // Noncompliant {{Make this "serialVersionUID" field "final long".}} } -class SerialVersionUidCheckH implements Serializable { +class SerialVersionUidCheckSampleH implements Serializable { void serialVersionUID() {} private static final long serialVersionUID = 1L; } -abstract class SerialVersionUidCheckI implements Serializable {} +abstract class SerialVersionUidCheckSampleI implements Serializable {} class MyThrowable extends Throwable {} class MyJPanel extends javax.swing.JPanel {} class MyAwtButton extends java.awt.Button { class InnerClass implements Serializable {} } -class SerialVersionUidCheckOuter { - class SerialVersionUidCheckInner implements Serializable {} // Noncompliant +class SerialVersionUidCheckSampleOuter { + class SerialVersionUidCheckSampleInner implements Serializable {} // Noncompliant } @SuppressWarnings("serial") -class SerialVersionUidCheckJ implements Serializable {} // Noncompliant, this issue will be filtered by the supress warning filter +class SerialVersionUidCheckSampleJ implements Serializable {} // Noncompliant, this issue will be filtered by the supress warning filter -enum SerialVersionUidCheckMyEnum { +enum SerialVersionUidCheckSampleMyEnum { FOO { void fun() {} }, diff --git a/java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidInRecordCheck.java b/java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidInRecordCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidInRecordCheck.java rename to java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidInRecordCheckSample.java index 079cd021bb2..dd10ab58d32 100644 --- a/java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidInRecordCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/serialization/SerialVersionUidInRecordCheckSample.java @@ -3,7 +3,7 @@ import java.io.Serial; import java.io.Serializable; -public class SerialVersionUidInRecordCheck { +public class SerialVersionUidInRecordCheckSample { record Person(String name, int age) implements Serializable { @Serial private static final long serialVersionUID = 0L; // Noncompliant {{Remove this redundant "serialVersionUID" field}} } diff --git a/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableFieldInSerializableClassCheck.java b/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableFieldInSerializableClassCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/serialization/SerializableFieldInSerializableClassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/serialization/SerializableFieldInSerializableClassCheckSample.java index 92c1a87f69c..768149d800f 100644 --- a/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableFieldInSerializableClassCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableFieldInSerializableClassCheckSample.java @@ -31,11 +31,11 @@ class Address { } class Person implements Serializable { Address address; // Noncompliant [[sc=11;ec=18]] {{Make "address" transient or serializable.}} - SerializableFieldInSerializableClassCheckA a; + SerializableFieldInSerializableClassCheckSampleA a; static Address address2;//Compliant : static field transient Address address3; } -enum SerializableFieldInSerializableClassCheckA { +enum SerializableFieldInSerializableClassCheckSampleA { B; Address address; Address[][] addressArray; @@ -60,10 +60,10 @@ class Person5 implements Serializable { Integer integer; //Compliant } -class SerializableFieldInSerializableClassCheckB {} +class SerializableFieldInSerializableClassCheckSampleB {} class Person6 implements Serializable { - private SerializableFieldInSerializableClassCheckB bs; // Noncompliant + private SerializableFieldInSerializableClassCheckSampleB bs; // Noncompliant private List persons; // Compliant private List things; // Noncompliant {{Make "things" transient or serializable.}} private List objects; // Noncompliant {{Make "objects" transient or serializable.}} diff --git a/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableObjectInSessionCheck.java b/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableObjectInSessionCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/serialization/SerializableObjectInSessionCheck.java rename to java-checks-test-sources/default/src/main/java/checks/serialization/SerializableObjectInSessionCheckSample.java index d64fbfd5b81..6ea439e1859 100644 --- a/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableObjectInSessionCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableObjectInSessionCheckSample.java @@ -26,7 +26,7 @@ import static java.util.Collections.EMPTY_LIST; -class SerializableObjectInSessionCheck { +class SerializableObjectInSessionCheckSample { void foo(HttpServletRequest request) { HttpSession session = request.getSession(); diff --git a/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableSuperConstructorCheck.java b/java-checks-test-sources/default/src/main/java/checks/serialization/SerializableSuperConstructorCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/serialization/SerializableSuperConstructorCheck.java rename to java-checks-test-sources/default/src/main/java/checks/serialization/SerializableSuperConstructorCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/AsyncMethodsOnConfigurationClassCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/AsyncMethodsOnConfigurationClassCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/main/java/checks/spring/AsyncMethodsOnConfigurationClassCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/AsyncMethodsOnConfigurationClassCheckSample.java index c1c9baaac25..caa1e090c9f 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/AsyncMethodsOnConfigurationClassCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/AsyncMethodsOnConfigurationClassCheckSample.java @@ -5,7 +5,7 @@ import org.springframework.scheduling.annotation.Async; @Configuration -public class AsyncMethodsOnConfigurationClassCheck { +public class AsyncMethodsOnConfigurationClassCheckSample { @Async // Noncompliant [[sc=3;ec=9;quickfixes=qf1]] {{Remove this "@Async" annotation from this method.}} // fix@qf1 {{Remove "@Async"}} diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheckSample.java similarity index 86% rename from java-checks-test-sources/default/src/main/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheckSample.java index efaa3811b72..baaf4cd924d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheckSample.java @@ -4,15 +4,15 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -public class AutowiredOnConstructorWhenMultipleConstructorsCheck { // Compliant +public class AutowiredOnConstructorWhenMultipleConstructorsCheckSample { // Compliant - public AutowiredOnConstructorWhenMultipleConstructorsCheck() { + public AutowiredOnConstructorWhenMultipleConstructorsCheckSample() { } - public AutowiredOnConstructorWhenMultipleConstructorsCheck(int i) { + public AutowiredOnConstructorWhenMultipleConstructorsCheckSample(int i) { } - public AutowiredOnConstructorWhenMultipleConstructorsCheck(String s) { + public AutowiredOnConstructorWhenMultipleConstructorsCheckSample(String s) { } @Component diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/ModelAttributeNamingConventionForSpELCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/ModelAttributeNamingConventionForSpELCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/spring/ModelAttributeNamingConventionForSpELCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/ModelAttributeNamingConventionForSpELCheckSample.java index ba30387da05..0b3122d121a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/ModelAttributeNamingConventionForSpELCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/ModelAttributeNamingConventionForSpELCheckSample.java @@ -5,7 +5,7 @@ import java.util.Map; import org.springframework.ui.Model; -class ModelAttributeNamingConventionForSpELCheck { +class ModelAttributeNamingConventionForSpELCheckSample { private static final String MY_LEGAL_CONSTANT = "legalName"; private static final String MY_ILLEGAL_CONSTANT = "a-b"; diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/PersistentEntityUsedAsRequestParameterCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/PersistentEntityUsedAsRequestParameterCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/spring/PersistentEntityUsedAsRequestParameterCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/PersistentEntityUsedAsRequestParameterCheckSample.java index 75af948c456..a156f1e60ec 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/PersistentEntityUsedAsRequestParameterCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/PersistentEntityUsedAsRequestParameterCheckSample.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -class PersistentEntityUsedAsRequestParameterCheck { +class PersistentEntityUsedAsRequestParameterCheckSample { @Entity public class Foo { private Long id; diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/RequestMappingMethodPublicCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/RequestMappingMethodPublicCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/checks/spring/RequestMappingMethodPublicCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/RequestMappingMethodPublicCheckSample.java diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/SpringAntMatcherOrderCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/SpringAntMatcherOrderCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/spring/SpringAntMatcherOrderCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/SpringAntMatcherOrderCheckSample.java index d3c77350cb4..02a88af2c9d 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/SpringAntMatcherOrderCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/SpringAntMatcherOrderCheckSample.java @@ -4,7 +4,7 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; -public class SpringAntMatcherOrderCheck { +public class SpringAntMatcherOrderCheckSample { protected void configure(HttpSecurity http, String dynamicUrl) throws Exception { diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheckSample.java index 915e38eb21f..42e6275a51e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheckSample.java @@ -5,7 +5,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -class SpringConfigurationWithAutowiredFieldsCheck { +class SpringConfigurationWithAutowiredFieldsCheckSample { class Bar { } class Foo { diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/SpringIncompatibleTransactionalCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/SpringIncompatibleTransactionalCheckSample.java similarity index 86% rename from java-checks-test-sources/default/src/main/java/checks/spring/SpringIncompatibleTransactionalCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/SpringIncompatibleTransactionalCheckSample.java index c78ca7fe3c5..ae69a96342a 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/SpringIncompatibleTransactionalCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/SpringIncompatibleTransactionalCheckSample.java @@ -6,9 +6,9 @@ import static javax.transaction.Transactional.TxType.REQUIRED; -public class SpringIncompatibleTransactionalCheck { +public class SpringIncompatibleTransactionalCheckSample { - SpringIncompatibleTransactionalCheck other; + SpringIncompatibleTransactionalCheckSample other; @Transactional public void springTransactionalDefault() { @@ -30,13 +30,13 @@ public void nonTransactional() { this.equals(other); } - SpringIncompatibleTransactionalCheck getOther() { + SpringIncompatibleTransactionalCheckSample getOther() { return other; } } -class SpringIncompatibleTransactionalCheckIncompatibilityMatrix { +class SpringIncompatibleTransactionalCheckSampleIncompatibilityMatrix { public void nonTransactional() { nonTransactional(); @@ -169,7 +169,7 @@ public void supports() { } -class SpringIncompatibleTransactionalCheckSupportJavaxTransactional { +class SpringIncompatibleTransactionalCheckSampleSupportJavaxTransactional { public void nonTransactional() { @@ -198,7 +198,7 @@ public void javaxTransactionalNever() { } @Transactional(propagation = Propagation.NOT_SUPPORTED) -class SpringIncompatibleTransactionalCheckClassInheritanceNotSupported { +class SpringIncompatibleTransactionalCheckSampleClassInheritanceNotSupported { public void nonTransactional() { transactional(); @@ -211,7 +211,7 @@ public void transactional() { } @Transactional(propagation = Propagation.REQUIRED) -class SpringIncompatibleTransactionalCheckClassInheritanceRequired { +class SpringIncompatibleTransactionalCheckSampleClassInheritanceRequired { // even if not anotated with @Transactional, this "public" method inherit form the class transactional propagation. public void methodA() { @@ -225,14 +225,14 @@ public void methodB() { } -class SpringIncompatibleTransactionalCheckClassWithoutTransactionnal { +class SpringIncompatibleTransactionalCheckSampleClassWithoutTransactionnal { public void method() { } } -class SpringIncompatibleTransactionalCheckClassWithOneTransactionnal { +class SpringIncompatibleTransactionalCheckSampleClassWithOneTransactionnal { @Transactional(propagation = Propagation.REQUIRED) public void methodA() { @@ -240,7 +240,7 @@ public void methodA() { } -class SpringIncompatibleTransactionalCheckClassWithSameTransactionnal { +class SpringIncompatibleTransactionalCheckSampleClassWithSameTransactionnal { @Transactional(propagation = Propagation.REQUIRED) public void methodA() { @@ -253,7 +253,7 @@ public void methodB() { } -abstract class SpringIncompatibleTransactionalCheckAbstractClass { +abstract class SpringIncompatibleTransactionalCheckSampleAbstractClass { @Transactional(propagation = Propagation.REQUIRES_NEW) public abstract void methodA(); @@ -265,7 +265,7 @@ public void methodB() { } -class SpringIncompatibleTransactionalCheckComplexMethodInvocation { +class SpringIncompatibleTransactionalCheckSampleComplexMethodInvocation { @Transactional(propagation = Propagation.REQUIRES_NEW) public String methodA() { @@ -280,14 +280,14 @@ public int methodB() { } -interface SpringIncompatibleTransactionalCheckBaseInterface { +interface SpringIncompatibleTransactionalCheckSampleBaseInterface { @Transactional(propagation = Propagation.REQUIRES_NEW) public String methodA(); } -class SpringIncompatibleTransactionalCheckDerivedClass implements SpringIncompatibleTransactionalCheckBaseInterface { +class SpringIncompatibleTransactionalCheckSampleDerivedClass implements SpringIncompatibleTransactionalCheckSampleBaseInterface { // Knonwn limitation, Spring also look at the "interface that the invoked method has been called through" to determine // the "propagation" value, and this rule ignore super classes/interfaces. @@ -305,7 +305,7 @@ public int methodB() { } -class SpringIncompatibleTransactionalCheckIntermediatePrivateMethodA { +class SpringIncompatibleTransactionalCheckSampleIntermediatePrivateMethodA { @Transactional(propagation = Propagation.REQUIRED) public void methodA() { @@ -323,7 +323,7 @@ public void methodB() { } -class SpringIncompatibleTransactionalCheckIntermediatePrivateMethodFalseNegative { +class SpringIncompatibleTransactionalCheckSampleIntermediatePrivateMethodFalseNegative { @Transactional(propagation = Propagation.REQUIRED) public void methodA() { diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/SpringRequestMappingMethodCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/SpringRequestMappingMethodCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/checks/spring/SpringRequestMappingMethodCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/SpringRequestMappingMethodCheckSample.java index 9c058eb2381..1f35057d5bd 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/SpringRequestMappingMethodCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/SpringRequestMappingMethodCheckSample.java @@ -8,7 +8,7 @@ @RestController @RequestMapping("/home") -public class SpringRequestMappingMethodCheck { +public class SpringRequestMappingMethodCheckSample { @RequestMapping("/") // Noncompliant [[sc=4;ec=18]] {{Make sure allowing safe and unsafe HTTP methods is safe here.}} String home() { diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/SpringSecurityDisableCSRFCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/SpringSecurityDisableCSRFCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/main/java/checks/spring/SpringSecurityDisableCSRFCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/SpringSecurityDisableCSRFCheckSample.java index 0125b7e26a4..b6860d1a514 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/SpringSecurityDisableCSRFCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/SpringSecurityDisableCSRFCheckSample.java @@ -13,7 +13,7 @@ import org.springframework.security.web.util.matcher.RequestMatcher; @EnableWebSecurity -public class SpringSecurityDisableCSRFCheck extends WebSecurityConfigurerAdapter { +public class SpringSecurityDisableCSRFCheckSample extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/SpringSessionFixationCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/SpringSessionFixationCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/checks/spring/SpringSessionFixationCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/SpringSessionFixationCheckSample.java index 149043b3e01..abf3b5f856e 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/SpringSessionFixationCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/SpringSessionFixationCheckSample.java @@ -7,7 +7,7 @@ import org.springframework.security.config.annotation.web.configurers.SessionManagementConfigurer; import org.springframework.security.web.SecurityFilterChain; -public class SpringSessionFixationCheck { +public class SpringSessionFixationCheckSample { @Configuration @EnableWebSecurity public static class WebSecurityConfig extends WebSecurityConfigurerAdapter { diff --git a/java-checks-test-sources/default/src/main/java/checks/spring/TransactionalMethodVisibilityCheck.java b/java-checks-test-sources/default/src/main/java/checks/spring/TransactionalMethodVisibilityCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/main/java/checks/spring/TransactionalMethodVisibilityCheck.java rename to java-checks-test-sources/default/src/main/java/checks/spring/TransactionalMethodVisibilityCheckSample.java index cbfc56bc7c2..f7274074945 100644 --- a/java-checks-test-sources/default/src/main/java/checks/spring/TransactionalMethodVisibilityCheck.java +++ b/java-checks-test-sources/default/src/main/java/checks/spring/TransactionalMethodVisibilityCheckSample.java @@ -4,7 +4,7 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.transaction.annotation.Transactional; -abstract class TransactionalMethodVisibilityCheck { +abstract class TransactionalMethodVisibilityCheckSample { public interface C { @Transactional diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DenialOfServiceXMLCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DenialOfServiceXMLCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DenialOfServiceXMLCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DenialOfServiceXMLCheckSample.java index 701de4c5b0c..f83cc568b0d 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DenialOfServiceXMLCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DenialOfServiceXMLCheckSample.java @@ -22,7 +22,7 @@ import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; -public class DenialOfServiceXMLCheck { +public class DenialOfServiceXMLCheckSample { DocumentBuilderFactory factoryAsField; diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DivisionByZeroCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DivisionByZeroCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DivisionByZeroCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DivisionByZeroCheckSample.java index 23ecc8db477..84090fb58d2 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DivisionByZeroCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/DivisionByZeroCheckSample.java @@ -6,7 +6,7 @@ import java.util.Random; @SuppressWarnings("java:S139") -class DivisionByZeroCheck { +class DivisionByZeroCheckSample { void flow_through_binary_expression_keep_track_of_the_inceptive_symbol(boolean condition, int unknownInt) { int divisorAncestor6 = condition ? 0 : 1; // flow@inceptive_symbol [[order=1]] {{Implies 'divisorAncestor6' is zero.}} @@ -640,7 +640,7 @@ private void decodeBigInteger(int value) throws Exception { } } -class DivisionByZeroCheckAssignment { +class DivisionByZeroCheckSampleAssignment { int myField; public int calculate(int i) { @@ -654,7 +654,7 @@ public int calculateTwo(int i) { } } -class DivisionByZeroCheckConstraintCopy { +class DivisionByZeroCheckSampleConstraintCopy { void f(int x) { boolean b1 = x < 0 || (x == 0.0 && (1 / x > 0)); // Noncompliant } @@ -664,7 +664,7 @@ void g(int x) { } } -class DivisionByZeroCheckTwoCompoundAssignments { +class DivisionByZeroCheckSampleTwoCompoundAssignments { double sSum; double mSum; @@ -680,7 +680,7 @@ public void xxx() { } } -class DivisionByZeroCheckNonZeroAfterDiv { +class DivisionByZeroCheckSampleNonZeroAfterDiv { void test(int i, int j) { int x = i / j; @@ -700,7 +700,7 @@ void transitive(int i, int j, int k) { } -class DivisionByZeroCheckRelationalOperators { +class DivisionByZeroCheckSampleRelationalOperators { void h() { int x = 1; int a = 0; @@ -746,7 +746,7 @@ private int g(int x, int y) { } } -class DivisionByZeroCheckBigIntegerAndDecimal { +class DivisionByZeroCheckSampleBigIntegerAndDecimal { void simpleBigInt(BigInteger r) { BigInteger z1 = BigInteger.valueOf(0); // flow@simpleBigInt {{'valueOf()' can return zero.}} flow@simpleBigInt {{Implies 'z1' can be zero.}} BigInteger z2 = z1; // flow@simpleBigInt {{Implies 'z2' has the same value as 'z1'.}} diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/LocksNotUnlockedCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/LocksNotUnlockedCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/LocksNotUnlockedCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/LocksNotUnlockedCheckSample.java index ab3ed91e281..2505cd24785 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/LocksNotUnlockedCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/LocksNotUnlockedCheckSample.java @@ -5,7 +5,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -abstract class LocksNotUnlockedCheck { +abstract class LocksNotUnlockedCheckSample { Lock l1 = new ReentrantLock(); Lock l2 = new ReentrantLock(); diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheckSample.java index f8480d4edef..cc85f7724e1 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MapComputeIfAbsentOrPresentCheckSample.java @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Objects; -abstract class MapComputeIfAbsentOrPresentCheck { +abstract class MapComputeIfAbsentOrPresentCheckSample { void foo(Map map, String key) { // Noncompliant@+1 [[flows=computeIfAbsent]] {{Replace this "Map.get()" and condition with a call to "Map.computeIfAbsent()".}} diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MinMaxRangeCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MinMaxRangeCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MinMaxRangeCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MinMaxRangeCheckSample.java index 0e46a337294..ba93e791ef9 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MinMaxRangeCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/MinMaxRangeCheckSample.java @@ -2,7 +2,7 @@ // This classes is placed in compiled code ('org.sonar.java.resolve.targets.se' package) in order to get // access to bytecode and resolve constants -class MinMaxRangeCheck { +class MinMaxRangeCheckSample { private static final int UPPER_INT = 20; private static final int LOWER_INT = 0; @@ -69,8 +69,8 @@ public double doRangeCheckNOK9(long num) { } public int doRangeCheckNOK10(int num) { - int result = Math.min(MinMaxRangeCheck.LOWER_INT, num); - return Math.max(MinMaxRangeCheck.UPPER_INT, result); // Noncompliant {{Change these chained max/min methods invocations, as final results will always be the upper bound.}} + int result = Math.min(MinMaxRangeCheckSample.LOWER_INT, num); + return Math.max(MinMaxRangeCheckSample.UPPER_INT, result); // Noncompliant {{Change these chained max/min methods invocations, as final results will always be the upper bound.}} } public int doRangeCheckOK1(int num) { // Let's say num = 12 diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NoWayOutLoopCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NoWayOutLoopCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NoWayOutLoopCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NoWayOutLoopCheckSample.java index 904c4486029..354f40f3969 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NoWayOutLoopCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NoWayOutLoopCheckSample.java @@ -6,7 +6,7 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicLong; -public class NoWayOutLoopCheck { +public class NoWayOutLoopCheckSample { private boolean loopExit; private Object a; @@ -254,7 +254,7 @@ private int next() { } } -class NoWayOutLoopCheckUnsupportedYet { +class NoWayOutLoopCheckSampleUnsupportedYet { void unreachableCount() { for (int i = 0; i < 10; i--) { // Noncompliant {{Correct this loop's end condition.}} @@ -267,33 +267,33 @@ private void doSomething() { } -class NoWayOutLoopCheckCoverage { +class NoWayOutLoopCheckSampleCoverage { int n; static void otherPlusAssignment() { - NoWayOutLoopCheckCoverage cov = new NoWayOutLoopCheckCoverage(); + NoWayOutLoopCheckSampleCoverage cov = new NoWayOutLoopCheckSampleCoverage(); cov.n = 0; for (int i = 1; i < 10; i += 1, cov.n += 1) { } } static void otherMinusAssignment() { - NoWayOutLoopCheckCoverage cov = new NoWayOutLoopCheckCoverage(); + NoWayOutLoopCheckSampleCoverage cov = new NoWayOutLoopCheckSampleCoverage(); cov.n = 0; for (int i = 1; i < 10; i += 1, cov.n -= 1) { } } static void otherIncrement() { - NoWayOutLoopCheckCoverage cov = new NoWayOutLoopCheckCoverage(); + NoWayOutLoopCheckSampleCoverage cov = new NoWayOutLoopCheckSampleCoverage(); cov.n = 0; for (int i = 1; i < 10; ++i, cov.n++) { } } static void otherDecrement() { - NoWayOutLoopCheckCoverage cov = new NoWayOutLoopCheckCoverage(); + NoWayOutLoopCheckSampleCoverage cov = new NoWayOutLoopCheckSampleCoverage(); cov.n = 0; for (int i = 1; i < 10; ++i, cov.n--) { cov.n = -cov.n; @@ -328,7 +328,7 @@ private static void doSomething() { class NoWayOutLoopThread extends Thread { @Override public void run() { - NoWayOutLoopCheck loop = new NoWayOutLoopCheck(); + NoWayOutLoopCheckSample loop = new NoWayOutLoopCheckSample(); for (;;) { loop.doSomething(); } diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/noDefault/NonNullSetToNullCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/noDefault/NonNullSetToNullCheckSample.java similarity index 87% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/noDefault/NonNullSetToNullCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/noDefault/NonNullSetToNullCheckSample.java index 3d83253b027..c66ed065929 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/noDefault/NonNullSetToNullCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/noDefault/NonNullSetToNullCheckSample.java @@ -20,7 +20,7 @@ * Note: S4449 is targeting point 3 aswell, but only when it is not directly annotated. The current rule will therefore only report an issue if * the parameter is directly annotated nonnull. */ -class NonNullSetToNullCheck { +class NonNullSetToNullCheckSample { @Nonnull private String primary; @@ -38,7 +38,7 @@ class NonNullSetToNullCheck { private static Integer STATIC_FIELD_NO_ANNOTATION; // ============ 1.1 Fields not initialized in constructor ============ - public NonNullSetToNullCheck(String color) { + public NonNullSetToNullCheckSample(String color) { if (color != null) { secondary = null; } @@ -47,14 +47,14 @@ public NonNullSetToNullCheck(String color) { otherNonnullField = ""; } - public NonNullSetToNullCheck(@Nonnull String color, String other) { + public NonNullSetToNullCheckSample(@Nonnull String color, String other) { primary = color; secondary = other; testObject = new Object(); otherNonnullField = ""; } - public NonNullSetToNullCheck() { // Noncompliant [[sc=10;ec=31]] {{"primary" is marked "@Nonnull" but is not initialized in this constructor.}} + public NonNullSetToNullCheckSample() { // Noncompliant [[sc=10;ec=37]] {{"primary" is marked "@Nonnull" but is not initialized in this constructor.}} return; // Just for coverage } @@ -166,22 +166,22 @@ public String getSecondaryOrDefault(String color) { // ============ 3. Testing nullable value passed as argument ============ public static void initialize1() { - NonNullSetToNullCheck instance = - new NonNullSetToNullCheck(null, "Blue"); // Noncompliant [[sc=7;ec=46]] {{Parameter 1 to this constructor is marked "@Nonnull" but null could be passed.}} + NonNullSetToNullCheckSample instance = + new NonNullSetToNullCheckSample(null, "Blue"); // Noncompliant [[sc=7;ec=52]] {{Parameter 1 to this constructor is marked "@Nonnull" but null could be passed.}} } public static void initialize2() { - NonNullSetToNullCheck instance = new NonNullSetToNullCheck("Black", null); + NonNullSetToNullCheckSample instance = new NonNullSetToNullCheckSample("Black", null); instance.setColors(null, "Green"); // Noncompliant {{Parameter 1 to this call is marked "@Nonnull" but null could be passed.}} } public static void initialize3() { - NonNullSetToNullCheck instance = new NonNullSetToNullCheck("Red", null); + NonNullSetToNullCheckSample instance = new NonNullSetToNullCheckSample("Red", null); instance.setSecondary(null); // Noncompliant {{Parameter 1 to this call is marked "@Nonnull" but null could be passed.}} } public static void initiliaze4() { - NonNullSetToNullCheck instance = new NonNullSetToNullCheck("Red", null); + NonNullSetToNullCheckSample instance = new NonNullSetToNullCheckSample("Red", null); instance.setColors("Cyan", "Blue"); getColorMix(); doSomething(); @@ -190,8 +190,8 @@ public static void initiliaze4() { } public static void initialize5() { - NonNullSetToNullCheck instance = - new NonNullSetToNullCheck(checkForNull(), "Blue"); // Noncompliant + NonNullSetToNullCheckSample instance = + new NonNullSetToNullCheckSample(checkForNull(), "Blue"); // Noncompliant } // ============ 4. Local variable assigned nullable value ============ @@ -257,7 +257,7 @@ private void callMethods(java.util.function.Supplier supplier) { } // ============ Other test cases ============ -class NonNullSetToNullCheckFieldWithInitializer { +class NonNullSetToNullCheckSampleFieldWithInitializer { @Nonnull private static final Integer STATIC_FIELD = null; // Compliant as static fields are not reported private static final Integer STATIC_FIELD_NO_ANNOTATION = null; @@ -266,7 +266,7 @@ class NonNullSetToNullCheckFieldWithInitializer { @Nonnull private Integer val2 = calculate(); - public NonNullSetToNullCheckFieldWithInitializer() { + public NonNullSetToNullCheckSampleFieldWithInitializer() { } // Compliant, the field has an initializer @Nonnull @@ -275,23 +275,23 @@ private Integer calculate() { } } -class NonNullSetToNullCheckCallingOtherConstructor { +class NonNullSetToNullCheckSampleCallingOtherConstructor { @Nonnull private Integer value; - NonNullSetToNullCheckCallingOtherConstructor(String s) { // Compliant - calls other constructor + NonNullSetToNullCheckSampleCallingOtherConstructor(String s) { // Compliant - calls other constructor this(Integer.valueOf(s)); } - NonNullSetToNullCheckCallingOtherConstructor(Object o) { // Noncompliant - calls super constructor but do not initialize value + NonNullSetToNullCheckSampleCallingOtherConstructor(Object o) { // Noncompliant - calls super constructor but do not initialize value super(); } - NonNullSetToNullCheckCallingOtherConstructor(String s, Object o) { // Noncompliant - calls other method + NonNullSetToNullCheckSampleCallingOtherConstructor(String s, Object o) { // Noncompliant - calls other method this.foo(o); } - NonNullSetToNullCheckCallingOtherConstructor(Integer i) { + NonNullSetToNullCheckSampleCallingOtherConstructor(Integer i) { this.value = i; } @@ -299,27 +299,27 @@ void foo(Object o) { } } -class NonNullSetToNullCheckExitWithException { +class NonNullSetToNullCheckSampleExitWithException { @Nonnull private Object self; - public NonNullSetToNullCheckExitWithException() { + public NonNullSetToNullCheckSampleExitWithException() { self = getSelf(); // Compliant } - public NonNullSetToNullCheckExitWithException(int i) throws NonNullSetToNullCheckMyException { + public NonNullSetToNullCheckSampleExitWithException(int i) throws NonNullSetToNullCheckSampleMyException { self = getOtherSelf(); // Compliant } - public NonNullSetToNullCheckExitWithException(@Nonnull String i) { + public NonNullSetToNullCheckSampleExitWithException(@Nonnull String i) { if (i == null) { throw new RuntimeException(); // method exit on exception, OK } self = i; } - public NonNullSetToNullCheckExitWithException(String x, String y) { // Compliant + public NonNullSetToNullCheckSampleExitWithException(String x, String y) { // Compliant try { Integer.valueOf(x); } catch (NumberFormatException e) { @@ -334,12 +334,12 @@ public Object getSelf() throws IllegalArgumentException { } @Nonnull - public Object getOtherSelf() throws NonNullSetToNullCheckMyException { + public Object getOtherSelf() throws NonNullSetToNullCheckSampleMyException { return self; } } -class NonNullSetToNullCheckMyException extends Exception { +class NonNullSetToNullCheckSampleMyException extends Exception { } abstract class ExcludedMethods { diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/packageNonNull/NonNullSetToNullCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/packageNonNull/NonNullSetToNullCheckSample.java similarity index 87% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/packageNonNull/NonNullSetToNullCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/packageNonNull/NonNullSetToNullCheckSample.java index a249853f720..b3c743c91bf 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/packageNonNull/NonNullSetToNullCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/NonNullSetToNullCheck/packageNonNull/NonNullSetToNullCheckSample.java @@ -3,12 +3,12 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -public class NonNullSetToNullCheck { +public class NonNullSetToNullCheckSample { Boolean notInitialized; Integer initialized; // 1.1: field not assigned in constructor - public NonNullSetToNullCheck() { // Noncompliant {{"notInitialized" is marked "@NonNullByDefault at package level" but is not initialized in this constructor.}} + public NonNullSetToNullCheckSample() { // Noncompliant {{"notInitialized" is marked "@NonNullByDefault at package level" but is not initialized in this constructor.}} initialized = 200; } diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ObjectOutputStreamCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ObjectOutputStreamCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ObjectOutputStreamCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ObjectOutputStreamCheckSample.java index e2dc08fde59..eb8b6500896 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ObjectOutputStreamCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ObjectOutputStreamCheckSample.java @@ -12,7 +12,7 @@ import static java.nio.file.StandardOpenOption.APPEND; -class ObjectOutputStreamCheck { +class ObjectOutputStreamCheckSample { void noncompliant_1(String fileName) throws IOException { FileOutputStream fos = new FileOutputStream(fileName , true); // fos opened in append mode ObjectOutputStream out = new ObjectOutputStream(fos); // Noncompliant {{Do not use a FileOutputStream in append mode.}} diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/OptionalGetBeforeIsPresentCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/OptionalGetBeforeIsPresentCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/OptionalGetBeforeIsPresentCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/OptionalGetBeforeIsPresentCheckSample.java index 08d16330a44..00baf90ecde 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/OptionalGetBeforeIsPresentCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/OptionalGetBeforeIsPresentCheckSample.java @@ -4,15 +4,15 @@ import java.util.stream.Stream; import javax.annotation.Nullable; -abstract class OptionalGetBeforeIsPresentCheck { +abstract class OptionalGetBeforeIsPresentCheckSample { Optional getOptional() { return Optional.of(""); } Optional optional; - OptionalGetBeforeIsPresentCheck() { + OptionalGetBeforeIsPresentCheckSample() { this(Optional.empty()); } - OptionalGetBeforeIsPresentCheck(Optional s) { + OptionalGetBeforeIsPresentCheckSample(Optional s) { s.get(); // Noncompliant {{Call "s.isPresent()" before accessing the value.}} if (s.isPresent()) { s.get(); // Compliant diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/noDefault/ParameterNullnessCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/noDefault/ParameterNullnessCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/noDefault/ParameterNullnessCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/noDefault/ParameterNullnessCheckSample.java index 91aa0bbf1d8..55f45b68e30 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/noDefault/ParameterNullnessCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/noDefault/ParameterNullnessCheckSample.java @@ -6,7 +6,7 @@ import javax.annotation.ParametersAreNullableByDefault; @ParametersAreNonnullByDefault -abstract class ParameterNullnessCheck { +abstract class ParameterNullnessCheckSample { Object field; diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/packageNonNull/ParameterNullnessCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/packageNonNull/ParameterNullnessCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/packageNonNull/ParameterNullnessCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/packageNonNull/ParameterNullnessCheckSample.java index d1ef1df1fef..29d82a5c51e 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/packageNonNull/ParameterNullnessCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/ParameterNullnessCheck/packageNonNull/ParameterNullnessCheckSample.java @@ -6,7 +6,7 @@ /** * Package is annotated with @javax.annotation.ParametersAreNonnullByDefault, every parameters in this file are nonnull by default. */ -abstract class ParameterNullnessCheck { +abstract class ParameterNullnessCheckSample { Object field; diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/RedundantAssignmentsCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/RedundantAssignmentsCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/RedundantAssignmentsCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/RedundantAssignmentsCheckSample.java index 66aaffe4c74..6eba7a6c9d4 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/RedundantAssignmentsCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/RedundantAssignmentsCheckSample.java @@ -5,7 +5,7 @@ import java.util.stream.Stream; import javax.annotation.Nullable; -class RedundantAssignmentsCheck { +class RedundantAssignmentsCheckSample { Object a,b,c,d; void foo() { diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3958_StreamNotConsumedCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3958_StreamNotConsumedCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3958_StreamNotConsumedCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3958_StreamNotConsumedCheckSample.java index 7059db6d4e3..10e0db617ca 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3958_StreamNotConsumedCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3958_StreamNotConsumedCheckSample.java @@ -4,7 +4,7 @@ import java.util.stream.*; import java.util.List; -abstract class S3958_StreamNotConsumedCheck { +abstract class S3958_StreamNotConsumedCheckSample { void test() { Stream stream = Stream.of(1, 2, 3); diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3959_StreamConsumedCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3959_StreamConsumedCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3959_StreamConsumedCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3959_StreamConsumedCheckSample.java index fbea05e51a5..c153501d909 100644 --- a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3959_StreamConsumedCheck.java +++ b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S3959_StreamConsumedCheckSample.java @@ -3,7 +3,7 @@ import java.util.stream.*; import java.util.List; -abstract class S3959_StreamConsumedCheck { +abstract class S3959_StreamConsumedCheckSample { void test() { Stream stream = Stream.of(1, 2, 3); diff --git a/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S6377_XmlValidatedSignatureCheck.java b/java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S6377_XmlValidatedSignatureCheckSample.java similarity index 100% rename from java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S6377_XmlValidatedSignatureCheck.java rename to java-checks-test-sources/default/src/main/java/symbolicexecution/checks/S6377_XmlValidatedSignatureCheckSample.java diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJApplyConfigurationCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJApplyConfigurationCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertJApplyConfigurationCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertJApplyConfigurationCheckSample.java index d0d592ff1d5..70af952351e 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJApplyConfigurationCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJApplyConfigurationCheckSample.java @@ -2,7 +2,7 @@ import org.assertj.core.configuration.Configuration; -public class AssertJApplyConfigurationCheck { +public class AssertJApplyConfigurationCheckSample { void notApplied() { Configuration configuration = new Configuration(); // Noncompliant [[sc=19;ec=32]] {{Apply this configuration with apply() or applyAndDisplay().}} configuration.setComparingPrivateFields(true); diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJAssertionsInConsumerCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJAssertionsInConsumerCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertJAssertionsInConsumerCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertJAssertionsInConsumerCheckSample.java index 52c71fb6a0d..1d5274cddb3 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJAssertionsInConsumerCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJAssertionsInConsumerCheckSample.java @@ -9,7 +9,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.atIndex; -public abstract class AssertJAssertionsInConsumerCheck { +public abstract class AssertJAssertionsInConsumerCheckSample { private static final Consumer classRequirements = s -> assertThat(s).isEqualTo("b"); diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJConsecutiveAssertionCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJConsecutiveAssertionCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertJConsecutiveAssertionCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertJConsecutiveAssertionCheckSample.java index 0a4858421ac..f90dd300ac3 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJConsecutiveAssertionCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJConsecutiveAssertionCheckSample.java @@ -10,7 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat; -public class AssertJConsecutiveAssertionCheck { +public class AssertJConsecutiveAssertionCheckSample { String myString = "42"; String myOtherString = "24"; List myList = new ArrayList<>(); diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJContextBeforeAssertionCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJContextBeforeAssertionCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertJContextBeforeAssertionCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertJContextBeforeAssertionCheckSample.java index 01ade8099c1..471b1789e3e 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJContextBeforeAssertionCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJContextBeforeAssertionCheckSample.java @@ -11,7 +11,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatObject; -public class AssertJContextBeforeAssertionCheck { +public class AssertJContextBeforeAssertionCheckSample { void foo() { assertThat("").isEqualTo("").as("Description1").isEqualTo(""); // Compliant diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJTestForEmptinessCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJTestForEmptinessCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertJTestForEmptinessCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertJTestForEmptinessCheckSample.java index b9832f7bf0e..50b4ad38e08 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertJTestForEmptinessCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertJTestForEmptinessCheckSample.java @@ -8,7 +8,7 @@ import static org.assertj.core.api.Assertions.assertThatObject; import static org.assertj.core.api.Assertions.atIndex; -public class AssertJTestForEmptinessCheck { +public class AssertJTestForEmptinessCheckSample { List logs = getLogs(); diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertThatThrownByAloneCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertThatThrownByAloneCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertThatThrownByAloneCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertThatThrownByAloneCheckSample.java index ae452807007..4318eaa0052 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertThatThrownByAloneCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertThatThrownByAloneCheckSample.java @@ -6,7 +6,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; -public class AssertThatThrownByAloneCheck { +public class AssertThatThrownByAloneCheckSample { @Test void noncompliant() { diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionArgumentOrderCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionArgumentOrderCheckSample.java similarity index 78% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertionArgumentOrderCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertionArgumentOrderCheckSample.java index bbe296d04b3..7efa1916084 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionArgumentOrderCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionArgumentOrderCheckSample.java @@ -5,19 +5,19 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.AssertionsForClassTypes.withinPercentage; -class AssertionArgumentOrderCheck { +class AssertionArgumentOrderCheckSample { static final String CONSTANT = ""; void junit() { - assertEquals(0, new AssertionArgumentOrderCheck().actual()); - assertEquals(new AssertionArgumentOrderCheck().actual(), 0); // Noncompliant [[sc=62;ec=63;secondary=12]] - assertEquals("message", new AssertionArgumentOrderCheck().actual(), 0); // Noncompliant - assertEquals("message", 0, new AssertionArgumentOrderCheck().actual()); + assertEquals(0, new AssertionArgumentOrderCheckSample().actual()); + assertEquals(new AssertionArgumentOrderCheckSample().actual(), 0); // Noncompliant [[sc=68;ec=69;secondary=12]] + assertEquals("message", new AssertionArgumentOrderCheckSample().actual(), 0); // Noncompliant + assertEquals("message", 0, new AssertionArgumentOrderCheckSample().actual()); assertEquals("message", "constantString", actualObject()); assertEquals("message", actualObject(), "constantString"); // Noncompliant - assertSame(0, new AssertionArgumentOrderCheck().actual()); - assertSame(new AssertionArgumentOrderCheck().actual(), 0); // Noncompliant - assertNotSame(new AssertionArgumentOrderCheck().actual(), 0); // Noncompliant - assertNotSame("message", new AssertionArgumentOrderCheck().actual(), 0); // Noncompliant + assertSame(0, new AssertionArgumentOrderCheckSample().actual()); + assertSame(new AssertionArgumentOrderCheckSample().actual(), 0); // Noncompliant + assertNotSame(new AssertionArgumentOrderCheckSample().actual(), 0); // Noncompliant + assertNotSame("message", new AssertionArgumentOrderCheckSample().actual(), 0); // Noncompliant //assert equals with double/float and delta assertEquals("message", 0d, actualDouble(), 1d); @@ -34,8 +34,8 @@ void junit() { assertEquals("message", actualObject(), CONSTANT); // Noncompliant - assertEquals("message", actualObject(), AssertionArgumentOrderCheck.CONSTANT); // Noncompliant - assertEquals("message", AssertionArgumentOrderCheck.CONSTANT, actualObject()); + assertEquals("message", actualObject(), AssertionArgumentOrderCheckSample.CONSTANT); // Noncompliant + assertEquals("message", AssertionArgumentOrderCheckSample.CONSTANT, actualObject()); assertEquals(1, 2); // Noncompliant {{Change this assertion to not compare two literals.}} assertEquals(actualObject(), Boolean.FALSE); // Noncompliant @@ -49,8 +49,8 @@ void junit() { void assertJ() { // Simple cases, we can find the expected value - assertThat(0).isEqualTo(new AssertionArgumentOrderCheck().actual()); // Noncompliant [[sc=16;ec=17;secondary=52]] {{Swap these 2 arguments so they are in the correct order: actual value, expected value.}} - assertThat(new AssertionArgumentOrderCheck().actual()).isEqualTo(0); + assertThat(0).isEqualTo(new AssertionArgumentOrderCheckSample().actual()); // Noncompliant [[sc=16;ec=17;secondary=52]] {{Swap these 2 arguments so they are in the correct order: actual value, expected value.}} + assertThat(new AssertionArgumentOrderCheckSample().actual()).isEqualTo(0); assertThat("a").isEqualTo("b"); // Noncompliant {{Change this assertion to not compare two literals.}} assertThat(actualObject()).isEqualTo("constantString"); assertThat("constantString").isEqualTo(actualObject()); // Noncompliant diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionInThreadRunCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionInThreadRunCheckSample.java similarity index 82% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertionInThreadRunCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertionInThreadRunCheckSample.java index 06594468a1a..855dce60a2d 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionInThreadRunCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionInThreadRunCheckSample.java @@ -4,7 +4,7 @@ import static org.easymock.EasyMock.expectLastCall; -class AssertionInThreadRunCheck extends Thread { +class AssertionInThreadRunCheckSample extends Thread { @Override public void run() { org.junit.Assert.assertTrue(true); // Noncompliant [[sc=22;ec=32]] {{Remove this assertion.}} @@ -20,7 +20,7 @@ public void foo() {} public void run(int i){} } -abstract class AssertionInThreadRunCheck_B { +abstract class AssertionInThreadRunCheckSample_B { public void run() { org.junit.Assert.assertTrue(true); org.junit.jupiter.api.Assertions.assertTrue(true); @@ -28,7 +28,7 @@ public void run() { abstract void foo(); } -class AssertionInThreadRunCheck_C extends junit.framework.TestCase { +class AssertionInThreadRunCheckSample_C extends junit.framework.TestCase { class A extends Thread { @Override public void run() { @@ -37,7 +37,7 @@ public void run() { } } -class AssertionInThreadRunCheck_D extends Thread { +class AssertionInThreadRunCheckSample_D extends Thread { @Override public void run() { // Compliant @@ -48,7 +48,7 @@ void foo() { } } -class AssertionInThreadRunCheck_ThreadStopperTest extends EasyMockSupport { +class AssertionInThreadRunCheckSample_ThreadStopperTest extends EasyMockSupport { public void failsToScan() { diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionInTryCatchCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionInTryCatchCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertionInTryCatchCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertionInTryCatchCheckSample.java index 01bcf9611d6..eadfb03c362 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionInTryCatchCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionInTryCatchCheckSample.java @@ -11,7 +11,7 @@ import static org.hamcrest.core.Is.is; import static org.junit.jupiter.api.Assertions.*; -public class AssertionInTryCatchCheck { +public class AssertionInTryCatchCheckSample { @Test public void test_non_compliant1() { diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsCompletenessCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsCompletenessCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertionsCompletenessCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertionsCompletenessCheckSample.java index 927b478e293..94f22455d0c 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsCompletenessCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsCompletenessCheckSample.java @@ -18,7 +18,7 @@ import org.junit.jupiter.api.Nested; import org.mockito.Mockito; -public class AssertionsCompletenessCheck { +public class AssertionsCompletenessCheckSample { @Rule public final org.assertj.core.api.JUnitSoftAssertions junit_soft_assertions = new org.assertj.core.api.JUnitSoftAssertions(); @@ -30,8 +30,8 @@ public void fest_assertions() { org.fest.assertions.Assertions.assertThat(true).overridingErrorMessage("foo"); // Noncompliant org.fest.assertions.Assertions.assertThat(true).isTrue(); // Compliant - org.fest.assertions.Assertions.assertThat(AssertionsCompletenessCheck.class.toString()).hasSize(0); // Compliant - org.fest.assertions.Assertions.assertThat(AssertionsCompletenessCheck.class.toString()).as("aa").hasSize(0); // Compliant + org.fest.assertions.Assertions.assertThat(AssertionsCompletenessCheckSample.class.toString()).hasSize(0); // Compliant + org.fest.assertions.Assertions.assertThat(AssertionsCompletenessCheckSample.class.toString()).as("aa").hasSize(0); // Compliant } private BooleanAssert return_fest_assertion(String filename, String key) { diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsInProductionCodeCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsInProductionCodeCheckSample.java similarity index 77% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertionsInProductionCodeCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertionsInProductionCodeCheckSample.java index 424c25217a3..e92833d3923 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsInProductionCodeCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsInProductionCodeCheckSample.java @@ -2,7 +2,7 @@ import static org.junit.Assert.assertEquals; -public class AssertionsInProductionCodeCheck { +public class AssertionsInProductionCodeCheckSample { void method_with_assertions_in_package_name_containing_test() { assertEquals(0, 0); // Compliant diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsWithoutMessageCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsWithoutMessageCheckSample.java similarity index 93% rename from java-checks-test-sources/default/src/test/java/checks/tests/AssertionsWithoutMessageCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/AssertionsWithoutMessageCheckSample.java index 4175bdd5534..d464da595f6 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsWithoutMessageCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/AssertionsWithoutMessageCheckSample.java @@ -12,7 +12,7 @@ import static checks.tests.MyAbstractIsEqualTo.isEqualTo; -class AssertionsWithoutMessageCheck { +class AssertionsWithoutMessageCheckSample { void foo() { org.assertj.core.api.Assertions.assertThat("").usingComparator(null).as("a").isEqualTo(222); // Compliant org.junit.Assert.assertTrue(true); // Noncompliant [[sc=22;ec=32]] {{Add a message to this assertion.}} @@ -149,24 +149,24 @@ void junit5() { org.junit.jupiter.api.Assertions.assertEquals(1.0, 2.0, () -> "messageSupplier"); org.junit.jupiter.api.Assertions.assertEquals(1.0, 2.0, 1.0, () -> "messageSupplier"); - org.junit.jupiter.api.Assertions.assertDoesNotThrow(() -> new AssertionsWithoutMessageCheck()); // Noncompliant - org.junit.jupiter.api.Assertions.assertDoesNotThrow(AssertionsWithoutMessageCheck::new); // Noncompliant - org.junit.jupiter.api.Assertions.assertDoesNotThrow(() -> new AssertionsWithoutMessageCheck(), "message"); - org.junit.jupiter.api.Assertions.assertDoesNotThrow(AssertionsWithoutMessageCheck::new, "message"); - org.junit.jupiter.api.Assertions.assertDoesNotThrow(AssertionsWithoutMessageCheck::new, () -> "message"); + org.junit.jupiter.api.Assertions.assertDoesNotThrow(() -> new AssertionsWithoutMessageCheckSample()); // Noncompliant + org.junit.jupiter.api.Assertions.assertDoesNotThrow(AssertionsWithoutMessageCheckSample::new); // Noncompliant + org.junit.jupiter.api.Assertions.assertDoesNotThrow(() -> new AssertionsWithoutMessageCheckSample(), "message"); + org.junit.jupiter.api.Assertions.assertDoesNotThrow(AssertionsWithoutMessageCheckSample::new, "message"); + org.junit.jupiter.api.Assertions.assertDoesNotThrow(AssertionsWithoutMessageCheckSample::new, () -> "message"); java.util.List list = new java.util.ArrayList(); org.junit.jupiter.api.Assertions.assertIterableEquals(list, list); // Noncompliant org.junit.jupiter.api.Assertions.assertIterableEquals(list, list, "message"); org.junit.jupiter.api.Assertions.assertIterableEquals(list, list, () -> "message"); - org.junit.jupiter.api.Assertions.assertTimeout(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheck::new); // Noncompliant - org.junit.jupiter.api.Assertions.assertTimeout(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheck::new, "message"); - org.junit.jupiter.api.Assertions.assertTimeout(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheck::new, () -> "message"); + org.junit.jupiter.api.Assertions.assertTimeout(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheckSample::new); // Noncompliant + org.junit.jupiter.api.Assertions.assertTimeout(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheckSample::new, "message"); + org.junit.jupiter.api.Assertions.assertTimeout(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheckSample::new, () -> "message"); - org.junit.jupiter.api.Assertions.assertTimeoutPreemptively(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheck::new); // Noncompliant - org.junit.jupiter.api.Assertions.assertTimeoutPreemptively(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheck::new, "message"); - org.junit.jupiter.api.Assertions.assertTimeoutPreemptively(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheck::new, () -> "message"); + org.junit.jupiter.api.Assertions.assertTimeoutPreemptively(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheckSample::new); // Noncompliant + org.junit.jupiter.api.Assertions.assertTimeoutPreemptively(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheckSample::new, "message"); + org.junit.jupiter.api.Assertions.assertTimeoutPreemptively(java.time.Duration.ofSeconds(3), AssertionsWithoutMessageCheckSample::new, () -> "message"); } class MyCustomGenericAssert extends GenericAssert { diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/BadTestClassNameCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/BadTestClassNameCheckSample.java similarity index 57% rename from java-checks-test-sources/default/src/test/java/checks/tests/BadTestClassNameCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/BadTestClassNameCheckSample.java index 90f3b2cceef..2fc18cc538d 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/BadTestClassNameCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/BadTestClassNameCheckSample.java @@ -2,12 +2,12 @@ import org.junit.Test; -class BadTestClassNameCheck { // Noncompliant {{Rename class "BadTestClassNameCheck" to match the regular expression: '^((Test|IT)[a-zA-Z0-9_]+|[A-Z][a-zA-Z0-9_]*(Test|Tests|TestCase|IT|ITCase))$'}} +class BadTestClassNameCheckSample { // Noncompliant {{Rename class "BadTestClassNameCheckSample" to match the regular expression: '^((Test|IT)[a-zA-Z0-9_]+|[A-Z][a-zA-Z0-9_]*(Test|Tests|TestCase|IT|ITCase))$'}} @Test void foo() {} } -abstract class AbstractBadTestClassNameCheck { // compliant +abstract class AbstractBadTestClassNameCheckSample { // compliant @Test void foo() {} } @@ -17,12 +17,12 @@ class BadTestClassName_Check { // Noncompliant void foo() {} } -class BadTestClassNameCheckTest { // Compliant +class BadTestClassNameCheckSampleTest { // Compliant @org.testng.annotations.Test void foo() {} } -class BadTestClassNameCheckSomeTests { // Compliant +class BadTestClassNameCheckSampleSomeTests { // Compliant @Test void foo() {} } @@ -32,32 +32,32 @@ class Bad_Test_Class_Name_Check_Some_Tests { // Compliant void foo() {} } -class BadTestClassNameCheck2 { // Compliant +class BadTestClassNameCheckSample2 { // Compliant void foo() {} - BadTestClassNameCheck a = new BadTestClassNameCheck() {}; + BadTestClassNameCheckSample a = new BadTestClassNameCheckSample() {}; } -class TestBadTestClassNameCheck { +class TestBadTestClassNameCheckSample { @Test void foo() { } } -class BadTestClassNameCheckTestCase { +class BadTestClassNameCheckSampleTestCase { @Test void foo() { } } -class ITBadTestClassNameCheck { +class ITBadTestClassNameCheckSample { @Test void foo() { } } -class BadTestClassNameCheckIT { +class BadTestClassNameCheckSampleIT { @Test void foo() { } } -class BadTestClassNameCheckITCase { +class BadTestClassNameCheckSampleITCase { @Test void foo() { } diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/BooleanOrNullLiteralInAssertionsCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/BooleanOrNullLiteralInAssertionsCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/test/java/checks/tests/BooleanOrNullLiteralInAssertionsCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/BooleanOrNullLiteralInAssertionsCheckSample.java index 88af1a6d41f..b6fb198b218 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/BooleanOrNullLiteralInAssertionsCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/BooleanOrNullLiteralInAssertionsCheckSample.java @@ -2,7 +2,7 @@ import static org.hamcrest.core.IsNot.not; -class BooleanOrNullLiteralInAssertionsCheck { +class BooleanOrNullLiteralInAssertionsCheckSample { void booleans() { org.junit.Assert.assertTrue( // Noncompliant [[sc=22;ec=32;secondary=8]] {{Remove or correct this assertion.}} true diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/ExpectedExceptionCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/ExpectedExceptionCheckSample.java similarity index 97% rename from java-checks-test-sources/default/src/test/java/checks/tests/ExpectedExceptionCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/ExpectedExceptionCheckSample.java index 1eaec4b7dfb..d1f6e6fa819 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/ExpectedExceptionCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/ExpectedExceptionCheckSample.java @@ -6,7 +6,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; -public class ExpectedExceptionCheck { +public class ExpectedExceptionCheckSample { @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/IgnoredTestsCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/IgnoredTestsCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/test/java/checks/tests/IgnoredTestsCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/IgnoredTestsCheckSample.java index e1cc0f15c8c..6e0c684911a 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/IgnoredTestsCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/IgnoredTestsCheckSample.java @@ -4,7 +4,7 @@ import org.junit.Assume; import org.junit.jupiter.api.Disabled; -abstract class IgnoredTestsCheck { +abstract class IgnoredTestsCheckSample { @org.junit.Ignore void foo() {} // Noncompliant [[sc=8;ec=11]] {{Either add an explanation about why this test is skipped or remove the "@Ignore" annotation.}} @@ -51,7 +51,7 @@ void assume6() { Assume.assumeFalse(Boolean.TRUE); // Noncompliant } - public IgnoredTestsCheck() { + public IgnoredTestsCheckSample() { Assume.assumeTrue(false); // Noncompliant } diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/JUnit45MethodAnnotationCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/JUnit45MethodAnnotationCheckSample.java similarity index 80% rename from java-checks-test-sources/default/src/test/java/checks/tests/JUnit45MethodAnnotationCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/JUnit45MethodAnnotationCheckSample.java index 8f8d3b8b351..5c29a120be6 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/JUnit45MethodAnnotationCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/JUnit45MethodAnnotationCheckSample.java @@ -1,13 +1,13 @@ package checks.tests; -class JUnit45MethodAnnotationCheck_JUnit4 { +class JUnit45MethodAnnotationCheckSample_JUnit4 { @org.junit.Test void test() { } public void setUp() { } // Noncompliant [[sc=15;ec=20]] {{Annotate this method with JUnit4 '@org.junit.Before' or rename it to avoid confusion.}} public void tearDown() { } // Noncompliant {{Annotate this method with JUnit4 '@org.junit.After' or rename it to avoid confusion.}} } -class JUnit45MethodAnnotationCheck_JUnit4_compliant { +class JUnit45MethodAnnotationCheckSample_JUnit4_compliant { protected Object step() { return null; } // unrelated protected Object teaDown() { return null; } // typo from tearDown, but could be unrelated public void setUp(boolean b) { } // Compliant, setUp with argument are excluded @@ -17,49 +17,49 @@ public void tearDown(String s) { } // Compliant, tearDown with argument are excl @org.junit.After public void tearDown() { } } -class JUnit45MethodAnnotationCheck_JUnit4_compliant2 { +class JUnit45MethodAnnotationCheckSample_JUnit4_compliant2 { @org.junit.Test void test() { } @org.junit.BeforeClass public static void setUp() { } @org.junit.AfterClass public static void tearDown() { } } -class JUnit45MethodAnnotationCheck_JUnit4_compliant_private_setup { +class JUnit45MethodAnnotationCheckSample_JUnit4_compliant_private_setup { @org.junit.Test void test() { } private void setUp() { } private void tearDown() { } } -abstract class AbstractJUnit45MethodAnnotationCheck_JUnit4 { +abstract class AbstractJUnit45MethodAnnotationCheckSample_JUnit4 { @org.junit.Before public void setUp() { } } -class JUnit45MethodAnnotationCheck_JUnit4_compliant3 extends AbstractJUnit45MethodAnnotationCheck_JUnit4 { +class JUnit45MethodAnnotationCheckSample_JUnit4_compliant3 extends AbstractJUnit45MethodAnnotationCheckSample_JUnit4 { @org.junit.Test void test() { } @Override public void setUp() { } // Compliant } -class JUnit45MethodAnnotationCheck_JUnit5 { +class JUnit45MethodAnnotationCheckSample_JUnit5 { @org.junit.jupiter.api.Test void test() { } public void setUp() { } // Noncompliant {{Annotate this method with JUnit5 '@org.junit.jupiter.api.BeforeEach' or rename it to avoid confusion.}} public void tearDown() { } // Noncompliant {{Annotate this method with JUnit5 '@org.junit.jupiter.api.AfterEach' or rename it to avoid confusion.}} } -class JUnit45MethodAnnotationCheck_JUnit5_compliant { +class JUnit45MethodAnnotationCheckSample_JUnit5_compliant { @org.junit.jupiter.api.Test void test() { } @org.junit.jupiter.api.BeforeEach public void setUp() { } @org.junit.jupiter.api.AfterEach public void tearDown() { } } -class JUnit45MethodAnnotationCheck_JUnit5_compliant2 { +class JUnit45MethodAnnotationCheckSample_JUnit5_compliant2 { @org.junit.jupiter.api.Test void test() { } @org.junit.jupiter.api.BeforeAll public static void setUp() { } @org.junit.jupiter.api.AfterAll public static void tearDown() { } } -class JUnit45MethodAnnotationCheck_JUnit4_5_mixed { +class JUnit45MethodAnnotationCheckSample_JUnit4_5_mixed { @org.junit.Test void junit4() { } @org.junit.jupiter.api.Test void junit5() { } @@ -71,7 +71,7 @@ class JUnit45MethodAnnotationCheck_JUnit4_5_mixed { @org.junit.After public void after() { } // Noncompliant {{Annotate this method with JUnit5 '@org.junit.jupiter.api.AfterEach' instead of JUnit4 '@After'.}} } -class JUnit45MethodAnnotationCheck_JUnit4_5_mixed2 { +class JUnit45MethodAnnotationCheckSample_JUnit4_5_mixed2 { @org.junit.Test void junit4() { } @org.junit.jupiter.api.Test void junit5() { } @@ -80,13 +80,13 @@ class JUnit45MethodAnnotationCheck_JUnit4_5_mixed2 { @org.junit.AfterClass public static void tearDown() { } // Noncompliant {{Annotate this method with JUnit5 '@org.junit.jupiter.api.AfterAll' instead of JUnit4 '@AfterClass'.}} } -class JUnit45MethodAnnotationCheck_JUnit3 extends junit.framework.TestCase { +class JUnit45MethodAnnotationCheckSample_JUnit3 extends junit.framework.TestCase { // Compliant, no need for annotation in JUnit 3 public void setUp() { } public void tearDown() { } } -class JUnit45MethodAnnotationCheck_mixed_JUnit34 extends junit.framework.TestCase { +class JUnit45MethodAnnotationCheckSample_mixed_JUnit34 extends junit.framework.TestCase { public void setUp() { } // Compliant public void tearDown() { } // Compliant diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/test/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheckSample.java index 6d071dfbe5b..4a50c9b4f56 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheckSample.java @@ -6,7 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -class JUnit5DefaultPackageClassAndMethodCheck { +class JUnit5DefaultPackageClassAndMethodCheckSample { @Test public void testPublic() {} // Noncompliant [[sc=3;ec=9;quickfixes=qf1]] {{Remove this 'public' modifier.}} diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/test/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckSample.java index 6832a6f8013..b6620daff7c 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckSample.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestFactory; -class JUnit5SilentlyIgnoreClassAndMethodCheck { +class JUnit5SilentlyIgnoreClassAndMethodCheckSample { @Test private void testPrivate() {} // Noncompliant [[sc=3;ec=10]] {{Remove this 'private' modifier.}} diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/JUnitCompatibleAnnotationsCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/JUnitCompatibleAnnotationsCheckSample.java similarity index 90% rename from java-checks-test-sources/default/src/test/java/checks/tests/JUnitCompatibleAnnotationsCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/JUnitCompatibleAnnotationsCheckSample.java index a5ff0a4d169..9c904061116 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/JUnitCompatibleAnnotationsCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/JUnitCompatibleAnnotationsCheckSample.java @@ -5,7 +5,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -public class JUnitCompatibleAnnotationsCheck { +public class JUnitCompatibleAnnotationsCheckSample { @Test @RepeatedTest(2) diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/JunitNestedAnnotationCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/JunitNestedAnnotationCheckSample.java similarity index 94% rename from java-checks-test-sources/default/src/test/java/checks/tests/JunitNestedAnnotationCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/JunitNestedAnnotationCheckSample.java index 801ce398d18..1f5cf2c5d86 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/JunitNestedAnnotationCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/JunitNestedAnnotationCheckSample.java @@ -6,7 +6,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -public class JunitNestedAnnotationCheck { // Compliant, this class has some tests but it's not an inner class +public class JunitNestedAnnotationCheckSample { // Compliant, this class has some tests but it's not an inner class @Test void a_test_in_a_non_inner_class() { diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/MockitoEqSimplificationCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/MockitoEqSimplificationCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/test/java/checks/tests/MockitoEqSimplificationCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/MockitoEqSimplificationCheckSample.java index a91e03be697..a324f146e39 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/MockitoEqSimplificationCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/MockitoEqSimplificationCheckSample.java @@ -17,7 +17,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class MockitoEqSimplificationCheck { +public class MockitoEqSimplificationCheckSample { @Captor ArgumentCaptor captor; diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/NonRandomizedTestDataCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/NonRandomizedTestDataCheckSample.java similarity index 95% rename from java-checks-test-sources/default/src/test/java/checks/tests/NonRandomizedTestDataCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/NonRandomizedTestDataCheckSample.java index e08b7677f40..23adc7232fc 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/NonRandomizedTestDataCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/NonRandomizedTestDataCheckSample.java @@ -3,7 +3,7 @@ import java.util.UUID; import org.junit.jupiter.api.Test; -public class NonRandomizedTestDataCheck { +public class NonRandomizedTestDataCheckSample { @Test public void randomizedTest() { diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedCheckedExceptionCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedCheckedExceptionCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedCheckedExceptionCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedCheckedExceptionCheckSample.java index 639501f7180..7c07f67d157 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedCheckedExceptionCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedCheckedExceptionCheckSample.java @@ -11,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -public class OneExpectedCheckedExceptionCheck { +public class OneExpectedCheckedExceptionCheckSample { private final Class myException = IOException.class; private final Executable exec = () -> throwIOException2(throwIOException(1)); diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedRuntimeExceptionCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedRuntimeExceptionCheckSample.java similarity index 99% rename from java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedRuntimeExceptionCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedRuntimeExceptionCheckSample.java index fdf79479726..41c188fc7e9 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedRuntimeExceptionCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/OneExpectedRuntimeExceptionCheckSample.java @@ -11,7 +11,7 @@ import static org.junit.Assert.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -public class OneExpectedRuntimeExceptionCheck { +public class OneExpectedRuntimeExceptionCheckSample { private final Class myException = IllegalStateException.class; private final Executable exec = () -> foo(foo(1)); diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/ParameterizedTestCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/ParameterizedTestCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/test/java/checks/tests/ParameterizedTestCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/ParameterizedTestCheckSample.java index c63ce4631b1..b75371e2d34 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/ParameterizedTestCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/ParameterizedTestCheckSample.java @@ -11,7 +11,7 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; -public class ParameterizedTestCheck { +public class ParameterizedTestCheckSample { String setup = "a"; @Test void testSum11() { // Noncompliant [[sc=8;ec=17;secondary=21,21,21,25,33]] {{Replace these 3 tests with a single Parameterized one.}} @@ -350,7 +350,7 @@ void setup(String s) {} } -abstract class ParameterizedTestCheckOneCandidate { +abstract class ParameterizedTestCheckSampleOneCandidate { @Test void testSum11() { // Compliant, only two methods are candidates, others are not. assertEquals(Integer.sum(1, 1), 2); @@ -385,7 +385,7 @@ void emptyTest() { abstract void abstractTest(); } -class ParameterizedTestCheckNotSameLiteralTypes { +class ParameterizedTestCheckSampleNotSameLiteralTypes { @Test void test1() { // Compliant "compute(1)" and "compute(2.0f)" is not related to the same method setup(); diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/RandomizedTestDataCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/RandomizedTestDataCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/test/java/checks/tests/RandomizedTestDataCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/RandomizedTestDataCheckSample.java index 2849ea9e419..c85f150e66d 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/RandomizedTestDataCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/RandomizedTestDataCheckSample.java @@ -4,7 +4,7 @@ import java.util.UUID; import org.junit.jupiter.api.Test; -public class RandomizedTestDataCheck { +public class RandomizedTestDataCheckSample { @Test public void randomizedTest() { diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/SpringAssertionsSimplificationCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/SpringAssertionsSimplificationCheckSample.java similarity index 98% rename from java-checks-test-sources/default/src/test/java/checks/tests/SpringAssertionsSimplificationCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/SpringAssertionsSimplificationCheckSample.java index 652650171f2..5b06d25f2e0 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/SpringAssertionsSimplificationCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/SpringAssertionsSimplificationCheckSample.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public class SpringAssertionsSimplificationCheck { +public class SpringAssertionsSimplificationCheckSample { Object myObject; ModelAndView modelAndView; diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/TestAnnotationWithExpectedExceptionCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/TestAnnotationWithExpectedExceptionCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/test/java/checks/tests/TestAnnotationWithExpectedExceptionCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/TestAnnotationWithExpectedExceptionCheckSample.java index 15c610556f5..16ec3dbed77 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/TestAnnotationWithExpectedExceptionCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/TestAnnotationWithExpectedExceptionCheckSample.java @@ -1,6 +1,6 @@ package checks.tests; -public class TestAnnotationWithExpectedExceptionCheck { +public class TestAnnotationWithExpectedExceptionCheckSample { @org.junit.Test(expected = ArrayIndexOutOfBoundsException.class) // Compliant, no assertions used public void testException() { throwingMethod(); diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/TestStabilityCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/TestStabilityCheckSample.java similarity index 91% rename from java-checks-test-sources/default/src/test/java/checks/tests/TestStabilityCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/TestStabilityCheckSample.java index c141c9ee60b..219cfb1a6cc 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/TestStabilityCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/TestStabilityCheckSample.java @@ -2,7 +2,7 @@ import org.testng.annotations.Test; -public class TestStabilityCheck { +public class TestStabilityCheckSample { @Test(successPercentage = 80, invocationCount = 10) // Noncompliant[[sc=9;ec=31]]{{Make this test stable and remove this "successPercentage" argument.}} public void flakyTest() { diff --git a/java-checks-test-sources/default/src/test/java/checks/tests/ThreadSleepInTestsCheck.java b/java-checks-test-sources/default/src/test/java/checks/tests/ThreadSleepInTestsCheckSample.java similarity index 96% rename from java-checks-test-sources/default/src/test/java/checks/tests/ThreadSleepInTestsCheck.java rename to java-checks-test-sources/default/src/test/java/checks/tests/ThreadSleepInTestsCheckSample.java index 6751508093f..63fa39d4964 100644 --- a/java-checks-test-sources/default/src/test/java/checks/tests/ThreadSleepInTestsCheck.java +++ b/java-checks-test-sources/default/src/test/java/checks/tests/ThreadSleepInTestsCheckSample.java @@ -6,7 +6,7 @@ import static java.lang.Thread.sleep; -public class ThreadSleepInTestsCheck { +public class ThreadSleepInTestsCheckSample { @Test public void test() throws InterruptedException { diff --git a/java-checks/src/test/java/org/sonar/java/checks/AbstractClassNoFieldShouldBeInterfaceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AbstractClassNoFieldShouldBeInterfaceCheckTest.java index e91900846ef..5fca716404f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AbstractClassNoFieldShouldBeInterfaceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AbstractClassNoFieldShouldBeInterfaceCheckTest.java @@ -28,9 +28,9 @@ class AbstractClassNoFieldShouldBeInterfaceCheckTest { - private static final String TEST_FILE = "checks/AbstractClassNoFieldShouldBeInterfaceCheck.java"; - private static final String TEST_FILE_NO_JAVA_VERSION = "checks/AbstractClassNoFieldShouldBeInterfaceCheck_no_version.java"; - private static final String TEST_FILE_JAVA_9 = "checks/AbstractClassNoFieldShouldBeInterfaceCheck_java9.java"; + private static final String TEST_FILE = "checks/AbstractClassNoFieldShouldBeInterfaceCheckSample.java"; + private static final String TEST_FILE_NO_JAVA_VERSION = "checks/AbstractClassNoFieldShouldBeInterfaceCheckSample_no_version.java"; + private static final String TEST_FILE_JAVA_9 = "checks/AbstractClassNoFieldShouldBeInterfaceCheckSample_java9.java"; @Test void test_no_version() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/AccessibilityChangeCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AccessibilityChangeCheckTest.java index c0d57b176e1..0a62891afe5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AccessibilityChangeCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AccessibilityChangeCheckTest.java @@ -30,7 +30,7 @@ class AccessibilityChangeCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AccessibilityChangeCheck.java")) + .onFile(mainCodeSourcesPath("checks/AccessibilityChangeCheckSample.java")) .withCheck(new AccessibilityChangeCheck()) .withJavaVersion(15) .verifyIssues(); @@ -48,7 +48,7 @@ void test_with_record_support() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/AccessibilityChangeCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/AccessibilityChangeCheckSample.java")) .withCheck(new AccessibilityChangeCheck()) .withJavaVersion(16) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/AccessibilityChangeOnRecordsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AccessibilityChangeOnRecordsCheckTest.java index e2a82425bda..4d9fe40cd3b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AccessibilityChangeOnRecordsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AccessibilityChangeOnRecordsCheckTest.java @@ -28,7 +28,7 @@ class AccessibilityChangeOnRecordsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AccessibilityChangeOnRecordsCheck.java")) + .onFile(mainCodeSourcesPath("checks/AccessibilityChangeOnRecordsCheckSample.java")) .withChecks(new AccessibilityChangeOnRecordsCheck()) .verifyIssues(); } @@ -36,7 +36,7 @@ void test() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AccessibilityChangeOnRecordsCheck.java")) + .onFile(mainCodeSourcesPath("checks/AccessibilityChangeOnRecordsCheckSample.java")) .withChecks(new AccessibilityChangeOnRecordsCheck()) .withoutSemantic() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/AnnotationDefaultArgumentCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AnnotationDefaultArgumentCheckTest.java index 0e652f5401f..aed1d1e635d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AnnotationDefaultArgumentCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AnnotationDefaultArgumentCheckTest.java @@ -30,7 +30,7 @@ class AnnotationDefaultArgumentCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AnnotationDefaultArgumentCheck.java")) + .onFile(mainCodeSourcesPath("checks/AnnotationDefaultArgumentCheckSample.java")) .withCheck(new AnnotationDefaultArgumentCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/AnnotationDefaultArgumentCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/AnnotationDefaultArgumentCheckSample.java")) .withCheck(new AnnotationDefaultArgumentCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/AnonymousClassShouldBeLambdaCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AnonymousClassShouldBeLambdaCheckTest.java index 65126434a54..9a917b5431b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AnonymousClassShouldBeLambdaCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AnonymousClassShouldBeLambdaCheckTest.java @@ -30,7 +30,7 @@ class AnonymousClassShouldBeLambdaCheckTest { @Test void java8() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AnonymousClassShouldBeLambdaCheck.java")) + .onFile(mainCodeSourcesPath("checks/AnonymousClassShouldBeLambdaCheckSample.java")) .withCheck(new AnonymousClassShouldBeLambdaCheck()) .withJavaVersion(8) .verifyIssues(); @@ -56,7 +56,7 @@ void unknown_version() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/AnonymousClassShouldBeLambdaCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/AnonymousClassShouldBeLambdaCheckSample.java")) .withCheck(new AnonymousClassShouldBeLambdaCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ArrayCopyLoopCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ArrayCopyLoopCheckTest.java index 81eda13cfea..9c7508e415d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ArrayCopyLoopCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ArrayCopyLoopCheckTest.java @@ -29,7 +29,7 @@ class ArrayCopyLoopCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ArrayCopyLoopCheck.java")) + .onFile(mainCodeSourcesPath("checks/ArrayCopyLoopCheckSample.java")) .withCheck(new ArrayCopyLoopCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ArrayDesignatorAfterTypeCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ArrayDesignatorAfterTypeCheckTest.java index 46f613621fc..ca120ba860a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ArrayDesignatorAfterTypeCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ArrayDesignatorAfterTypeCheckTest.java @@ -29,7 +29,7 @@ class ArrayDesignatorAfterTypeCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/ArrayDesignatorAfterTypeCheck.java")) + .onFile(mainCodeSourcesPath("checks/ArrayDesignatorAfterTypeCheckSample.java")) .withCheck(new ArrayDesignatorAfterTypeCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ArrayDesignatorOnVariableCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ArrayDesignatorOnVariableCheckTest.java index c18521470d8..22c18fff2a2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ArrayDesignatorOnVariableCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ArrayDesignatorOnVariableCheckTest.java @@ -29,7 +29,7 @@ class ArrayDesignatorOnVariableCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/ArrayDesignatorOnVariableCheck.java")) + .onFile(mainCodeSourcesPath("checks/ArrayDesignatorOnVariableCheckSample.java")) .withCheck(new ArrayDesignatorOnVariableCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ArrayForVarArgCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ArrayForVarArgCheckTest.java index f2e776ab65c..0c9860617b5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ArrayForVarArgCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ArrayForVarArgCheckTest.java @@ -30,7 +30,7 @@ class ArrayForVarArgCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ArrayForVarArgCheck.java")) + .onFile(mainCodeSourcesPath("checks/ArrayForVarArgCheckSample.java")) .withCheck(new ArrayForVarArgCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ArrayForVarArgCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ArrayForVarArgCheckSample.java")) .withCheck(new ArrayForVarArgCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ArrayHashCodeAndToStringCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ArrayHashCodeAndToStringCheckTest.java index 06538343e10..23a4e6dafa6 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ArrayHashCodeAndToStringCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ArrayHashCodeAndToStringCheckTest.java @@ -29,7 +29,7 @@ class ArrayHashCodeAndToStringCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/ArrayHashCodeAndToStringCheck.java")) + .onFile(mainCodeSourcesPath("checks/ArrayHashCodeAndToStringCheckSample.java")) .withCheck(new ArrayHashCodeAndToStringCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ArraysAsListOfPrimitiveToStreamCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ArraysAsListOfPrimitiveToStreamCheckTest.java index ed1c75ca5c4..a4762a6e8e1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ArraysAsListOfPrimitiveToStreamCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ArraysAsListOfPrimitiveToStreamCheckTest.java @@ -29,7 +29,7 @@ class ArraysAsListOfPrimitiveToStreamCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ArraysAsListOfPrimitiveToStreamCheck.java")) + .onFile(mainCodeSourcesPath("checks/ArraysAsListOfPrimitiveToStreamCheckSample.java")) .withCheck(new ArraysAsListOfPrimitiveToStreamCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/AssertOnBooleanVariableCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AssertOnBooleanVariableCheckTest.java index a6d20a4d40b..8c8aa1015c5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AssertOnBooleanVariableCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AssertOnBooleanVariableCheckTest.java @@ -29,7 +29,7 @@ class AssertOnBooleanVariableCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AssertOnBooleanVariableCheck.java")) + .onFile(mainCodeSourcesPath("checks/AssertOnBooleanVariableCheckSample.java")) .withCheck(new AssertOnBooleanVariableCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/AssertionsInProductionCodeCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AssertionsInProductionCodeCheckTest.java index e513e20ab97..2b7f8615918 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AssertionsInProductionCodeCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AssertionsInProductionCodeCheckTest.java @@ -30,7 +30,7 @@ class AssertionsInProductionCodeCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AssertionsInProductionCodeCheck.java")) + .onFile(mainCodeSourcesPath("checks/AssertionsInProductionCodeCheckSample.java")) .withCheck(new AssertionsInProductionCodeCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_specific_package_name() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertionsInProductionCodeCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertionsInProductionCodeCheckSample.java")) .withCheck(new AssertionsInProductionCodeCheck()) .verifyNoIssues(); } @@ -46,7 +46,7 @@ void test_specific_package_name() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AssertionsInProductionCodeCheck.java")) + .onFile(mainCodeSourcesPath("checks/AssertionsInProductionCodeCheckSample.java")) .withCheck(new AssertionsInProductionCodeCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/AssertsOnParametersOfPublicMethodCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AssertsOnParametersOfPublicMethodCheckTest.java index 6077698af39..6d3d62b6e11 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AssertsOnParametersOfPublicMethodCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AssertsOnParametersOfPublicMethodCheckTest.java @@ -29,7 +29,7 @@ class AssertsOnParametersOfPublicMethodCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AssertsOnParametersOfPublicMethodCheck.java")) + .onFile(mainCodeSourcesPath("checks/AssertsOnParametersOfPublicMethodCheckSample.java")) .withCheck(new AssertsOnParametersOfPublicMethodCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/AssignmentInSubExpressionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AssignmentInSubExpressionCheckTest.java index b8babeba6f2..50587f4a77d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AssignmentInSubExpressionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AssignmentInSubExpressionCheckTest.java @@ -29,7 +29,7 @@ class AssignmentInSubExpressionCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AssignmentInSubExpressionCheck.java")) + .onFile(mainCodeSourcesPath("checks/AssignmentInSubExpressionCheckSample.java")) .withCheck(new AssignmentInSubExpressionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/AtLeastOneConstructorCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/AtLeastOneConstructorCheckTest.java index 545c708bcbf..f771775cf6d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/AtLeastOneConstructorCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/AtLeastOneConstructorCheckTest.java @@ -30,7 +30,7 @@ class AtLeastOneConstructorCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/AtLeastOneConstructorCheck.java")) + .onFile(mainCodeSourcesPath("checks/AtLeastOneConstructorCheckSample.java")) .withCheck(new AtLeastOneConstructorCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/AtLeastOneConstructorCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/AtLeastOneConstructorCheckSample.java")) .withCheck(new AtLeastOneConstructorCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/BasicAuthCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/BasicAuthCheckTest.java index 0030c6ba423..29d133754cf 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/BasicAuthCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/BasicAuthCheckTest.java @@ -28,7 +28,7 @@ class BasicAuthCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/BasicAuthCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/BasicAuthCheckSample.java")) .withCheck(new BasicAuthCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/BigDecimalDoubleConstructorCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/BigDecimalDoubleConstructorCheckTest.java index cbab6c53a3e..a8b88685655 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/BigDecimalDoubleConstructorCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/BigDecimalDoubleConstructorCheckTest.java @@ -29,7 +29,7 @@ class BigDecimalDoubleConstructorCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/BigDecimalDoubleConstructorCheck.java")) + .onFile(mainCodeSourcesPath("checks/BigDecimalDoubleConstructorCheckSample.java")) .withCheck(new BigDecimalDoubleConstructorCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/BooleanLiteralCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/BooleanLiteralCheckTest.java index 78cc61def09..94ec6e1a1d9 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/BooleanLiteralCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/BooleanLiteralCheckTest.java @@ -29,7 +29,7 @@ class BooleanLiteralCheckTest { @Test void detected() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/BooleanLiteralCheck.java")) + .onFile(mainCodeSourcesPath("checks/BooleanLiteralCheckSample.java")) .withCheck(new BooleanLiteralCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/BooleanMethodReturnCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/BooleanMethodReturnCheckTest.java index 3c322e586ca..1890ee87213 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/BooleanMethodReturnCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/BooleanMethodReturnCheckTest.java @@ -28,7 +28,7 @@ class BooleanMethodReturnCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/BooleanMethodReturnCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/BooleanMethodReturnCheckSample.java")) .withCheck(new BooleanMethodReturnCheck()) .verifyIssues(); } @@ -36,7 +36,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/BooleanMethodReturnCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/BooleanMethodReturnCheckSample.java")) .withCheck(new BooleanMethodReturnCheck()) .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/BoxedBooleanExpressionsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/BoxedBooleanExpressionsCheckTest.java index d6b8855a458..14603ac2512 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/BoxedBooleanExpressionsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/BoxedBooleanExpressionsCheckTest.java @@ -30,12 +30,12 @@ class BoxedBooleanExpressionsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/BoxedBooleanExpressionsCheck.java")) + .onFile(mainCodeSourcesPath("checks/BoxedBooleanExpressionsCheckSample.java")) .withCheck(new BoxedBooleanExpressionsCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/BoxedBooleanExpressionsCheck.java")) + .onFile(mainCodeSourcesPath("checks/BoxedBooleanExpressionsCheckSample.java")) .withCheck(new BoxedBooleanExpressionsCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/DanglingElseStatementsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DanglingElseStatementsCheckTest.java index d6d3a5eda2a..17171105d51 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DanglingElseStatementsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DanglingElseStatementsCheckTest.java @@ -29,7 +29,7 @@ class DanglingElseStatementsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/DanglingElseStatementsCheck.java")) + .onFile(mainCodeSourcesPath("checks/DanglingElseStatementsCheckSample.java")) .withCheck(new DanglingElseStatementsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/DateFormatWeekYearCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DateFormatWeekYearCheckTest.java index b8e4b70060f..19abcffb70f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DateFormatWeekYearCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DateFormatWeekYearCheckTest.java @@ -30,7 +30,7 @@ class DateFormatWeekYearCheckTest { @Test void test() { ((InternalCheckVerifier) CheckVerifier.newVerifier()) - .onFile(mainCodeSourcesPath("/checks/DateFormatWeekYearCheck.java")) + .onFile(mainCodeSourcesPath("/checks/DateFormatWeekYearCheckSample.java")) .withCheck(new DateFormatWeekYearCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/DateUtilsTruncateCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DateUtilsTruncateCheckTest.java index ef4e4865232..ea041773619 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DateUtilsTruncateCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DateUtilsTruncateCheckTest.java @@ -26,7 +26,7 @@ class DateUtilsTruncateCheckTest { - private static final String FILENAME = mainCodeSourcesPath("checks/DateUtilsTruncateCheck.java"); + private static final String FILENAME = mainCodeSourcesPath("checks/DateUtilsTruncateCheckSample.java"); @Test void java8() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/DeadStoreCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DeadStoreCheckTest.java index 978221340f7..16edafeab7d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DeadStoreCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DeadStoreCheckTest.java @@ -28,7 +28,7 @@ class DeadStoreCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/DeadStoreCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/DeadStoreCheckSample.java")) .withCheck(new DeadStoreCheck()) .verifyIssues(); } @@ -36,7 +36,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/DeadStoreCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/DeadStoreCheckSample.java")) .withCheck(new DeadStoreCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/DefaultEncodingUsageCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DefaultEncodingUsageCheckTest.java index b7f6093eb2b..3a0d30b3a96 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DefaultEncodingUsageCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DefaultEncodingUsageCheckTest.java @@ -31,7 +31,7 @@ class DefaultEncodingUsageCheckTest { @ValueSource(ints = {8, 11, 17}) void test_before_java_version_18(int javaVersion) { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/DefaultEncodingUsageCheck.java")) + .onFile(mainCodeSourcesPath("checks/DefaultEncodingUsageCheckSample.java")) .withCheck(new DefaultEncodingUsageCheck()) .withJavaVersion(javaVersion) .verifyIssues(); @@ -41,7 +41,7 @@ void test_before_java_version_18(int javaVersion) { @ValueSource(ints = {-1, 18, 19}) void test_since_java_version_18_or_not_set(int javaVersion) { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/DefaultEncodingUsageCheck.java")) + .onFile(mainCodeSourcesPath("checks/DefaultEncodingUsageCheckSample.java")) .withCheck(new DefaultEncodingUsageCheck()) .withJavaVersion(javaVersion) .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/DefaultInitializedFieldCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DefaultInitializedFieldCheckTest.java index 341036c346d..10b8bbf0833 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DefaultInitializedFieldCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DefaultInitializedFieldCheckTest.java @@ -29,7 +29,7 @@ class DefaultInitializedFieldCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/DefaultInitializedFieldCheck.java")) + .onFile(mainCodeSourcesPath("checks/DefaultInitializedFieldCheckSample.java")) .withCheck(new DefaultInitializedFieldCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/DeprecatedArgumentsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DeprecatedArgumentsCheckTest.java index d2129d73349..e966b02cf1a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DeprecatedArgumentsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DeprecatedArgumentsCheckTest.java @@ -29,7 +29,7 @@ class DeprecatedArgumentsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/DeprecatedArgumentsCheck.java")) + .onFile(mainCodeSourcesPath("checks/DeprecatedArgumentsCheckSample.java")) .withCheck(new DeprecatedArgumentsCheck()) .withJavaVersion(9) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/DepthOfInheritanceTreeCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DepthOfInheritanceTreeCheckTest.java index 45e97d42c35..7142532b050 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DepthOfInheritanceTreeCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DepthOfInheritanceTreeCheckTest.java @@ -40,7 +40,7 @@ void max_level_is_2() { DepthOfInheritanceTreeCheck check = new DepthOfInheritanceTreeCheck(); check.setMax(2); - String filename = mainCodeSourcesPath("checks/DepthOfInheritanceTreeCheck.java"); + String filename = mainCodeSourcesPath("checks/DepthOfInheritanceTreeCheckSample.java"); CheckVerifier.newVerifier() .onFile(filename) diff --git a/java-checks/src/test/java/org/sonar/java/checks/DoubleBraceInitializationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DoubleBraceInitializationCheckTest.java index 2c6cf9c68b5..c231a3c0d53 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DoubleBraceInitializationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DoubleBraceInitializationCheckTest.java @@ -29,7 +29,7 @@ class DoubleBraceInitializationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/DoubleBraceInitializationCheck.java")) + .onFile(mainCodeSourcesPath("checks/DoubleBraceInitializationCheckSample.java")) .withCheck(new DoubleBraceInitializationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/DuplicateConditionIfElseIfCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DuplicateConditionIfElseIfCheckTest.java index 0ef81c11678..4422cc6949e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DuplicateConditionIfElseIfCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DuplicateConditionIfElseIfCheckTest.java @@ -29,7 +29,7 @@ class DuplicateConditionIfElseIfCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/DuplicateConditionIfElseIfCheck.java")) + .onFile(mainCodeSourcesPath("checks/DuplicateConditionIfElseIfCheckSample.java")) .withCheck(new DuplicateConditionIfElseIfCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/DynamicClassLoadCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/DynamicClassLoadCheckTest.java index 41a862dd173..90d85c539c7 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/DynamicClassLoadCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/DynamicClassLoadCheckTest.java @@ -29,7 +29,7 @@ class DynamicClassLoadCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/DynamicClassLoadCheck.java")) + .onFile(mainCodeSourcesPath("checks/DynamicClassLoadCheckSample.java")) .withCheck(new DynamicClassLoadCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/EmptyMethodsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/EmptyMethodsCheckTest.java index 7a72ea4f6eb..a39dbf119e8 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/EmptyMethodsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/EmptyMethodsCheckTest.java @@ -29,7 +29,7 @@ class EmptyMethodsCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/EmptyMethodsCheck.java")) + .onFile(mainCodeSourcesPath("checks/EmptyMethodsCheckSample.java")) .withCheck(new EmptyMethodsCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/EmptyStatementUsageCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/EmptyStatementUsageCheckTest.java index 0d33212db9c..9309395349b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/EmptyStatementUsageCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/EmptyStatementUsageCheckTest.java @@ -29,7 +29,7 @@ class EmptyStatementUsageCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/EmptyStatementUsageCheck.java")) + .onFile(mainCodeSourcesPath("checks/EmptyStatementUsageCheckSample.java")) .withCheck(new EmptyStatementUsageCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/EnumMapCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/EnumMapCheckTest.java index acc92e82e52..8f7d21b9fde 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/EnumMapCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/EnumMapCheckTest.java @@ -29,7 +29,7 @@ class EnumMapCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/EnumMapCheck.java")) + .onFile(mainCodeSourcesPath("checks/EnumMapCheckSample.java")) .withCheck(new EnumMapCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/EnumMutableFieldCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/EnumMutableFieldCheckTest.java index a42dcbddf25..83dd69632b7 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/EnumMutableFieldCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/EnumMutableFieldCheckTest.java @@ -30,7 +30,7 @@ class EnumMutableFieldCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/EnumMutableFieldCheck.java")) + .onFile(mainCodeSourcesPath("checks/EnumMutableFieldCheckSample.java")) .withCheck(new EnumMutableFieldCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void testNonCompiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/EnumMutableFieldCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/EnumMutableFieldCheckSample.java")) .withCheck(new EnumMutableFieldCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/EnumSetCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/EnumSetCheckTest.java index 8093556c092..55068b743c7 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/EnumSetCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/EnumSetCheckTest.java @@ -29,7 +29,7 @@ class EnumSetCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/EnumSetCheck.java")) + .onFile(mainCodeSourcesPath("checks/EnumSetCheckSample.java")) .withCheck(new EnumSetCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/EqualsNotOverriddenInSubclassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/EqualsNotOverriddenInSubclassCheckTest.java index d05bc867d56..bd4db452dda 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/EqualsNotOverriddenInSubclassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/EqualsNotOverriddenInSubclassCheckTest.java @@ -30,12 +30,12 @@ class EqualsNotOverriddenInSubclassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/EqualsNotOverriddenInSubclassCheck.java")) + .onFile(mainCodeSourcesPath("checks/EqualsNotOverriddenInSubclassCheckSample.java")) .withCheck(new EqualsNotOverriddenInSubclassCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/EqualsNotOverriddenInSubclassCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/EqualsNotOverriddenInSubclassCheckSample.java")) .withCheck(new EqualsNotOverriddenInSubclassCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/EqualsOnAtomicClassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/EqualsOnAtomicClassCheckTest.java index 8a3a409c20b..bcaf5402905 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/EqualsOnAtomicClassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/EqualsOnAtomicClassCheckTest.java @@ -29,7 +29,7 @@ class EqualsOnAtomicClassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/EqualsOnAtomicClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/EqualsOnAtomicClassCheckSample.java")) .withCheck(new EqualsOnAtomicClassCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/EqualsParametersMarkedNonNullCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/EqualsParametersMarkedNonNullCheckTest.java index d47d267938c..ec910a3e02d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/EqualsParametersMarkedNonNullCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/EqualsParametersMarkedNonNullCheckTest.java @@ -30,7 +30,7 @@ class EqualsParametersMarkedNonNullCheckTest { @Test void detected() { ((InternalCheckVerifier) CheckVerifier.newVerifier()) - .onFile(mainCodeSourcesPath("checks/EqualsParametersMarkedNonNullCheck.java")) + .onFile(mainCodeSourcesPath("checks/EqualsParametersMarkedNonNullCheckSample.java")) .withCheck(new EqualsParametersMarkedNonNullCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ErrorClassExtendedCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ErrorClassExtendedCheckTest.java index c17256e733b..16faedc31ba 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ErrorClassExtendedCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ErrorClassExtendedCheckTest.java @@ -29,7 +29,7 @@ class ErrorClassExtendedCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ErrorClassExtendedCheck.java")) + .onFile(mainCodeSourcesPath("checks/ErrorClassExtendedCheckSample.java")) .withCheck(new ErrorClassExtendedCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/EscapedUnicodeCharactersCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/EscapedUnicodeCharactersCheckTest.java index 1405a9be32e..2e17325366b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/EscapedUnicodeCharactersCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/EscapedUnicodeCharactersCheckTest.java @@ -30,7 +30,7 @@ class EscapedUnicodeCharactersCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/EscapedUnicodeCharactersCheck.java")) + .onFile(mainCodeSourcesPath("checks/EscapedUnicodeCharactersCheckSample.java")) .withCheck(new EscapedUnicodeCharactersCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_text_blocks() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/EscapedUnicodeCharactersTextBlocksCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/EscapedUnicodeCharactersTextBlocksCheckSample.java")) .withCheck(new EscapedUnicodeCharactersCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ExpressionComplexityCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ExpressionComplexityCheckTest.java index b6bb06ad3d8..24f760363e3 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ExpressionComplexityCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ExpressionComplexityCheckTest.java @@ -29,7 +29,7 @@ class ExpressionComplexityCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ExpressionComplexityCheck.java")) + .onFile(mainCodeSourcesPath("checks/ExpressionComplexityCheckSample.java")) .withCheck(new ExpressionComplexityCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/FinalizeFieldsSetCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/FinalizeFieldsSetCheckTest.java index f76a197aaae..8bb8ba10d12 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/FinalizeFieldsSetCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/FinalizeFieldsSetCheckTest.java @@ -30,7 +30,7 @@ class FinalizeFieldsSetCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/FinalizeFieldsSetCheck.java")) + .onFile(mainCodeSourcesPath("checks/FinalizeFieldsSetCheckSample.java")) .withCheck(new FinalizeFieldsSetCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/FinalizeFieldsSetCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/FinalizeFieldsSetCheckSample.java")) .withCheck(new FinalizeFieldsSetCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/FixmeTagPresenceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/FixmeTagPresenceCheckTest.java index ffaba0bee06..81cbd13febb 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/FixmeTagPresenceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/FixmeTagPresenceCheckTest.java @@ -29,7 +29,7 @@ class FixmeTagPresenceCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/FixmeTagPresenceCheck.java")) + .onFile(mainCodeSourcesPath("checks/FixmeTagPresenceCheckSample.java")) .withCheck(new FixmeTagPresenceCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ForLoopFalseConditionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ForLoopFalseConditionCheckTest.java index 2be525ebb17..34ea4757a9b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ForLoopFalseConditionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ForLoopFalseConditionCheckTest.java @@ -30,7 +30,7 @@ class ForLoopFalseConditionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ForLoopFalseConditionCheck.java")) + .onFile(mainCodeSourcesPath("checks/ForLoopFalseConditionCheckSample.java")) .withCheck(new ForLoopFalseConditionCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ForLoopFalseConditionCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ForLoopFalseConditionCheckSample.java")) .withCheck(new ForLoopFalseConditionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ForLoopIncrementAndUpdateCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ForLoopIncrementAndUpdateCheckTest.java index 167140fae4f..c6651cc840b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ForLoopIncrementAndUpdateCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ForLoopIncrementAndUpdateCheckTest.java @@ -30,7 +30,7 @@ class ForLoopIncrementAndUpdateCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ForLoopIncrementAndUpdateCheck.java")) + .onFile(mainCodeSourcesPath("checks/ForLoopIncrementAndUpdateCheckSample.java")) .withCheck(new ForLoopIncrementAndUpdateCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ForLoopIncrementAndUpdateCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ForLoopIncrementAndUpdateCheckSample.java")) .withCheck(new ForLoopIncrementAndUpdateCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ForLoopVariableTypeCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ForLoopVariableTypeCheckTest.java index a05bce774eb..febaf7a768c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ForLoopVariableTypeCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ForLoopVariableTypeCheckTest.java @@ -31,7 +31,7 @@ class ForLoopVariableTypeCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ForLoopVariableTypeCheck.java")) + .onFile(mainCodeSourcesPath("checks/ForLoopVariableTypeCheckSample.java")) .withCheck(new ForLoopVariableTypeCheck()) .verifyIssues(); } @@ -39,7 +39,7 @@ void test() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ForLoopVariableTypeCheck.java")) + .onFile(mainCodeSourcesPath("checks/ForLoopVariableTypeCheckSample.java")) .withCheck(new ForLoopVariableTypeCheck()) .withClassPath(Collections.emptyList()) .verifyIssues(); @@ -48,7 +48,7 @@ void test_without_semantic() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ForLoopVariableTypeCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ForLoopVariableTypeCheckSample.java")) .withCheck(new ForLoopVariableTypeCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/GarbageCollectorCalledCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/GarbageCollectorCalledCheckTest.java index 04e936ecb1c..02fc79a952c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/GarbageCollectorCalledCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/GarbageCollectorCalledCheckTest.java @@ -30,7 +30,7 @@ class GarbageCollectorCalledCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/GarbageCollectorCalledCheck.java")) + .onFile(mainCodeSourcesPath("checks/GarbageCollectorCalledCheckSample.java")) .withCheck(new GarbageCollectorCalledCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/GarbageCollectorCalledCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/GarbageCollectorCalledCheckSample.java")) .withCheck(new GarbageCollectorCalledCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/GetClassLoaderCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/GetClassLoaderCheckTest.java index 899d7d949f3..976c92badfa 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/GetClassLoaderCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/GetClassLoaderCheckTest.java @@ -29,7 +29,7 @@ class GetClassLoaderCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/GetClassLoaderCheck.java")) + .onFile(mainCodeSourcesPath("checks/GetClassLoaderCheckSample.java")) .withCheck(new GetClassLoaderCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/GetRequestedSessionIdCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/GetRequestedSessionIdCheckTest.java index 58f48b778f4..a6d51a9971b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/GetRequestedSessionIdCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/GetRequestedSessionIdCheckTest.java @@ -29,7 +29,7 @@ class GetRequestedSessionIdCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/GetRequestedSessionIdCheck.java")) + .onFile(mainCodeSourcesPath("checks/GetRequestedSessionIdCheckSample.java")) .withCheck(new GetRequestedSessionIdCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/HardCodedPasswordCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/HardCodedPasswordCheckTest.java index edc9bbc154c..b5776a88ae0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/HardCodedPasswordCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/HardCodedPasswordCheckTest.java @@ -30,7 +30,7 @@ class HardCodedPasswordCheckTest { @Test void default_words() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/HardCodedPasswordCheck.java")) + .onFile(mainCodeSourcesPath("checks/HardCodedPasswordCheckSample.java")) .withCheck(new HardCodedPasswordCheck()) .verifyIssues(); } @@ -48,7 +48,7 @@ void custom_words() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/HardCodedPasswordCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/HardCodedPasswordCheckSample.java")) .withCheck(new HardCodedPasswordCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/HardCodedSecretCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/HardCodedSecretCheckTest.java index 17e7423ec3b..8b07f7a53f2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/HardCodedSecretCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/HardCodedSecretCheckTest.java @@ -29,7 +29,7 @@ class HardCodedSecretCheckTest { @Test void default_words() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/HardCodedSecretCheck.java")) + .onFile(mainCodeSourcesPath("checks/HardCodedSecretCheckSample.java")) .withCheck(new HardCodedSecretCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/HardcodedIpCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/HardcodedIpCheckTest.java index 16d946b55ea..73e6f6c7c2a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/HardcodedIpCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/HardcodedIpCheckTest.java @@ -29,7 +29,7 @@ class HardcodedIpCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/HardcodedIpCheck.java")) + .onFile(mainCodeSourcesPath("checks/HardcodedIpCheckSample.java")) .withCheck(new HardcodedIpCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/HardcodedURICheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/HardcodedURICheckTest.java index 669d60027a4..ccb91b0685c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/HardcodedURICheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/HardcodedURICheckTest.java @@ -28,7 +28,7 @@ class HardcodedURICheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/HardcodedURICheck.java")) + .onFile(mainCodeSourcesPath("checks/HardcodedURICheckSample.java")) .withCheck(new HardcodedURICheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/HasNextCallingNextCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/HasNextCallingNextCheckTest.java index b6bef9cd720..9adf2a095c3 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/HasNextCallingNextCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/HasNextCallingNextCheckTest.java @@ -29,7 +29,7 @@ class HasNextCallingNextCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/HasNextCallingNextCheck.java")) + .onFile(mainCodeSourcesPath("checks/HasNextCallingNextCheckSample.java")) .withCheck(new HasNextCallingNextCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/HiddenFieldCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/HiddenFieldCheckTest.java index c668e13a0d5..374514ad0f5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/HiddenFieldCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/HiddenFieldCheckTest.java @@ -30,7 +30,7 @@ class HiddenFieldCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/HiddenFieldCheck.java")) + .onFile(mainCodeSourcesPath("checks/HiddenFieldCheckSample.java")) .withCheck(new HiddenFieldCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/IdenticalCasesInSwitchCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/IdenticalCasesInSwitchCheckTest.java index 4250fbebd69..e0033adfc9c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/IdenticalCasesInSwitchCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/IdenticalCasesInSwitchCheckTest.java @@ -30,7 +30,7 @@ class IdenticalCasesInSwitchCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/IdenticalCasesInSwitchCheck.java")) + .onFile(mainCodeSourcesPath("checks/IdenticalCasesInSwitchCheckSample.java")) .withCheck(new IdenticalCasesInSwitchCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_switch_expression() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/IdenticalCasesInSwitchCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/IdenticalCasesInSwitchCheckSample.java")) .withCheck(new IdenticalCasesInSwitchCheck()) .withJavaVersion(14) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/IgnoredReturnValueCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/IgnoredReturnValueCheckTest.java index 3e402d095a0..34c93127910 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/IgnoredReturnValueCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/IgnoredReturnValueCheckTest.java @@ -32,12 +32,12 @@ class IgnoredReturnValueCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/S2201_IgnoredReturnValueCheck.java")) + .onFile(mainCodeSourcesPath("checks/S2201_IgnoredReturnValueCheckSample.java")) .withCheck(CHECK) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/S2201_IgnoredReturnValueCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/S2201_IgnoredReturnValueCheckSample.java")) .withCheck(CHECK) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/IgnoredStreamReturnValueCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/IgnoredStreamReturnValueCheckTest.java index fbee4c88236..49ceed26777 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/IgnoredStreamReturnValueCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/IgnoredStreamReturnValueCheckTest.java @@ -28,7 +28,7 @@ class IgnoredStreamReturnValueCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/IgnoredStreamReturnValueCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/IgnoredStreamReturnValueCheckSample.java")) .withCheck(new IgnoredStreamReturnValueCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ImmediateReverseBoxingCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ImmediateReverseBoxingCheckTest.java index 152bcecaa6a..d9d4f7e9589 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ImmediateReverseBoxingCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ImmediateReverseBoxingCheckTest.java @@ -31,7 +31,7 @@ class ImmediateReverseBoxingCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/ImmediateReverseBoxingCheck.java")) + .onFile(mainCodeSourcesPath("checks/ImmediateReverseBoxingCheckSample.java")) .withCheck(new ImmediateReverseBoxingCheck()) .withQuickFixes() .verifyIssues(); @@ -40,7 +40,7 @@ void test() { @Test void test_non_compilable() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ImmediateReverseBoxingCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ImmediateReverseBoxingCheckSample.java")) .withCheck(new ImmediateReverseBoxingCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ImmediatelyReturnedVariableCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ImmediatelyReturnedVariableCheckTest.java index 7c694a231d1..fb79151789a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ImmediatelyReturnedVariableCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ImmediatelyReturnedVariableCheckTest.java @@ -29,7 +29,7 @@ class ImmediatelyReturnedVariableCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(TestUtils.mainCodeSourcesPath("checks/ImmediatelyReturnedVariableCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/ImmediatelyReturnedVariableCheckSample.java")) .withCheck(new ImmediatelyReturnedVariableCheck()) .withQuickFixes() .verifyIssues(); @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/ImmediatelyReturnedVariableCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/ImmediatelyReturnedVariableCheckSample.java")) .withCheck(new ImmediatelyReturnedVariableCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ImplementsEnumerationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ImplementsEnumerationCheckTest.java index be3a79205f8..ab315a07f6e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ImplementsEnumerationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ImplementsEnumerationCheckTest.java @@ -29,7 +29,7 @@ class ImplementsEnumerationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ImplementsEnumerationCheck.java")) + .onFile(mainCodeSourcesPath("checks/ImplementsEnumerationCheckSample.java")) .withCheck(new ImplementsEnumerationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/InappropriateRegexpCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InappropriateRegexpCheckTest.java index bfd9a5daa85..364ad94a4e2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InappropriateRegexpCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InappropriateRegexpCheckTest.java @@ -29,7 +29,7 @@ class InappropriateRegexpCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InappropriateRegexpCheck.java")) + .onFile(mainCodeSourcesPath("checks/InappropriateRegexpCheckSample.java")) .withCheck(new InappropriateRegexpCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/IncorrectOrderOfMembersCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/IncorrectOrderOfMembersCheckTest.java index 1cd39c7af7e..0c9ef0eef69 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/IncorrectOrderOfMembersCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/IncorrectOrderOfMembersCheckTest.java @@ -29,7 +29,7 @@ class IncorrectOrderOfMembersCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/IncorrectOrderOfMembersCheck.java")) + .onFile(mainCodeSourcesPath("checks/IncorrectOrderOfMembersCheckSample.java")) .withCheck(new IncorrectOrderOfMembersCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/IndentationAfterConditionalCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/IndentationAfterConditionalCheckTest.java index a16b697a3f3..b4c16d1bc2f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/IndentationAfterConditionalCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/IndentationAfterConditionalCheckTest.java @@ -28,7 +28,7 @@ class IndentationAfterConditionalCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/IndentationAfterConditionalCheck.java")) + .onFile(mainCodeSourcesPath("checks/IndentationAfterConditionalCheckSample.java")) .withCheck(new IndentationAfterConditionalCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/InnerClassOfNonSerializableCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InnerClassOfNonSerializableCheckTest.java index 118972b4d81..5465d1aaf8e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InnerClassOfNonSerializableCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InnerClassOfNonSerializableCheckTest.java @@ -29,7 +29,7 @@ class InnerClassOfNonSerializableCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InnerClassOfNonSerializableCheck.java")) + .onFile(mainCodeSourcesPath("checks/InnerClassOfNonSerializableCheckSample.java")) .withCheck(new InnerClassOfNonSerializableCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/InnerClassOfSerializableCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InnerClassOfSerializableCheckTest.java index 27224463a49..0bda6791bf3 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InnerClassOfSerializableCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InnerClassOfSerializableCheckTest.java @@ -29,7 +29,7 @@ class InnerClassOfSerializableCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InnerClassOfSerializableCheck.java")) + .onFile(mainCodeSourcesPath("checks/InnerClassOfSerializableCheckSample.java")) .withCheck(new InnerClassOfSerializableCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/InputStreamReadCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InputStreamReadCheckTest.java index 2b505e31e95..a089e9efc10 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InputStreamReadCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InputStreamReadCheckTest.java @@ -29,7 +29,7 @@ class InputStreamReadCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InputStreamReadCheck.java")) + .onFile(mainCodeSourcesPath("checks/InputStreamReadCheckSample.java")) .withCheck(new InputStreamReadCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/InsecureCreateTempFileCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InsecureCreateTempFileCheckTest.java index 0d02c1c1321..5240f49f3f9 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InsecureCreateTempFileCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InsecureCreateTempFileCheckTest.java @@ -37,7 +37,7 @@ void no_version() { @Test void java_7() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InsecureCreateTempFileCheck.java")) + .onFile(mainCodeSourcesPath("checks/InsecureCreateTempFileCheckSample.java")) .withCheck(new InsecureCreateTempFileCheck()) .withJavaVersion(7) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/InstanceofUsedOnExceptionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InstanceofUsedOnExceptionCheckTest.java index 1951ae632fd..03cf94a4c8b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InstanceofUsedOnExceptionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InstanceofUsedOnExceptionCheckTest.java @@ -29,7 +29,7 @@ class InstanceofUsedOnExceptionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InstanceofUsedOnExceptionCheck.java")) + .onFile(mainCodeSourcesPath("checks/InstanceofUsedOnExceptionCheckSample.java")) .withCheck(new InstanceofUsedOnExceptionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/InterfaceAsConstantContainerCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InterfaceAsConstantContainerCheckTest.java index 7639941146d..6ed83148cb4 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InterfaceAsConstantContainerCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InterfaceAsConstantContainerCheckTest.java @@ -29,7 +29,7 @@ class InterfaceAsConstantContainerCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InterfaceAsConstantContainerCheck.java")) + .onFile(mainCodeSourcesPath("checks/InterfaceAsConstantContainerCheckSample.java")) .withCheck(new InterfaceAsConstantContainerCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/InterfaceOrSuperclassShadowingCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InterfaceOrSuperclassShadowingCheckTest.java index e57a00f77d1..b86ea265116 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InterfaceOrSuperclassShadowingCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InterfaceOrSuperclassShadowingCheckTest.java @@ -30,7 +30,7 @@ class InterfaceOrSuperclassShadowingCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InterfaceOrSuperclassShadowingCheck.java")) + .onFile(mainCodeSourcesPath("checks/InterfaceOrSuperclassShadowingCheckSample.java")) .withCheck(new InterfaceOrSuperclassShadowingCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/InterfaceOrSuperclassShadowingCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/InterfaceOrSuperclassShadowingCheckSample.java")) .withCheck(new InterfaceOrSuperclassShadowingCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/InterruptedExceptionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InterruptedExceptionCheckTest.java index a83bd563c57..9edc53e5c15 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InterruptedExceptionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InterruptedExceptionCheckTest.java @@ -30,12 +30,12 @@ class InterruptedExceptionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InterruptedExceptionCheck.java")) + .onFile(mainCodeSourcesPath("checks/InterruptedExceptionCheckSample.java")) .withCheck(new InterruptedExceptionCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InterruptedExceptionCheck.java")) + .onFile(mainCodeSourcesPath("checks/InterruptedExceptionCheckSample.java")) .withCheck(new InterruptedExceptionCheck()) .withoutSemantic() .verifyIssues(); @@ -44,12 +44,12 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/InterruptedExceptionCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/InterruptedExceptionCheckSample.java")) .withCheck(new InterruptedExceptionCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/InterruptedExceptionCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/InterruptedExceptionCheckSample.java")) .withCheck(new InterruptedExceptionCheck()) .withoutSemantic() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/InvalidDateValuesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/InvalidDateValuesCheckTest.java index 6264fe67189..17969b84b36 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/InvalidDateValuesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/InvalidDateValuesCheckTest.java @@ -29,7 +29,7 @@ class InvalidDateValuesCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/InvalidDateValuesCheck.java")) + .onFile(mainCodeSourcesPath("checks/InvalidDateValuesCheckSample.java")) .withCheck(new InvalidDateValuesCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/IsInstanceMethodCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/IsInstanceMethodCheckTest.java index 5a467c0c3f1..94c47ef0515 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/IsInstanceMethodCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/IsInstanceMethodCheckTest.java @@ -30,7 +30,7 @@ class IsInstanceMethodCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/IsInstanceMethodCheck.java")) + .onFile(mainCodeSourcesPath("checks/IsInstanceMethodCheckSample.java")) .withCheck(new IsInstanceMethodCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/IsInstanceMethodCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/IsInstanceMethodCheckSample.java")) .withCheck(new IsInstanceMethodCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/IterableIteratorCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/IterableIteratorCheckTest.java index 0e756352b99..46102e04207 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/IterableIteratorCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/IterableIteratorCheckTest.java @@ -29,7 +29,7 @@ class IterableIteratorCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/IterableIteratorCheck.java")) + .onFile(mainCodeSourcesPath("checks/IterableIteratorCheckSample.java")) .withCheck(new IterableIteratorCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/IteratorNextExceptionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/IteratorNextExceptionCheckTest.java index 52aa6aa7f1e..6f43f2feb27 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/IteratorNextExceptionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/IteratorNextExceptionCheckTest.java @@ -28,7 +28,7 @@ class IteratorNextExceptionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/IteratorNextExceptionCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/IteratorNextExceptionCheckSample.java")) .withCheck(new IteratorNextExceptionCheck()) .verifyIssues(); } @@ -36,7 +36,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/IteratorNextExceptionCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/IteratorNextExceptionCheckSample.java")) .withCheck(new IteratorNextExceptionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/JacksonDeserializationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/JacksonDeserializationCheckTest.java index a5751ebb1b4..db87066bec9 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/JacksonDeserializationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/JacksonDeserializationCheckTest.java @@ -29,7 +29,7 @@ class JacksonDeserializationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/JacksonDeserializationCheck.java")) + .onFile(mainCodeSourcesPath("checks/JacksonDeserializationCheckSample.java")) .withCheck(new JacksonDeserializationCheck()) .verifyIssues(); } @@ -37,7 +37,7 @@ void test() { @Test void test_no_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/JacksonDeserializationCheck.java")) + .onFile(mainCodeSourcesPath("checks/JacksonDeserializationCheckSample.java")) .withCheck(new JacksonDeserializationCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/JdbcDriverExplicitLoadingCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/JdbcDriverExplicitLoadingCheckTest.java index 958992cc562..bf986452aab 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/JdbcDriverExplicitLoadingCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/JdbcDriverExplicitLoadingCheckTest.java @@ -26,7 +26,7 @@ class JdbcDriverExplicitLoadingCheckTest { - private static final String FILENAME = mainCodeSourcesPath("checks/JdbcDriverExplicitLoadingCheck.java"); + private static final String FILENAME = mainCodeSourcesPath("checks/JdbcDriverExplicitLoadingCheckSample.java"); @Test void java6() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/LabelsShouldNotBeUsedCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/LabelsShouldNotBeUsedCheckTest.java index 2bdbbc7f3d4..0d9a06fb340 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/LabelsShouldNotBeUsedCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/LabelsShouldNotBeUsedCheckTest.java @@ -29,7 +29,7 @@ class LabelsShouldNotBeUsedCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/LabelsShouldNotBeUsedCheck.java")) + .onFile(mainCodeSourcesPath("checks/LabelsShouldNotBeUsedCheckSample.java")) .withCheck(new LabelsShouldNotBeUsedCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/LambdaTooBigCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/LambdaTooBigCheckTest.java index 96f86d702f5..54ba997af36 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/LambdaTooBigCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/LambdaTooBigCheckTest.java @@ -29,7 +29,7 @@ class LambdaTooBigCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/LambdaTooBigCheck.java")) + .onFile(mainCodeSourcesPath("checks/LambdaTooBigCheckSample.java")) .withCheck(new LambdaTooBigCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/LazyArgEvaluationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/LazyArgEvaluationCheckTest.java index 08096baadee..c2d247f9881 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/LazyArgEvaluationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/LazyArgEvaluationCheckTest.java @@ -30,7 +30,7 @@ class LazyArgEvaluationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/LazyArgEvaluationCheck.java")) + .onFile(mainCodeSourcesPath("checks/LazyArgEvaluationCheckSample.java")) .withCheck(new LazyArgEvaluationCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/LazyArgEvaluationCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/LazyArgEvaluationCheckSample.java")) .withCheck(new LazyArgEvaluationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/LeastSpecificTypeCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/LeastSpecificTypeCheckTest.java index 66c5860f57d..b446d879b69 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/LeastSpecificTypeCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/LeastSpecificTypeCheckTest.java @@ -30,7 +30,7 @@ class LeastSpecificTypeCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/LeastSpecificTypeCheck.java")) + .onFile(mainCodeSourcesPath("checks/LeastSpecificTypeCheckSample.java")) .withCheck(new LeastSpecificTypeCheck()) .verifyIssues(); } @@ -45,7 +45,7 @@ void test_with_generics() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/LeastSpecificTypeCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/LeastSpecificTypeCheckSample.java")) .withCheck(new LeastSpecificTypeCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/LeftCurlyBraceEndLineCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/LeftCurlyBraceEndLineCheckTest.java index 84c2e712d43..f069cbd80f3 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/LeftCurlyBraceEndLineCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/LeftCurlyBraceEndLineCheckTest.java @@ -28,7 +28,7 @@ class LeftCurlyBraceEndLineCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/LeftCurlyBraceEndLineCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/LeftCurlyBraceEndLineCheckSample.java")) .withCheck(new LeftCurlyBraceEndLineCheck()) .verifyIssues(); } @@ -44,7 +44,7 @@ void java_17() { @Test void detected_switch_expressions() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/LeftCurlyBraceEndLineCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/LeftCurlyBraceEndLineCheckSample.java")) .withCheck(new LeftCurlyBraceEndLineCheck()) .withJavaVersion(14) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/LeftCurlyBraceStartLineCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/LeftCurlyBraceStartLineCheckTest.java index 3b34572e664..bd02daa4ee2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/LeftCurlyBraceStartLineCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/LeftCurlyBraceStartLineCheckTest.java @@ -28,7 +28,7 @@ class LeftCurlyBraceStartLineCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/LeftCurlyBraceStartLineCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/LeftCurlyBraceStartLineCheckSample.java")) .withCheck(new LeftCurlyBraceStartLineCheck()) .verifyIssues(); } @@ -44,7 +44,7 @@ void java_17() { @Test void detected_switch_expressions() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/LeftCurlyBraceStartLineCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/LeftCurlyBraceStartLineCheckSample.java")) .withCheck(new LeftCurlyBraceStartLineCheck()) .withJavaVersion(14) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/LoggedRethrownExceptionsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/LoggedRethrownExceptionsCheckTest.java index de5326aa1cb..9bd5c29cbf7 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/LoggedRethrownExceptionsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/LoggedRethrownExceptionsCheckTest.java @@ -28,7 +28,7 @@ class LoggedRethrownExceptionsCheckTest { @Test void test() throws Exception { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/LoggedRethrownExceptionsCheck.java")) + .onFile(mainCodeSourcesPath("checks/LoggedRethrownExceptionsCheckSample.java")) .withCheck(new LoggedRethrownExceptionsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/LongBitsToDoubleOnIntCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/LongBitsToDoubleOnIntCheckTest.java index 273dc924a97..2da28542868 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/LongBitsToDoubleOnIntCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/LongBitsToDoubleOnIntCheckTest.java @@ -30,7 +30,7 @@ class LongBitsToDoubleOnIntCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/LongBitsToDoubleOnIntCheck.java")) + .onFile(mainCodeSourcesPath("checks/LongBitsToDoubleOnIntCheckSample.java")) .withCheck(new LongBitsToDoubleOnIntCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/LongBitsToDoubleOnIntCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/LongBitsToDoubleOnIntCheckSample.java")) .withCheck(new LongBitsToDoubleOnIntCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/MapKeyNotComparableCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/MapKeyNotComparableCheckTest.java index 6c6d61df63d..c4b01c7e4e3 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/MapKeyNotComparableCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/MapKeyNotComparableCheckTest.java @@ -30,7 +30,7 @@ class MapKeyNotComparableCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/MapKeyNotComparableCheck.java")) + .onFile(mainCodeSourcesPath("checks/MapKeyNotComparableCheckSample.java")) .withCheck(new MapKeyNotComparableCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_incomplete_semantic() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/MapKeyNotComparableCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/MapKeyNotComparableCheckSample.java")) .withCheck(new MapKeyNotComparableCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/MathOnFloatCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/MathOnFloatCheckTest.java index 44ece20c425..6d01d51b999 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/MathOnFloatCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/MathOnFloatCheckTest.java @@ -29,7 +29,7 @@ class MathOnFloatCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/MathOnFloatCheck.java")) + .onFile(mainCodeSourcesPath("checks/MathOnFloatCheckSample.java")) .withCheck(new MathOnFloatCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/MembersDifferOnlyByCapitalizationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/MembersDifferOnlyByCapitalizationCheckTest.java index 463578ed3bd..f93375bfc8e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/MembersDifferOnlyByCapitalizationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/MembersDifferOnlyByCapitalizationCheckTest.java @@ -29,7 +29,7 @@ class MembersDifferOnlyByCapitalizationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/MembersDifferOnlyByCapitalizationCheck.java")) + .onFile(mainCodeSourcesPath("checks/MembersDifferOnlyByCapitalizationCheckSample.java")) .withCheck(new MembersDifferOnlyByCapitalizationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/MethodOnlyCallsSuperCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/MethodOnlyCallsSuperCheckTest.java index 72cf8d34d0a..1ebc93f721c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/MethodOnlyCallsSuperCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/MethodOnlyCallsSuperCheckTest.java @@ -30,12 +30,12 @@ class MethodOnlyCallsSuperCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/MethodOnlyCallsSuperCheck.java")) + .onFile(mainCodeSourcesPath("checks/MethodOnlyCallsSuperCheckSample.java")) .withCheck(new MethodOnlyCallsSuperCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/MethodOnlyCallsSuperCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/MethodOnlyCallsSuperCheckSample.java")) .withCheck(new MethodOnlyCallsSuperCheck()) .verifyNoIssues(); } @@ -43,13 +43,13 @@ void test() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/MethodOnlyCallsSuperCheck.java")) + .onFile(mainCodeSourcesPath("checks/MethodOnlyCallsSuperCheckSample.java")) .withCheck(new MethodOnlyCallsSuperCheck()) .withoutSemantic() .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/MethodOnlyCallsSuperCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/MethodOnlyCallsSuperCheckSample.java")) .withCheck(new MethodOnlyCallsSuperCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/MethodWithExcessiveReturnsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/MethodWithExcessiveReturnsCheckTest.java index 0ccbf0e4c56..727d8df6706 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/MethodWithExcessiveReturnsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/MethodWithExcessiveReturnsCheckTest.java @@ -30,7 +30,7 @@ class MethodWithExcessiveReturnsCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/MethodWithExcessiveReturnsCheck.java")) + .onFile(mainCodeSourcesPath("checks/MethodWithExcessiveReturnsCheckSample.java")) .withCheck(new MethodWithExcessiveReturnsCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void detected() { @Test void detectedNonCompiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/MethodWithExcessiveReturnsCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/MethodWithExcessiveReturnsCheckSample.java")) .withCheck(new MethodWithExcessiveReturnsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/MissingDeprecatedCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/MissingDeprecatedCheckTest.java index 929072b8cd6..b81a245ae40 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/MissingDeprecatedCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/MissingDeprecatedCheckTest.java @@ -30,7 +30,7 @@ class MissingDeprecatedCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/MissingDeprecatedCheck.java")) + .onFile(mainCodeSourcesPath("checks/MissingDeprecatedCheckSample.java")) .withCheck(new MissingDeprecatedCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/MissingOverridesInRecordWithArrayComponentCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/MissingOverridesInRecordWithArrayComponentCheckTest.java index 349ce8b9257..b34a8a9e9a7 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/MissingOverridesInRecordWithArrayComponentCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/MissingOverridesInRecordWithArrayComponentCheckTest.java @@ -27,7 +27,7 @@ class MissingOverridesInRecordWithArrayComponentCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/MissingOverridesInRecordWithArrayComponentCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/MissingOverridesInRecordWithArrayComponentCheckSample.java")) .withChecks(new MissingOverridesInRecordWithArrayComponentCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ModifiersOrderCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ModifiersOrderCheckTest.java index 0e00197efcb..1562d2ba1f8 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ModifiersOrderCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ModifiersOrderCheckTest.java @@ -30,7 +30,7 @@ class ModifiersOrderCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ModifiersOrderCheck.java")) + .onFile(mainCodeSourcesPath("checks/ModifiersOrderCheckSample.java")) .withCheck(new ModifiersOrderCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ModulusEqualityCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ModulusEqualityCheckTest.java index 843511a1df8..b597ad4e4d8 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ModulusEqualityCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ModulusEqualityCheckTest.java @@ -29,7 +29,7 @@ class ModulusEqualityCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ModulusEqualityCheck.java")) + .onFile(mainCodeSourcesPath("checks/ModulusEqualityCheckSample.java")) .withCheck(new ModulusEqualityCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/MutableMembersUsageCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/MutableMembersUsageCheckTest.java index 0e74eca1e5e..3ef8a8cf8d6 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/MutableMembersUsageCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/MutableMembersUsageCheckTest.java @@ -30,7 +30,7 @@ class MutableMembersUsageCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/MutableMembersUsageCheck.java")) + .onFile(mainCodeSourcesPath("checks/MutableMembersUsageCheckSample.java")) .withCheck(new MutableMembersUsageCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/MutableMembersUsageCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/MutableMembersUsageCheckSample.java")) .withCheck(new MutableMembersUsageCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/NPEThrowCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NPEThrowCheckTest.java index c9e1819066e..6c01f2cd18a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NPEThrowCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NPEThrowCheckTest.java @@ -29,7 +29,7 @@ class NPEThrowCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/NPEThrowCheck.java")) + .onFile(mainCodeSourcesPath("checks/NPEThrowCheckSample.java")) .withCheck(new NPEThrowCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/NestedBlocksCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NestedBlocksCheckTest.java index ccffd4eeb28..c857875fb6e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NestedBlocksCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NestedBlocksCheckTest.java @@ -30,7 +30,7 @@ class NestedBlocksCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/NestedBlocksCheck.java")) + .onFile(mainCodeSourcesPath("checks/NestedBlocksCheckSample.java")) .withCheck(new NestedBlocksCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_java_14() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/NestedBlocksCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/NestedBlocksCheckSample.java")) .withCheck(new NestedBlocksCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/NestedIfStatementsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NestedIfStatementsCheckTest.java index 346e051801b..4718fe99da1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NestedIfStatementsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NestedIfStatementsCheckTest.java @@ -33,7 +33,7 @@ void detected() { NestedIfStatementsCheck check = new NestedIfStatementsCheck(); assertThat(check.max).isEqualTo(3); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/NestedIfStatementsCheck.java")) + .onFile(mainCodeSourcesPath("checks/NestedIfStatementsCheckSample.java")) .withCheck(check) .verifyIssues(); } @@ -52,7 +52,7 @@ void custom() { void detected_switch_expressions() { NestedIfStatementsCheck check = new NestedIfStatementsCheck(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/NestedIfStatementsCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/NestedIfStatementsCheckSample.java")) .withJavaVersion(14) .withCheck(check) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/NestedSwitchCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NestedSwitchCheckTest.java index fd12c7eb197..f29957f705f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NestedSwitchCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NestedSwitchCheckTest.java @@ -28,7 +28,7 @@ class NestedSwitchCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/NestedSwitchStatementCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/NestedSwitchStatementCheckSample.java")) .withCheck(new NestedSwitchCheck()) .verifyIssues(); } @@ -36,7 +36,7 @@ void test() { @Test void test_switch_expressions() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/NestedSwitchExpressionCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/NestedSwitchExpressionCheckSample.java")) .withCheck(new NestedSwitchCheck()) .withJavaVersion(14) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/NestedTernaryOperatorsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NestedTernaryOperatorsCheckTest.java index 53575337645..503c6fb6509 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NestedTernaryOperatorsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NestedTernaryOperatorsCheckTest.java @@ -28,7 +28,7 @@ class NestedTernaryOperatorsCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/NestedTernaryOperatorsCheck.java")) + .onFile(mainCodeSourcesPath("checks/NestedTernaryOperatorsCheckSample.java")) .withCheck(new NestedTernaryOperatorsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/NestedTryCatchCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NestedTryCatchCheckTest.java index 688429337e2..f43b7291016 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NestedTryCatchCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NestedTryCatchCheckTest.java @@ -29,7 +29,7 @@ class NestedTryCatchCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/NestedTryCatchCheck.java")) + .onFile(mainCodeSourcesPath("checks/NestedTryCatchCheckSample.java")) .withCheck(new NestedTryCatchCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/NoCheckstyleTagPresenceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NoCheckstyleTagPresenceCheckTest.java index 28ac1fd30a7..f1d5c38da58 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NoCheckstyleTagPresenceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NoCheckstyleTagPresenceCheckTest.java @@ -29,7 +29,7 @@ class NoCheckstyleTagPresenceCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/NoCheckstyleTagPresenceCheck.java")) + .onFile(mainCodeSourcesPath("checks/NoCheckstyleTagPresenceCheckSample.java")) .withCheck(new NoCheckstyleTagPresenceCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/NoPmdTagPresenceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NoPmdTagPresenceCheckTest.java index c1950adb842..3c805fa4f20 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NoPmdTagPresenceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NoPmdTagPresenceCheckTest.java @@ -29,7 +29,7 @@ class NoPmdTagPresenceCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/NoPmdTagPresenceCheck.java")) + .onFile(mainCodeSourcesPath("checks/NoPmdTagPresenceCheckSample.java")) .withCheck(new NoPmdTagPresenceCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/NonStaticClassInitializerCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NonStaticClassInitializerCheckTest.java index a4f6cc1c6e6..2df40550371 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NonStaticClassInitializerCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NonStaticClassInitializerCheckTest.java @@ -29,7 +29,7 @@ class NonStaticClassInitializerCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/NonStaticClassInitializerCheck.java")) + .onFile(mainCodeSourcesPath("checks/NonStaticClassInitializerCheckSample.java")) .withCheck(new NonStaticClassInitializerCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/NotifyCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NotifyCheckTest.java index a36b534589f..6d95878e1c5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NotifyCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NotifyCheckTest.java @@ -29,7 +29,7 @@ class NotifyCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/NotifyCheck.java")) + .onFile(mainCodeSourcesPath("checks/NotifyCheckSample.java")) .withCheck(new NotifyCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/NullCheckWithInstanceofCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/NullCheckWithInstanceofCheckTest.java index 90d29aa5b75..921aac530ae 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/NullCheckWithInstanceofCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/NullCheckWithInstanceofCheckTest.java @@ -28,7 +28,7 @@ class NullCheckWithInstanceofCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/NullCheckWithInstanceofCheck.java")) + .onFile(mainCodeSourcesPath("checks/NullCheckWithInstanceofCheckSample.java")) .withCheck(new NullCheckWithInstanceofCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ObjectCreatedOnlyToCallGetClassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ObjectCreatedOnlyToCallGetClassCheckTest.java index 2eed36d21e9..7ac165c0eac 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ObjectCreatedOnlyToCallGetClassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ObjectCreatedOnlyToCallGetClassCheckTest.java @@ -29,7 +29,7 @@ class ObjectCreatedOnlyToCallGetClassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ObjectCreatedOnlyToCallGetClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/ObjectCreatedOnlyToCallGetClassCheckSample.java")) .withCheck(new ObjectCreatedOnlyToCallGetClassCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeCheckTest.java index ae1ee473939..869153d0b7d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeCheckTest.java @@ -28,7 +28,7 @@ class ObjectFinalizeCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ObjectFinalizeCheck.java")) + .onFile(mainCodeSourcesPath("checks/ObjectFinalizeCheckSample.java")) .withCheck(new ObjectFinalizeCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeOverridenCallsSuperFinalizeCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeOverridenCallsSuperFinalizeCheckTest.java index 036d84e4ea8..bf5ddc7437f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeOverridenCallsSuperFinalizeCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeOverridenCallsSuperFinalizeCheckTest.java @@ -28,7 +28,7 @@ class ObjectFinalizeOverridenCallsSuperFinalizeCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ObjectFinalizeOverridenCallsSuperFinalizeCheck.java")) + .onFile(mainCodeSourcesPath("checks/ObjectFinalizeOverridenCallsSuperFinalizeCheckSample.java")) .withCheck(new ObjectFinalizeOverridenCallsSuperFinalizeCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeOverridenNotPublicCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeOverridenNotPublicCheckTest.java index f478315494f..34f2fbc7536 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeOverridenNotPublicCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ObjectFinalizeOverridenNotPublicCheckTest.java @@ -28,7 +28,7 @@ class ObjectFinalizeOverridenNotPublicCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ObjectFinalizeOverridenNotPublicCheck.java")) + .onFile(mainCodeSourcesPath("checks/ObjectFinalizeOverridenNotPublicCheckSample.java")) .withCheck(new ObjectFinalizeOverridenNotPublicCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/OmitPermittedTypesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/OmitPermittedTypesCheckTest.java index 97a74388a6e..5fce72eca3d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/OmitPermittedTypesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/OmitPermittedTypesCheckTest.java @@ -31,7 +31,7 @@ class OmitPermittedTypesCheckTest { @Test void test() { ((InternalCheckVerifier) CheckVerifier.newVerifier()) - .onFile(mainCodeSourcesPath("checks/OmitPermittedTypesCheck/OmitPermittedTypesCheck.java")) + .onFile(mainCodeSourcesPath("checks/OmitPermittedTypesCheck/OmitPermittedTypesCheckSample.java")) .withCheck(new OmitPermittedTypesCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/OneDeclarationPerLineCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/OneDeclarationPerLineCheckTest.java index ea8e6b251d8..7774d552bda 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/OneDeclarationPerLineCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/OneDeclarationPerLineCheckTest.java @@ -28,7 +28,7 @@ class OneDeclarationPerLineCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/OneDeclarationPerLineCheck.java")) + .onFile(mainCodeSourcesPath("checks/OneDeclarationPerLineCheckSample.java")) .withCheck(new OneDeclarationPerLineCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/OptionalAsParameterCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/OptionalAsParameterCheckTest.java index 540251c7133..5921c25d996 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/OptionalAsParameterCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/OptionalAsParameterCheckTest.java @@ -28,7 +28,7 @@ class OptionalAsParameterCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/OptionalAsParameterCheck.java")) + .onFile(mainCodeSourcesPath("checks/OptionalAsParameterCheckSample.java")) .withCheck(new OptionalAsParameterCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/OutputStreamOverrideWriteCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/OutputStreamOverrideWriteCheckTest.java index 57fe7adc630..d21e9dad1f5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/OutputStreamOverrideWriteCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/OutputStreamOverrideWriteCheckTest.java @@ -29,7 +29,7 @@ class OutputStreamOverrideWriteCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/OutputStreamOverrideWriteCheck.java")) + .onFile(mainCodeSourcesPath("checks/OutputStreamOverrideWriteCheckSample.java")) .withCheck(new OutputStreamOverrideWriteCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/OverrideAnnotationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/OverrideAnnotationCheckTest.java index 3121abb8b2e..a2e2adefa28 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/OverrideAnnotationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/OverrideAnnotationCheckTest.java @@ -31,7 +31,7 @@ class OverrideAnnotationCheckTest { @Test void test_java() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/OverrideAnnotationCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/OverrideAnnotationCheckSample.java")) .withCheck(new OverrideAnnotationCheck()) .verifyIssues(); } @@ -53,7 +53,7 @@ void test_java_8() { .withJavaVersion(8) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/OverrideAnnotationCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/OverrideAnnotationCheckSample.java")) .withCheck(new OverrideAnnotationCheck()) .withJavaVersion(8) .verifyIssues(); @@ -62,7 +62,7 @@ void test_java_8() { @Test void test_java_6() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/OverrideAnnotationCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/OverrideAnnotationCheckSample.java")) .withCheck(new OverrideAnnotationCheck()) .withJavaVersion(6) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ParameterReassignedToCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ParameterReassignedToCheckTest.java index 873eb4cb3bb..1505b2dcfe7 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ParameterReassignedToCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ParameterReassignedToCheckTest.java @@ -29,7 +29,7 @@ class ParameterReassignedToCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ParameterReassignedToCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ParameterReassignedToCheckSample.java")) .withCheck(new ParameterReassignedToCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/PopulateBeansCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PopulateBeansCheckTest.java index 0ff361fc9d2..5894f1f4ab5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PopulateBeansCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PopulateBeansCheckTest.java @@ -29,7 +29,7 @@ class PopulateBeansCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PopulateBeansCheck.java")) + .onFile(mainCodeSourcesPath("checks/PopulateBeansCheckSample.java")) .withCheck(new PopulateBeansCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/PredictableSeedCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PredictableSeedCheckTest.java index d32e6dd8819..fd8dd9f6792 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PredictableSeedCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PredictableSeedCheckTest.java @@ -29,7 +29,7 @@ class PredictableSeedCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PredictableSeedCheck.java")) + .onFile(mainCodeSourcesPath("checks/PredictableSeedCheckSample.java")) .withCheck(new PredictableSeedCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/PreparedStatementAndResultSetCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PreparedStatementAndResultSetCheckTest.java index 48bcce156ee..4373248c5db 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PreparedStatementAndResultSetCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PreparedStatementAndResultSetCheckTest.java @@ -30,7 +30,7 @@ class PreparedStatementAndResultSetCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PreparedStatementAndResultSetCheck.java")) + .onFile(mainCodeSourcesPath("checks/PreparedStatementAndResultSetCheckSample.java")) .withCheck(new PreparedStatementAndResultSetCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/PreparedStatementAndResultSetCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/PreparedStatementAndResultSetCheckSample.java")) .withCheck(new PreparedStatementAndResultSetCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/PrimitiveWrappersInTernaryOperatorCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PrimitiveWrappersInTernaryOperatorCheckTest.java index 80c4c868cc6..e50265eaf82 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PrimitiveWrappersInTernaryOperatorCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PrimitiveWrappersInTernaryOperatorCheckTest.java @@ -28,7 +28,7 @@ class PrimitiveWrappersInTernaryOperatorCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PrimitiveWrappersInTernaryOperatorCheck.java")) + .onFile(mainCodeSourcesPath("checks/PrimitiveWrappersInTernaryOperatorCheckSample.java")) .withCheck(new PrimitiveWrappersInTernaryOperatorCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/PrimitivesMarkedNullableCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PrimitivesMarkedNullableCheckTest.java index 48efaeeedd2..d7c2e23e7ec 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PrimitivesMarkedNullableCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PrimitivesMarkedNullableCheckTest.java @@ -30,7 +30,7 @@ class PrimitivesMarkedNullableCheckTest { @Test void test() { ((InternalCheckVerifier) CheckVerifier.newVerifier()) - .onFile(mainCodeSourcesPath("checks/PrimitivesMarkedNullableCheck.java")) + .onFile(mainCodeSourcesPath("checks/PrimitivesMarkedNullableCheckSample.java")) .withCheck(new PrimitivesMarkedNullableCheck()) .withQuickFixes() .verifyIssues(); @@ -39,7 +39,7 @@ void test() { @Test void noSemantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PrimitivesMarkedNullableCheck.java")) + .onFile(mainCodeSourcesPath("checks/PrimitivesMarkedNullableCheckSample.java")) .withCheck(new PrimitivesMarkedNullableCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/PrintfFailCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PrintfFailCheckTest.java index c5cc692acb9..f4d5bf1924b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PrintfFailCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PrintfFailCheckTest.java @@ -29,7 +29,7 @@ class PrintfFailCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PrintfFailCheck.java")) + .onFile(mainCodeSourcesPath("checks/PrintfFailCheckSample.java")) .withCheck(new PrintfFailCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/PrintfMisuseCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PrintfMisuseCheckTest.java index c9a12a489b0..1009507578f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PrintfMisuseCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PrintfMisuseCheckTest.java @@ -30,7 +30,7 @@ class PrintfMisuseCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PrintfMisuseCheck.java")) + .onFile(mainCodeSourcesPath("checks/PrintfMisuseCheckSample.java")) .withCheck(new PrintfMisuseCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/PrivateFieldUsedLocallyCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PrivateFieldUsedLocallyCheckTest.java index f9e3afc95e0..94fea630514 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PrivateFieldUsedLocallyCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PrivateFieldUsedLocallyCheckTest.java @@ -31,7 +31,7 @@ class PrivateFieldUsedLocallyCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/PrivateFieldUsedLocallyCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/PrivateFieldUsedLocallyCheckSample.java")) .withCheck(new PrivateFieldUsedLocallyCheck()) .verifyIssues(); } @@ -39,7 +39,7 @@ void test() { @Test void test_quick_fixes() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/PrivateFieldUsedLocallyCheck.java")) + .onFile(mainCodeSourcesPath("checks/PrivateFieldUsedLocallyCheckSample.java")) .withCheck(new PrivateFieldUsedLocallyCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/PseudoRandomCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PseudoRandomCheckTest.java index 68b9495ca2f..7ca36044fcd 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PseudoRandomCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PseudoRandomCheckTest.java @@ -28,7 +28,7 @@ class PseudoRandomCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PseudoRandomCheck.java")) + .onFile(mainCodeSourcesPath("checks/PseudoRandomCheckSample.java")) .withCheck(new PseudoRandomCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/PublicConstructorInAbstractClassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PublicConstructorInAbstractClassCheckTest.java index b553a2205c5..5814a03ee7a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PublicConstructorInAbstractClassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PublicConstructorInAbstractClassCheckTest.java @@ -28,7 +28,7 @@ class PublicConstructorInAbstractClassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PublicConstructorInAbstractClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/PublicConstructorInAbstractClassCheckSample.java")) .withCheck(new PublicConstructorInAbstractClassCheck()) .verifyIssues(); } @@ -36,7 +36,7 @@ void test() { @Test void test_non_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PublicConstructorInAbstractClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/PublicConstructorInAbstractClassCheckSample.java")) .withCheck(new PublicConstructorInAbstractClassCheck()) .withoutSemantic() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/PublicStaticMutableMembersCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/PublicStaticMutableMembersCheckTest.java index f1f8c07b956..cfe6e85b77c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/PublicStaticMutableMembersCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/PublicStaticMutableMembersCheckTest.java @@ -31,7 +31,7 @@ class PublicStaticMutableMembersCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PublicStaticMutableMembersCheck.java")) + .onFile(mainCodeSourcesPath("checks/PublicStaticMutableMembersCheckSample.java")) .withCheck(new PublicStaticMutableMembersCheck()) .verifyIssues(); } @@ -39,7 +39,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/PublicStaticMutableMembersCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/PublicStaticMutableMembersCheckSample.java")) .withCheck(new PublicStaticMutableMembersCheck()) .verifyNoIssues(); } @@ -47,7 +47,7 @@ void test_non_compiling() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/PublicStaticMutableMembersCheck.java")) + .onFile(mainCodeSourcesPath("checks/PublicStaticMutableMembersCheckSample.java")) .withCheck(new PublicStaticMutableMembersCheck()) .withClassPath(Collections.emptyList()) .verifyIssues(); @@ -56,7 +56,7 @@ void test_without_semantic() { @Test void test_non_compiling_without_semantic() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/PublicStaticMutableMembersCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/PublicStaticMutableMembersCheckSample.java")) .withCheck(new PublicStaticMutableMembersCheck()) .withClassPath(Collections.emptyList()) .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/RandomFloatToIntCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RandomFloatToIntCheckTest.java index b256dac4c33..5f502479882 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RandomFloatToIntCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RandomFloatToIntCheckTest.java @@ -29,7 +29,7 @@ class RandomFloatToIntCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RandomFloatToIntCheck.java")) + .onFile(mainCodeSourcesPath("checks/RandomFloatToIntCheckSample.java")) .withCheck(new RandomFloatToIntCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RawByteBitwiseOperationsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RawByteBitwiseOperationsCheckTest.java index 18b000341da..1ff5a67faab 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RawByteBitwiseOperationsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RawByteBitwiseOperationsCheckTest.java @@ -28,7 +28,7 @@ class RawByteBitwiseOperationsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RawByteBitwiseOperationsCheck.java")) + .onFile(mainCodeSourcesPath("checks/RawByteBitwiseOperationsCheckSample.java")) .withCheck(new RawByteBitwiseOperationsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RawExceptionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RawExceptionCheckTest.java index ca3cb650678..b93de70f80d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RawExceptionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RawExceptionCheckTest.java @@ -30,7 +30,7 @@ class RawExceptionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RawExceptionCheck.java")) + .onFile(mainCodeSourcesPath("checks/RawExceptionCheckSample.java")) .withCheck(new RawExceptionCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RawExceptionCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RawExceptionCheckSample.java")) .withCheck(new RawExceptionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RawTypeCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RawTypeCheckTest.java index e1d8b041f03..4826d440fb5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RawTypeCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RawTypeCheckTest.java @@ -31,7 +31,7 @@ class RawTypeCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RawTypeCheck.java")) + .onFile(mainCodeSourcesPath("checks/RawTypeCheckSample.java")) .withCheck(new RawTypeCheck()) .verifyIssues(); } @@ -39,13 +39,13 @@ void test() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RawTypeCheck.java")) + .onFile(mainCodeSourcesPath("checks/RawTypeCheckSample.java")) .withCheck(new RawTypeCheck()) .withClassPath(Collections.emptyList()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RawTypeCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RawTypeCheckSample.java")) .withCheck(new RawTypeCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RecordDuplicatedGetterCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RecordDuplicatedGetterCheckTest.java index 11ddcd13904..12efe121322 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RecordDuplicatedGetterCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RecordDuplicatedGetterCheckTest.java @@ -29,7 +29,7 @@ class RecordDuplicatedGetterCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RecordDuplicatedGetterCheck.java")) + .onFile(mainCodeSourcesPath("checks/RecordDuplicatedGetterCheckSample.java")) .withCheck(new RecordDuplicatedGetterCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RecordInsteadOfClassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RecordInsteadOfClassCheckTest.java index 01773fe2772..32ed35b819f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RecordInsteadOfClassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RecordInsteadOfClassCheckTest.java @@ -30,7 +30,7 @@ class RecordInsteadOfClassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RecordInsteadOfClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/RecordInsteadOfClassCheckSample.java")) .withCheck(new RecordInsteadOfClassCheck()) .withJavaVersion(16) .verifyIssues(); @@ -39,7 +39,7 @@ void test() { @Test void test_incomplete_semantic() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RecordInsteadOfClassCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RecordInsteadOfClassCheckSample.java")) .withCheck(new RecordInsteadOfClassCheck()) .withJavaVersion(16) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/RedundantAbstractMethodCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RedundantAbstractMethodCheckTest.java index cafe95fc933..2024740e811 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RedundantAbstractMethodCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RedundantAbstractMethodCheckTest.java @@ -29,7 +29,7 @@ class RedundantAbstractMethodCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RedundantAbstractMethodCheck.java")) + .onFile(mainCodeSourcesPath("checks/RedundantAbstractMethodCheckSample.java")) .withCheck(new RedundantAbstractMethodCheck()) .verifyIssues(); } @@ -37,13 +37,13 @@ void test() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RedundantAbstractMethodCheck.java")) + .onFile(mainCodeSourcesPath("checks/RedundantAbstractMethodCheckSample.java")) .withCheck(new RedundantAbstractMethodCheck()) .withoutSemantic() .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RedundantAbstractMethodCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RedundantAbstractMethodCheckSample.java")) .withCheck(new RedundantAbstractMethodCheck()) .withoutSemantic() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/RedundantCloseCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RedundantCloseCheckTest.java index 26bb2ea0678..51d1191aa56 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RedundantCloseCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RedundantCloseCheckTest.java @@ -30,7 +30,7 @@ class RedundantCloseCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RedundantCloseCheck.java")) + .onFile(mainCodeSourcesPath("checks/RedundantCloseCheckSample.java")) .withCheck(new RedundantCloseCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RedundantCloseCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RedundantCloseCheckSample.java")) .withCheck(new RedundantCloseCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RedundantModifierCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RedundantModifierCheckTest.java index b6a854ab7c5..d30267176ad 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RedundantModifierCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RedundantModifierCheckTest.java @@ -29,7 +29,7 @@ class RedundantModifierCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RedundantModifierCheck.java")) + .onFile(mainCodeSourcesPath("checks/RedundantModifierCheckSample.java")) .withCheck(new RedundantModifierCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RedundantRecordMethodsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RedundantRecordMethodsCheckTest.java index 932f0c19684..a5825a601da 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RedundantRecordMethodsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RedundantRecordMethodsCheckTest.java @@ -27,7 +27,7 @@ class RedundantRecordMethodsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/RedundantRecordMethodsCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/RedundantRecordMethodsCheckSample.java")) .withCheck(new RedundantRecordMethodsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RedundantThrowsDeclarationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RedundantThrowsDeclarationCheckTest.java index 15587499d2e..5eb30f0c047 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RedundantThrowsDeclarationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RedundantThrowsDeclarationCheckTest.java @@ -31,7 +31,7 @@ class RedundantThrowsDeclarationCheckTest { @Test void test() { ((InternalCheckVerifier) CheckVerifier.newVerifier()) - .onFile(mainCodeSourcesPath("checks/RedundantThrowsDeclarationCheck.java")) + .onFile(mainCodeSourcesPath("checks/RedundantThrowsDeclarationCheckSample.java")) .withCheck(new RedundantThrowsDeclarationCheck()) .withQuickFixes() .verifyIssues(); @@ -40,7 +40,7 @@ void test() { @Test void test_non_compiling_code() { ((InternalCheckVerifier) CheckVerifier.newVerifier()) - .onFile(nonCompilingTestSourcesPath("checks/RedundantThrowsDeclarationCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RedundantThrowsDeclarationCheckSample.java")) .withCheck(new RedundantThrowsDeclarationCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/RedundantTypeCastCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RedundantTypeCastCheckTest.java index f5a85a47f4f..ee296f9ccec 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RedundantTypeCastCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RedundantTypeCastCheckTest.java @@ -30,7 +30,7 @@ class RedundantTypeCastCheckTest { @Test void test() { ((InternalCheckVerifier) CheckVerifier.newVerifier()) - .onFile(mainCodeSourcesPath("checks/RedundantTypeCastCheck.java")) + .onFile(mainCodeSourcesPath("checks/RedundantTypeCastCheckSample.java")) .withCheck(new RedundantTypeCastCheck()) .withQuickFixes() .verifyIssues(); @@ -39,7 +39,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RedundantTypeCastCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RedundantTypeCastCheckSample.java")) .withCheck(new RedundantTypeCastCheck()) .verifyIssues(); } @@ -47,14 +47,14 @@ void test_non_compiling() { @Test void testWithoutSemantic() { ((InternalCheckVerifier) CheckVerifier.newVerifier()) - .onFile(mainCodeSourcesPath("checks/RedundantTypeCastCheck.java")) + .onFile(mainCodeSourcesPath("checks/RedundantTypeCastCheckSample.java")) .withCheck(new RedundantTypeCastCheck()) .withoutSemantic() .withQuickFixes() .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RedundantTypeCastCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RedundantTypeCastCheckSample.java")) .withCheck(new RedundantTypeCastCheck()) .withoutSemantic() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ReflectionOnNonRuntimeAnnotationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ReflectionOnNonRuntimeAnnotationCheckTest.java index d86c26dfc03..2f2ce0682a0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ReflectionOnNonRuntimeAnnotationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ReflectionOnNonRuntimeAnnotationCheckTest.java @@ -29,7 +29,7 @@ class ReflectionOnNonRuntimeAnnotationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ReflectionOnNonRuntimeAnnotationCheck.java")) + .onFile(mainCodeSourcesPath("checks/ReflectionOnNonRuntimeAnnotationCheckSample.java")) .withCheck(new ReflectionOnNonRuntimeAnnotationCheck()) .verifyIssues(); } @@ -37,7 +37,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ReflectionOnNonRuntimeAnnotationCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ReflectionOnNonRuntimeAnnotationCheckSample.java")) .withCheck(new ReflectionOnNonRuntimeAnnotationCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RegexPatternsNeedlesslyCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RegexPatternsNeedlesslyCheckTest.java index f896c9f33c0..ebad1b0ccb2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RegexPatternsNeedlesslyCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RegexPatternsNeedlesslyCheckTest.java @@ -28,7 +28,7 @@ class RegexPatternsNeedlesslyCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RegexPatternsNeedlesslyCheck.java")) + .onFile(mainCodeSourcesPath("checks/RegexPatternsNeedlesslyCheckSample.java")) .withCheck(new RegexPatternsNeedlesslyCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ReplaceGuavaWithJavaCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ReplaceGuavaWithJavaCheckTest.java index 84769e3274f..b3059601156 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ReplaceGuavaWithJavaCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ReplaceGuavaWithJavaCheckTest.java @@ -27,7 +27,7 @@ class ReplaceGuavaWithJavaCheckTest { - private static final String FILENAME = mainCodeSourcesPath("checks/ReplaceGuavaWithJavaCheck.java"); + private static final String FILENAME = mainCodeSourcesPath("checks/ReplaceGuavaWithJavaCheckSample.java"); @Test void test_with_java_7() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/ReplaceLambdaByMethodRefCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ReplaceLambdaByMethodRefCheckTest.java index c270eefbc20..11e4eaa3499 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ReplaceLambdaByMethodRefCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ReplaceLambdaByMethodRefCheckTest.java @@ -28,7 +28,7 @@ class ReplaceLambdaByMethodRefCheckTest { - private static final String FILENAME = "checks/ReplaceLambdaByMethodRefCheck.java"; + private static final String FILENAME = "checks/ReplaceLambdaByMethodRefCheckSample.java"; public static final String NO_VERSION_FILENAME = "checks/ReplaceLambdaByMethodRefCheck_no_version.java"; @Test diff --git a/java-checks/src/test/java/org/sonar/java/checks/RestrictedIdentifiersUsageCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RestrictedIdentifiersUsageCheckTest.java index 956f6ac1a9a..9915759bc71 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RestrictedIdentifiersUsageCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RestrictedIdentifiersUsageCheckTest.java @@ -30,7 +30,7 @@ class RestrictedIdentifiersUsageCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RestrictedIdentifiersUsageCheck.java")) + .onFile(mainCodeSourcesPath("checks/RestrictedIdentifiersUsageCheckSample.java")) .withCheck(new RestrictedIdentifiersUsageCheck()) .withJavaVersion(14) .verifyIssues(); @@ -39,7 +39,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RestrictedIdentifiersUsageCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RestrictedIdentifiersUsageCheckSample.java")) .withCheck(new RestrictedIdentifiersUsageCheck()) .withJavaVersion(8) .verifyIssues(); @@ -48,7 +48,7 @@ void test_non_compiling() { @Test void test_no_version() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/RestrictedIdentifiersUsageCheck.java")) + .onFile(mainCodeSourcesPath("checks/RestrictedIdentifiersUsageCheckSample.java")) .withCheck(new RestrictedIdentifiersUsageCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ResultSetIsLastCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ResultSetIsLastCheckTest.java index 79655457e35..bfb3addcff8 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ResultSetIsLastCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ResultSetIsLastCheckTest.java @@ -29,7 +29,7 @@ class ResultSetIsLastCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ResultSetIsLastCheck.java")) + .onFile(mainCodeSourcesPath("checks/ResultSetIsLastCheckSample.java")) .withCheck(new ResultSetIsLastCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ReturnEmptyArrayNotNullCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ReturnEmptyArrayNotNullCheckTest.java index 9c8bad0e7ca..8af788b9c9a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ReturnEmptyArrayNotNullCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ReturnEmptyArrayNotNullCheckTest.java @@ -29,7 +29,7 @@ class ReturnEmptyArrayNotNullCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/ReturnEmptyArrayNotNullCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/ReturnEmptyArrayNotNullCheckSample.java")) .withCheck(new ReturnEmptyArrayNotNullCheck()) .verifyIssues(); } @@ -52,7 +52,7 @@ void quick_fixes() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/ReturnEmptyArrayNotNullCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/ReturnEmptyArrayNotNullCheckSample.java")) .withCheck(new ReturnEmptyArrayNotNullCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ReuseRandomCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ReuseRandomCheckTest.java index 3bb4173a6da..d6d4744ba59 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ReuseRandomCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ReuseRandomCheckTest.java @@ -28,7 +28,7 @@ class ReuseRandomCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ReuseRandomCheck.java")) + .onFile(mainCodeSourcesPath("checks/ReuseRandomCheckSample.java")) .withCheck(new ReuseRandomCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/RightCurlyBraceSameLineAsNextBlockCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RightCurlyBraceSameLineAsNextBlockCheckTest.java index 7db080aa546..23e995dfcfe 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RightCurlyBraceSameLineAsNextBlockCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RightCurlyBraceSameLineAsNextBlockCheckTest.java @@ -29,7 +29,7 @@ class RightCurlyBraceSameLineAsNextBlockCheckTest { @Test void detected() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/RightCurlyBraceSameLineAsNextBlockCheck.java")) + .onFile(mainCodeSourcesPath("checks/RightCurlyBraceSameLineAsNextBlockCheckSample.java")) .withCheck(new RightCurlyBraceSameLineAsNextBlockCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/RunFinalizersCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/RunFinalizersCheckTest.java index 6d8b4221a96..f60b9263ba0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/RunFinalizersCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/RunFinalizersCheckTest.java @@ -36,11 +36,11 @@ void test() { .asInt(); if (javaVersion < 11) { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RunFinalizersCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RunFinalizersCheckSample.java")) .withCheck(new RunFinalizersCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/RunFinalizersCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/RunFinalizersCheckSample.java")) .withCheck(new RunFinalizersCheck()) .withJavaVersion(javaVersion) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ScheduledThreadPoolExecutorZeroCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ScheduledThreadPoolExecutorZeroCheckTest.java index 4360ce56154..64891545fba 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ScheduledThreadPoolExecutorZeroCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ScheduledThreadPoolExecutorZeroCheckTest.java @@ -28,7 +28,7 @@ class ScheduledThreadPoolExecutorZeroCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ScheduledThreadPoolExecutorZeroCheck.java")) + .onFile(mainCodeSourcesPath("checks/ScheduledThreadPoolExecutorZeroCheckSample.java")) .withCheck(new ScheduledThreadPoolExecutorZeroCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SelfAssignementCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SelfAssignementCheckTest.java index b4813653853..fdbb2cdc561 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SelfAssignementCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SelfAssignementCheckTest.java @@ -29,7 +29,7 @@ class SelfAssignementCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/SelfAssignementCheck.java")) + .onFile(mainCodeSourcesPath("checks/SelfAssignementCheckSample.java")) .withCheck(new SelfAssignementCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ServletInstanceFieldCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ServletInstanceFieldCheckTest.java index 0fc8dc19778..41bd13fda8e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ServletInstanceFieldCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ServletInstanceFieldCheckTest.java @@ -30,11 +30,11 @@ class ServletInstanceFieldCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ServletInstanceFieldCheck.java")) + .onFile(mainCodeSourcesPath("checks/ServletInstanceFieldCheckSample.java")) .withCheck(new ServletInstanceFieldCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ServletInstanceFieldCheck.java")) + .onFile(mainCodeSourcesPath("checks/ServletInstanceFieldCheckSample.java")) .withCheck(new ServletInstanceFieldCheck()) .withoutSemantic() .verifyNoIssues(); @@ -56,11 +56,11 @@ void test_jakarta() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ServletInstanceFieldCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ServletInstanceFieldCheckSample.java")) .withCheck(new ServletInstanceFieldCheck()) .verifyNoIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ServletInstanceFieldCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ServletInstanceFieldCheckSample.java")) .withCheck(new ServletInstanceFieldCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ServletMethodsExceptionsThrownCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ServletMethodsExceptionsThrownCheckTest.java index 69a06cb7a15..de287fb858e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ServletMethodsExceptionsThrownCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ServletMethodsExceptionsThrownCheckTest.java @@ -29,7 +29,7 @@ class ServletMethodsExceptionsThrownCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ServletMethodsExceptionsThrownCheck.java")) + .onFile(mainCodeSourcesPath("checks/ServletMethodsExceptionsThrownCheckSample.java")) .withCheck(new ServletMethodsExceptionsThrownCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ShiftOnIntOrLongCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ShiftOnIntOrLongCheckTest.java index b37aa6e98b1..6cf2972983d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ShiftOnIntOrLongCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ShiftOnIntOrLongCheckTest.java @@ -29,7 +29,7 @@ class ShiftOnIntOrLongCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ShiftOnIntOrLongCheck.java")) + .onFile(mainCodeSourcesPath("checks/ShiftOnIntOrLongCheckSample.java")) .withCheck(new ShiftOnIntOrLongCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SillyEqualsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SillyEqualsCheckTest.java index 4ea193b6896..08d158b6dcf 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SillyEqualsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SillyEqualsCheckTest.java @@ -30,14 +30,14 @@ class SillyEqualsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SillyEqualsCheck.java")) + .onFile(mainCodeSourcesPath("checks/SillyEqualsCheckSample.java")) .withCheck(new SillyEqualsCheck()) .verifyIssues(); } @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/SillyEqualsCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/SillyEqualsCheckSample.java")) .withCheck(new SillyEqualsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SillyStringOperationsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SillyStringOperationsCheckTest.java index 51c08598c6d..a8c195a6970 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SillyStringOperationsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SillyStringOperationsCheckTest.java @@ -29,7 +29,7 @@ class SillyStringOperationsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SillyStringOperationsCheck.java")) + .onFile(mainCodeSourcesPath("checks/SillyStringOperationsCheckSample.java")) .withCheck(new SillyStringOperationsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SimpleClassNameCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SimpleClassNameCheckTest.java index d0835d8af23..b17cd99f04c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SimpleClassNameCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SimpleClassNameCheckTest.java @@ -30,7 +30,7 @@ class SimpleClassNameCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SimpleClassNameCheck.java")) + .onFile(mainCodeSourcesPath("checks/SimpleClassNameCheckSample.java")) .withCheck(new SimpleClassNameCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/SimpleClassNameCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/SimpleClassNameCheckSample.java")) .withCheck(new SimpleClassNameCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SimpleStringLiteralForSingleLineStringsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SimpleStringLiteralForSingleLineStringsCheckTest.java index b10a65593d6..9f8c89bd3c2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SimpleStringLiteralForSingleLineStringsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SimpleStringLiteralForSingleLineStringsCheckTest.java @@ -30,7 +30,7 @@ class SimpleStringLiteralForSingleLineStringsCheckTest { void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SimpleStringLiteralForSingleLineStringsCheck.java")) + .onFile(mainCodeSourcesPath("checks/SimpleStringLiteralForSingleLineStringsCheckSample.java")) .withCheck(new SimpleStringLiteralForSingleLineStringsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SpecializedFunctionalInterfacesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SpecializedFunctionalInterfacesCheckTest.java index ba516691f4f..88bcd1bac2b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SpecializedFunctionalInterfacesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SpecializedFunctionalInterfacesCheckTest.java @@ -30,11 +30,11 @@ class SpecializedFunctionalInterfacesCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SpecializedFunctionalInterfacesCheck.java")) + .onFile(mainCodeSourcesPath("checks/SpecializedFunctionalInterfacesCheckSample.java")) .withCheck(new SpecializedFunctionalInterfacesCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SpecializedFunctionalInterfacesCheck.java")) + .onFile(mainCodeSourcesPath("checks/SpecializedFunctionalInterfacesCheckSample.java")) .withCheck(new SpecializedFunctionalInterfacesCheck()) .withoutSemantic() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/StandardCharsetsConstantsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StandardCharsetsConstantsCheckTest.java index e021418c0ef..fac3fa189a7 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StandardCharsetsConstantsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StandardCharsetsConstantsCheckTest.java @@ -30,12 +30,12 @@ class StandardCharsetsConstantsCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/StandardCharsetsConstantsCheck.java")) + .onFile(mainCodeSourcesPath("checks/StandardCharsetsConstantsCheckSample.java")) .withCheck(new StandardCharsetsConstantsCheck()) .withQuickFixes() .verifyIssues(); InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/StandardCharsetsConstantsCheck.java")) + .onFile(mainCodeSourcesPath("checks/StandardCharsetsConstantsCheckSample.java")) .withCheck(new StandardCharsetsConstantsCheck()) .withJavaVersion(7) .withQuickFixes() @@ -51,7 +51,7 @@ void test() { .withJavaVersion(10) .verifyIssues(); InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/StandardCharsetsConstantsCheck.java")) + .onFile(mainCodeSourcesPath("checks/StandardCharsetsConstantsCheckSample.java")) .withCheck(new StandardCharsetsConstantsCheck()) .withJavaVersion(6) .withQuickFixes() diff --git a/java-checks/src/test/java/org/sonar/java/checks/StaticFieldUpateCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StaticFieldUpateCheckTest.java index e8b13b7e59e..9895431df26 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StaticFieldUpateCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StaticFieldUpateCheckTest.java @@ -31,7 +31,7 @@ class StaticFieldUpateCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/StaticFieldUpateCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/StaticFieldUpateCheckSample.java")) .withCheck(new StaticFieldUpateCheck()) .verifyIssues(); } @@ -39,7 +39,7 @@ void detected() { @Test void detected_non_compiling() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/StaticFieldUpateCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/StaticFieldUpateCheckSample.java")) .withCheck(new StaticFieldUpateCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StaticFieldUpdateInConstructorCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StaticFieldUpdateInConstructorCheckTest.java index 217974055d3..b199d0acb1d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StaticFieldUpdateInConstructorCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StaticFieldUpdateInConstructorCheckTest.java @@ -28,7 +28,7 @@ class StaticFieldUpdateInConstructorCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StaticFieldUpdateInConstructorCheck.java")) + .onFile(mainCodeSourcesPath("checks/StaticFieldUpdateInConstructorCheckSample.java")) .withCheck(new StaticFieldUpdateInConstructorCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StaticMembersAccessCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StaticMembersAccessCheckTest.java index 302d0db8c02..6bcf011ba25 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StaticMembersAccessCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StaticMembersAccessCheckTest.java @@ -29,7 +29,7 @@ class StaticMembersAccessCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/StaticMembersAccessCheck.java")) + .onFile(mainCodeSourcesPath("checks/StaticMembersAccessCheckSample.java")) .withCheck(new StaticMembersAccessCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/StaticMethodCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StaticMethodCheckTest.java index e05161e47e2..74908fe9b48 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StaticMethodCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StaticMethodCheckTest.java @@ -31,7 +31,7 @@ class StaticMethodCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/StaticMethodCheck.java")) + .onFile(mainCodeSourcesPath("checks/StaticMethodCheckSample.java")) .withCheck(new StaticMethodCheck()) .withQuickFixes() .verifyIssues(); @@ -40,7 +40,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/StaticMethodCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/StaticMethodCheckSample.java")) .withCheck(new StaticMethodCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StreamPeekCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StreamPeekCheckTest.java index f273a10d6c9..0dc63a8d1c6 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StreamPeekCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StreamPeekCheckTest.java @@ -29,7 +29,7 @@ class StreamPeekCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StreamPeekCheck.java")) + .onFile(mainCodeSourcesPath("checks/StreamPeekCheckSample.java")) .withCheck(new StreamPeekCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StringBufferAndBuilderWithCharCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StringBufferAndBuilderWithCharCheckTest.java index 3f5f053439b..1bf9d082685 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StringBufferAndBuilderWithCharCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StringBufferAndBuilderWithCharCheckTest.java @@ -29,7 +29,7 @@ class StringBufferAndBuilderWithCharCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StringBufferAndBuilderWithCharCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringBufferAndBuilderWithCharCheckSample.java")) .withCheck(new StringBufferAndBuilderWithCharCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StringConcatToTextBlockCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StringConcatToTextBlockCheckTest.java index 02fc02ed127..8526281693d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StringConcatToTextBlockCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StringConcatToTextBlockCheckTest.java @@ -29,7 +29,7 @@ class StringConcatToTextBlockCheckTest { @Test void java15() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StringConcatToTextBlockCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringConcatToTextBlockCheckSample.java")) .withCheck(new StringConcatToTextBlockCheck()) .withJavaVersion(15) .verifyIssues(); @@ -38,7 +38,7 @@ void java15() { @Test void java8() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StringConcatToTextBlockCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringConcatToTextBlockCheckSample.java")) .withCheck(new StringConcatToTextBlockCheck()) .withJavaVersion(8) .verifyNoIssues(); @@ -47,7 +47,7 @@ void java8() { @Test void unknown_version() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StringConcatToTextBlockCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringConcatToTextBlockCheckSample.java")) .withCheck(new StringConcatToTextBlockCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StringConcatenationInLoopCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StringConcatenationInLoopCheckTest.java index ff57af637bf..7eb87579947 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StringConcatenationInLoopCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StringConcatenationInLoopCheckTest.java @@ -29,7 +29,7 @@ class StringConcatenationInLoopCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StringConcatenationInLoopCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringConcatenationInLoopCheckSample.java")) .withCheck(new StringConcatenationInLoopCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StringLiteralDuplicatedCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StringLiteralDuplicatedCheckTest.java index e2c4514ff0d..0d03a9982ee 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StringLiteralDuplicatedCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StringLiteralDuplicatedCheckTest.java @@ -30,7 +30,7 @@ class StringLiteralDuplicatedCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StringLiteralDuplicatedCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringLiteralDuplicatedCheckSample.java")) .withCheck(new StringLiteralDuplicatedCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void detected() { @Test void detected_text_blocks() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/TextBlocksDuplicatedCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/TextBlocksDuplicatedCheckSample.java")) .withCheck(new StringLiteralDuplicatedCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StringLiteralInsideEqualsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StringLiteralInsideEqualsCheckTest.java index 8848a0e748a..8ea734963f1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StringLiteralInsideEqualsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StringLiteralInsideEqualsCheckTest.java @@ -29,7 +29,7 @@ class StringLiteralInsideEqualsCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/StringLiteralInsideEqualsCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringLiteralInsideEqualsCheckSample.java")) .withCheck(new StringLiteralInsideEqualsCheck()) .withQuickFixes() .verifyIssues(); @@ -38,7 +38,7 @@ void test() { @Test void testNonCompiling() { InternalCheckVerifier.newInstance() - .onFile(nonCompilingTestSourcesPath("checks/StringLiteralInsideEqualsCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/StringLiteralInsideEqualsCheckSample.java")) .withCheck(new StringLiteralInsideEqualsCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/StringMethodsWithLocaleCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StringMethodsWithLocaleCheckTest.java index bb929e1b0bd..29a772765f1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StringMethodsWithLocaleCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StringMethodsWithLocaleCheckTest.java @@ -28,7 +28,7 @@ class StringMethodsWithLocaleCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StringMethodsWithLocaleCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringMethodsWithLocaleCheckSample.java")) .withCheck(new StringMethodsWithLocaleCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StringOffsetMethodsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StringOffsetMethodsCheckTest.java index 4d3959ffce7..2d06f677ba5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StringOffsetMethodsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StringOffsetMethodsCheckTest.java @@ -29,7 +29,7 @@ class StringOffsetMethodsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StringOffsetMethodsCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringOffsetMethodsCheckSample.java")) .withCheck(new StringOffsetMethodsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StringPrimitiveConstructorCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StringPrimitiveConstructorCheckTest.java index 8340ea625b9..d408365c77c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StringPrimitiveConstructorCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StringPrimitiveConstructorCheckTest.java @@ -29,7 +29,7 @@ class StringPrimitiveConstructorCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/StringPrimitiveConstructorCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringPrimitiveConstructorCheckSample.java")) .withCheck(new StringPrimitiveConstructorCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/StringToPrimitiveConversionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StringToPrimitiveConversionCheckTest.java index 6cd7b297e94..0f7b0bfe0fb 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StringToPrimitiveConversionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StringToPrimitiveConversionCheckTest.java @@ -30,7 +30,7 @@ class StringToPrimitiveConversionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StringToPrimitiveConversionCheck.java")) + .onFile(mainCodeSourcesPath("checks/StringToPrimitiveConversionCheckSample.java")) .withCheck(new StringToPrimitiveConversionCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void not_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/StringToPrimitiveConversionCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/StringToPrimitiveConversionCheckSample.java")) .withCheck(new StringToPrimitiveConversionCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/StrongCipherAlgorithmCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/StrongCipherAlgorithmCheckTest.java index 54126a2b993..942fbe40d03 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/StrongCipherAlgorithmCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/StrongCipherAlgorithmCheckTest.java @@ -30,7 +30,7 @@ class StrongCipherAlgorithmCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/StrongCipherAlgorithmCheck.java")) + .onFile(mainCodeSourcesPath("checks/StrongCipherAlgorithmCheckSample.java")) .withCheck(new StrongCipherAlgorithmCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_java_15() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/StrongCipherAlgorithmCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/StrongCipherAlgorithmCheckSample.java")) .withCheck(new StrongCipherAlgorithmCheck()) .withJavaVersion(15) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/SubClassStaticReferenceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SubClassStaticReferenceCheckTest.java index ef5014a91e0..50dbe729877 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SubClassStaticReferenceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SubClassStaticReferenceCheckTest.java @@ -26,7 +26,7 @@ class SubClassStaticReferenceCheckTest { - private static final String filename = mainCodeSourcesPath("checks/SubClassStaticReferenceCheck.java"); + private static final String filename = mainCodeSourcesPath("checks/SubClassStaticReferenceCheckSample.java"); @Test void detected() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/SunPackagesUsedCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SunPackagesUsedCheckTest.java index 14bdcaef1ee..7e080bffc98 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SunPackagesUsedCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SunPackagesUsedCheckTest.java @@ -28,7 +28,7 @@ class SunPackagesUsedCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/SunPackagesUsedCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/SunPackagesUsedCheckSample.java")) .withCheck(new SunPackagesUsedCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SwitchCaseTooBigCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SwitchCaseTooBigCheckTest.java index 93e8c55ed3e..76a55692861 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SwitchCaseTooBigCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SwitchCaseTooBigCheckTest.java @@ -30,7 +30,7 @@ class SwitchCaseTooBigCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchCaseTooBigCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchCaseTooBigCheckSample.java")) .withCheck(new SwitchCaseTooBigCheck()) .verifyIssues(); } @@ -50,7 +50,7 @@ void limit() { SwitchCaseTooBigCheck check = new SwitchCaseTooBigCheck(); check.max = 0; CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchCaseTooBigCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchCaseTooBigCheckSample.java")) .withCheck(new SwitchCaseTooBigCheck()) .verifyIssues(); } @@ -58,7 +58,7 @@ void limit() { @Test void test_switch_expressions() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/SwitchCaseTooBigCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/SwitchCaseTooBigCheckSample.java")) .withCheck(new SwitchCaseTooBigCheck()) .withJavaVersion(14) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/SwitchCasesShouldBeCommaSeparatedCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SwitchCasesShouldBeCommaSeparatedCheckTest.java index 758a285f54a..4c93174b065 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SwitchCasesShouldBeCommaSeparatedCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SwitchCasesShouldBeCommaSeparatedCheckTest.java @@ -29,7 +29,7 @@ class SwitchCasesShouldBeCommaSeparatedCheckTest { @Test void test_switch_statements() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchCasesShouldBeCommaSeparatedCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchCasesShouldBeCommaSeparatedCheckSample.java")) .withCheck(new SwitchCasesShouldBeCommaSeparatedCheck()) .withJavaVersion(14) .verifyIssues(); @@ -38,7 +38,7 @@ void test_switch_statements() { @Test void test_switch_expressions() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/SwitchCasesShouldBeCommaSeparatedCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/SwitchCasesShouldBeCommaSeparatedCheckSample.java")) .withCheck(new SwitchCasesShouldBeCommaSeparatedCheck()) .withJavaVersion(14) .verifyIssues(); @@ -47,7 +47,7 @@ void test_switch_expressions() { @Test void test_unsupported_java_version() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchCasesShouldBeCommaSeparatedCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchCasesShouldBeCommaSeparatedCheckSample.java")) .withCheck(new SwitchCasesShouldBeCommaSeparatedCheck()) .withJavaVersion(13) .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/SwitchDefaultLastCaseCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SwitchDefaultLastCaseCheckTest.java index 9f8ad009ac8..6c1adb03f6e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SwitchDefaultLastCaseCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SwitchDefaultLastCaseCheckTest.java @@ -29,7 +29,7 @@ class SwitchDefaultLastCaseCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchDefaultLastCaseCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchDefaultLastCaseCheckSample.java")) .withCheck(new SwitchDefaultLastCaseCheck()) .verifyIssues(); } @@ -37,7 +37,7 @@ void test() { @Test void test_switch_expressions() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/SwitchDefaultLastCaseCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/SwitchDefaultLastCaseCheckSample.java")) .withCheck(new SwitchDefaultLastCaseCheck()) .withJavaVersion(14) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/SwitchInsteadOfIfSequenceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SwitchInsteadOfIfSequenceCheckTest.java index 29089d6918a..4da0e59cd0e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SwitchInsteadOfIfSequenceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SwitchInsteadOfIfSequenceCheckTest.java @@ -30,7 +30,7 @@ class SwitchInsteadOfIfSequenceCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchInsteadOfIfSequenceCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchInsteadOfIfSequenceCheckSample.java")) .withCheck(new SwitchInsteadOfIfSequenceCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void detected() { @Test void prior_java_7() throws Exception { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchInsteadOfIfSequenceCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchInsteadOfIfSequenceCheckSample.java")) .withCheck(new SwitchInsteadOfIfSequenceCheck()) .withJavaVersion(6) .verifyNoIssues(); @@ -47,7 +47,7 @@ void prior_java_7() throws Exception { @Test void after_java_15() throws Exception { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/SwitchInsteadOfIfSequenceCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/SwitchInsteadOfIfSequenceCheckSample.java")) .withCheck(new SwitchInsteadOfIfSequenceCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SwitchLastCaseIsDefaultCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SwitchLastCaseIsDefaultCheckTest.java index 0bb7715295e..5b1fba813f2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SwitchLastCaseIsDefaultCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SwitchLastCaseIsDefaultCheckTest.java @@ -30,7 +30,7 @@ class SwitchLastCaseIsDefaultCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchLastCaseIsDefaultCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchLastCaseIsDefaultCheckSample.java")) .withCheck(new SwitchLastCaseIsDefaultCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/SwitchLastCaseIsDefaultCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/SwitchLastCaseIsDefaultCheckSample.java")) .withCheck(new SwitchLastCaseIsDefaultCheck()) .withClassPath(Collections.emptyList()) .verifyNoIssues(); @@ -47,7 +47,7 @@ void test_non_compiling() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchLastCaseIsDefaultCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchLastCaseIsDefaultCheckSample.java")) .withCheck(new SwitchLastCaseIsDefaultCheck()) .withClassPath(Collections.emptyList()) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/SwitchRedundantKeywordCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SwitchRedundantKeywordCheckTest.java index 2048eb0ef67..2d8d52d1a21 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SwitchRedundantKeywordCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SwitchRedundantKeywordCheckTest.java @@ -29,7 +29,7 @@ class SwitchRedundantKeywordCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchRedundantKeywordCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchRedundantKeywordCheckSample.java")) .withCheck(new SwitchRedundantKeywordCheck()) .withJavaVersion(14) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/SwitchWithLabelsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SwitchWithLabelsCheckTest.java index 6dad9c060e5..016a1b34894 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SwitchWithLabelsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SwitchWithLabelsCheckTest.java @@ -30,7 +30,7 @@ class SwitchWithLabelsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchWithLabelsCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchWithLabelsCheckSample.java")) .withCheck(new SwitchWithLabelsCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/SwitchWithLabelsCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/SwitchWithLabelsCheckSample.java")) .withCheck(new SwitchWithLabelsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SwitchWithTooManyCasesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SwitchWithTooManyCasesCheckTest.java index 19ff1e72e52..8e38f04cdc1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SwitchWithTooManyCasesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SwitchWithTooManyCasesCheckTest.java @@ -30,7 +30,7 @@ class SwitchWithTooManyCasesCheckTest { @Test void defaultValue() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SwitchWithTooManyCasesCheck.java")) + .onFile(mainCodeSourcesPath("checks/SwitchWithTooManyCasesCheckSample.java")) .withCheck(new SwitchWithTooManyCasesCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SyncGetterAndSetterCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SyncGetterAndSetterCheckTest.java index 0faf7e7071c..d89455ee0bb 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SyncGetterAndSetterCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SyncGetterAndSetterCheckTest.java @@ -29,7 +29,7 @@ class SyncGetterAndSetterCheckTest { @Test void syncGetterAndSetterCheckTest() throws Exception { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SyncGetterAndSetterCheck.java")) + .onFile(mainCodeSourcesPath("checks/SyncGetterAndSetterCheckSample.java")) .withCheck(new SyncGetterAndSetterCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SynchronizationOnStringOrBoxedCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SynchronizationOnStringOrBoxedCheckTest.java index bd7ab7b914d..a320e040517 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SynchronizationOnStringOrBoxedCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SynchronizationOnStringOrBoxedCheckTest.java @@ -30,7 +30,7 @@ class SynchronizationOnStringOrBoxedCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SynchronizationOnStringOrBoxedCheck.java")) + .onFile(mainCodeSourcesPath("checks/SynchronizationOnStringOrBoxedCheckSample.java")) .withCheck(new SynchronizationOnStringOrBoxedCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/SynchronizationOnStringOrBoxedCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/SynchronizationOnStringOrBoxedCheckSample.java")) .withCheck(new SynchronizationOnStringOrBoxedCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SynchronizedClassUsageCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SynchronizedClassUsageCheckTest.java index 5153fb88fc4..9feb5a6eb41 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SynchronizedClassUsageCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SynchronizedClassUsageCheckTest.java @@ -31,11 +31,11 @@ class SynchronizedClassUsageCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SynchronizedClassUsageCheck.java")) + .onFile(mainCodeSourcesPath("checks/SynchronizedClassUsageCheckSample.java")) .withCheck(new SynchronizedClassUsageCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SynchronizedClassUsageByAPICheck.java")) + .onFile(mainCodeSourcesPath("checks/SynchronizedClassUsageByAPICheckSample.java")) .withCheck(new SynchronizedClassUsageCheck()) .verifyIssues(); } @@ -43,12 +43,12 @@ void detected() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SynchronizedClassUsageCheck.java")) + .onFile(mainCodeSourcesPath("checks/SynchronizedClassUsageCheckSample.java")) .withCheck(new SynchronizedClassUsageCheck()) .withClassPath(Collections.emptyList()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SynchronizedClassUsageByAPICheck.java")) + .onFile(mainCodeSourcesPath("checks/SynchronizedClassUsageByAPICheckSample.java")) .withCheck(new SynchronizedClassUsageCheck()) .withClassPath(Collections.emptyList()) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/SynchronizedLockCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SynchronizedLockCheckTest.java index 7ea8f5750fa..4aae089dc2c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SynchronizedLockCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SynchronizedLockCheckTest.java @@ -29,7 +29,7 @@ class SynchronizedLockCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SynchronizedLockCheck.java")) + .onFile(mainCodeSourcesPath("checks/SynchronizedLockCheckSample.java")) .withCheck(new SynchronizedLockCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SynchronizedOverrideCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SynchronizedOverrideCheckTest.java index d5d5f476c6d..7083c18ef6e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SynchronizedOverrideCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SynchronizedOverrideCheckTest.java @@ -28,7 +28,7 @@ class SynchronizedOverrideCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SynchronizedOverrideCheck.java")) + .onFile(mainCodeSourcesPath("checks/SynchronizedOverrideCheckSample.java")) .withCheck(new SynchronizedOverrideCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/SystemOutOrErrUsageCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/SystemOutOrErrUsageCheckTest.java index c4e89437acc..3bd5ca639cd 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/SystemOutOrErrUsageCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/SystemOutOrErrUsageCheckTest.java @@ -28,7 +28,7 @@ class SystemOutOrErrUsageCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/SystemOutOrErrUsageCheck.java")) + .onFile(mainCodeSourcesPath("checks/SystemOutOrErrUsageCheckSample.java")) .withCheck(new SystemOutOrErrUsageCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/TextBlocksInComplexExpressionsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/TextBlocksInComplexExpressionsCheckTest.java index 08d4ce7d851..0f9e3e60289 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/TextBlocksInComplexExpressionsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/TextBlocksInComplexExpressionsCheckTest.java @@ -29,7 +29,7 @@ class TextBlocksInComplexExpressionsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TextBlocksInComplexExpressionsCheck.java")) + .onFile(mainCodeSourcesPath("checks/TextBlocksInComplexExpressionsCheckSample.java")) .withCheck(new TextBlocksInComplexExpressionsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ThreadAsRunnableArgumentCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ThreadAsRunnableArgumentCheckTest.java index 3ab32d75d4f..415bedd1c64 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ThreadAsRunnableArgumentCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ThreadAsRunnableArgumentCheckTest.java @@ -29,7 +29,7 @@ class ThreadAsRunnableArgumentCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ThreadAsRunnableArgumentCheck.java")) + .onFile(mainCodeSourcesPath("checks/ThreadAsRunnableArgumentCheckSample.java")) .withCheck(new ThreadAsRunnableArgumentCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ThreadOverridesRunCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ThreadOverridesRunCheckTest.java index 5c9e69e2a94..1af2dea91b8 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ThreadOverridesRunCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ThreadOverridesRunCheckTest.java @@ -30,7 +30,7 @@ class ThreadOverridesRunCheckTest { @Test void detected() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ThreadOverridesRunCheck.java")) + .onFile(mainCodeSourcesPath("checks/ThreadOverridesRunCheckSample.java")) .withCheck(new ThreadOverridesRunCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void detected() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/ThreadOverridesRunCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/ThreadOverridesRunCheckSample.java")) .withCheck(new ThreadOverridesRunCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ThreadRunCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ThreadRunCheckTest.java index 99ba5360e92..1824b5ffb74 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ThreadRunCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ThreadRunCheckTest.java @@ -29,7 +29,7 @@ class ThreadRunCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/ThreadRunCheck.java")) + .onFile(mainCodeSourcesPath("checks/ThreadRunCheckSample.java")) .withCheck(new ThreadRunCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ThreadSleepCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ThreadSleepCheckTest.java index c08eb7226d4..e1dd7518787 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ThreadSleepCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ThreadSleepCheckTest.java @@ -29,7 +29,7 @@ class ThreadSleepCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ThreadSleepCheck.java")) + .onFile(mainCodeSourcesPath("checks/ThreadSleepCheckSample.java")) .withCheck(new ThreadSleepCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ThreadWaitCallCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ThreadWaitCallCheckTest.java index 2a2712813a4..9ffb9034fad 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ThreadWaitCallCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ThreadWaitCallCheckTest.java @@ -29,7 +29,7 @@ class ThreadWaitCallCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ThreadWaitCallCheck.java")) + .onFile(mainCodeSourcesPath("checks/ThreadWaitCallCheckSample.java")) .withCheck(new ThreadWaitCallCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ThrowsFromFinallyCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ThrowsFromFinallyCheckTest.java index 8261772f9a7..73449d3b998 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ThrowsFromFinallyCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ThrowsFromFinallyCheckTest.java @@ -29,7 +29,7 @@ class ThrowsFromFinallyCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/ThrowsFromFinallyCheck.java")) + .onFile(mainCodeSourcesPath("checks/ThrowsFromFinallyCheckSample.java")) .withCheck(new ThrowsFromFinallyCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/ToArrayCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ToArrayCheckTest.java index 4d63d6bc99e..55b101a4977 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ToArrayCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ToArrayCheckTest.java @@ -29,7 +29,7 @@ class ToArrayCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/ToArrayCheck.java")) + .onFile(mainCodeSourcesPath("checks/ToArrayCheckSample.java")) .withCheck(new ToArrayCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ToStringReturningNullCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ToStringReturningNullCheckTest.java index 3e0ad3fec8a..d6b16fab5c0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ToStringReturningNullCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ToStringReturningNullCheckTest.java @@ -29,7 +29,7 @@ class ToStringReturningNullCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/ToStringReturningNullCheck.java")) + .onFile(mainCodeSourcesPath("checks/ToStringReturningNullCheckSample.java")) .withCheck(new ToStringReturningNullCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/ToStringUsingBoxingCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ToStringUsingBoxingCheckTest.java index 7491efb2558..aee292bff2c 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/ToStringUsingBoxingCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/ToStringUsingBoxingCheckTest.java @@ -29,7 +29,7 @@ class ToStringUsingBoxingCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/ToStringUsingBoxingCheck.java")) + .onFile(mainCodeSourcesPath("checks/ToStringUsingBoxingCheckSample.java")) .withCheck(new ToStringUsingBoxingCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/TodoTagPresenceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/TodoTagPresenceCheckTest.java index 2c6121e3d13..cebd95169df 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/TodoTagPresenceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/TodoTagPresenceCheckTest.java @@ -29,7 +29,7 @@ class TodoTagPresenceCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TodoTagPresenceCheck.java")) + .onFile(mainCodeSourcesPath("checks/TodoTagPresenceCheckSample.java")) .withCheck(new TodoTagPresenceCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/TooManyMethodsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/TooManyMethodsCheckTest.java index 356dcc0ceda..69da48a07bc 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/TooManyMethodsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/TooManyMethodsCheckTest.java @@ -32,7 +32,7 @@ void test() { TooManyMethodsCheck check = new TooManyMethodsCheck(); check.maximumMethodThreshold = 4; CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TooManyMethodsCheck.java")) + .onFile(mainCodeSourcesPath("checks/TooManyMethodsCheckSample.java")) .withCheck(check) .verifyIssues(); } @@ -53,7 +53,7 @@ void test_non_compiling() { TooManyMethodsCheck check = new TooManyMethodsCheck(); check.maximumMethodThreshold = 4; CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/TooManyMethodsCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/TooManyMethodsCheckSample.java")) .withCheck(check) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/TooManyParametersCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/TooManyParametersCheckTest.java index d26f9200460..e0407f54324 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/TooManyParametersCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/TooManyParametersCheckTest.java @@ -30,7 +30,7 @@ class TooManyParametersCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TooManyParametersCheck.java")) + .onFile(mainCodeSourcesPath("checks/TooManyParametersCheckSample.java")) .withCheck(new TooManyParametersCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/TooManyParametersCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/TooManyParametersCheckSample.java")) .withCheck(new TooManyParametersCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/TrailingCommentCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/TrailingCommentCheckTest.java index 7a1c62ac5fa..416211b2681 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/TrailingCommentCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/TrailingCommentCheckTest.java @@ -32,13 +32,13 @@ void detected() { TrailingCommentCheck check = new TrailingCommentCheck(); assertThat(check.legalCommentPattern).isEqualTo("^\\s*+[^\\s]++$"); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TrailingCommentCheck.java")) + .onFile(mainCodeSourcesPath("checks/TrailingCommentCheckSample.java")) .withCheck(check) .verifyIssues(); check.legalCommentPattern = ""; // parameter has changed but regexp is not recompiled, so we find the same issues. CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TrailingCommentCheck.java")) + .onFile(mainCodeSourcesPath("checks/TrailingCommentCheckSample.java")) .withCheck(check) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/TransientFieldInNonSerializableCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/TransientFieldInNonSerializableCheckTest.java index e7c27023a92..ed350ab3619 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/TransientFieldInNonSerializableCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/TransientFieldInNonSerializableCheckTest.java @@ -30,7 +30,7 @@ class TransientFieldInNonSerializableCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TransientFieldInNonSerializableCheck.java")) + .onFile(mainCodeSourcesPath("checks/TransientFieldInNonSerializableCheckSample.java")) .withCheck(new TransientFieldInNonSerializableCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/TransientFieldInNonSerializableCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/TransientFieldInNonSerializableCheckSample.java")) .withCheck(new TransientFieldInNonSerializableCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/TryWithResourcesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/TryWithResourcesCheckTest.java index b12f6fd11b3..c92e23ef28e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/TryWithResourcesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/TryWithResourcesCheckTest.java @@ -29,7 +29,7 @@ class TryWithResourcesCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TryWithResourcesCheck.java")) + .onFile(mainCodeSourcesPath("checks/TryWithResourcesCheckSample.java")) .withCheck(new TryWithResourcesCheck()) .withJavaVersion(7) .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/TypeParametersShadowingCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/TypeParametersShadowingCheckTest.java index e717dcc705a..c3e858f9a2a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/TypeParametersShadowingCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/TypeParametersShadowingCheckTest.java @@ -29,7 +29,7 @@ class TypeParametersShadowingCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TypeParametersShadowingCheck.java")) + .onFile(mainCodeSourcesPath("checks/TypeParametersShadowingCheckSample.java")) .withCheck(new TypeParametersShadowingCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/TypeUpperBoundNotFinalCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/TypeUpperBoundNotFinalCheckTest.java index 82c29c234bf..be6267056d9 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/TypeUpperBoundNotFinalCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/TypeUpperBoundNotFinalCheckTest.java @@ -30,7 +30,7 @@ class TypeUpperBoundNotFinalCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TypeUpperBoundNotFinalCheck.java")) + .onFile(mainCodeSourcesPath("checks/TypeUpperBoundNotFinalCheckSample.java")) .withCheck(new TypeUpperBoundNotFinalCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_incomplete_semantic() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/TypeUpperBoundNotFinalCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/TypeUpperBoundNotFinalCheckSample.java")) .withCheck(new TypeUpperBoundNotFinalCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/design/BrainMethodCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/design/BrainMethodCheckTest.java index bf7af437ee7..5f87b48fe45 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/design/BrainMethodCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/design/BrainMethodCheckTest.java @@ -26,7 +26,7 @@ class BrainMethodCheckTest { - private static final String highComplexityFilePath = mainCodeSourcesPath("checks/BrainMethodCheck.java"); + private static final String highComplexityFilePath = mainCodeSourcesPath("checks/BrainMethodCheckSample.java"); private static final String lowComplexityFilePath = mainCodeSourcesPath("checks/BrainMethodCheckLowerThresholds.java"); private static final String subsetFilePath = mainCodeSourcesPath("checks/BrainMethodCheckSubsetOfIssues.java"); diff --git a/java-checks/src/test/java/org/sonar/java/checks/naming/BadTestClassNameCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/naming/BadTestClassNameCheckTest.java index 1d3e93f4f53..db6601173ce 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/naming/BadTestClassNameCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/naming/BadTestClassNameCheckTest.java @@ -25,7 +25,7 @@ import static org.sonar.java.checks.verifier.TestUtils.testCodeSourcesPath; class BadTestClassNameCheckTest { - private static final String TEST_FILE = testCodeSourcesPath("checks/tests/BadTestClassNameCheck.java"); + private static final String TEST_FILE = testCodeSourcesPath("checks/tests/BadTestClassNameCheckSample.java"); @Test void test() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/naming/BooleanMethodNameCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/naming/BooleanMethodNameCheckTest.java index b7a6ee3279c..c73ddb913f6 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/naming/BooleanMethodNameCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/naming/BooleanMethodNameCheckTest.java @@ -29,7 +29,7 @@ class BooleanMethodNameCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/naming/BooleanMethodNameCheck.java")) + .onFile(mainCodeSourcesPath("checks/naming/BooleanMethodNameCheckSample.java")) .withCheck(new BooleanMethodNameCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/naming/FieldNameMatchingTypeNameCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/naming/FieldNameMatchingTypeNameCheckTest.java index f35c935fe14..a54639e53da 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/naming/FieldNameMatchingTypeNameCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/naming/FieldNameMatchingTypeNameCheckTest.java @@ -29,7 +29,7 @@ class FieldNameMatchingTypeNameCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/naming/FieldNameMatchingTypeNameCheck.java")) + .onFile(mainCodeSourcesPath("checks/naming/FieldNameMatchingTypeNameCheckSample.java")) .withCheck(new FieldNameMatchingTypeNameCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/naming/MethodNamedHashcodeOrEqualCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/naming/MethodNamedHashcodeOrEqualCheckTest.java index f53fbe8859b..55a9704f6b7 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/naming/MethodNamedHashcodeOrEqualCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/naming/MethodNamedHashcodeOrEqualCheckTest.java @@ -30,7 +30,7 @@ class MethodNamedHashcodeOrEqualCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/naming/MethodNamedHashcodeOrEqualCheck.java")) + .onFile(mainCodeSourcesPath("checks/naming/MethodNamedHashcodeOrEqualCheckSample.java")) .withCheck(new MethodNamedHashcodeOrEqualCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_incomplete_semantic() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/naming/MethodNamedHashcodeOrEqualCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/naming/MethodNamedHashcodeOrEqualCheckSample.java")) .withCheck(new MethodNamedHashcodeOrEqualCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/AbstractRegexCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/AbstractRegexCheckTest.java index 797da6e5b91..bcf4f1c480e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/AbstractRegexCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/AbstractRegexCheckTest.java @@ -228,7 +228,7 @@ public void checkRegex(RegexParseResult regexForLiterals, ExpressionTree methodI } } CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/AbstractRegexCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/AbstractRegexCheckSample.java")) .withCheck(new IssueOnAllRegexCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/AnchorPrecedenceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/AnchorPrecedenceCheckTest.java index 79c82dbb2fa..52723f21bd0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/AnchorPrecedenceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/AnchorPrecedenceCheckTest.java @@ -29,7 +29,7 @@ class AnchorPrecedenceCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/AnchorPrecedenceCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/AnchorPrecedenceCheckSample.java")) .withCheck(new AnchorPrecedenceCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/DuplicatesInCharacterClassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/DuplicatesInCharacterClassCheckTest.java index 63e30682b25..eab87a3b949 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/DuplicatesInCharacterClassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/DuplicatesInCharacterClassCheckTest.java @@ -29,7 +29,7 @@ class DuplicatesInCharacterClassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/DuplicatesInCharacterClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/DuplicatesInCharacterClassCheckSample.java")) .withCheck(new DuplicatesInCharacterClassCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyLineRegexCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyLineRegexCheckTest.java index 328892cba1e..d97ca5b55e3 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyLineRegexCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyLineRegexCheckTest.java @@ -30,7 +30,7 @@ class EmptyLineRegexCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/EmptyLineRegexCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/EmptyLineRegexCheckSample.java")) .withCheck(new EmptyLineRegexCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void testTextBlocks() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/regex/EmptyLineRegexCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/regex/EmptyLineRegexCheckSample.java")) .withCheck(new EmptyLineRegexCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyRegexGroupCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyRegexGroupCheckTest.java index 93a2329d259..a6c249d4084 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyRegexGroupCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyRegexGroupCheckTest.java @@ -29,7 +29,7 @@ class EmptyRegexGroupCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/EmptyRegexGroupCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/EmptyRegexGroupCheckSample.java")) .withCheck(new EmptyRegexGroupCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyStringRepetitionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyStringRepetitionCheckTest.java index b2db1a55fd0..68980fcc808 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyStringRepetitionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/EmptyStringRepetitionCheckTest.java @@ -29,7 +29,7 @@ class EmptyStringRepetitionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/EmptyStringRepetitionCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/EmptyStringRepetitionCheckSample.java")) .withCheck(new EmptyStringRepetitionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/EscapeSequenceControlCharacterCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/EscapeSequenceControlCharacterCheckTest.java index dd727b62119..5a5c826c853 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/EscapeSequenceControlCharacterCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/EscapeSequenceControlCharacterCheckTest.java @@ -29,7 +29,7 @@ class EscapeSequenceControlCharacterCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/EscapeSequenceControlCharacterCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/EscapeSequenceControlCharacterCheckSample.java")) .withCheck(new EscapeSequenceControlCharacterCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/GraphemeClustersInClassesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/GraphemeClustersInClassesCheckTest.java index 07cf97c9232..a4303a8305f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/GraphemeClustersInClassesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/GraphemeClustersInClassesCheckTest.java @@ -29,7 +29,7 @@ class GraphemeClustersInClassesCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/GraphemeClustersInClassesCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/GraphemeClustersInClassesCheckSample.java")) .withCheck(new GraphemeClustersInClassesCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/ImpossibleBackReferenceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/ImpossibleBackReferenceCheckTest.java index 0368fe3a8aa..98964d50a9f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/ImpossibleBackReferenceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/ImpossibleBackReferenceCheckTest.java @@ -29,7 +29,7 @@ class ImpossibleBackReferenceCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/ImpossibleBackReferenceCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/ImpossibleBackReferenceCheckSample.java")) .withCheck(new ImpossibleBackReferenceCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/ImpossibleBoundariesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/ImpossibleBoundariesCheckTest.java index 350a70ecbeb..30b097585ef 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/ImpossibleBoundariesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/ImpossibleBoundariesCheckTest.java @@ -29,7 +29,7 @@ class ImpossibleBoundariesCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/ImpossibleBoundariesCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/ImpossibleBoundariesCheckSample.java")) .withCheck(new ImpossibleBoundariesCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/InvalidRegexCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/InvalidRegexCheckTest.java index a474b7cf81b..adc2747fa64 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/InvalidRegexCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/InvalidRegexCheckTest.java @@ -29,7 +29,7 @@ class InvalidRegexCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/InvalidRegexCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/InvalidRegexCheckSample.java")) .withCheck(new InvalidRegexCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/MultipleWhitespaceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/MultipleWhitespaceCheckTest.java index daac37f425d..023d0172a11 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/MultipleWhitespaceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/MultipleWhitespaceCheckTest.java @@ -29,7 +29,7 @@ class MultipleWhitespaceCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/MultipleWhitespaceCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/MultipleWhitespaceCheckSample.java")) .withCheck(new MultipleWhitespaceCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/PossessiveQuantifierContinuationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/PossessiveQuantifierContinuationCheckTest.java index 94f679df412..5f31f723979 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/PossessiveQuantifierContinuationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/PossessiveQuantifierContinuationCheckTest.java @@ -29,7 +29,7 @@ class PossessiveQuantifierContinuationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/PossessiveQuantifierContinuationCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/PossessiveQuantifierContinuationCheckSample.java")) .withCheck(new PossessiveQuantifierContinuationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/RedosCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/RedosCheckTest.java index c29eec8cc50..d8a34721c9b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/RedosCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/RedosCheckTest.java @@ -29,7 +29,7 @@ class RedosCheckTest { @Test void test_java_version_unset() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/RedosCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/RedosCheckSample.java")) .withCheck(new RedosCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test_java_version_unset() { void test_java_version_9() { CheckVerifier.newVerifier() .withJavaVersion(9) - .onFile(mainCodeSourcesPath("checks/regex/RedosCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/RedosCheckSample.java")) .withCheck(new RedosCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/RedundantRegexAlternativesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/RedundantRegexAlternativesCheckTest.java index a7b3ffd4e32..f45b0a5d1ce 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/RedundantRegexAlternativesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/RedundantRegexAlternativesCheckTest.java @@ -29,7 +29,7 @@ class RedundantRegexAlternativesCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/RedundantRegexAlternativesCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/RedundantRegexAlternativesCheckSample.java")) .withCheck(new RedundantRegexAlternativesCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/RegexComplexityCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/RegexComplexityCheckTest.java index 1932b6dfff3..311631e2538 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/RegexComplexityCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/RegexComplexityCheckTest.java @@ -29,7 +29,7 @@ class RegexComplexityCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/RegexComplexityCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/RegexComplexityCheckSample.java")) .withCheck(new RegexComplexityCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/RegexLookaheadCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/RegexLookaheadCheckTest.java index e6fd1bb9c32..a2c9f477fc8 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/RegexLookaheadCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/RegexLookaheadCheckTest.java @@ -29,7 +29,7 @@ class RegexLookaheadCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/RegexLookaheadCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/RegexLookaheadCheckSample.java")) .withCheck(new RegexLookaheadCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/ReluctantQuantifierCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/ReluctantQuantifierCheckTest.java index 4d3291fa38a..e8791578e79 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/ReluctantQuantifierCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/ReluctantQuantifierCheckTest.java @@ -29,7 +29,7 @@ class ReluctantQuantifierCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/ReluctantQuantifierCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/ReluctantQuantifierCheckSample.java")) .withCheck(new ReluctantQuantifierCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheckTest.java index c2b312979cb..1d5b2cb1740 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/ReluctantQuantifierWithEmptyContinuationCheckTest.java @@ -29,7 +29,7 @@ class ReluctantQuantifierWithEmptyContinuationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/ReluctantQuantifierWithEmptyContinuationCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/ReluctantQuantifierWithEmptyContinuationCheckSample.java")) .withCheck(new ReluctantQuantifierWithEmptyContinuationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/SingleCharCharacterClassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/SingleCharCharacterClassCheckTest.java index c6860fb5090..3bf4a331535 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/SingleCharCharacterClassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/SingleCharCharacterClassCheckTest.java @@ -29,7 +29,7 @@ class SingleCharCharacterClassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/SingleCharCharacterClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/SingleCharCharacterClassCheckSample.java")) .withCheck(new SingleCharCharacterClassCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/SingleCharacterAlternationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/SingleCharacterAlternationCheckTest.java index e7d154aa858..96e3f6b9223 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/SingleCharacterAlternationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/SingleCharacterAlternationCheckTest.java @@ -30,7 +30,7 @@ class SingleCharacterAlternationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/SingleCharacterAlternationCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/SingleCharacterAlternationCheckSample.java")) .withCheck(new SingleCharacterAlternationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/regex/SuperfluousCurlyBraceCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/regex/SuperfluousCurlyBraceCheckTest.java index 5e87f1390ab..60451295358 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/regex/SuperfluousCurlyBraceCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/regex/SuperfluousCurlyBraceCheckTest.java @@ -29,7 +29,7 @@ class SuperfluousCurlyBraceCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/regex/SuperfluousCurlyBraceCheck.java")) + .onFile(mainCodeSourcesPath("checks/regex/SuperfluousCurlyBraceCheckSample.java")) .withCheck(new SuperfluousCurlyBraceCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidBiometricAuthWithoutCryptoCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidBiometricAuthWithoutCryptoCheckTest.java index a79ec27eeef..d3b4d4fa028 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidBiometricAuthWithoutCryptoCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidBiometricAuthWithoutCryptoCheckTest.java @@ -29,7 +29,7 @@ class AndroidBiometricAuthWithoutCryptoCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/AndroidBiometricAuthWithoutCryptoCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/AndroidBiometricAuthWithoutCryptoCheckSample.java")) .withCheck(new AndroidBiometricAuthWithoutCryptoCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidBroadcastingCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidBroadcastingCheckTest.java index 9ee0b1f5ad1..7bd989ee649 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidBroadcastingCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidBroadcastingCheckTest.java @@ -29,7 +29,7 @@ class AndroidBroadcastingCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/AndroidBroadcastingCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/AndroidBroadcastingCheckSample.java")) .withCheck(new AndroidBroadcastingCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheckTest.java index 4eca6e1ef8e..2f0f4231323 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidMobileDatabaseEncryptionKeysCheckTest.java @@ -29,7 +29,7 @@ class AndroidMobileDatabaseEncryptionKeysCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/AndroidMobileDatabaseEncryptionKeysCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/AndroidMobileDatabaseEncryptionKeysCheckSample.java")) .withCheck(new AndroidMobileDatabaseEncryptionKeysCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidNonAuthenticatedUsersCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidNonAuthenticatedUsersCheckTest.java index daddf3ce037..7a66b806f66 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidNonAuthenticatedUsersCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidNonAuthenticatedUsersCheckTest.java @@ -29,7 +29,7 @@ class AndroidNonAuthenticatedUsersCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/AndroidNonAuthenticatedUsersCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/AndroidNonAuthenticatedUsersCheckSample.java")) .withCheck(new AndroidNonAuthenticatedUsersCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidUnencryptedDatabaseCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidUnencryptedDatabaseCheckTest.java index a6d860bb394..b9c34a15948 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidUnencryptedDatabaseCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidUnencryptedDatabaseCheckTest.java @@ -29,7 +29,7 @@ class AndroidUnencryptedDatabaseCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/AndroidUnencryptedDatabaseCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/AndroidUnencryptedDatabaseCheckSample.java")) .withCheck(new AndroidUnencryptedDatabaseCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidUnencryptedFilesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidUnencryptedFilesCheckTest.java index 42ff54373e6..f51b10921e5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/AndroidUnencryptedFilesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/AndroidUnencryptedFilesCheckTest.java @@ -29,7 +29,7 @@ class AndroidUnencryptedFilesCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/AndroidUnencryptedFilesCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/AndroidUnencryptedFilesCheckSample.java")) .withCheck(new AndroidUnencryptedFilesCheck()) .withinAndroidContext(true) .verifyIssues(); @@ -38,7 +38,7 @@ void test() { @Test void test_not_android_context() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/AndroidUnencryptedFilesCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/AndroidUnencryptedFilesCheckSample.java")) .withCheck(new AndroidUnencryptedFilesCheck()) .withinAndroidContext(false) .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/AuthorizationsStrongDecisionsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/AuthorizationsStrongDecisionsCheckTest.java index 3c05d08e689..02bb3fb90e2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/AuthorizationsStrongDecisionsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/AuthorizationsStrongDecisionsCheckTest.java @@ -29,7 +29,7 @@ class AuthorizationsStrongDecisionsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/AuthorizationsStrongDecisionsCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/AuthorizationsStrongDecisionsCheckSample.java")) .withCheck(new AuthorizationsStrongDecisionsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/DataHashingCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/DataHashingCheckTest.java index 3f5957d7863..3f70074aea0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/DataHashingCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/DataHashingCheckTest.java @@ -29,7 +29,7 @@ class DataHashingCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/DataHashingCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/DataHashingCheckSample.java")) .withCheck(new DataHashingCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/DebugFeatureEnabledCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/DebugFeatureEnabledCheckTest.java index 5eabcc4d1ee..095b138dbc0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/DebugFeatureEnabledCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/DebugFeatureEnabledCheckTest.java @@ -30,11 +30,11 @@ class DebugFeatureEnabledCheckTest { @Test void testEnableWebSecurity() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/security/DebugFeatureEnabledCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/security/DebugFeatureEnabledCheckSample.java")) .withCheck(new DebugFeatureEnabledCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/security/DebugFeatureEnabledCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/security/DebugFeatureEnabledCheckSample.java")) .withCheck(new DebugFeatureEnabledCheck()) .withoutSemantic() .verifyNoIssues(); @@ -43,7 +43,7 @@ void testEnableWebSecurity() { @Test void testPrintStackTrace() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/DebugFeatureEnabledCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/DebugFeatureEnabledCheckSample.java")) .withCheck(new DebugFeatureEnabledCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/DisableAutoEscapingCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/DisableAutoEscapingCheckTest.java index 709e56eed56..78065f8e1d6 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/DisableAutoEscapingCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/DisableAutoEscapingCheckTest.java @@ -30,7 +30,7 @@ class DisableAutoEscapingCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/DisableAutoEscapingCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/DisableAutoEscapingCheckSample.java")) .withCheck(new DisableAutoEscapingCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/security/DisableAutoEscapingCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/security/DisableAutoEscapingCheckSample.java")) .withCheck(new DisableAutoEscapingCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/EmptyDatabasePasswordCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/EmptyDatabasePasswordCheckTest.java index 47877b6f112..e02adc03c5d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/EmptyDatabasePasswordCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/EmptyDatabasePasswordCheckTest.java @@ -29,7 +29,7 @@ class EmptyDatabasePasswordCheckTest { @Test void test() throws Exception { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/EmptyDatabasePasswordCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/EmptyDatabasePasswordCheckSample.java")) .withCheck(new EmptyDatabasePasswordCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/EncryptionAlgorithmCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/EncryptionAlgorithmCheckTest.java index 81b7118e6ac..55cefdb8516 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/EncryptionAlgorithmCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/EncryptionAlgorithmCheckTest.java @@ -29,7 +29,7 @@ class EncryptionAlgorithmCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/EncryptionAlgorithmCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/EncryptionAlgorithmCheckSample.java")) .withCheck(new EncryptionAlgorithmCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/ExcessiveContentRequestCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/ExcessiveContentRequestCheckTest.java index 6a7d67840fe..7676343c5bf 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/ExcessiveContentRequestCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/ExcessiveContentRequestCheckTest.java @@ -324,7 +324,7 @@ void CachedResult_toBytes_returns_the_expected_result() { @Test void test_default_max() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/ExcessiveContentRequestCheck/ExcessiveContentRequestCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/ExcessiveContentRequestCheck/ExcessiveContentRequestCheckSample.java")) .withCheck(new ExcessiveContentRequestCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/FilePermissionsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/FilePermissionsCheckTest.java index 05f1b2b9b4d..85834c3514a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/FilePermissionsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/FilePermissionsCheckTest.java @@ -29,7 +29,7 @@ class FilePermissionsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/FilePermissionsCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/FilePermissionsCheckSample.java")) .withCheck(new FilePermissionsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/IntegerToHexStringCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/IntegerToHexStringCheckTest.java index 4ebbb0d37d0..57025b72795 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/IntegerToHexStringCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/IntegerToHexStringCheckTest.java @@ -26,7 +26,7 @@ class IntegerToHexStringCheckTest { - public static final String TEST_FILE = mainCodeSourcesPath("checks/security/IntegerToHexStringCheck.java"); + public static final String TEST_FILE = mainCodeSourcesPath("checks/security/IntegerToHexStringCheckSample.java"); @Test void test() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/LDAPAuthenticatedConnectionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/LDAPAuthenticatedConnectionCheckTest.java index 6fa4b633ef9..6f249dce0a0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/LDAPAuthenticatedConnectionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/LDAPAuthenticatedConnectionCheckTest.java @@ -33,7 +33,7 @@ class LDAPAuthenticatedConnectionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/LDAPAuthenticatedConnectionCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/LDAPAuthenticatedConnectionCheckSample.java")) .withCheck(new LDAPAuthenticatedConnectionCheck()) // FIXME should not requires an empty classpath .withClassPath(Collections.emptyList()) diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/LDAPDeserializationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/LDAPDeserializationCheckTest.java index dfa87527091..0687a961d3f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/LDAPDeserializationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/LDAPDeserializationCheckTest.java @@ -29,7 +29,7 @@ class LDAPDeserializationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/LDAPDeserializationCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/LDAPDeserializationCheckSample.java")) .withCheck(new LDAPDeserializationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/LogConfigurationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/LogConfigurationCheckTest.java index e0bf137fef1..15d582d5119 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/LogConfigurationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/LogConfigurationCheckTest.java @@ -29,7 +29,7 @@ class LogConfigurationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/LogConfigurationCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/LogConfigurationCheckSample.java")) .withCheck(new LogConfigurationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/OpenSAML2AuthenticationBypassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/OpenSAML2AuthenticationBypassCheckTest.java index 86f9cb346d0..9249ecd6ea0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/OpenSAML2AuthenticationBypassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/OpenSAML2AuthenticationBypassCheckTest.java @@ -29,7 +29,7 @@ class OpenSAML2AuthenticationBypassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/OpenSAML2AuthenticationBypassCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/OpenSAML2AuthenticationBypassCheckSample.java")) .withCheck(new OpenSAML2AuthenticationBypassCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/ReceivingIntentsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/ReceivingIntentsCheckTest.java index 5db1f1dbff1..47f793a7dc2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/ReceivingIntentsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/ReceivingIntentsCheckTest.java @@ -29,7 +29,7 @@ class ReceivingIntentsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/security/ReceivingIntentsCheck.java")) + .onFile(mainCodeSourcesPath("checks/security/ReceivingIntentsCheckSample.java")) .withCheck(new ReceivingIntentsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/SecureCookieCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/SecureCookieCheckTest.java index 2912f75a62f..552cfffdccb 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/SecureCookieCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/SecureCookieCheckTest.java @@ -32,7 +32,7 @@ class SecureCookieCheckTest { - private static final String SOURCE_PATH = "checks/security/SecureCookieCheck.java"; + private static final String SOURCE_PATH = "checks/security/SecureCookieCheckSample.java"; private static final String TEST_SOURCE_PATH = mainCodeSourcesPath(SOURCE_PATH); private static final String NON_COMPILING_TEST_SOURCE_PATH = nonCompilingTestSourcesPath(SOURCE_PATH); public static final List SPRING_3_2_CLASSPATH = TestClasspathUtils.loadFromFile(Constants.SPRING_3_2_CLASSPATH); diff --git a/java-checks/src/test/java/org/sonar/java/checks/security/ServerCertificatesCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/security/ServerCertificatesCheckTest.java index cf69b4cd9f0..02df4a04e78 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/security/ServerCertificatesCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/security/ServerCertificatesCheckTest.java @@ -27,7 +27,7 @@ class ServerCertificatesCheckTest { - private static final String TEST_FILE = "checks/security/ServerCertificatesCheck.java"; + private static final String TEST_FILE = "checks/security/ServerCertificatesCheckSample.java"; @Test void test() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/serialization/ExternalizableClassConstructorCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/serialization/ExternalizableClassConstructorCheckTest.java index bed6301b310..75615078ec8 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/serialization/ExternalizableClassConstructorCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/serialization/ExternalizableClassConstructorCheckTest.java @@ -29,7 +29,7 @@ class ExternalizableClassConstructorCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/serialization/ExternalizableClassConstructorCheck.java")) + .onFile(mainCodeSourcesPath("checks/serialization/ExternalizableClassConstructorCheckSample.java")) .withCheck(new ExternalizableClassConstructorCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/serialization/NonSerializableWriteCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/serialization/NonSerializableWriteCheckTest.java index 28a221898fc..b2bdf19a1df 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/serialization/NonSerializableWriteCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/serialization/NonSerializableWriteCheckTest.java @@ -29,7 +29,7 @@ class NonSerializableWriteCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/serialization/NonSerializableWriteCheck.java")) + .onFile(mainCodeSourcesPath("checks/serialization/NonSerializableWriteCheckSample.java")) .withCheck(new NonSerializableWriteCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/serialization/RecordSerializationIgnoredMembersCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/serialization/RecordSerializationIgnoredMembersCheckTest.java index 34b7ebbfe5b..57d1933159a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/serialization/RecordSerializationIgnoredMembersCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/serialization/RecordSerializationIgnoredMembersCheckTest.java @@ -29,7 +29,7 @@ class RecordSerializationIgnoredMembersCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/serialization/RecordSerializationIgnoredMembersCheck.java")) + .onFile(mainCodeSourcesPath("checks/serialization/RecordSerializationIgnoredMembersCheckSample.java")) .withCheck(new RecordSerializationIgnoredMembersCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerialVersionUidCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerialVersionUidCheckTest.java index ae9b528d4bf..9f24dcb0883 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerialVersionUidCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerialVersionUidCheckTest.java @@ -27,7 +27,7 @@ class SerialVersionUidCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/serialization/SerialVersionUidCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/serialization/SerialVersionUidCheckSample.java")) .withCheck(new SerialVersionUidCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerialVersionUidInRecordCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerialVersionUidInRecordCheckTest.java index 362fb049364..d184a667109 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerialVersionUidInRecordCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerialVersionUidInRecordCheckTest.java @@ -29,7 +29,7 @@ class SerialVersionUidInRecordCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/serialization/SerialVersionUidInRecordCheck.java")) + .onFile(mainCodeSourcesPath("checks/serialization/SerialVersionUidInRecordCheckSample.java")) .withCheck(new SerialVersionUidInRecordCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/serialization/SerialVersionUidInRecordCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/serialization/SerialVersionUidInRecordCheckSample.java")) .withCheck(new SerialVersionUidInRecordCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableFieldInSerializableClassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableFieldInSerializableClassCheckTest.java index a63a328fca1..e16a534fcb9 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableFieldInSerializableClassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableFieldInSerializableClassCheckTest.java @@ -30,7 +30,7 @@ class SerializableFieldInSerializableClassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/serialization/SerializableFieldInSerializableClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/serialization/SerializableFieldInSerializableClassCheckSample.java")) .withCheck(new SerializableFieldInSerializableClassCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/serialization/SerializableFieldInSerializableClassCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/serialization/SerializableFieldInSerializableClassCheckSample.java")) .withCheck(new SerializableFieldInSerializableClassCheck()) .verifyIssues(); } @@ -46,7 +46,7 @@ void test_non_compiling() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/serialization/SerializableFieldInSerializableClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/serialization/SerializableFieldInSerializableClassCheckSample.java")) .withCheck(new SerializableFieldInSerializableClassCheck()) .withoutSemantic() .verifyIssues(); @@ -55,7 +55,7 @@ void test_without_semantic() { @Test void test_non_compiling_without_semantic() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/serialization/SerializableFieldInSerializableClassCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/serialization/SerializableFieldInSerializableClassCheckSample.java")) .withCheck(new SerializableFieldInSerializableClassCheck()) .withoutSemantic() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableObjectInSessionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableObjectInSessionCheckTest.java index 303d2659383..f8bfdd0dff8 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableObjectInSessionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableObjectInSessionCheckTest.java @@ -29,7 +29,7 @@ class SerializableObjectInSessionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/serialization/SerializableObjectInSessionCheck.java")) + .onFile(mainCodeSourcesPath("checks/serialization/SerializableObjectInSessionCheckSample.java")) .withCheck(new SerializableObjectInSessionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableSuperConstructorCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableSuperConstructorCheckTest.java index f67d4e3751f..2d8daa08921 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableSuperConstructorCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/serialization/SerializableSuperConstructorCheckTest.java @@ -30,7 +30,7 @@ class SerializableSuperConstructorCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/serialization/SerializableSuperConstructorCheck.java")) + .onFile(mainCodeSourcesPath("checks/serialization/SerializableSuperConstructorCheckSample.java")) .withCheck(new SerializableSuperConstructorCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/serialization/SerializableSuperConstructorCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/serialization/SerializableSuperConstructorCheckSample.java")) .withCheck(new SerializableSuperConstructorCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/AsyncMethodsOnConfigurationClassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/AsyncMethodsOnConfigurationClassCheckTest.java index daadd892cbf..d237c9bbef1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/AsyncMethodsOnConfigurationClassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/AsyncMethodsOnConfigurationClassCheckTest.java @@ -29,7 +29,7 @@ class AsyncMethodsOnConfigurationClassCheckTest { @Test void test() { InternalCheckVerifier.newInstance() - .onFile(mainCodeSourcesPath("checks/spring/AsyncMethodsOnConfigurationClassCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/AsyncMethodsOnConfigurationClassCheckSample.java")) .withCheck(new AsyncMethodsOnConfigurationClassCheck()) .withQuickFixes() .verifyIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheckTest.java index 318f829083d..5693336e681 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheckTest.java @@ -29,7 +29,7 @@ class AutowiredOnConstructorWhenMultipleConstructorsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/AutowiredOnConstructorWhenMultipleConstructorsCheckSample.java")) .withCheck(new AutowiredOnConstructorWhenMultipleConstructorsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/ModelAttributeNamingConventionForSpELCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/ModelAttributeNamingConventionForSpELCheckTest.java index 2203d5abdd5..b1223d2a772 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/ModelAttributeNamingConventionForSpELCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/ModelAttributeNamingConventionForSpELCheckTest.java @@ -29,11 +29,11 @@ class ModelAttributeNamingConventionForSpELCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/ModelAttributeNamingConventionForSpELCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/ModelAttributeNamingConventionForSpELCheckSample.java")) .withCheck(new ModelAttributeNamingConventionForSpELCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/ModelAttributeNamingConventionForSpELCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/ModelAttributeNamingConventionForSpELCheckSample.java")) .withCheck(new ModelAttributeNamingConventionForSpELCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/PersistentEntityUsedAsRequestParameterCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/PersistentEntityUsedAsRequestParameterCheckTest.java index 9a3671d180b..8721d0d3ec5 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/PersistentEntityUsedAsRequestParameterCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/PersistentEntityUsedAsRequestParameterCheckTest.java @@ -29,11 +29,11 @@ class PersistentEntityUsedAsRequestParameterCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/PersistentEntityUsedAsRequestParameterCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/PersistentEntityUsedAsRequestParameterCheckSample.java")) .withCheck(new PersistentEntityUsedAsRequestParameterCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/PersistentEntityUsedAsRequestParameterCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/PersistentEntityUsedAsRequestParameterCheckSample.java")) .withCheck(new PersistentEntityUsedAsRequestParameterCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/RequestMappingMethodPublicCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/RequestMappingMethodPublicCheckTest.java index 550cef39239..bfc8bb48ed2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/RequestMappingMethodPublicCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/RequestMappingMethodPublicCheckTest.java @@ -29,11 +29,11 @@ class RequestMappingMethodPublicCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/RequestMappingMethodPublicCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/RequestMappingMethodPublicCheckSample.java")) .withCheck(new RequestMappingMethodPublicCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/RequestMappingMethodPublicCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/RequestMappingMethodPublicCheckSample.java")) .withCheck(new RequestMappingMethodPublicCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringAntMatcherOrderCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringAntMatcherOrderCheckTest.java index c6df24f8c5a..60129413288 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringAntMatcherOrderCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringAntMatcherOrderCheckTest.java @@ -33,11 +33,11 @@ class SpringAntMatcherOrderCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/spring/SpringAntMatcherOrderCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/spring/SpringAntMatcherOrderCheckSample.java")) .withCheck(new SpringAntMatcherOrderCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/spring/SpringAntMatcherOrderCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/spring/SpringAntMatcherOrderCheckSample.java")) .withCheck(new SpringAntMatcherOrderCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheckTest.java index 8c00d40faf8..92a91337e92 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringConfigurationWithAutowiredFieldsCheckTest.java @@ -26,7 +26,7 @@ class SpringConfigurationWithAutowiredFieldsCheckTest { - private static final String FILE = mainCodeSourcesPath("checks/spring/SpringConfigurationWithAutowiredFieldsCheck.java"); + private static final String FILE = mainCodeSourcesPath("checks/spring/SpringConfigurationWithAutowiredFieldsCheckSample.java"); @Test void test() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringIncompatibleTransactionalCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringIncompatibleTransactionalCheckTest.java index c2e8b46e315..4651a47d1b6 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringIncompatibleTransactionalCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringIncompatibleTransactionalCheckTest.java @@ -28,7 +28,7 @@ class SpringIncompatibleTransactionalCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("checks/spring/SpringIncompatibleTransactionalCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("checks/spring/SpringIncompatibleTransactionalCheckSample.java")) .withCheck(new SpringIncompatibleTransactionalCheck()) .verifyIssues(); } @@ -36,7 +36,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("checks/spring/SpringIncompatibleTransactionalCheck.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("checks/spring/SpringIncompatibleTransactionalCheckSample.java")) .withCheck(new SpringIncompatibleTransactionalCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringRequestMappingMethodCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringRequestMappingMethodCheckTest.java index cf58fec2b24..576b6bf57a1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringRequestMappingMethodCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringRequestMappingMethodCheckTest.java @@ -29,7 +29,7 @@ class SpringRequestMappingMethodCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/SpringRequestMappingMethodCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/SpringRequestMappingMethodCheckSample.java")) .withCheck(new SpringRequestMappingMethodCheck()) .verifyIssues(); } @@ -37,7 +37,7 @@ void test() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/SpringRequestMappingMethodCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/SpringRequestMappingMethodCheckSample.java")) .withCheck(new SpringRequestMappingMethodCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringScanDefaultPackageCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringScanDefaultPackageCheckTest.java index 1b4c0804489..19383b727ea 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringScanDefaultPackageCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringScanDefaultPackageCheckTest.java @@ -30,12 +30,12 @@ class SpringScanDefaultPackageCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("SpringScanDefaultPackageCheck.java")) + .onFile(mainCodeSourcesPath("SpringScanDefaultPackageCheckSample.java")) .withCheck(new SpringScanDefaultPackageCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("SpringScanDefaultPackageCheck.java")) + .onFile(mainCodeSourcesPath("SpringScanDefaultPackageCheckSample.java")) .withCheck(new SpringScanDefaultPackageCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringSecurityDisableCSRFCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringSecurityDisableCSRFCheckTest.java index d2d2d975122..01a2a23d3be 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringSecurityDisableCSRFCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringSecurityDisableCSRFCheckTest.java @@ -29,7 +29,7 @@ class SpringSecurityDisableCSRFCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/SpringSecurityDisableCSRFCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/SpringSecurityDisableCSRFCheckSample.java")) .withCheck(new SpringSecurityDisableCSRFCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringSessionFixationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringSessionFixationCheckTest.java index 8d9b93e825e..268fd3919e0 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/SpringSessionFixationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/SpringSessionFixationCheckTest.java @@ -29,7 +29,7 @@ class SpringSessionFixationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/SpringSessionFixationCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/SpringSessionFixationCheckSample.java")) .withCheck(new SpringSessionFixationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/spring/TransactionalMethodVisibilityCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/spring/TransactionalMethodVisibilityCheckTest.java index 16db14e1a72..8ec4a9a76db 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/spring/TransactionalMethodVisibilityCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/spring/TransactionalMethodVisibilityCheckTest.java @@ -30,7 +30,7 @@ class TransactionalMethodVisibilityCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/spring/TransactionalMethodVisibilityCheck.java")) + .onFile(mainCodeSourcesPath("checks/spring/TransactionalMethodVisibilityCheckSample.java")) .withCheck(new TransactionalMethodVisibilityCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/spring/TransactionalMethodVisibilityCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/spring/TransactionalMethodVisibilityCheckSample.java")) .withCheck(new TransactionalMethodVisibilityCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/synchronization/DoubleCheckedLockingCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/synchronization/DoubleCheckedLockingCheckTest.java index 3ebd90b3fa1..91ed5a51a48 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/synchronization/DoubleCheckedLockingCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/synchronization/DoubleCheckedLockingCheckTest.java @@ -30,7 +30,7 @@ class DoubleCheckedLockingCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/DoubleCheckedLockingCheck.java")) + .onFile(mainCodeSourcesPath("checks/DoubleCheckedLockingCheckSample.java")) .withCheck(new DoubleCheckedLockingCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void not_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/DoubleCheckedLockingCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/DoubleCheckedLockingCheckSample.java")) .withCheck(new DoubleCheckedLockingCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/synchronization/TwoLocksWaitCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/synchronization/TwoLocksWaitCheckTest.java index 947c14ac9b5..6ca21a256cb 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/synchronization/TwoLocksWaitCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/synchronization/TwoLocksWaitCheckTest.java @@ -29,7 +29,7 @@ class TwoLocksWaitCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("checks/TwoLocksWaitCheck.java")) + .onFile(mainCodeSourcesPath("checks/TwoLocksWaitCheckSample.java")) .withCheck(new TwoLocksWaitCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJApplyConfigurationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJApplyConfigurationCheckTest.java index 445b4235daf..858595a9851 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJApplyConfigurationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJApplyConfigurationCheckTest.java @@ -29,7 +29,7 @@ class AssertJApplyConfigurationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertJApplyConfigurationCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertJApplyConfigurationCheckSample.java")) .withCheck(new AssertJApplyConfigurationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJAssertionsInConsumerCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJAssertionsInConsumerCheckTest.java index cfca28379b2..a85787e591e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJAssertionsInConsumerCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJAssertionsInConsumerCheckTest.java @@ -30,7 +30,7 @@ class AssertJAssertionsInConsumerCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertJAssertionsInConsumerCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertJAssertionsInConsumerCheckSample.java")) .withCheck(new AssertJAssertionsInConsumerCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_compiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/tests/AssertJAssertionsInConsumerCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/tests/AssertJAssertionsInConsumerCheckSample.java")) .withCheck(new AssertJAssertionsInConsumerCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJConsecutiveAssertionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJConsecutiveAssertionCheckTest.java index e474095b14d..f6d86963c99 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJConsecutiveAssertionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJConsecutiveAssertionCheckTest.java @@ -29,7 +29,7 @@ class AssertJConsecutiveAssertionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertJConsecutiveAssertionCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertJConsecutiveAssertionCheckSample.java")) .withCheck(new AssertJConsecutiveAssertionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJContextBeforeAssertionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJContextBeforeAssertionCheckTest.java index 4564d21ebb7..695851361b1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJContextBeforeAssertionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJContextBeforeAssertionCheckTest.java @@ -29,7 +29,7 @@ class AssertJContextBeforeAssertionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertJContextBeforeAssertionCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertJContextBeforeAssertionCheckSample.java")) .withCheck(new AssertJContextBeforeAssertionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJTestForEmptinessCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJTestForEmptinessCheckTest.java index a47a577d846..fde4e291a78 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJTestForEmptinessCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertJTestForEmptinessCheckTest.java @@ -29,7 +29,7 @@ class AssertJTestForEmptinessCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertJTestForEmptinessCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertJTestForEmptinessCheckSample.java")) .withCheck(new AssertJTestForEmptinessCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertThatThrownByAloneCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertThatThrownByAloneCheckTest.java index a1baccdb84c..ac157497a9a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertThatThrownByAloneCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertThatThrownByAloneCheckTest.java @@ -29,7 +29,7 @@ class AssertThatThrownByAloneCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertThatThrownByAloneCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertThatThrownByAloneCheckSample.java")) .withCheck(new AssertThatThrownByAloneCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionArgumentOrderCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionArgumentOrderCheckTest.java index 45fbc77f0b2..49109a84801 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionArgumentOrderCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionArgumentOrderCheckTest.java @@ -30,7 +30,7 @@ class AssertionArgumentOrderCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertionArgumentOrderCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertionArgumentOrderCheckSample.java")) .withCheck(new AssertionArgumentOrderCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionInThreadRunCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionInThreadRunCheckTest.java index c5fd7f1c2d5..1b8121a165b 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionInThreadRunCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionInThreadRunCheckTest.java @@ -29,11 +29,11 @@ class AssertionInThreadRunCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertionInThreadRunCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertionInThreadRunCheckSample.java")) .withCheck(new AssertionInThreadRunCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertionInThreadRunCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertionInThreadRunCheckSample.java")) .withCheck(new AssertionInThreadRunCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionInTryCatchCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionInTryCatchCheckTest.java index ee4825b920d..4a13d728a0a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionInTryCatchCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionInTryCatchCheckTest.java @@ -29,7 +29,7 @@ class AssertionInTryCatchCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertionInTryCatchCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertionInTryCatchCheckSample.java")) .withCheck(new AssertionInTryCatchCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionsCompletenessCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionsCompletenessCheckTest.java index 18c5ca63a88..df24ceca8df 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionsCompletenessCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionsCompletenessCheckTest.java @@ -30,11 +30,11 @@ class AssertionsCompletenessCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertionsCompletenessCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertionsCompletenessCheckSample.java")) .withCheck(new AssertionsCompletenessCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertionsCompletenessCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertionsCompletenessCheckSample.java")) .withCheck(new AssertionsCompletenessCheck()) .withoutSemantic() .verifyNoIssues(); @@ -43,7 +43,7 @@ void test() { @Test void test_non_compiling_because_of_removed_api() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/tests/AssertionsCompletenessCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/tests/AssertionsCompletenessCheckSample.java")) .withCheck(new AssertionsCompletenessCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionsWithoutMessageCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionsWithoutMessageCheckTest.java index 2f7831a92be..273e5dba32f 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionsWithoutMessageCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/AssertionsWithoutMessageCheckTest.java @@ -29,7 +29,7 @@ class AssertionsWithoutMessageCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/AssertionsWithoutMessageCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/AssertionsWithoutMessageCheckSample.java")) .withCheck(new AssertionsWithoutMessageCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/BooleanOrNullLiteralInAssertionsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/BooleanOrNullLiteralInAssertionsCheckTest.java index 88bd94f4284..a1da0343d8d 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/BooleanOrNullLiteralInAssertionsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/BooleanOrNullLiteralInAssertionsCheckTest.java @@ -28,7 +28,7 @@ class BooleanOrNullLiteralInAssertionsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/BooleanOrNullLiteralInAssertionsCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/BooleanOrNullLiteralInAssertionsCheckSample.java")) .withCheck(new BooleanOrNullLiteralInAssertionsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/ExpectedExceptionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/ExpectedExceptionCheckTest.java index d405ad8de41..cb2640acba2 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/ExpectedExceptionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/ExpectedExceptionCheckTest.java @@ -29,7 +29,7 @@ class ExpectedExceptionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/ExpectedExceptionCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/ExpectedExceptionCheckSample.java")) .withCheck(new ExpectedExceptionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/IgnoredTestsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/IgnoredTestsCheckTest.java index dd551d11e30..68fdddfe841 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/IgnoredTestsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/IgnoredTestsCheckTest.java @@ -30,7 +30,7 @@ class IgnoredTestsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/IgnoredTestsCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/IgnoredTestsCheckSample.java")) .withCheck(new IgnoredTestsCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_without_semantic() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/IgnoredTestsCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/IgnoredTestsCheckSample.java")) .withCheck(new IgnoredTestsCheck()) .withClassPath(Collections.emptyList()) .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit45MethodAnnotationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit45MethodAnnotationCheckTest.java index 8bf816b2410..efc877707a9 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit45MethodAnnotationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit45MethodAnnotationCheckTest.java @@ -30,7 +30,7 @@ class JUnit45MethodAnnotationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/JUnit45MethodAnnotationCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/JUnit45MethodAnnotationCheckSample.java")) .withCheck(new JUnit45MethodAnnotationCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_unknown_symbols() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/tests/JUnit45MethodAnnotationCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/tests/JUnit45MethodAnnotationCheckSample.java")) .withCheck(new JUnit45MethodAnnotationCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheckTest.java index 56f6cd2150d..84be163433a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit5DefaultPackageClassAndMethodCheckTest.java @@ -27,7 +27,7 @@ class JUnit5DefaultPackageClassAndMethodCheckTest { - private static final String testSourcePath = testCodeSourcesPath("checks/tests/JUnit5DefaultPackageClassAndMethodCheck.java"); + private static final String testSourcePath = testCodeSourcesPath("checks/tests/JUnit5DefaultPackageClassAndMethodCheckSample.java"); @Test void test() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckTest.java index 9d971eea3ae..0a403afa988 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckTest.java @@ -27,7 +27,7 @@ class JUnit5SilentlyIgnoreClassAndMethodCheckTest { - private static final String SOURCE_PATH = "checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheck.java"; + private static final String SOURCE_PATH = "checks/tests/JUnit5SilentlyIgnoreClassAndMethodCheckSample.java"; @Test void test() { diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/JUnitCompatibleAnnotationsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/JUnitCompatibleAnnotationsCheckTest.java index 05c432e35e8..0388f0dc7db 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/JUnitCompatibleAnnotationsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/JUnitCompatibleAnnotationsCheckTest.java @@ -28,7 +28,7 @@ class JUnitCompatibleAnnotationsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/JUnitCompatibleAnnotationsCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/JUnitCompatibleAnnotationsCheckSample.java")) .withCheck(new JUnitCompatibleAnnotationsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/JunitNestedAnnotationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/JunitNestedAnnotationCheckTest.java index b26f1fdb967..c5e36241293 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/JunitNestedAnnotationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/JunitNestedAnnotationCheckTest.java @@ -29,7 +29,7 @@ class JunitNestedAnnotationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/JunitNestedAnnotationCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/JunitNestedAnnotationCheckSample.java")) .withCheck(new JunitNestedAnnotationCheck()) .verifyIssues(); } @@ -37,7 +37,7 @@ void test() { @Test void noSemantic() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/JunitNestedAnnotationCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/JunitNestedAnnotationCheckSample.java")) .withCheck(new JunitNestedAnnotationCheck()) .withoutSemantic() .verifyNoIssues(); diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/MockitoEqSimplificationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/MockitoEqSimplificationCheckTest.java index 0ce041068a1..f733b00d54a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/MockitoEqSimplificationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/MockitoEqSimplificationCheckTest.java @@ -30,12 +30,12 @@ class MockitoEqSimplificationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/MockitoEqSimplificationCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/MockitoEqSimplificationCheckSample.java")) .withCheck(new MockitoEqSimplificationCheck()) .verifyIssues(); CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/tests/MockitoEqSimplificationCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/tests/MockitoEqSimplificationCheckSample.java")) .withCheck(new MockitoEqSimplificationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/NoTestInTestClassCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/NoTestInTestClassCheckTest.java index 8e2d0c0bca1..093fe210a44 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/NoTestInTestClassCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/NoTestInTestClassCheckTest.java @@ -31,7 +31,7 @@ class NoTestInTestClassCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/NoTestInTestClassCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/NoTestInTestClassCheckSample.java")) .withCheck(new NoTestInTestClassCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/OneExpectedCheckedExceptionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/OneExpectedCheckedExceptionCheckTest.java index dedb9da8117..c65c2b6ca8a 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/OneExpectedCheckedExceptionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/OneExpectedCheckedExceptionCheckTest.java @@ -29,7 +29,7 @@ class OneExpectedCheckedExceptionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/OneExpectedCheckedExceptionCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/OneExpectedCheckedExceptionCheckSample.java")) .withCheck(new OneExpectedCheckedExceptionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/OneExpectedRuntimeExceptionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/OneExpectedRuntimeExceptionCheckTest.java index fd4fb3be982..65c909d10d1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/OneExpectedRuntimeExceptionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/OneExpectedRuntimeExceptionCheckTest.java @@ -29,7 +29,7 @@ class OneExpectedRuntimeExceptionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/OneExpectedRuntimeExceptionCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/OneExpectedRuntimeExceptionCheckSample.java")) .withCheck(new OneExpectedRuntimeExceptionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/ParameterizedTestCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/ParameterizedTestCheckTest.java index 7afeed152d4..0ec2120e85e 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/ParameterizedTestCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/ParameterizedTestCheckTest.java @@ -29,7 +29,7 @@ class ParameterizedTestCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/ParameterizedTestCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/ParameterizedTestCheckSample.java")) .withCheck(new ParameterizedTestCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/RandomizedTestDataCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/RandomizedTestDataCheckTest.java index 4b3770ec76e..8087c4af945 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/RandomizedTestDataCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/RandomizedTestDataCheckTest.java @@ -29,7 +29,7 @@ class RandomizedTestDataCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/RandomizedTestDataCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/RandomizedTestDataCheckSample.java")) .withCheck(new RandomizedTestDataCheck()) .verifyIssues(); } @@ -37,7 +37,7 @@ void test() { @Test void testNoIssues() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/NonRandomizedTestDataCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/NonRandomizedTestDataCheckSample.java")) .withCheck(new RandomizedTestDataCheck()) .verifyNoIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/SpringAssertionsSimplificationCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/SpringAssertionsSimplificationCheckTest.java index 833612fc5e3..dd3e2287e56 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/SpringAssertionsSimplificationCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/SpringAssertionsSimplificationCheckTest.java @@ -29,7 +29,7 @@ class SpringAssertionsSimplificationCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/SpringAssertionsSimplificationCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/SpringAssertionsSimplificationCheckSample.java")) .withCheck(new SpringAssertionsSimplificationCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/TestAnnotationWithExpectedExceptionCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/TestAnnotationWithExpectedExceptionCheckTest.java index 6c466ecd894..d4091fc11a3 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/TestAnnotationWithExpectedExceptionCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/TestAnnotationWithExpectedExceptionCheckTest.java @@ -29,7 +29,7 @@ class TestAnnotationWithExpectedExceptionCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/TestAnnotationWithExpectedExceptionCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/TestAnnotationWithExpectedExceptionCheckSample.java")) .withCheck(new TestAnnotationWithExpectedExceptionCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/TestsStabilityCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/TestsStabilityCheckTest.java index 2cd5306d923..6f7d6f60899 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/TestsStabilityCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/TestsStabilityCheckTest.java @@ -29,7 +29,7 @@ class TestsStabilityCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/TestStabilityCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/TestStabilityCheckSample.java")) .withCheck(new TestsStabilityCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/ThreadSleepInTestsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/ThreadSleepInTestsCheckTest.java index 235c091e8f0..188a5aaeb07 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/ThreadSleepInTestsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/ThreadSleepInTestsCheckTest.java @@ -29,7 +29,7 @@ class ThreadSleepInTestsCheckTest { @Test void test() { CheckVerifier.newVerifier() - .onFile(testCodeSourcesPath("checks/tests/ThreadSleepInTestsCheck.java")) + .onFile(testCodeSourcesPath("checks/tests/ThreadSleepInTestsCheckSample.java")) .withCheck(new ThreadSleepInTestsCheck()) .verifyIssues(); } diff --git a/java-checks/src/test/java/org/sonar/java/checks/tests/TooManyAssertionsCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/tests/TooManyAssertionsCheckTest.java index 4578e201ab3..b7eac30d7b1 100644 --- a/java-checks/src/test/java/org/sonar/java/checks/tests/TooManyAssertionsCheckTest.java +++ b/java-checks/src/test/java/org/sonar/java/checks/tests/TooManyAssertionsCheckTest.java @@ -55,7 +55,7 @@ void custom_at_25() { @Test void nonCompiling() { CheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("checks/tests/TooManyAssertionsCheck.java")) + .onFile(nonCompilingTestSourcesPath("checks/tests/TooManyAssertionsCheckSample.java")) .withCheck(new TooManyAssertionsCheck()) .verifyNoIssues(); } diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/DenialOfServiceXMLCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/DenialOfServiceXMLCheckTest.java index 9e87dd14ca6..83380d33839 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/DenialOfServiceXMLCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/DenialOfServiceXMLCheckTest.java @@ -29,7 +29,7 @@ class DenialOfServiceXMLCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/DenialOfServiceXMLCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/DenialOfServiceXMLCheckSample.java")) .withChecks(new XxeProcessingCheck(), new DenialOfServiceXMLCheck()) .withClassPath(SETestUtils.CLASS_PATH) diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/DivisionByZeroCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/DivisionByZeroCheckTest.java index 5f885a6bbf9..095bb9f8b14 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/DivisionByZeroCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/DivisionByZeroCheckTest.java @@ -45,7 +45,7 @@ class DivisionByZeroCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("symbolicexecution/checks/DivisionByZeroCheck.java")) + .onFile(mainCodeSourcesPath("symbolicexecution/checks/DivisionByZeroCheckSample.java")) .withCheck(new DivisionByZeroCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); @@ -63,7 +63,7 @@ void primitives() { @Test void test_noncompiling() { SECheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("symbolicexecution/checks/DivisionByZeroCheck.java")) + .onFile(nonCompilingTestSourcesPath("symbolicexecution/checks/DivisionByZeroCheckSample.java")) .withCheck(new DivisionByZeroCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyNoIssues(); @@ -102,5 +102,5 @@ private DivisionByZeroCheck.ZeroConstraint copyConstraint(SymbolicValue a, Symbo ps = ListUtils.getOnlyElement(rel.setConstraint(ps, BooleanConstraint.TRUE)); return ps.getConstraint(b, DivisionByZeroCheck.ZeroConstraint.class); } - + } diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/LocksNotUnlockedCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/LocksNotUnlockedCheckTest.java index dda1f965384..1be306a18d6 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/LocksNotUnlockedCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/LocksNotUnlockedCheckTest.java @@ -32,7 +32,7 @@ class LocksNotUnlockedCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("symbolicexecution/checks/LocksNotUnlockedCheck.java")) + .onFile(mainCodeSourcesPath("symbolicexecution/checks/LocksNotUnlockedCheckSample.java")) .withCheck(new LocksNotUnlockedCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); @@ -50,7 +50,7 @@ void object_constraint_cache_issues() { @Test void unknown_variable_still_report_issues() { SECheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("symbolicexecution/checks/LocksNotUnlockedCheck.java")) + .onFile(nonCompilingTestSourcesPath("symbolicexecution/checks/LocksNotUnlockedCheckSample.java")) .withCheck(new LocksNotUnlockedCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/MapComputeIfAbsentOrPresentCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/MapComputeIfAbsentOrPresentCheckTest.java index 456f8caf07c..fc762a936e6 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/MapComputeIfAbsentOrPresentCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/MapComputeIfAbsentOrPresentCheckTest.java @@ -31,7 +31,7 @@ class MapComputeIfAbsentOrPresentCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("symbolicexecution/checks/MapComputeIfAbsentOrPresentCheck.java")) + .onFile(mainCodeSourcesPath("symbolicexecution/checks/MapComputeIfAbsentOrPresentCheckSample.java")) .withCheck(new MapComputeIfAbsentOrPresentCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); @@ -40,7 +40,7 @@ void test() { @Test void test_non_compiling() { SECheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("symbolicexecution/checks/MapComputeIfAbsentOrPresentCheck.java")) + .onFile(nonCompilingTestSourcesPath("symbolicexecution/checks/MapComputeIfAbsentOrPresentCheckSample.java")) .withCheck(new MapComputeIfAbsentOrPresentCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/MinMaxRangeCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/MinMaxRangeCheckTest.java index d92106dee6c..82b2f0c91ad 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/MinMaxRangeCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/MinMaxRangeCheckTest.java @@ -30,7 +30,7 @@ class MinMaxRangeCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("symbolicexecution/checks/MinMaxRangeCheck.java")) + .onFile(mainCodeSourcesPath("symbolicexecution/checks/MinMaxRangeCheckSample.java")) .withCheck(new MinMaxRangeCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/NoWayOutLoopCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/NoWayOutLoopCheckTest.java index 483b6eb10e6..f3b347a47c1 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/NoWayOutLoopCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/NoWayOutLoopCheckTest.java @@ -30,7 +30,7 @@ class NoWayOutLoopCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("symbolicexecution/checks/NoWayOutLoopCheck.java")) + .onFile(mainCodeSourcesPath("symbolicexecution/checks/NoWayOutLoopCheckSample.java")) .withCheck(new NoWayOutLoopCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/NonNullSetToNullCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/NonNullSetToNullCheckTest.java index 5355134611e..f1b2611fceb 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/NonNullSetToNullCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/NonNullSetToNullCheckTest.java @@ -30,7 +30,7 @@ class NonNullSetToNullCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("symbolicexecution/checks/NonNullSetToNullCheck/noDefault/NonNullSetToNullCheck.java")) + .onFile(mainCodeSourcesPath("symbolicexecution/checks/NonNullSetToNullCheck/noDefault/NonNullSetToNullCheckSample.java")) .withCheck(new NonNullSetToNullCheck()) .verifyIssues(); } @@ -38,7 +38,7 @@ void test() { @Test void test_non_null_api() { SECheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("symbolicexecution/checks/NonNullSetToNullCheck/packageNonNull/NonNullSetToNullCheck.java")) + .onFile(mainCodeSourcesPath("symbolicexecution/checks/NonNullSetToNullCheck/packageNonNull/NonNullSetToNullCheckSample.java")) .withCheck(new NonNullSetToNullCheck()) .verifyIssues(); } @@ -46,7 +46,7 @@ void test_non_null_api() { @Test void test_non_compiling() { SECheckVerifier.newVerifier() - .onFile(nonCompilingTestSourcesPath("symbolicexecution/checks/NonNullSetToNullCheck.java")) + .onFile(nonCompilingTestSourcesPath("symbolicexecution/checks/NonNullSetToNullCheckSample.java")) .withCheck(new NonNullSetToNullCheck()) .verifyIssues(); } diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/ObjectOutputStreamCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/ObjectOutputStreamCheckTest.java index 8658ac501b0..a2dc09f55e2 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/ObjectOutputStreamCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/ObjectOutputStreamCheckTest.java @@ -29,7 +29,7 @@ class ObjectOutputStreamCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("/symbolicexecution/checks/ObjectOutputStreamCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("/symbolicexecution/checks/ObjectOutputStreamCheckSample.java")) .withCheck(new ObjectOutputStreamCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/OptionalGetBeforeIsPresentCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/OptionalGetBeforeIsPresentCheckTest.java index b4897ae4c8c..83ebdb0082f 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/OptionalGetBeforeIsPresentCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/OptionalGetBeforeIsPresentCheckTest.java @@ -30,7 +30,7 @@ class OptionalGetBeforeIsPresentCheckTest { @Test void test_with_jdk_8() { SECheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("symbolicexecution/checks/OptionalGetBeforeIsPresentCheck.java")) + .onFile(mainCodeSourcesPath("symbolicexecution/checks/OptionalGetBeforeIsPresentCheckSample.java")) .withCheck(new OptionalGetBeforeIsPresentCheck()) .withClassPath(SETestUtils.CLASS_PATH) .withJavaVersion(8) diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/ParameterNullnessCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/ParameterNullnessCheckTest.java index c189796cfb7..b47f431074f 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/ParameterNullnessCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/ParameterNullnessCheckTest.java @@ -28,7 +28,7 @@ class ParameterNullnessCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/ParameterNullnessCheck/noDefault/ParameterNullnessCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/ParameterNullnessCheck/noDefault/ParameterNullnessCheckSample.java")) .withCheck(new ParameterNullnessCheck()) .verifyIssues(); } @@ -36,7 +36,7 @@ void test() { @Test void test_package_annotation() { SECheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/ParameterNullnessCheck/packageNonNull/ParameterNullnessCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/ParameterNullnessCheck/packageNonNull/ParameterNullnessCheckSample.java")) .withCheck(new ParameterNullnessCheck()) .verifyIssues(); } diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/RedundantAssignmentsCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/RedundantAssignmentsCheckTest.java index 1a80a2cd873..1abb7e9b910 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/RedundantAssignmentsCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/RedundantAssignmentsCheckTest.java @@ -30,7 +30,7 @@ class RedundantAssignmentsCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(mainCodeSourcesPath("symbolicexecution/checks/RedundantAssignmentsCheck.java")) + .onFile(mainCodeSourcesPath("symbolicexecution/checks/RedundantAssignmentsCheckSample.java")) .withCheck(new RedundantAssignmentsCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/StreamConsumedCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/StreamConsumedCheckTest.java index 13cba0bbc87..f4dded8aba4 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/StreamConsumedCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/StreamConsumedCheckTest.java @@ -29,7 +29,7 @@ class StreamConsumedCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/S3959_StreamConsumedCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/S3959_StreamConsumedCheckSample.java")) .withCheck(new StreamConsumedCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); @@ -38,7 +38,7 @@ void test() { @Test void swtichExpression() { SECheckVerifier.newVerifier() - .onFile(TestUtils.nonCompilingTestSourcesPath("symbolicexecution/checks/S3959_SwitchExpression.java")) + .onFile(TestUtils.nonCompilingTestSourcesPath("symbolicexecution/checks/S3959_SwitchExpressionSample.java")) .withCheck(new StreamConsumedCheck()) .withClassPath(SETestUtils.CLASS_PATH) .withJavaVersion(14) diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/StreamNotConsumedCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/StreamNotConsumedCheckTest.java index 5ed05b11f6a..0c582a34727 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/StreamNotConsumedCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/StreamNotConsumedCheckTest.java @@ -29,7 +29,7 @@ class StreamNotConsumedCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/S3958_StreamNotConsumedCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/S3958_StreamNotConsumedCheckSample.java")) .withCheck(new StreamNotConsumedCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues(); diff --git a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/XmlValidatedSignatureCheckTest.java b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/XmlValidatedSignatureCheckTest.java index f639458d5b2..3c8df432d45 100644 --- a/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/XmlValidatedSignatureCheckTest.java +++ b/java-symbolic-execution/src/test/java/org/sonar/java/se/checks/XmlValidatedSignatureCheckTest.java @@ -33,7 +33,7 @@ class XmlValidatedSignatureCheckTest { @Test void test() { SECheckVerifier.newVerifier() - .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/S6377_XmlValidatedSignatureCheck.java")) + .onFile(TestUtils.mainCodeSourcesPath("symbolicexecution/checks/S6377_XmlValidatedSignatureCheckSample.java")) .withChecks(new XmlValidatedSignatureCheck()) .withClassPath(SETestUtils.CLASS_PATH) .verifyIssues();