This document is intended for CleanThat developers and users (e.g. through Spotless).
We adhere to the keepachangelog format
ArithmethicAssignment
should not assume String concatenation is symmetric.
ArithmeticOverFloats
is introducedCastMathOperandsBeforeAssignement
is introducedArithmethicAssignment
is introducedUseOptionalOfNullable
is introducedSimplifyOptionalVariablesWithMap
is introducedOptionalWrappedIfToFilter
is introducedOptionalWrappedVariableToMap
is introducedForEachIfBreakToStreamFindFirst
is introducedForEachIfBreakElseToStreamTakeWhile
is introducedUsePredefinedStandardCharset
is introducedStringFromString
is introducedOptionalMapIdentity
is introducedStreamMapIdentity
is introducedStreamForEachNestingForLoopToFlatMap
is introducedStreamFlatMapStreamToFlatMap
is introduced
SimplifyBooleanInitialization
will not produce invalid/corrupted initializer in case of negated initialization.PrimitiveWrapperInstantiation
will not confuse class named like a boxed type with a boxed type.EnhancedForLoopToStreamAnyMatch
will not accept a condition holding anAssignExpr
- Each
IMutator
see its simple class name configured as default identifier. FileSystemCodeProvider
will log but not throw when loading a file with an incompatible charset.StringReplaceAllWithQuotableInput
covers more cases of quotable regexes.
SimplifyBooleanExpression
is introducedStringReplaceAllWithQuotableInput
is introducedEnhancedForLoopToForEach
is introducedLoopIntRangeToIntStreamForEach
is introducedFileSystemCodeProvider
now accepts a custom charset (default remainsUTF-8
)SimplifyStreamVariablesWithMap
is introduced
PrimitiveWrapperInstantiation
will not treat nested class as a boxed type anymore (e.g.java.awt.geom.Rectangle2D.Double
)SimplifyStartsWith
is renamed fromStringStartsWithChar
given the existing PMD rule
@SuppressCleanthat
enables skipping Cleanthat for specific pieces of codeRemoveDoubleNegation
is introducedRemoveAllToClearCollection
is introducedSpotBugsMutators
is introducedCollectionIndexOfToContains
is introducedStringIndexOfToContains
is introduced
- In many cases, the presence of comment will prevent a mutator, as comments would be lost in many cases
EnhancedForLoopToStreamAnyMatch
will not produce invalid code in case ofreturn
over theforEach
variable
UseUnderscoresInNumericLiterals
now applies only over 5+ digits (like PMD default configuration)
EnhancedForLoopToStreamCollect
is introduced@CaseNotYetImplemented
enables preparing unitTests for future features or limitations
S1602
is renamedRSPEC-1602
S1612
is renamedRSPEC-1612
LambdaReturnsSingleStatement
now properly handles multiple argumentsLambdaReturnsSingleStatement
may lose comments
UseStringIsEmpty
is extracted fromUseCollectionIsEmpty
UnnecessaryLambdaEnclosingParameters
is introduced but it is not functionalErrorProneMutators
is introducedGuavaInlineStringsRepeat
is introduced, and added inErrorProneMutators
ObjectEqualsForPrimitives
is introducedObjectsHashCodePrimitive
is introducedEnhancedForLoopToStreamAnyMatch
is introducedRedundantLogicalComplementsInStream
is introducedSimplifyBooleanInitialization
is introducedSafeButControversial
is introduced
AvoidUncheckedExceptionsInSignatures
may encounterUnsolvedSymbolExceptions
AvoidInlineConditionals
will not produce invalidvar
declarations.
StringStartsWithChar
is added inSafeButNotConsensual
$.repository.meta.full_clean_on_configuration_change
is a new option to enable full repository cleaning on a configuration change. It is defaulted tofalse
while previous behavior was as if it was alwaystrue
.EclipseStylesheetGenerator
has a new option to discard ambiguous options (tryOptionsKeepingExistingFormat
)
StringStartsWithChar
is an additional mutatormvn cleanthat:apply
is a new Mojo enabling one-shotting a rules over current directory README.MD
ArraysDotStream
requires the argument to be an Array to convert useArrays.stream()
. It may also rely onStream.of
for other casesArraysDotStream
will apply only if the scope isArrays
EmptyControlStatement
will not break empty method definitions.LiteralsFirstInComparisons
better handles unresolved symbols.LambdaIsMethodReference
will not rely onT.class::cast
if T is a Type bound (e.g. in<T> void method(...)
).LocalVariableTypeInference
crashes lesss often on unresolved types
UseTextBlocks
is temporarily dropped fromSafeButNotConsensual
as its results are too poor (javaparser/javaparser#3936).LambdaReturnsSingleStatement
is temporarily dropped fromSafeButNotConsensual
as its results are too poor (javaparser/javaparser#3938).BoxedPrimitiveConstructor
is renamedPrimitiveWrapperInstantiation
, as it is the relevant PMD rule.
LocalVariableTypeInference
crashes lesss often on unresolved typesUnnecessaryModifier
will not removestatic
from interface methods
LineEnding
management is dropped fromILintFixer
andILintFixerWithPath
ModifierOrder
is promoted inSafeAndConsensual
StringToString
is promoted inSafeAndConsensual
UnnecessaryModifier
does not strip anymore thestatic
keyword ofMethodDeclaration
IMutator
is generated into MUTATORS.generated.MD byRunGenerateDocumentation
UseUnderscoresInNumericLiterals
is an additional PMD mutatorUseTextBlocks
is an additional mutatorUnnecessaryImport
is an additional mutatorBoxedPrimitiveConstructor
is an additional mutatorLambdaIsMethodReference
is an additional mutatorAvoidUncheckedExceptionsInSignatures
is an additional mutatorPrimitiveBoxedForString
is renamed intoUnnecessaryBoxing
SafeButNotAndConsensual
is an additional composite mutator
- Add empty constructor in
CompositeWalkableMutator
CompositeMutator.getIds()
do not return underlying identifiers anymore
- Invalid reports of any IMutators as not being idempotent
CreateTempFilesUsingNioCases
now handle a null directoryLocalVariableTypeInference
does not replace assignments with different types (e.g.ArrayList
assigned to aList
variable)- Introduces
IJavaparserMutator
, paving the way for other mutators (from Eclipse Cleanup, OpenRewrite, etc)
AllIncludingDraftCompositeMutators
was misbehaving givenMutatorsScanner
CreateTempFilesUsingNioCases
now handle a null directory
- Additional mutator:
EmptyControlStatement
turns{}
into `` - Additional mutator:
UnnecessaryModifier
turnspublic static final
into `` in interfaces - Implemented generic
trimTrailingWhitespace
,endWithNewline
andindex
from Spotless - Composite Mutators can now be referenced by one of their identifier
OptionalNotEmpty
is promoted inSafeAndConsensual
UnnecessaryModifier
is promoted inSafeAndConsensual
UnnecessaryFullyQualifiedName
is promoted inSafeAndConsensual
MarkdownFormatterFactory
includes pattern is now defaulted to*.MD
and*.md
JsonFormatterFactory
includes pattern is now defaulted to*.json
- BREAKING CHANGE
isProductionReady
has been removed, and replaced by a fully-functionalincludeDraft
- BREAKING CHANGE A draft-mutator explicitly listed is applied even if
includeDraft
is false
- Fixes ImportOrderStep when the ordersFile parameters is used.
- Additional mutator:
LocalVariableTypeInference
turnsint i = 10;
intovar i = 10;
- Additional composite mutators:
OptionalNotEmpty
,PMDMutators
,CheckStyleMutators
andSonarMutators
- CleanThat Robot will open a single Review-Request per protected-branch (instead of opening one for each dirty event, with a random). The naming convention is
cleanthat/headfor-XXX-yyyy-MM-dd
whereXXX
is the protected branch name andyyyy-MM-dd
is current day. - Handle any source JDK version (with the help of JavaVersion)
- Mutators can be included by their fully-qualified class name
- Fix issue related to dynamic IMutators detection
- Spotless oriented release
- Added Spotless as an Engine
- Additional mutator for PMD.ComparisonWithNaN
- Additional mutator for JDK8 Streams: StreamAnyMatch
- The concept of language has been replaced by engine. Instead of implementing language-specific formatters, CleanThat now targets wiring linter-engines (like Spotless).
- POTENTIALLY BREAKING Most CleanThat linters has been dropped
- Initial release!