Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6487386

Font.equals() incorrectly returns false if getAttributes() is called on just one of the fonts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 6, 7
    • client-libs
    • 2d
    • b33
    • 6
    • b03
    • generic, x86
    • generic, windows_xp
    • Verified

        This program below incorrectly prints false since JDK 6 b33 in April 2005 :

        import java.awt.Font;

        public class FNE {

            public static void main(String[] args) throws Exception {
                Font f1 = new Font("Lucida Sans", Font.PLAIN, 12);
                Font cf1 = f1.deriveFont(Font.PLAIN, 12f);
                f1.getAttributes();
                //cf1.getAttributes();
                System.out.println("equal="+f1.equals(cf1));
            }
        }

              prr Philip Race
              prr Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: