diff --git a/bindings/java/src/net/hyperic/sigar/ptql/ProcessFinder.java b/bindings/java/src/net/hyperic/sigar/ptql/ProcessFinder.java index 211e0498..c5214b2f 100644 --- a/bindings/java/src/net/hyperic/sigar/ptql/ProcessFinder.java +++ b/bindings/java/src/net/hyperic/sigar/ptql/ProcessFinder.java @@ -74,7 +74,7 @@ public class ProcessFinder { ProcessFinder finder = new ProcessFinder(sigar); try { - return finder.find(ProcessQueryFactory.getInstance(query, sigar)); + return finder.find(ProcessQueryFactory.getInstance(query)); } catch (QueryLoadException e) { throw new SigarException(e.getMessage()); } catch (MalformedQueryException e) { diff --git a/bindings/java/src/net/hyperic/sigar/ptql/ProcessQueryFactory.java b/bindings/java/src/net/hyperic/sigar/ptql/ProcessQueryFactory.java index 4dbfbaa4..2858008f 100644 --- a/bindings/java/src/net/hyperic/sigar/ptql/ProcessQueryFactory.java +++ b/bindings/java/src/net/hyperic/sigar/ptql/ProcessQueryFactory.java @@ -5,7 +5,6 @@ import java.util.Comparator; import java.util.Map; import java.util.StringTokenizer; -import net.hyperic.sigar.SigarProxy; import net.hyperic.sigar.util.ReferenceMap; public class ProcessQueryFactory implements Comparator { @@ -13,14 +12,8 @@ public class ProcessQueryFactory implements Comparator { private static Map cache = ReferenceMap.synchronizedMap(); - private SigarProxy sigar = null; - public ProcessQueryFactory() {} - public ProcessQueryFactory(SigarProxy sigar) { - this.sigar = sigar; - } - //sort what will become instruction branches. //so the cheapest are executed first. private int getOrder(String s) { @@ -127,13 +120,6 @@ public class ProcessQueryFactory implements Comparator { throws MalformedQueryException, QueryLoadException { - return getInstance(query, null); - } - - public static ProcessQuery getInstance(String query, SigarProxy sigar) - throws MalformedQueryException, - QueryLoadException { - if (query == null) { throw new MalformedQueryException("null query"); } @@ -165,7 +151,7 @@ public class ProcessQueryFactory implements Comparator { queries.put(vals[0], vals[1]); } - ProcessQueryFactory factory = new ProcessQueryFactory(sigar); + ProcessQueryFactory factory = new ProcessQueryFactory(); pQuery = factory.prepare(queries);