< prev index next >
src/java.desktop/share/classes/java/awt/Font.java
Print this page
rev 14936 : 8160721: Avoid deoptimizations in Font.equals.
*** 1811,1822 ****
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
! if (obj != null) {
! try {
Font font = (Font)obj;
if (size == font.size &&
style == font.style &&
nonIdentityTx == font.nonIdentityTx &&
hasLayoutAttributes == font.hasLayoutAttributes &&
--- 1811,1821 ----
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
! if (obj != null && obj instanceof Font) {
Font font = (Font)obj;
if (size == font.size &&
style == font.style &&
nonIdentityTx == font.nonIdentityTx &&
hasLayoutAttributes == font.hasLayoutAttributes &&
*** 1838,1850 ****
} else {
return values.equals(font.getAttributeValues());
}
}
}
- catch (ClassCastException e) {
- }
- }
return false;
}
/**
* Converts this {@code Font} object to a {@code String}
--- 1837,1846 ----
< prev index next >