This check can be performed at compile time only in situations where the size is specified as a constant expression. However, the Java Language Specification requires that this check be performed at runtime:
15.10.2
:
[...]
- . - , .
- . DimExpr , a
NegativeArraySizeException.
, , . , , . , , , , .