JDK-7021987 : native2ascii "file cannot be read" error message is broken
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_redhat_5.0
  • CPU: x86
  • Submitted: 2011-02-24
  • Updated: 2011-04-27
  • Resolved: 2011-04-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b134Fixed
Related Reports
Relates :  
Description
Tested using jdk7 promoted b130.
When did following, error message is not correctly showing the file path.

bash-3.2$ native2ascii xxx
java.lang.Exception: [Ljava.lang.String;@1e91259 could not be read.

It should say "xxx could not be read." instead.
The fix for this bug adds a new test case. When this
test is used on older bits, the test now fails:

     sun/tools/native2ascii/Native2AsciiTests.sh

Comments
SUGGESTED FIX diff -r b7e763a573a4 src/share/classes/sun/tools/native2ascii/Main.java --- a/src/share/classes/sun/tools/native2ascii/Main.java Tue Mar 01 12:03:44 2011 +0000 +++ b/src/share/classes/sun/tools/native2ascii/Main.java Wed Mar 02 10:32:13 2011 +0000 @@ -363,9 +363,7 @@ public class Main { private String formatMsg(String key, String arg) { String msg = getMsg(key); - String[] args = new String[1]; - args[0] = arg; - return MessageFormat.format(msg, (Object)args); + return MessageFormat.format(msg, arg); }
02-03-2011

EVALUATION The changes for 4921754 fixed a warning but didn't get it right.
02-03-2011