Synopsis: | Unnecessary wrapper object creation |
Language: | Java |
Severity Level: | 4 |
Category: | Optimization |
Description: |
Parsing method should be called directy instead.public int convert(String s) { int i, i2; i = Integer.valueOf(s).intValue(); // this wastes an object i = Integer.parseInt(s); // this is better i2 = Integer.valueOf(i).intValue(); // this wastes an object i2 = i; // this is better return i2; } |