Synopsis: | Avoid implicit allocation of objects |
Language: | Java |
Severity Level: | 4 |
Category: | Basic |
Description: |
When writing code such as byte[] myLocalStackVariable = { 0x00, 0x00 }; Java implicitly allocates an object. For some applications this is a bad thing. It is better to make the allocation explicit: byte[] myLocalStackVariable = new byte[] {0x00, 0x00}; This way everybody will realize that a new object is allocated. |