IntelliJ inspection for verbose array initialisation

55 views Asked by At

Is there an inspection in IntelliJ which will detect when I have written

final String[] args = new String[]{​"a", "b"}​;

instead of the shorter (and equally valid)

final String[] args = {​​​"a", "b"}​​​;

I can't find one and I would like a weak warning when I use the more verbose form.

1

There are 1 answers

1
Bas Leijdekkers On BEST ANSWER

Yes, there is: Java | Code style issues | Redundant 'new' expression in constant array creation