-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1
-
None
-
x86, sparc
-
solaris_2.5, windows_nt
Name: mc57594 Date: 01/27/97
getWidths calls charWidth, which calls getWidths, and back again until the stack is hammered.
This is code from java.awt.FontMetrics.java v. 1.14: (comments mine)
public int charWidth(char ch) { if (ch < 256) { return getWidths()[ch]; // YOW! } char data[] = {ch}; return charsWidth(data, 0, 1); }
public int[] getWidths() { int widths[] = new int[256]; for (char ch = 0 ; ch < 256 ; ch++) { widths[ch] = charWidth(ch); // Whoops! } return widths; }
======================================================================
- duplicates
-
JDK-4032165 java.awt.FontMetrics class has mutual recursive methods.
-
- Closed
-
-
JDK-4007374 FontMetrics has circular method calls
-
- Closed
-