Work on #3 for ALPHA fields
This commit is contained in:
@@ -42,20 +42,24 @@ public abstract class AlphaNumericFieldParseInfo extends FieldParseInfo {
|
|||||||
throw new ParseException(String.format("Insufficient data for %s field of length %d, pos %d",
|
throw new ParseException(String.format("Insufficient data for %s field of length %d, pos %d",
|
||||||
type, length, pos), pos);
|
type, length, pos), pos);
|
||||||
}
|
}
|
||||||
String _v = new String(buf, pos, length, getCharacterEncoding());
|
try {
|
||||||
if (_v.length() != length) {
|
String _v = new String(buf, pos, length, getCharacterEncoding());
|
||||||
_v = new String(buf, pos, buf.length-pos, getCharacterEncoding()).substring(0, length);
|
if (_v.length() != length) {
|
||||||
}
|
_v = new String(buf, pos, buf.length-pos, getCharacterEncoding()).substring(0, length);
|
||||||
if (custom == null) {
|
}
|
||||||
return new IsoValue<String>(type, _v, length, null);
|
if (custom == null) {
|
||||||
} else {
|
return new IsoValue<String>(type, _v, length, null);
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
} else {
|
||||||
IsoValue<?> v = new IsoValue(type, custom.decodeField(_v), length, custom);
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
if (v.getValue() == null) {
|
IsoValue<?> v = new IsoValue(type, custom.decodeField(_v), length, custom);
|
||||||
return new IsoValue<String>(type, _v, length, null);
|
if (v.getValue() == null) {
|
||||||
}
|
return new IsoValue<String>(type, _v, length, null);
|
||||||
return v;
|
}
|
||||||
}
|
return v;
|
||||||
|
}
|
||||||
|
} catch (StringIndexOutOfBoundsException ex) {
|
||||||
|
throw new ParseException(String.format("Insufficient data for %s field of length %d, pos %d", type, length, pos), pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user