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

Equal fonts are not equal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • 7
    • 7
    • client-libs
    • None
    • 2d
    • x86
    • windows_xp

      Let's see 4 cases:

      1) first font is equal to the second one:
              Font f1 = new Font( "serif", Font.BOLD, 12 );
              Font f2 = new Font( "serif", Font.BOLD, 12 );
              System.out.println( f1.equals( f2 ) );
      EXPECT: true
      ACTUAL: true

      2) first font is equal to the second one:
              Font f1 = new Font( "serif", Font.BOLD, 12 ); f1.getAttributes();
              Font f2 = new Font( "serif", Font.BOLD, 12 );
              System.out.println( f1.equals( f2 ) );
      EXPECT: true
      ACTUAL: false

      3) first font is equal to the second one:
              Font f1 = new Font( "serif", Font.BOLD, 12 );
              Font f2 = new Font( "serif", Font.BOLD, 12 ); f2.getAttributes();
              System.out.println( f1.equals( f2 ) );
      EXPECT: true
      ACTUAL: false

      4) first font is equal to the second one:
              Font f1 = new Font( "serif", Font.BOLD, 12 ); f1.getAttributes();
              Font f2 = new Font( "serif", Font.BOLD, 12 ); f2.getAttributes();
              System.out.println( f1.equals( f2 ) );
      EXPECT: true
      ACTUAL: true

      Sources are attached.

            Unassigned Unassigned
            malenkov Sergey Malenkov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: