On Wed, 28 Apr 2021 00:12:44 GMT, Xue-Lei Andrew Fan <xue...@openjdk.org> wrote:
>> src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java line 1694: >> >>> 1692: if (cause instanceof SocketException) { >>> 1693: try { >>> 1694: throw conContext.fatal(alert, cause); >> >> Why did you change to a throw here? Isn't everything from fatal() going to >> be thrown anyway? > > The fatal() will always throw an exception. We could use the method without > throw. In some places, IDE or compiler could complain because it cannot > detect that the fatal() method will throw and the program ends here. In the > past, we use fatal() method without throw, later we change the fatal() return > value form "void" to an exception so that throw could be used to mitigate the > IDE or compiler complaints. > > It is not really necessary to make this code change here. I just want to > make the coding style consistent for the fatal() calling. Interesting, ok. I don't recall seeing such situations with the IDE I often use. (Netbeans) ------------- PR: https://git.openjdk.java.net/jdk/pull/3292