On Fri, 12 Feb 2021 13:31:47 GMT, Hannes Wallnöfer <hann...@openjdk.org> wrote:

>> Jonathan Gibbons has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   improve handling of nested links
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
>  line 1082:
> 
>> 1080:                     default -> {
>> 1081:                         assert false;
>> 1082:                         return HtmlTree.EMPTY;
> 
> What is the reason to `assert false` here and in other places instead of, 
> say, always throw a RuntimeException?

This is the general discussion about the use of `assert`, and whether it is 
better to throw an exception in production code, or "carry on regardless". I 
wish Java had a should-not-happen statement or at least a ShoudNotHappen 
exception.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2369

Reply via email to