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;
import edu.umiacs.ace.monitor.log.LogEnum;
import edu.umiacs.ace.monitor.log.LogEventManager;
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.Comparator;
import java.util.Date;
......@@ -42,10 +47,6 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.locks.Lock;
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 {
MonitoredItemManager.class);
EntityManager em;
// TODO: This may leak...
private Set<String> existingParents = new HashSet<String>();
private Set<String> existingParents = new HashSet<>();
public MonitoredItemManager( EntityManager em ) {
this.em = em;
}
public List<MonitoredItem> listItemsBefore( Collection c, Date d ) {
public Iterable<MonitoredItem> listItemsBefore( Collection c, Date d ) {
lock.lock();
try {
......
......@@ -49,6 +49,7 @@ public class KSFuture<V extends Runnable> extends KnownFuture<Submittable<V>> {
Submittable<V> result = getKnownResult();
beforeExecute(result);
super.run();
// TODO: Check exception and print if true?
afterExecute(result);
}
......
......@@ -254,7 +254,7 @@ public final class HashTreeBuilder {
// Find out how many nodes are going to be in the parent level
int parentNodeCount = size / order;
List<HashTree.Node> parentLevel =
new ArrayList<HashTree.Node>(parentNodeCount);
new ArrayList<>(parentNodeCount);
// Index for iterating through the nodes in this level
int iterIndex = 0;
......@@ -290,7 +290,7 @@ public final class HashTreeBuilder {
// Construct the parent node
List<HashTree.Node> childrenNodes =
new ArrayList<HashTree.Node>(childrenNodeCount);
new ArrayList<>(childrenNodeCount);
HashTree.Node parentNode = new HashTree.Node();
for ( int i = iterIndex, childIndex = 0;
......
Markdown is supported
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