JDK-4087772 : Dingbats converter throws ArrayIndexOutofBoundsException
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt:i18n
  • Affected Version: 1.2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.5.1,solaris_2.6
  • CPU: sparc
  • Submitted: 1997-10-21
  • Updated: 1999-01-19
  • Resolved: 1999-01-19
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.
Other
1.2.0 1.2fcsFixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The JDK demo symboltest is throwing an ArrayIndexOutofBoundsException.  I believe it's attempting to display characters in the hex range of x2700 know as DINGBAT characters.   java full version "JDK1.2P2"

/usr/local/java/jdk1.2/solaris/demo/awt-1.1/symboltest

java.lang.ArrayIndexOutOfBoundsException: 149
        at sun.awt.motif.CharToByteX11Dingbats.canConvert(CharToByteX11Dingbats.java:56)
        at sun.awt.PlatformFont.makeConvertedMultiFontChars(PlatformFont.java:412)
        at sun.awt.motif.X11Graphics.drawMFChars(Native Method)
        at sun.awt.motif.X11Graphics.drawChars(X11Graphics.java:342)
        at Symbol.paint(Symbol.java:26)
        at java.awt.Component.dispatchEventImpl(Component.java:1864)
        at java.awt.Component.dispatchEvent(Component.java:1823)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:45)

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.2fcs FIXED IN: 1.2fcs INTEGRATED IN: 1.2fcs VERIFIED IN: 1.2fcs
14-06-2004

SUGGESTED FIX fred.oliver@East 1998-04-08 Fixed in Sunsoft Java. In CharToByteX11Dingbats.canConvert(), change if(ch >= 0x2701 && ch <= 0x27be) { if (table[ch - 0x2700] != 0x00) return true; else return false; } return false; to if (ch >= 0x2701 && ch <= 0x2760) // direct map return true; if (ch >= 0x2761 && ch <= 0x27be) { if (table[ch - 0x2761] != 0x00) // table lookup return true; else return false; } and change a line in convert() from output[outOff + i] = table[ch - 0x2700]; to if (ch >= 0x2761){ output[outOff + i] = table[ch - 0x2761]; // table lookup } else { output[outOff + i] = (byte)(ch + 0x20 - 0x2700); // direct map }
11-06-2004

EVALUATION This happens in the existing awt code and should be looked at by the i18n team. jeet.kaul@Eng 1997-10-27 ---- The mapping table used in the converter is totally bogus and needs to be rewritten. norbert.lindenberg@Eng 1998-01-09 ===== This bug has not been fixed yet cindy.jao@eng 1998-03-19 fred.oliver@East 1998-04-08 It appears that someone intended to simply the JDK1.1 version by making the table big enough to map the whole range, and then changed the code but not the table. ---- Solaris only. Win32 uses different converter for symbols. Exibit the problem on Beta4 "K". koushi.takahashi@japan 1998-07-07
07-07-1998