fix cache

This commit is contained in:
Doug MacEachern 2006-03-01 22:08:12 +00:00
parent 114294061e
commit 9965f09f1c
1 changed files with 6 additions and 6 deletions

View File

@ -42,6 +42,12 @@ public class SigarInvokerJMX extends SigarInvoker {
SigarInvokerJMX invoker; SigarInvokerJMX invoker;
int ix = name.indexOf(":");
if (ix > 0) {
//skip domain name
name = name.substring(ix + 1);
}
if ((invoker = (SigarInvokerJMX)cache.get(name)) != null) { if ((invoker = (SigarInvokerJMX)cache.get(name)) != null) {
return invoker; return invoker;
} }
@ -50,12 +56,6 @@ public class SigarInvokerJMX extends SigarInvoker {
invoker.setProxy(proxy); invoker.setProxy(proxy);
int ix = name.indexOf(":");
if (ix > 0) {
//skip domain name
name = name.substring(ix + 1);
}
StringTokenizer st = new StringTokenizer(name, ","); StringTokenizer st = new StringTokenizer(name, ",");
while (st.hasMoreTokens()) { while (st.hasMoreTokens()) {