-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
Description
What version of OpenRewrite are you using?
I am using
- OpenRewrite v2.0.0
How are you running OpenRewrite?
I am running the spring boot 3.1 migration via the command line:
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1 -Drewrite.exportDatatables=true
What is the smallest, simplest way to reproduce the problem?
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
class A {
void foo() {
StringEntity se = new StringEntity("", ContentType.APPLICATION_JSON);
se.setContentEncoding("utf-8");
}
}What did you expect to see?
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.io.entity.StringEntity;
class A {
void foo() {
StringEntity se = new StringEntity("", ContentType.APPLICATION_JSON, "utf-8", false);
}
}Note that the fourth constructor parameter (chunked) of StringEntity is set to false based on the default value that is used by the smaller constructor:
What did you see instead?
setContentEncoding is not replaced with setting the value via the constructor.
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.io.entity.StringEntity;
class A {
void foo(String bar) {
StringEntity se = new StringEntity("", ContentType.APPLICATION_JSON);
se.setContentEncoding("utf-8");
}
}Are you interested in contributing a fix to OpenRewrite?
No
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Backlog
