in dom/src/main/java/org/apache/james/mime4j/field/MimeVersionFieldLenientImpl.java [53:89]
private void parse() {
parsed = true;
major = DEFAULT_MAJOR_VERSION;
minor = DEFAULT_MINOR_VERSION;
RawField f = getRawField();
ByteSequence buf = f.getRaw();
int pos = f.getDelimiterIdx() + 1;
if (buf == null) {
String body = f.getBody();
if (body == null) {
return;
}
buf = ContentUtil.encode(body);
pos = 0;
}
RawFieldParser parser = RawFieldParser.DEFAULT;
ParserCursor cursor = new ParserCursor(pos, buf.length());
String token1 = parser.parseValue(buf, cursor, DELIM);
try {
major = Integer.parseInt(token1);
if (major < 0) {
major = 0;
}
} catch (NumberFormatException ex) {
}
if (!cursor.atEnd() && buf.byteAt(cursor.getPos()) == FULL_STOP) {
cursor.updatePos(cursor.getPos() + 1);
}
String token2 = parser.parseValue(buf, cursor, null);
try {
minor = Integer.parseInt(token2);
if (minor < 0) {
minor = 0;
}
} catch (NumberFormatException ex) {
}
}