EVALUATION
The fix is to set the "errorValue" back into "errno" then let
JNU_ThrowByNameWithLastError do the job.
A regression test is NOT included in the bugfix putback, because it's hard to
write a good one, which probably needs to figure out how to handle/play with
(1)a local version of OS (2)appropriately installed l10n message pacakges (3)set
the correct testing locale (4)run the java test case (5)the test case also need
to figure out how to verify an output text msessage is "correct" (not garbled),
meant you need to find an appropriate "golden data" based on the locale/os/version
to match the output...probably not worth the energy. A simple test case below
can help you manually verify the bug and its fix, for example on a Japanese Solaris
do something like
(1)setenv LC_ALL ja
(2)java ExceptionMsg 2>& output
(3)verify the text in "output" via a browser, with encoding set to euc-jp.
public class ExceptionMsg {
public static void main(String[] args) throws Throwable{
try {
SocketChannel socketChannel = SocketChannel.open();
boolean b = socketChannel.connect(new InetSocketAddress("javaweb.sfbay", 4444));
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
}
|