8.1.14 release (2023-08-07)
warning
Due to some issues with building the projects, auto-generated recipe examples have been temporarily turned off.
New Recipes
- org.openrewrite.java.apache.httpclient4.MappingDeprecatedClasses: Uses new classes/methods instead of the deprecated ones
- org.openrewrite.java.apache.httpclient4.MigrateDefaultHttpClient: Since DefaultHttpClient is deprecated, we need to change it to the CloseableHttpClient. It only covers the default scenario with no custom HttpParams or ConnectionManager.
- org.openrewrite.java.apache.httpclient4.UpgradeApacheHttpClient_4_5: Migrate applications to the latest Apache HttpClient 4.5.x release. This recipe modifies application's build files, make changes to deprecated/preferred APIs, and migrates configuration settings that have changes between versions.
- org.openrewrite.java.apache.httpclient5.AddTimeUnitArgument: In Apache Http Client 5.x migration, an extra TimeUnit argument is required in the timeout and duration methods. Previously in 4.x, all these methods were implicitly having the timeout or duration expressed in milliseconds, but in 5.x the unit of the timeout or duration is required. So, by default this recipe adds
TimeUnit.MILLISECONDS
, it is possible to specify this as a parameter. Since all affected methods of the Apache Http Client 5.x migration only have one integer/long argument, the recipe applies with matched method invocations of exactly one parameter. - org.openrewrite.java.apache.httpclient5.NewStatusLine:
HttpResponse::getStatusLine()
was deprecated in 4.x, so we replace it fornew StatusLine(HttpResponse)
. Ideally we will try to simplify method chains forgetStatusCode
,getProtocolVersion
andgetReasonPhrase
, but there are some scenarios where theStatusLine
object is assigned or used directly, and we need to instantiate the object. - org.openrewrite.java.apache.httpclient5.StatusLine: Migrates deprecated methods to their equivalent ones in 5.x
- org.openrewrite.java.apache.httpclient5.UpgradeApacheHttpClient_5: Migrate applications to the latest Apache HttpClient 5.x release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.apache.httpclient5.UpgradeApacheHttpClient_5_ClassMapping: Mapping of all the compatible classes of ApacheHttpClient 5.x from 4.x.
- org.openrewrite.java.apache.httpclient5.UpgradeApacheHttpClient_5_DeprecatedMethods: Migrates deprecated methods to their equivalent ones in 5.x
- org.openrewrite.java.apache.httpclient5.UpgradeApacheHttpClient_5_TimeUnit: Apache HttpClient 5.x Timeout and duration methods need an extra the TimeUnit argument. This recipe uses milliseconds as a default unit.
- org.openrewrite.java.migrate.io.ReplaceFileInOrOutputStreamFinalizeWithClose: Replace invocations of the deprecated
finalize()
method onFileInputStream
andFileOutputStream
withclose()
. - org.openrewrite.java.migrate.lombok.UpdateLombokToJava11: Update Lombok dependency to a version that is compatible with Java 11 and migrate experimental Lombok types that have been promoted.
- org.openrewrite.java.spring.framework.UpgradeSpringFrameworkDependencies: Upgrade spring-framework 5.x Maven dependencies using a Node Semver advanced range selector.
- org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertion: Many AssertJ chained assertions have dedicated assertions that function the same. It is best to use the dedicated assertions.
- org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertions: Replace AssertJ chained assertions with dedicated assertions that function the same.
- org.openrewrite.java.testing.hamcrest.HamcrestOfMatchersToAssertJ: Migrate the
anyOf
Hamcrest Matcher to AssertJ'ssatisfiesAnyOf
assertion. - org.openrewrite.search.FindParseToPrintInequality: OpenRewrite
Parser
implementations should produceSourceFile
objects whoseprintAll()
method should be byte-for-byte equivalent with the original source file. When this isn't true, recipes can still run on theSourceFile
and even produce diffs, but the diffs would fail to apply as a patch to the original source file. MostParser
useParser#requirePrintEqualsInput
to produce aParseError
when they fail to produce aSourceFile
that is print idempotent. - org.openrewrite.text.FindMultiselect: Search for text, treating all textual sources as plain text. This version of the recipe exists to experiment with multiselect recipe options.
Removed Recipes
- org.openrewrite.FindBuildToolFailures: This recipe explores build tool failures after an LST is produced for classifying the types of failures that can occur and prioritizing fixes according to the most common problems.
- org.openrewrite.java.migrate.lombok.UpdateLombokToJava17: Update Lombok dependency to a version that is compatible with Java 17 and migrate experimental Lombok types that have been promoted.
- org.openrewrite.java.testing.assertj.UseExplicitContains: Convert AssertJ
assertThat(collection.contains(element)).isTrue()
toassertThat(collection).contains(element)
andassertThat(collection.contains(element)).isFalse()
toassertThat(collection).doesNotContain(element)
. - org.openrewrite.java.testing.assertj.UseExplicitIsEmpty: Convert AssertJ
assertThat(collection.isEmpty()).isTrue()
toassertThat(collection).isEmpty()
andassertThat(collection.isEmpty()).isFalse()
toassertThat(collection).isNotEmpty()
. - org.openrewrite.java.testing.assertj.UseExplicitSize: Convert
assertThat(collection.size()).isEqualTo(Y)
to AssertJ'sassertThat(collection).hasSize()
. - org.openrewrite.java.testing.hamcrest.FlattenAllOf: Convert Hamcrest
allOf(Matcher...)
to individualassertThat
statements for easier migration. - org.openrewrite.java.testing.hamcrest.HamcrestAnyOfToAssertJ: Migrate the
anyOf
Hamcrest Matcher to AssertJ'ssatisfiesAnyOf
assertion.
Changed Recipes
- org.openrewrite.text.Find was changed:
- Old Options:
caseSensitive: { type: Boolean, required: false }
dotAll: { type: Boolean, required: false }
filePattern: { type: String, required: true }
find: { type: String, required: true }
multiline: { type: Boolean, required: false }
regex: { type: Boolean, required: false }
- New Options:
caseSensitive: { type: Boolean, required: false }
dotAll: { type: Boolean, required: false }
filePattern: { type: String, required: false }
find: { type: String, required: true }
multiline: { type: Boolean, required: false }
regex: { type: Boolean, required: false }
- Old Options:
- org.openrewrite.java.spring.amqp.UseTlsAmqpConnectionString was changed:
- Old Options:
oldPort: { type: Integer, required: true }
pathExpressions: { type: List, required: false }
port: { type: Integer, required: true }
propertyKey: { type: String, required: true }
tlsPropertyKey: { type: String, required: true }
- New Options:
oldPort: { type: Integer, required: true }
pathExpressions: { type: List, required: false }
port: { type: Integer, required: true }
propertyKey: { type: String, required: false }
tlsPropertyKey: { type: String, required: false }
- Old Options: