A DESCRIPTION OF THE REQUEST :
Every call to the decode(String s) method in the URI class in which s contains at least one '%' character results in a needless allocation of a byte array of length s.length(). Unless I am missing something, this array is never used.
JUSTIFICATION :
There is no point allocating (and then garbage collecting) an unused array every time this method is called.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No allocation of unused byte array.
ACTUAL -
Allocation of unused byte array.
---------- BEGIN SOURCE ----------
// remove the line below from java/net/URI.java
// in jdk 1.6 beta 2 it is line 2966
byte[] ba = new byte[n];
---------- END SOURCE ----------
Every call to the decode(String s) method in the URI class in which s contains at least one '%' character results in a needless allocation of a byte array of length s.length(). Unless I am missing something, this array is never used.
JUSTIFICATION :
There is no point allocating (and then garbage collecting) an unused array every time this method is called.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No allocation of unused byte array.
ACTUAL -
Allocation of unused byte array.
---------- BEGIN SOURCE ----------
// remove the line below from java/net/URI.java
// in jdk 1.6 beta 2 it is line 2966
byte[] ba = new byte[n];
---------- END SOURCE ----------
- duplicates
-
JDK-6238862 Dead store to local variable in method java.net.URI.decode(String)
-
- Closed
-