Skip to content

ChangePackage doesn't handle classes with GWT JNSI methods #4995

Closed
@auke-

Description

@auke-

What version of OpenRewrite are you using?

I am using OpenRewrite v8.44.2 with the ChangePackage recipe.

What is the smallest, simplest way to reproduce the problem?

type: specs.openrewrite.org/v1beta/recipe
name: com.yourorg.ChangePackageExample
displayName: Rename package name example
recipeList:
  - org.openrewrite.java.ChangePackage:
      oldPackageName: old_package_name
      newPackageName: new_package_name
package old_package_name;
class A {
  native void alert(String msg) /*-{ $wnd.alert(msg); }-*/;
}

What did you expect to see?

package new_package_name;
class A {
  native void alert(String msg) /*-{ $wnd.alert(msg); }-*/;
}

What did you see instead?

OpenRewrite didn't touch the file. It seems like it ignores Java classes with native methods and/or trailing comment.

See reproducer

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtest providedAlready replicated with a unit test, using JUnit pioneer's ExpectedToFail

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions