java - Arrays should not be statically initialized by an array initializer. Why? -
this 1 of rules googles static analyser codepro analytix:
summary
arrays should not statically initialized array initializer.
description
this audit rule checks array variables initialized (either in initializer or in assignment statement) using array initializer.
example
the following array declaration flagged because of use of array initializer:
int[] values = {0, 1, 2};
now, can disable if don't it, that's not problem. i'm wondering why problem, , solution keep code being flagged audit rule?
it's interesting question, , decision groundless imho. (i hope else answer thread if there legit reason behind design decision).
moreover, google shows how format static initializers in practice formatting guide https://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s4.8.3.1-array-initializers without saying how bad use constructs ...
i guess person behind rule had tooth against style of programming :)
Comments
Post a Comment