bug in ParserRuntimeException.ctor

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug in ParserRuntimeException.ctor

olsin
Hello,
I hit a small problem.
In
    public ParserRuntimeException(Throwable cause, String message, Object... messageArgs) {
        super(String.format(message, messageArgs), cause);
    }
when
  messageArgs == Object[0]
instead of the cause getting
    java.util.MissingFormatArgumentException: Format specifier 'd'
        at java.util.Formatter.format(Formatter.java:2466)
        at java.util.Formatter.format(Formatter.java:2401)
        at java.lang.String.format(String.java:2845)
        at org.parboiled.errors.ParserRuntimeException.<init>(ParserRuntimeException.java:40)
        at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:328)
        at org.parboiled.parserunners.BasicParseRunner$Handler.matchRoot(BasicParseRunner.java:115)
        at org.parboiled.parserunners.BasicParseRunner.runRootContext(BasicParseRunner.java:105)
        at org.parboiled.parserunners.BasicParseRunner.runRootContext(BasicParseRunner.java:98)
        at org.parboiled.parserunners.ReportingParseRunner.runRootContext(ReportingParseRunner.java:73)
        at org.parboiled.parserunners.BasicParseRunner.run(BasicParseRunner.java:92)
        at org.parboiled.parserunners.BasicParseRunner.run(BasicParseRunner.java:87)
        at org.parboiled.parserunners.BasicParseRunner.run(BasicParseRunner.java:83)
             ...

P.S. A REAL COOL THING. I was using CTTL in C++ (EBNF as C++ templates), and was looking for smth similar Java - of all offerrings parboiled rocks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: bug in ParserRuntimeException.ctor

mathias
Administrator
Hi Olsin,

oh man, your message has been sitting for months in my spam heap without being noticed.
Sorry!

Thanks for the report (and the praise), will be fixed with the next release!

Cheers,
Mathias

---
mathias@parboiled.org
http://www.parboiled.org
Loading...