From c08e466f19e6da4dcf6bc93dfd2709a35cf3e248 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Mon, 21 Oct 2019 22:38:21 +0200 Subject: Refactor ValueList --- src/pl/edu/mimuw/cloudatlas/model/ValueList.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pl/edu/mimuw/cloudatlas/model/ValueList.java b/src/pl/edu/mimuw/cloudatlas/model/ValueList.java index d60e896..ae438e2 100644 --- a/src/pl/edu/mimuw/cloudatlas/model/ValueList.java +++ b/src/pl/edu/mimuw/cloudatlas/model/ValueList.java @@ -40,8 +40,8 @@ import pl.edu.mimuw.cloudatlas.model.ValueList; /** * A value representing a list of values of the specified type. Implements List interface. *

- * All constructors expect type of elements stored in this list. This type is checked when adding elements to the list - * and an IllegalArgumentException is thrown in case of error. + * All constructors take a type of elements stored in this list. This type is checked when adding elements to the list + * and an IllegalArgumentException is thrown in case of a mismatch. * * @see java.util.List */ @@ -110,9 +110,9 @@ public class ValueList extends ValueSimple> implements List { if(this.type.getElementType().isCompatible(((TypeCollection)type).getElementType())) { if(this.isNull()) return new ValueSet(null, this.type.getElementType()); - Set l = new HashSet(); - l.addAll(this); - return new ValueSet(l, this.type.getElementType()); + Set set = new HashSet(); + set.addAll(this); + return new ValueSet(set, this.type.getElementType()); } throw new UnsupportedConversionException(getType(), type); case STRING: @@ -147,7 +147,7 @@ public class ValueList extends ValueSimple> implements List { throw new IllegalArgumentException("If you want to use null, create an object containing null instead."); if(!type.getElementType().isCompatible(element.getType())) throw new IllegalArgumentException("This list contains elements of type " - + type.getElementType().toString() + " only. Not compatibile with elements of type: " + + type.getElementType().toString() + " only. Incompatible with elements of type: " + element.getType().toString()); } -- cgit v1.2.3