Is it possible to make checkstyle require java 7 formatting of the diamond operator? I want to ensure my codebase consistently uses the new Java 7 style, i.e.:
List<String> items = new LinkedList<>();
instead of the older:
List<String> items = new LinkedList<String>();
Take a look at this.
One of the users is complaining about a bug in the diamond operator grammar:
List list = new ArrayList<>();
throws an error:unexpected token: >
This bug report was closed thanks to a patch that adds support for Java 7.
According to the page, one of the features added was:
4) Diamond Generics: In presence of a diamond, the AST looks like:
+--TYPE_ARGUMENTS
|
+--GENERIC_START
+--GENERIC_END
Download link for the patch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With