java - Convert existing generics to diamond syntax - Stack Overflow
Oh yes, I have successfully done this on IntelliJ (free Community Edition).
Menu > Analyze > Inspect Code...
In the result, select "Java language level migration aids > Explicity type can be replaced with <>"
Right click, run "Apply Fix 'Replace with <>'" And you got diamonds.
There was a bug about diamond on anomymous classes, so some code may not compile after the fix. You'll have to revert them back then.
Read full article from java - Convert existing generics to diamond syntax - Stack Overflow
No comments:
Post a Comment