Skip to content

Issue discovered on src/main/java/io/moderne/java/server/jboss/tomcat/CreateTomcatContextXml.java with Remove redundant casts #871

@timtebeek

Description

@timtebeek

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions