Skip to content

Commit

Permalink
remove java 7 specific language features
Browse files Browse the repository at this point in the history
  • Loading branch information
abramsm committed Jun 20, 2013
1 parent 0fcb805 commit 2e91143
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -21,6 +21,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;

Expand All @@ -46,9 +47,9 @@ public class ConcurrentStreamSummary<T> implements ITopK<T>
public ConcurrentStreamSummary(final int capacity)
{
this.capacity = capacity;
this.minVal = new AtomicReference<>();
this.minVal = new AtomicReference<ScoredItem>();
this.size = new AtomicLong(0);
this.itemMap = new ConcurrentHashMap<>(capacity);
this.itemMap = new ConcurrentHashMap<T, ScoredItem>(capacity);
this.reachCapacity = new AtomicBoolean(false);
}

Expand Down Expand Up @@ -121,7 +122,7 @@ public String toString()
@Override
public List<T> peek(final int k)
{
List<T> toReturn = new ArrayList<>(k);
List<T> toReturn = new ArrayList<T>(k);
List<ScoredItem<T>> values = peekWithScores(k);
for (ScoredItem<T> value : values)
{
Expand All @@ -132,7 +133,7 @@ public List<T> peek(final int k)

public List<ScoredItem<T>> peekWithScores(final int k)
{
List<ScoredItem<T>> values = new ArrayList<>();
List<ScoredItem<T>> values = new ArrayList<ScoredItem<T>>();
for (Map.Entry<T, ScoredItem> entry : itemMap.entrySet())
{
ScoredItem value = entry.getValue();
Expand Down

0 comments on commit 2e91143

Please sign in to comment.