Simplify creation of return value

git-svn-id: https://j8583.svn.sourceforge.net/svnroot/j8583/j8583@104 db60a039-f72e-0410-b1d2-baa000846441
This commit is contained in:
chochos
2012-05-18 15:29:44 +00:00
parent da6bb2bb23
commit 67c5522e92
@@ -62,13 +62,9 @@ public class LllvarParseInfo extends FieldParseInfo {
if (custom == null) {
return new IsoValue<String>(type, _v, length, null);
} else {
@SuppressWarnings({"unchecked", "rawtypes"})
IsoValue<?> v = new IsoValue(type, custom.decodeField(_v), length, custom);
if (v.getValue() == null) {
//problems decoding? return the string
return new IsoValue<String>(type, _v, length, null);
}
return v;
Object decoded = custom.decodeField(_v);
//If decode fails, return string; otherwise use the decoded object and its codec
return new IsoValue(type, decoded == null ? _v : decoded, length, decoded == null ? null : custom);
}
}