Skip to content

Declare default @Retention on @Incubating explicitly #6451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

izeye
Copy link
Contributor

@izeye izeye commented Jun 21, 2025

This PR removes explicit default @Retention declarations.

See spring-projects/spring-framework#35027

Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

I'm not sure how common knowledge the default retention policy is. I don't know that (or have forgotten that), for example. In that sense, it might actually be nice it is explicitly there when reading the code, even if it doesn't change anything programmatically. @jonatan-ivanov thoughts?

@izeye
Copy link
Contributor Author

izeye commented Jun 23, 2025

@shakuzen Thanks for the feedback!

I'm okay with either way.

If we want to keep the default, the following needs to be updated instead for consistency:

/**
* This is a feature that is experimental and may yield a breaking change in a minor
* release.
*/
@Documented
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface Incubating {
String since();
}

@jonatan-ivanov
Copy link
Member

I don't have a strong opinion but I'm leaning towards spelling this out explicitly.
@izeye, if it's ok with you, would you mind do the change on @Incubating instead?

@izeye izeye changed the base branch from main to 1.13.x June 26, 2025 16:41
@izeye izeye changed the title Remove explicit default @Retention declarations Declare default @Retention on @Incubating explicitly Jun 26, 2025
@izeye
Copy link
Contributor Author

izeye commented Jun 26, 2025

@jonatan-ivanov Sure, I updated this as suggested.

@jonatan-ivanov jonatan-ivanov added type: task A general task polish A general improvement (naming things, fixing minor issues, etc.) labels Jun 26, 2025
@jonatan-ivanov jonatan-ivanov added this to the 1.14.9 milestone Jun 26, 2025
@jonatan-ivanov
Copy link
Member

Thank you!

@jonatan-ivanov jonatan-ivanov merged commit 2dcb761 into micrometer-metrics:1.13.x Jun 26, 2025
10 checks passed
@izeye izeye deleted the retention branch June 26, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish A general improvement (naming things, fixing minor issues, etc.) type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants