Skip to content
Permalink
Browse files
Merge remote-tracking branch 'dmak/MIME4J-280'
  • Loading branch information
aduprat committed Sep 13, 2018
2 parents 64b332b + c0513d9 commit ae77907e341a86690cf3d49d84b03f27cb27d0b2
Showing 6 changed files with 18 additions and 18 deletions.
@@ -224,7 +224,7 @@ private void parse() {
} catch (ParseException e) {
parseException = e;
} catch (TokenMgrError e) {
parseException = new ParseException(e.getMessage());
parseException = new ParseException(e);
}

final String dispositionType = parser.getDispositionType();
@@ -197,7 +197,7 @@ private void parse() {
} catch (ParseException e) {
parseException = e;
} catch (TokenMgrError e) {
parseException = new ParseException(e.getMessage());
parseException = new ParseException(e);
}

mediaType = parser.getType();
@@ -73,7 +73,7 @@ private void parse() {
} catch (ParseException e) {
parseException = e;
} catch (TokenMgrError e) {
parseException = new ParseException(e.getMessage());
parseException = new ParseException(e);
}

parsed = true;
@@ -70,16 +70,16 @@ public Address buildAddress(ASTaddress node, DecodeMonitor monitor) throws Parse
try {
name = DecoderUtil.decodeEncodedWords(name, monitor);
} catch (IllegalArgumentException e) {
throw new ParseException(e.getMessage());
throw new ParseException(e);
}
Mailbox mb = buildAngleAddr((ASTangle_addr) n2);
return new Mailbox(name, mb.getRoute(), mb.getLocalPart(),
mb.getDomain());
} else {
throw new ParseException();
throw new ParseException("Address \"group_body\" or \"angle_addr\" is expected but got \"" + n + "\"");
}
} else {
throw new ParseException();
throw new ParseException("Address \"phrase\" is expected but got \"" + n + "\"");
}
}

@@ -91,7 +91,7 @@ private MailboxList buildGroupBody(ASTgroup_body node, DecodeMonitor monitor) th
if (n instanceof ASTmailbox)
results.add(buildMailbox((ASTmailbox) n, monitor));
else
throw new ParseException();
throw new ParseException("Address \"mailbox\" is expected but got \"" + n + "\"");
}
return new MailboxList(results, true);
}
@@ -106,7 +106,7 @@ public Mailbox buildMailbox(ASTmailbox node, DecodeMonitor monitor) throws Parse
} else if (n instanceof ASTname_addr) {
return buildNameAddr((ASTname_addr) n, monitor);
} else {
throw new ParseException();
throw new ParseException("Address \"addr_spec\" or \"angle_addr\" or \"name_addr\" is expected but got \"" + n + "\"");
}
}

@@ -117,21 +117,21 @@ private Mailbox buildNameAddr(ASTname_addr node, DecodeMonitor monitor) throws P
if (n instanceof ASTphrase) {
name = buildString((ASTphrase) n, false);
} else {
throw new ParseException();
throw new ParseException("Address \"phrase\" is expected but got \"" + n + "\"");
}

n = it.next();
if (n instanceof ASTangle_addr) {
try {
name = DecoderUtil.decodeEncodedWords(name, monitor);
} catch (IllegalArgumentException e) {
throw new ParseException(e.getMessage());
throw new ParseException(e);
}
Mailbox mb = buildAngleAddr((ASTangle_addr) n);
return new Mailbox(name, mb.getRoute(), mb.getLocalPart(),
mb.getDomain());
} else {
throw new ParseException();
throw new ParseException("Address \"angle_addr\" is expected but got \"" + n + "\"");
}
}

@@ -146,12 +146,12 @@ private Mailbox buildAngleAddr(ASTangle_addr node) throws ParseException {
// do nothing
}
else
throw new ParseException();
throw new ParseException("Address \"route\" or \"addr_spec\" is expected but got \"" + n + "\"");

if (n instanceof ASTaddr_spec)
return buildAddrSpec(route, (ASTaddr_spec) n);
else
throw new ParseException();
throw new ParseException("Address \"addr_spec\" is expected but got \"" + n + "\"");
}

private DomainList buildRoute(ASTroute node) throws ParseException {
@@ -162,7 +162,7 @@ private DomainList buildRoute(ASTroute node) throws ParseException {
if (n instanceof ASTdomain)
results.add(buildString((ASTdomain) n, true));
else
throw new ParseException();
throw new ParseException("Address \"domain\" is expected but got \"" + n + "\"");
}
return new DomainList(results);
}
@@ -84,7 +84,7 @@ void parse() :
this.major = Integer.parseInt(major.image);
this.minor = Integer.parseInt(minor.image);
} catch (NumberFormatException e) {
throw new ParseException(e.getMessage());
throw new ParseException(e);
}
}
}
@@ -77,7 +77,7 @@ public class AddressListParser {
parseAddressList0();
return (ASTaddress_list) jjtree.rootNode();
} catch (TokenMgrError tme) {
throw new ParseException(tme.getMessage());
throw new ParseException(tme);
}
}

@@ -86,7 +86,7 @@ public class AddressListParser {
parseAddress0();
return (ASTaddress) jjtree.rootNode();
} catch (TokenMgrError tme) {
throw new ParseException(tme.getMessage());
throw new ParseException(tme);
}
}

@@ -95,7 +95,7 @@ public class AddressListParser {
parseMailbox0();
return (ASTmailbox) jjtree.rootNode();
} catch (TokenMgrError tme) {
throw new ParseException(tme.getMessage());
throw new ParseException(tme);
}
}

0 comments on commit ae77907

Please sign in to comment.