-
Bug
-
Resolution: Duplicate
-
P2
-
7
-
None
-
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.
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.
- duplicates
-
JDK-6487386 Font.equals() incorrectly returns false if getAttributes() is called on just one of the fonts
- Closed
- relates to
-
JDK-4951733 LTP: Stack overflow encoding a derived Font with XMLEncoder
- Closed