From 7f641d31e3f1f54e8d43544ef4beea652b135766 Mon Sep 17 00:00:00 2001 From: Dave Date: Sun, 28 Jun 2015 22:37:07 +0200 Subject: [PATCH] Declaring generic List interface rather than ArrayList --- src/nodash/core/spheres/NoByteSetSphere.java | 7 ++++--- src/nodash/models/NoSession.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nodash/core/spheres/NoByteSetSphere.java b/src/nodash/core/spheres/NoByteSetSphere.java index 910fdff..8f562c3 100644 --- a/src/nodash/core/spheres/NoByteSetSphere.java +++ b/src/nodash/core/spheres/NoByteSetSphere.java @@ -19,13 +19,14 @@ package nodash.core.spheres; import java.security.PublicKey; import java.util.ArrayList; +import java.util.List; import java.util.concurrent.ConcurrentHashMap; import nodash.models.NoByteSet; import nodash.models.NoUser; public final class NoByteSetSphere { - private static final ArrayList EMPTY_BYTESET_LIST = new ArrayList(0); + private static final List EMPTY_BYTESET_LIST = new ArrayList(0); private static ConcurrentHashMap> byteSets = new ConcurrentHashMap>(); @@ -37,14 +38,14 @@ public final class NoByteSetSphere { NoByteSetSphere.byteSets.get(publicKey).add(byteSet); } - public static void addList(ArrayList byteSetList, PublicKey publicKey) { + public static void addList(List byteSetList, PublicKey publicKey) { if (!NoByteSetSphere.byteSets.containsKey(publicKey)) { NoByteSetSphere.byteSets.put(publicKey, new ArrayList()); } NoByteSetSphere.byteSets.get(publicKey).addAll(byteSetList); } - public static ArrayList consume(NoUser user) { + public static List consume(NoUser user) { if (NoByteSetSphere.byteSets.containsKey(user.getRSAPublicKey())) { ArrayList result = NoByteSetSphere.byteSets.get(user.getRSAPublicKey()); NoByteSetSphere.byteSets.remove(user.getRSAPublicKey()); diff --git a/src/nodash/models/NoSession.java b/src/nodash/models/NoSession.java index 050f8a7..a316993 100644 --- a/src/nodash/models/NoSession.java +++ b/src/nodash/models/NoSession.java @@ -35,7 +35,7 @@ public final class NoSession implements Serializable { private final long expiry; private boolean newUserSession; - public ArrayList incoming; + public List incoming; public NoUser current; public UUID uuid;