I'm experiencing periodically a difference in the number of digits return when calling
Thread thr = Thread.currentThread();
thr.hashcode();
Sometimes the returned value is a 7 or 6 digit number, is there a way to always convert the "thr" value to be an 8 digit number? What do you think of toOctalString(int i)?
I tried something like this to possible eliminate the problem, but I don't think this effective.
int threadValue = 0;
int condition = thr.hashCode() - 10000000;
if (condition < -1) {
// in the event a hascode returns a 7 digit number
threadValue = (thr.hashCode() * 10);
} else {
threadValue = thr.hashCode();
}
Thanks in advance!
Dano
dan_kryzer@hotmail.com
What's your major malfunction
Thread thr = Thread.currentThread();
thr.hashcode();
Sometimes the returned value is a 7 or 6 digit number, is there a way to always convert the "thr" value to be an 8 digit number? What do you think of toOctalString(int i)?
I tried something like this to possible eliminate the problem, but I don't think this effective.
int threadValue = 0;
int condition = thr.hashCode() - 10000000;
if (condition < -1) {
// in the event a hascode returns a 7 digit number
threadValue = (thr.hashCode() * 10);
} else {
threadValue = thr.hashCode();
}
Thanks in advance!
Dano
dan_kryzer@hotmail.com
What's your major malfunction