diff options
-rw-r--r-- | config-lib/src/main/java/com/yahoo/config/LeafNodeVector.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/config-lib/src/main/java/com/yahoo/config/LeafNodeVector.java b/config-lib/src/main/java/com/yahoo/config/LeafNodeVector.java index a5dee11637f..d1d5fc61915 100644 --- a/config-lib/src/main/java/com/yahoo/config/LeafNodeVector.java +++ b/config-lib/src/main/java/com/yahoo/config/LeafNodeVector.java @@ -34,27 +34,27 @@ public class LeafNodeVector<REAL, NODE extends LeafNode<REAL>> extends NodeVecto realValues = realList(vector); } + @SuppressWarnings("unchecked") + public List<REAL> asList() { + return realValues; + } + /** * Creates a new Node by cloning the default node. */ @SuppressWarnings("unchecked") - private NODE createNew(NODE defaultNode) { + private static <NODE extends LeafNode<?>> NODE createNew(NODE defaultNode) { return (NODE) (defaultNode).clone(); } - private List<REAL> realList(List<NODE> nodes) { - List<REAL> reals = new ArrayList<REAL>(); - for(NODE node : vector) { + private static<REAL, NODE extends LeafNode<REAL>> List<REAL> realList(List<NODE> nodes) { + List<REAL> reals = new ArrayList<>(); + for(NODE node : nodes) { reals.add(node.value()); } return Collections.unmodifiableList(reals); } - @SuppressWarnings("unchecked") - public List<REAL> asList() { - return realValues; - } - // TODO: Try to eliminate the need for this method when we have moved FileAcquirer to the config library // It is needed now because the builder has a list of String, while REAL=FileReference. public static LeafNodeVector<FileReference, FileNode> createFileNodeVector(Collection<String> values) { |