currently I am working on a project that deals with byte-code analysis. I came across the code,
char[] buff = new char[1];
//some code tainting the buff
return (new String(buff));
in the byte code I found the relevant mapping of new String(buff) to be
Ljava/lang/StringValue.cache
can anyone of you guys explain from where this cache field comes to the scenario?
it is from jdk i.6, StringValue. according to the description, "This class consists exclusively of static methods that operate on character arrays used by Strings for storing the value. "
Can anyone put a light on this? What is its purpose actually? What I think that it is mostly because of the character buffer they used which is passed to the string as an arguement. This class is not modifying the contents of the buffer, rather I think it is just a gateway to illustrate that the content of the buffer is only for initialing a string.