Fix #10 - improve use of type parameters instead of suppressing warnings

This commit is contained in:
Enrique Zamudio
2013-04-23 11:22:21 -05:00
parent 0221f8881a
commit cc5918dd50
15 changed files with 98 additions and 121 deletions
@@ -169,7 +169,8 @@ public class ConfigParser {
throw new IOException("Invalid ISO8583 type for template: " + elem.getAttribute("type"));
}
NodeList fields = elem.getElementsByTagName("field");
IsoMessage m = new IsoMessage();
@SuppressWarnings("unchecked")
T m = (T)new IsoMessage();
m.setType(type);
m.setCharacterEncoding(mfact.getCharacterEncoding());
for (int j = 0; j < fields.getLength(); j++) {
@@ -184,7 +185,7 @@ public class ConfigParser {
CustomField<Object> _cf = mfact.getCustomField(num);
m.setValue(num, _cf == null ? v : _cf.decodeField(v), _cf, itype, length);
}
mfact.addMessageTemplate((T)m);
mfact.addMessageTemplate(m);
}
//Read the parsing guides