Skip to content
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

[java] Rename rule UseDiamondOperator to UnnecessaryTypeArguments #3273

Open
adangel opened this issue May 13, 2021 · 1 comment
Open

[java] Rename rule UseDiamondOperator to UnnecessaryTypeArguments #3273

adangel opened this issue May 13, 2021 · 1 comment
Labels
a:suggestion An idea, with little analysis on feasibility, to be considered is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them
Milestone

Comments

@adangel
Copy link
Member

adangel commented May 13, 2021

As explained here #3253 (comment) :

The rule's description now does not mention the "diamond operator". It's not an operator, it's just shorthand syntax. The JLS
says "diamond type arguments", and now we do too. We would ideally rename the rule.

The suggestion is, to rename the rule UseDiamondOperator to UnnecessaryTypeArguments

The normal rule deprecation policy should be applied:

  • rename the rule
  • add a deprecated rule reference to preserve the old name

If we do this on the pmd6 main branch, we can cleanup the deprecated rule reference with pmd7.

@adangel adangel added a:suggestion An idea, with little analysis on feasibility, to be considered is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them labels May 13, 2021
@oowekyala
Copy link
Member

Actually I think UnnecessaryTypeArguments would be more appropriate. This would allow us to extend the rule to eg Collections.<String>emptyList(). This has been in the PMD 7 backlog for a while: https://github.com/pmd/pmd/projects/3#card-60640901

@adangel adangel added this to Rule changes backlog in PMD 7 Jan 10, 2023
@adangel adangel changed the title [java] Rename rule UseDiamondOperator to UseDiamondTypeArguments [java] Rename rule UseDiamondOperator to UnnecessaryTypeArguments Jan 10, 2023
@adangel adangel added this to the 7.0.0 milestone Jan 10, 2023
@adangel adangel removed this from Rule changes backlog in PMD 7 Jan 23, 2023
@adangel adangel modified the milestones: 7.0.0, 7.x Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:suggestion An idea, with little analysis on feasibility, to be considered is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them
Projects
None yet
Development

No branches or pull requests

2 participants