Skip to content

ChangeType: visit annotations on package declarations#7086

Open
timtebeek wants to merge 1 commit intomainfrom
tim/investigate-issue-1018
Open

ChangeType: visit annotations on package declarations#7086
timtebeek wants to merge 1 commit intomainfrom
tim/investigate-issue-1018

Conversation

@timtebeek
Copy link
Member

@timtebeek timtebeek commented Mar 20, 2026

Summary

…Package

Fixes an issue where fully-qualified annotations on package declarations
in package-info.java files were not being visited by ChangeType's visitor.
Comment on lines +418 to +430
spec -> spec.recipe(new ChangeType("a.b.c.A1", "a.b.d.A2", true)),
java("package a.b.c;\npublic @interface A1 {}"),
java("package a.b.d;\npublic @interface A2 {}"),
java(
"""
@a.b.c.A1 package foo;
""",
"""
@A2 package foo;

import a.b.d.A2;
""",
spec -> spec.path("foo/package-info.java")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all honesty we saw this test pass even when the main code change was rolled back, but the change makes sense, and I suspect it's to do with our testing framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Java migration in package-info.java files are not working

1 participant