Problem
Compilation error after removing explicit cast.
Expected behavior
Either no change, or at least no compilation issues.
Example diff
From: src/main/java/io/moderne/java/server/jboss/tomcat/CreateTomcatContextXml.java
xmlParser.parse(ctx, TomcatConfiguration.tomcatContextXmlContent())
.findFirst()
- .map(sourceFile -> (SourceFile) sourceFile.withSourcePath(targetPath))
+ .map(sourceFile -> sourceFile.withSourcePath(targetPath))
.ifPresent(generated::add);
}
Recipes in example diff:
org.openrewrite.staticanalysis.RemoveRedundantTypeCast
References:
- View original result
- Recipe ID:
org.openrewrite.staticanalysis.RemoveRedundantTypeCast
- Recipe Name:
Remove redundant casts
- Repository:
moderneinc/rewrite-java-application-server/main
- Created at Mon May 04 2026 10:15:40 GMT+0200 (Central European Summer Time)
Problem
Compilation error after removing explicit cast.
Expected behavior
Either no change, or at least no compilation issues.
Example diff
From:
src/main/java/io/moderne/java/server/jboss/tomcat/CreateTomcatContextXml.javaxmlParser.parse(ctx, TomcatConfiguration.tomcatContextXmlContent()) .findFirst() - .map(sourceFile -> (SourceFile) sourceFile.withSourcePath(targetPath)) + .map(sourceFile -> sourceFile.withSourcePath(targetPath)) .ifPresent(generated::add); }Recipes in example diff:
org.openrewrite.staticanalysis.RemoveRedundantTypeCastReferences:
org.openrewrite.staticanalysis.RemoveRedundantTypeCastRemove redundant castsmoderneinc/rewrite-java-application-server/main