summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorTania Bento <tbento@redhat.com>2006-11-24 21:32:03 +0000
committerTania Bento <tbento@redhat.com>2006-11-24 21:32:03 +0000
commita10e1e8fd32383f5eb21aa2250cc45878a69da9d (patch)
treec65c1a15080fdb368e41c349338cc074743f5495 /java
parent5a348add86cf8b31de3944d9053d9c870947c5d9 (diff)
downloadclasspath-a10e1e8fd32383f5eb21aa2250cc45878a69da9d.tar.gz
2006-11-24 Tania Bento <tbento@redhat.com>
* java/awt/font/TextHitInfo.java (equals(TextHitInfo)): If TextHitInfo parameter is null, return false. (beforeOffset): Decreased first parameter by 1.
Diffstat (limited to 'java')
-rw-r--r--java/awt/font/TextHitInfo.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/java/awt/font/TextHitInfo.java b/java/awt/font/TextHitInfo.java
index 2b23e1963..f6fee1add 100644
--- a/java/awt/font/TextHitInfo.java
+++ b/java/awt/font/TextHitInfo.java
@@ -81,6 +81,9 @@ public final class TextHitInfo
public boolean equals(TextHitInfo hitInfo)
{
+ if (hitInfo == null)
+ return false;
+
return (charIndex == hitInfo.getCharIndex ())
&& (leadingEdge == hitInfo.isLeadingEdge ());
}
@@ -97,7 +100,7 @@ public final class TextHitInfo
public static TextHitInfo beforeOffset(int offset)
{
- return new TextHitInfo (offset, false);
+ return new TextHitInfo ((offset - 1), false);
}
public static TextHitInfo afterOffset(int offset)