Commit 16fb0803 authored by Michael Ritter's avatar Michael Ritter
Browse files

Code cleanup

parent 2f2d3d82
...@@ -34,6 +34,11 @@ package edu.umiacs.ace.monitor.core; ...@@ -34,6 +34,11 @@ package edu.umiacs.ace.monitor.core;
import edu.umiacs.ace.monitor.log.LogEnum; import edu.umiacs.ace.monitor.log.LogEnum;
import edu.umiacs.ace.monitor.log.LogEventManager; import edu.umiacs.ace.monitor.log.LogEventManager;
import edu.umiacs.ace.util.PersistUtil; import edu.umiacs.ace.util.PersistUtil;
import org.apache.log4j.Logger;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.Query;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
...@@ -42,10 +47,6 @@ import java.util.List; ...@@ -42,10 +47,6 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.Query;
import org.apache.log4j.Logger;
/** /**
* *
...@@ -58,13 +59,13 @@ public class MonitoredItemManager { ...@@ -58,13 +59,13 @@ public class MonitoredItemManager {
MonitoredItemManager.class); MonitoredItemManager.class);
EntityManager em; EntityManager em;
// TODO: This may leak... // TODO: This may leak...
private Set<String> existingParents = new HashSet<String>(); private Set<String> existingParents = new HashSet<>();
public MonitoredItemManager( EntityManager em ) { public MonitoredItemManager( EntityManager em ) {
this.em = em; this.em = em;
} }
public List<MonitoredItem> listItemsBefore( Collection c, Date d ) { public Iterable<MonitoredItem> listItemsBefore( Collection c, Date d ) {
lock.lock(); lock.lock();
try { try {
......
...@@ -49,6 +49,7 @@ public class KSFuture<V extends Runnable> extends KnownFuture<Submittable<V>> { ...@@ -49,6 +49,7 @@ public class KSFuture<V extends Runnable> extends KnownFuture<Submittable<V>> {
Submittable<V> result = getKnownResult(); Submittable<V> result = getKnownResult();
beforeExecute(result); beforeExecute(result);
super.run(); super.run();
// TODO: Check exception and print if true?
afterExecute(result); afterExecute(result);
} }
......
...@@ -254,7 +254,7 @@ public final class HashTreeBuilder { ...@@ -254,7 +254,7 @@ public final class HashTreeBuilder {
// Find out how many nodes are going to be in the parent level // Find out how many nodes are going to be in the parent level
int parentNodeCount = size / order; int parentNodeCount = size / order;
List<HashTree.Node> parentLevel = List<HashTree.Node> parentLevel =
new ArrayList<HashTree.Node>(parentNodeCount); new ArrayList<>(parentNodeCount);
// Index for iterating through the nodes in this level // Index for iterating through the nodes in this level
int iterIndex = 0; int iterIndex = 0;
...@@ -290,7 +290,7 @@ public final class HashTreeBuilder { ...@@ -290,7 +290,7 @@ public final class HashTreeBuilder {
// Construct the parent node // Construct the parent node
List<HashTree.Node> childrenNodes = List<HashTree.Node> childrenNodes =
new ArrayList<HashTree.Node>(childrenNodeCount); new ArrayList<>(childrenNodeCount);
HashTree.Node parentNode = new HashTree.Node(); HashTree.Node parentNode = new HashTree.Node();
for ( int i = iterIndex, childIndex = 0; for ( int i = iterIndex, childIndex = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment