-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
7
-
generic
-
generic
Platform: All
JDK: 7, 6
Class java.awt.font.TextLayout overrides method equals() which says:
/**
* Returns <code>true</code> if the specified <code>Object</code> is a
* <code>TextLayout</code> object and if the specified <code>Object</code>
* equals this <code>TextLayout</code>.
In fact it happens only if layouts are the same instance.
-----------------------------------------------
import java.awt.*;
import java.awt.font.*;
public class Temp {
public static void main(String[] args) {
String string = "01234567890123456789";
Font font = new Font("Helvetica", Font.PLAIN, 12);
FontRenderContext fontRenderContext = new FontRenderContext(null, true, true);
TextLayout layout_1 = new TextLayout(string, font, fontRenderContext);
TextLayout layout_2 = new TextLayout(string, font, fontRenderContext);
boolean areEqual = (layout_1.equals(layout_2));
System.out.println("areEqual = " + areEqual);
}
}
-----------------------------------------------
JDK: 7, 6
Class java.awt.font.TextLayout overrides method equals() which says:
/**
* Returns <code>true</code> if the specified <code>Object</code> is a
* <code>TextLayout</code> object and if the specified <code>Object</code>
* equals this <code>TextLayout</code>.
In fact it happens only if layouts are the same instance.
-----------------------------------------------
import java.awt.*;
import java.awt.font.*;
public class Temp {
public static void main(String[] args) {
String string = "01234567890123456789";
Font font = new Font("Helvetica", Font.PLAIN, 12);
FontRenderContext fontRenderContext = new FontRenderContext(null, true, true);
TextLayout layout_1 = new TextLayout(string, font, fontRenderContext);
TextLayout layout_2 = new TextLayout(string, font, fontRenderContext);
boolean areEqual = (layout_1.equals(layout_2));
System.out.println("areEqual = " + areEqual);
}
}
-----------------------------------------------
- duplicates
-
JDK-4497648 TextLayout equals method is not implemented
-
- Resolved
-