Taken from the forum:
http://forums.opensymphony.com/thread.jspa?threadID=68960&messageID=129971#129971
I found a error for the com.opensymphony.oscache.plugins.diskpersistence.HashDiskPersistenceListener class, in this class have a method named byteArrayToHexString(byte[] in),the old source code follow as:
/**
* Nibble conversion. Thanks to our friends at:
*
http://www.devx.com/tips/Tip/13540
* @param in the byte array to convert
* @return a java.lang.String based version of they byte array
*/
static String byteArrayToHexString(byte[] in) {
if ((in == null) || (in.length <= 0)) {
return null;
}
StringBuffer out = new StringBuffer(in.length * 2);
for (int i = 0; i < in.length; i++) {
byte ch = (byte) (in & 0xF0); // Strip off high nibble
ch = (byte) (ch >>> 4);
// shift the bits down
ch = (byte) (ch & 0x0F);
// must do this is high order bit is on!
out.append(PSEUDO[(int) ch]); // convert the nibble to a String Character
ch = (byte) (in & 0x0F); // Strip off low nibble
out.append(PSEUDO[(int) ch]); // convert the nibble to a String Character
i++;
}
return out.toString();
}
notice the bold font, in this part , the code plus once , and int the for (int i = 0; i < in.length; i++) do this plus again, so this method do plus handle twice, the error is this method only conversion the byteArray half items.
The modify method follow as :
/**
* Nibble conversion. Thanks to our friends at:
*
http://www.devx.com/tips/Tip/13540
* @param in the byte array to convert
* @return a java.lang.String based version of they byte array
*/
static String byteArrayToHexString(byte[] in) {
if ((in == null) || (in.length <= 0)) {
return null;
}
StringBuffer out = new StringBuffer(in.length * 2);
for (int i = 0; i < in.length; i++) {
byte ch = (byte) (in & 0xF0); // Strip off high nibble
ch = (byte) (ch >>> 4);
// shift the bits down
ch = (byte) (ch & 0x0F);
// must do this is high order bit is on!
out.append(PSEUDO[(int) ch]); // convert the nibble to a String Character
ch = (byte) (in & 0x0F); // Strip off low nibble
out.append(PSEUDO[(int) ch]); // convert the nibble to a String Character
}
return out.toString();
}