Skip to content

Commit 5583903

Browse files
committed
Make cachestats nonstatic and remove shutdown hook
1 parent 8bc444d commit 5583903

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/main/java/com/github/javabdd/BDDFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ public String toString() {
13291329
/**
13301330
* Singleton object for cache statistics.
13311331
*/
1332-
protected static CacheStats cachestats = new CacheStats();
1332+
protected CacheStats cachestats = new CacheStats();
13331333

13341334
/**
13351335
* <p>Return the current cache statistics for this BDD factory.</p>

src/main/java/com/github/javabdd/JFactory.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,8 @@ private JFactory() { }
5454
public static BDDFactory init(int nodenum, int cachesize) {
5555
BDDFactory f = new JFactory();
5656
f.initialize(nodenum, cachesize);
57-
if (cachestats.enabled) addShutdownHook(f);
5857
return f;
5958
}
60-
61-
static void addShutdownHook(final BDDFactory f) {
62-
Runtime.getRuntime().addShutdownHook(new Thread() {
63-
public void run() {
64-
System.out.println(f.getCacheStats().toString());
65-
}
66-
});
67-
}
6859

6960
boolean ZDD = false;
7061

0 commit comments

Comments
 (0)