RFR: 8065988: Duplicated error messages for "no source file" in javac

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Nov 26 21:26:26 UTC 2014


Shinya,

It would be better to just do the increment in the "case LOG:" case, 
when the message is actually reported to the log. In the other two arms 
of the switch statement, an exception is thrown instead of reporting 
anything to the log.

-- Jon


On 11/26/2014 12:25 PM, bitter_fox wrote:
> Another fix is here:
> http://cr.openjdk.java.net/~shinyafox/8065988/webrev.01/ 
> <http://cr.openjdk.java.net/%7Eshinyafox/8065988/webrev.01/>
>
> increment log.nerrors in Argument#error.
>
> I don't know which is better, but it looks beautiful.
>
>
> 2014-11-27 4:59 GMT+09:00 bitter_fox <bitterfoxc at gmail.com 
> <mailto:bitterfoxc at gmail.com>>:
>
>     Hi, Jonathan.
>
>     Because log.nerror is never incremented by printing "file not
>     found" error.
>
>     The error printed in Argument#error:
>                 case ILLEGAL_ARGUMENT: {
>                     String msg = log.localize(PrefixKind.JAVAC, key,
>     args);
>                     throw new PropagatedException(new
>     IllegalArgumentException(msg));
>                 }
>
>     It calls Log#localize, and it doesn't increment log.nerrors.
>
>     So in this case, I think log.nerrors won't work well.
>
>     Regards,
>     Shinya Yoshida(@bitter_fox, shinyafox)
>
>
>     2014-11-27 4:44 GMT+09:00 Jonathan Gibbons
>     <jonathan.gibbons at oracle.com <mailto:jonathan.gibbons at oracle.com>>:
>
>         On 11/26/2014 11:28 AM, bitter_fox wrote:
>
>             Hi,
>             Please review my patch for 8065988.
>
>             I couldn't write the test.
>             Could you write the test for this issue?
>
>             webrev is here:
>             http://cr.openjdk.java.net/~shinyafox/8065988/webrev.00/
>             <http://cr.openjdk.java.net/%7Eshinyafox/8065988/webrev.00/>
>             <http://cr.openjdk.java.net/%7Eshinyafox/8065988/webrev.00/>
>
>             bugs is here:
>             https://bugs.openjdk.java.net/browse/JDK-8065988
>
>             Regards,
>             Shinya Yoshida(@bitter_fox, shinyafox)
>
>
>         Shinya,
>
>         I've read through your patch, but I'd be looking to understand
>         why you need to pass back and use a boolean result from
>         Arguments.init rather than use the existing mechanism of
>         checking log.nerrors.
>
>         -- Jon
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20141126/cde113ad/attachment.html>


More information about the compiler-dev mailing list