From bca4203db1b8c4998d25d676f8689d2be5b9f9bc Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 21 Jun 2004 22:49:40 +0000 Subject: [PATCH] change SynchronizedSigarProxyCache.getInstance to construct the Sigar instance itself --- .../src/net/hyperic/sigar/SynchronizedSigarProxyCache.java | 4 ++-- bindings/java/src/net/hyperic/sigar/test/TestPTQL.java | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bindings/java/src/net/hyperic/sigar/SynchronizedSigarProxyCache.java b/bindings/java/src/net/hyperic/sigar/SynchronizedSigarProxyCache.java index 204f29be..e7e16e0f 100644 --- a/bindings/java/src/net/hyperic/sigar/SynchronizedSigarProxyCache.java +++ b/bindings/java/src/net/hyperic/sigar/SynchronizedSigarProxyCache.java @@ -8,12 +8,12 @@ public class SynchronizedSigarProxyCache private static Object lock = new Object(); private static SigarProxy instance = null; - public static SigarProxy getInstance(Sigar sigar) + public static SigarProxy getInstance() throws SigarException { synchronized (lock) { if (instance == null) { - instance = SigarProxyCache.newInstance(sigar); + instance = SigarProxyCache.newInstance(new Sigar()); } } diff --git a/bindings/java/src/net/hyperic/sigar/test/TestPTQL.java b/bindings/java/src/net/hyperic/sigar/test/TestPTQL.java index 90ea0eb7..4c82b314 100644 --- a/bindings/java/src/net/hyperic/sigar/test/TestPTQL.java +++ b/bindings/java/src/net/hyperic/sigar/test/TestPTQL.java @@ -134,10 +134,7 @@ public class TestPTQL extends SigarTestCase { } public void testCreate() throws Exception { - Sigar sigar = new Sigar(); - - SigarProxy proxy = - SynchronizedSigarProxyCache.getInstance(sigar); + SigarProxy proxy = SynchronizedSigarProxyCache.getInstance(); traceln(""); testOK(proxy);