From 8770b99fdb6f47dea7b1f598633407e67b22572f Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Thu, 14 Apr 2022 15:09:45 +0200 Subject: - improved encoding of numerical values outside the allowed range - additional unit tests - fixes in the unused version 2 of FCB --- .../barcode/ticket/api/utils/UicEncoderUtils.java | 36 +++------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'src/main/java/org/uic/barcode/ticket/api/utils/UicEncoderUtils.java') diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/UicEncoderUtils.java b/src/main/java/org/uic/barcode/ticket/api/utils/UicEncoderUtils.java index f5eb15c..261b7ac 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/UicEncoderUtils.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/UicEncoderUtils.java @@ -217,7 +217,7 @@ public class UicEncoderUtils { } /** - * Gets the num list. + * Gets the list of all numeric strings. * * @param list the list * @return the num list @@ -244,9 +244,10 @@ public class UicEncoderUtils { return numList; } + /** - * Gets the i a5 non num list. + * Gets the IA5 string list of all elements that are not nmeric. * * @param list the list * @return the i a5 non num list @@ -274,8 +275,7 @@ public class UicEncoderUtils { return ia5List; } - - + /** * Gets the i a5. @@ -443,34 +443,6 @@ public class UicEncoderUtils { return list; } - /** - * Gets the restricted int list. - * - * @param intList the int list - * @param min the min - * @param max the max - * @return the restricted int list - * @throws EncodingFormatException the encoding format exception - */ - public static List getRestrictedIntList( Collection intList, int min, int max) throws EncodingFormatException { - if (intList == null || intList.isEmpty()) return null; - - ArrayList list = new ArrayList(); - - for (Integer i : intList){ - if (i != 0){ - - if (i < min || i > max){ - throw new EncodingFormatException("Integer value exceeds boundaries"); - } - - list.add(i); - } - } - - if (list.isEmpty()) return null; - return list; - } /** * Encode restricted integer collection. -- cgit v1.2.3