From e2789034233cbc057bf6b4d5c202afd28a7cb202 Mon Sep 17 00:00:00 2001 From: Enrique Zamudio Date: Thu, 19 Feb 2015 19:55:24 -0600 Subject: [PATCH] diamond op #32 --- .../solab/iso8583/parse/AlphaParseInfo.java | 6 +++--- .../solab/iso8583/parse/AmountParseInfo.java | 4 ++-- .../solab/iso8583/parse/BinaryParseInfo.java | 12 +++++------ .../solab/iso8583/parse/Date10ParseInfo.java | 4 ++-- .../solab/iso8583/parse/Date4ParseInfo.java | 4 ++-- .../solab/iso8583/parse/DateExpParseInfo.java | 4 ++-- .../solab/iso8583/parse/LlbinParseInfo.java | 20 +++++++++---------- .../solab/iso8583/parse/LllbinParseInfo.java | 20 +++++++++---------- 8 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/solab/iso8583/parse/AlphaParseInfo.java b/src/main/java/com/solab/iso8583/parse/AlphaParseInfo.java index 6ea5410..f46e370 100644 --- a/src/main/java/com/solab/iso8583/parse/AlphaParseInfo.java +++ b/src/main/java/com/solab/iso8583/parse/AlphaParseInfo.java @@ -49,12 +49,12 @@ public class AlphaParseInfo extends AlphaNumericFieldParseInfo { } try { if (custom == null) { - return new IsoValue(type, new String(buf, pos, length, getCharacterEncoding()), length, null); + return new IsoValue<>(type, new String(buf, pos, length, getCharacterEncoding()), length, null); } else { T decoded = custom.decodeField(new String(buf, pos, length, getCharacterEncoding())); return decoded == null ? - new IsoValue(type, new String(buf, pos, length, getCharacterEncoding()), length, null) : - new IsoValue(type, decoded, length, custom); + new IsoValue<>(type, new String(buf, pos, length, getCharacterEncoding()), length, null) : + new IsoValue<>(type, decoded, length, custom); } } catch (IndexOutOfBoundsException ex) { throw new ParseException(String.format( diff --git a/src/main/java/com/solab/iso8583/parse/AmountParseInfo.java b/src/main/java/com/solab/iso8583/parse/AmountParseInfo.java index 6e4c44b..9de0d46 100644 --- a/src/main/java/com/solab/iso8583/parse/AmountParseInfo.java +++ b/src/main/java/com/solab/iso8583/parse/AmountParseInfo.java @@ -51,7 +51,7 @@ public class AmountParseInfo extends FieldParseInfo { } String c = new String(buf, pos, 12, getCharacterEncoding()); try { - return new IsoValue(type, new BigDecimal(c).movePointLeft(2)); + return new IsoValue<>(type, new BigDecimal(c).movePointLeft(2)); } catch (NumberFormatException ex) { throw new ParseException(String.format("Cannot read amount '%s' field %d pos %d", c, field, pos), pos); @@ -76,7 +76,7 @@ public class AmountParseInfo extends FieldParseInfo { } } try { - return new IsoValue(IsoType.AMOUNT, new BigDecimal(new String(digits))); + return new IsoValue<>(IsoType.AMOUNT, new BigDecimal(new String(digits))); } catch (NumberFormatException ex) { throw new ParseException(String.format("Cannot read amount '%s' field %d pos %d", new String(digits), field, pos), pos); diff --git a/src/main/java/com/solab/iso8583/parse/BinaryParseInfo.java b/src/main/java/com/solab/iso8583/parse/BinaryParseInfo.java index 0def120..7556266 100644 --- a/src/main/java/com/solab/iso8583/parse/BinaryParseInfo.java +++ b/src/main/java/com/solab/iso8583/parse/BinaryParseInfo.java @@ -52,11 +52,11 @@ public class BinaryParseInfo extends FieldParseInfo { } byte[] binval = HexCodec.hexDecode(new String(buf, pos, length*2)); if (custom == null) { - return new IsoValue(type, binval, binval.length, null); + return new IsoValue<>(type, binval, binval.length, null); } else { T dec = custom.decodeField(new String(buf, pos, length*2, getCharacterEncoding())); - return dec == null ? new IsoValue(type, binval, binval.length, null) : - new IsoValue(type, dec, length, custom); + return dec == null ? new IsoValue<>(type, binval, binval.length, null) : + new IsoValue<>(type, dec, length, custom); } } @@ -75,11 +75,11 @@ public class BinaryParseInfo extends FieldParseInfo { byte[] _v = new byte[length]; System.arraycopy(buf, pos, _v, 0, length); if (custom == null) { - return new IsoValue(type, _v, length, null); + return new IsoValue<>(type, _v, length, null); } else { T dec = custom.decodeField(HexCodec.hexEncode(_v, 0, _v.length)); - return dec == null ? new IsoValue(type, _v, length, null) : - new IsoValue(type, dec, length, custom); + return dec == null ? new IsoValue<>(type, _v, length, null) : + new IsoValue<>(type, dec, length, custom); } } diff --git a/src/main/java/com/solab/iso8583/parse/Date10ParseInfo.java b/src/main/java/com/solab/iso8583/parse/Date10ParseInfo.java index ebbca48..7526dd2 100644 --- a/src/main/java/com/solab/iso8583/parse/Date10ParseInfo.java +++ b/src/main/java/com/solab/iso8583/parse/Date10ParseInfo.java @@ -71,7 +71,7 @@ public class Date10ParseInfo extends DateTimeParseInfo { cal.setTimeZone(tz); } adjustWithFutureTolerance(cal); - return new IsoValue(type, cal.getTime(), null); + return new IsoValue<>(type, cal.getTime(), null); } @Override @@ -105,7 +105,7 @@ public class Date10ParseInfo extends DateTimeParseInfo { cal.setTimeZone(tz); } adjustWithFutureTolerance(cal); - return new IsoValue(type, cal.getTime(), null); + return new IsoValue<>(type, cal.getTime(), null); } } diff --git a/src/main/java/com/solab/iso8583/parse/Date4ParseInfo.java b/src/main/java/com/solab/iso8583/parse/Date4ParseInfo.java index 35cf58c..b1227dd 100644 --- a/src/main/java/com/solab/iso8583/parse/Date4ParseInfo.java +++ b/src/main/java/com/solab/iso8583/parse/Date4ParseInfo.java @@ -66,7 +66,7 @@ public class Date4ParseInfo extends DateTimeParseInfo { cal.setTimeZone(tz); } Date10ParseInfo.adjustWithFutureTolerance(cal); - return new IsoValue(type, cal.getTime(), null); + return new IsoValue<>(type, cal.getTime(), null); } @Override @@ -94,7 +94,7 @@ public class Date4ParseInfo extends DateTimeParseInfo { cal.setTimeZone(tz); } DateTimeParseInfo.adjustWithFutureTolerance(cal); - return new IsoValue(type, cal.getTime(), null); + return new IsoValue<>(type, cal.getTime(), null); } } diff --git a/src/main/java/com/solab/iso8583/parse/DateExpParseInfo.java b/src/main/java/com/solab/iso8583/parse/DateExpParseInfo.java index e3be670..6300d42 100644 --- a/src/main/java/com/solab/iso8583/parse/DateExpParseInfo.java +++ b/src/main/java/com/solab/iso8583/parse/DateExpParseInfo.java @@ -67,7 +67,7 @@ public class DateExpParseInfo extends DateTimeParseInfo { if (tz != null) { cal.setTimeZone(tz); } - return new IsoValue(type, cal.getTime(), null); + return new IsoValue<>(type, cal.getTime(), null); } @Override @@ -99,6 +99,6 @@ public class DateExpParseInfo extends DateTimeParseInfo { if (tz != null) { cal.setTimeZone(tz); } - return new IsoValue(type, cal.getTime(), null); + return new IsoValue<>(type, cal.getTime(), null); } } diff --git a/src/main/java/com/solab/iso8583/parse/LlbinParseInfo.java b/src/main/java/com/solab/iso8583/parse/LlbinParseInfo.java index a6ef867..e287ef0 100644 --- a/src/main/java/com/solab/iso8583/parse/LlbinParseInfo.java +++ b/src/main/java/com/solab/iso8583/parse/LlbinParseInfo.java @@ -62,12 +62,12 @@ public class LlbinParseInfo extends FieldParseInfo { byte[] binval = len == 0 ? new byte[0] : HexCodec.hexDecode( new String(buf, pos + 2, len)); if (custom == null) { - return new IsoValue(type, binval, binval.length, null); + return new IsoValue<>(type, binval, binval.length, null); } else if (custom instanceof CustomBinaryField) { try { T dec = ((CustomBinaryField)custom).decodeBinaryField(buf, pos + 2, len); - return dec == null ? new IsoValue(type, binval, binval.length, null) : - new IsoValue(type, dec, 0, custom); + return dec == null ? new IsoValue<>(type, binval, binval.length, null) : + new IsoValue<>(type, dec, 0, custom); } catch (IndexOutOfBoundsException ex) { throw new ParseException(String.format( "Insufficient data for LLBIN field %d, pos %d (LEN states '%s')", @@ -76,8 +76,8 @@ public class LlbinParseInfo extends FieldParseInfo { } else { try { T dec = custom.decodeField(new String(buf, pos + 2, len)); - return dec == null ? new IsoValue(type, binval, binval.length, null) : - new IsoValue(type, dec, binval.length, custom); + return dec == null ? new IsoValue<>(type, binval, binval.length, null) : + new IsoValue<>(type, dec, binval.length, custom); } catch (IndexOutOfBoundsException ex) { throw new ParseException(String.format( "Insufficient data for LLBIN field %d, pos %d (LEN states '%s')", @@ -109,12 +109,12 @@ public class LlbinParseInfo extends FieldParseInfo { byte[] _v = new byte[l]; System.arraycopy(buf, pos+1, _v, 0, l); if (custom == null) { - return new IsoValue(type, _v, null); + return new IsoValue<>(type, _v, null); } else if (custom instanceof CustomBinaryField) { try { T dec = ((CustomBinaryField)custom).decodeBinaryField(buf, pos + 1, l); - return dec == null ? new IsoValue(type, _v, _v.length, null) : - new IsoValue(type, dec, l, custom); + return dec == null ? new IsoValue<>(type, _v, _v.length, null) : + new IsoValue<>(type, dec, l, custom); } catch (IndexOutOfBoundsException ex) { throw new ParseException(String.format( "Insufficient data for LLBIN field %d, pos %d length %d", @@ -122,8 +122,8 @@ public class LlbinParseInfo extends FieldParseInfo { } } else { T dec = custom.decodeField(HexCodec.hexEncode(_v, 0, _v.length)); - return dec == null ? new IsoValue(type, _v, null) : - new IsoValue(type, dec, custom); + return dec == null ? new IsoValue<>(type, _v, null) : + new IsoValue<>(type, dec, custom); } } diff --git a/src/main/java/com/solab/iso8583/parse/LllbinParseInfo.java b/src/main/java/com/solab/iso8583/parse/LllbinParseInfo.java index 03b27bd..afc92f0 100644 --- a/src/main/java/com/solab/iso8583/parse/LllbinParseInfo.java +++ b/src/main/java/com/solab/iso8583/parse/LllbinParseInfo.java @@ -59,13 +59,13 @@ public class LllbinParseInfo extends FieldParseInfo { } byte[] binval = l == 0 ? new byte[0] : HexCodec.hexDecode(new String(buf, pos + 3, l)); if (custom == null) { - return new IsoValue(type, binval, binval.length, null); + return new IsoValue<>(type, binval, binval.length, null); } else if (custom instanceof CustomBinaryField) { try { T dec = ((CustomBinaryField)custom).decodeBinaryField( buf, pos + 3, l); - return dec == null ? new IsoValue(type, binval, binval.length, null) : - new IsoValue(type, dec, 0, custom); + return dec == null ? new IsoValue<>(type, binval, binval.length, null) : + new IsoValue<>(type, dec, 0, custom); } catch (IndexOutOfBoundsException ex) { throw new ParseException(String.format( "Insufficient data for LLLBIN field %d, pos %d", field, pos), pos); @@ -74,8 +74,8 @@ public class LllbinParseInfo extends FieldParseInfo { try { T dec = custom.decodeField( l == 0 ? "" : new String(buf, pos + 3, l)); - return dec == null ? new IsoValue(type, binval, binval.length, null) : - new IsoValue(type, dec, l, custom); + return dec == null ? new IsoValue<>(type, binval, binval.length, null) : + new IsoValue<>(type, dec, l, custom); } catch (IndexOutOfBoundsException ex) { throw new ParseException(String.format( "Insufficient data for LLLBIN field %d, pos %d", field, pos), pos); @@ -107,21 +107,21 @@ public class LllbinParseInfo extends FieldParseInfo { byte[] _v = new byte[l]; System.arraycopy(buf, pos+2, _v, 0, l); if (custom == null) { - return new IsoValue(type, _v, null); + return new IsoValue<>(type, _v, null); } else if (custom instanceof CustomBinaryField) { try { T dec = ((CustomBinaryField)custom).decodeBinaryField( buf, pos + 2, l); - return dec == null ? new IsoValue(type, _v, _v.length, null) : - new IsoValue(type, dec, l, custom); + return dec == null ? new IsoValue<>(type, _v, _v.length, null) : + new IsoValue<>(type, dec, l, custom); } catch (IndexOutOfBoundsException ex) { throw new ParseException(String.format( "Insufficient data for LLLBIN field %d, pos %d", field, pos), pos); } } else { T dec = custom.decodeField(HexCodec.hexEncode(_v, 0, _v.length)); - return dec == null ? new IsoValue(type, _v, null) : - new IsoValue(type, dec, custom); + return dec == null ? new IsoValue<>(type, _v, null) : + new IsoValue<>(type, dec, custom); } }