You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2019/12/01 09:16:30 UTC

svn commit: r1870668 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java

Author: tilman
Date: Sun Dec  1 09:16:30 2019
New Revision: 1870668

URL: http://svn.apache.org/viewvc?rev=1870668&view=rev
Log:
PDFBOX-4701: do not use mutable fields in equals()

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java?rev=1870668&r1=1870667&r2=1870668&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java Sun Dec  1 09:16:30 2019
@@ -860,10 +860,6 @@ public final class TextPosition
         {
             return false;
         }
-        if (Float.compare(that.direction, direction) != 0)
-        {
-            return false;
-        }
         if (textMatrix != null ? !textMatrix.equals(that.textMatrix) : that.textMatrix != null)
         {
             return false;
@@ -872,16 +868,9 @@ public final class TextPosition
         {
             return false;
         }
-        if (font != null ? !font.equals(that.font) : that.font != null)
-        {
-            return false;
-        }
-        if (!Arrays.equals(widths, that.widths))
-        {
-            return false;
-        }
-        return unicode != null ? unicode.equals(that.unicode) : that.unicode == null;
-
+        return font != null ? font.equals(that.font) : that.font == null;
+        
+        // If changing this method, do not compare mutable fields (PDFBOX-4701)        
     }
 
     @Override