You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ms...@apache.org on 2020/09/05 05:57:51 UTC

svn commit: r1881479 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java

Author: msahyoun
Date: Sat Sep  5 05:57:50 2020
New Revision: 1881479

URL: http://svn.apache.org/viewvc?rev=1881479&view=rev
Log:
PDFBOX-4723: revert equals and hashCode for COSStream

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java?rev=1881479&r1=1881478&r2=1881479&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java Sat Sep  5 05:57:50 2020
@@ -77,73 +77,6 @@ public class COSStream extends COSDictio
     }
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean equals(Object o) {
-        if (o == this)
-        {
-            return true;
-        }
-
-        if (!(o instanceof COSStream))
-        {
-            return false;
-        }
-
-        COSStream toBeCompared = (COSStream) o;
-
-        if (toBeCompared.size() != size())
-        {
-            return false;
-        }
-
-        // compare dictionary content
-        Iterator<Entry<COSName, COSBase>> iter = entrySet().iterator();
-        while (iter.hasNext())
-        {
-            Entry<COSName, COSBase> entry = iter.next();
-            COSName key = entry.getKey();
-            COSBase value = entry.getValue();
-
-            if (!toBeCompared.containsKey(key)) 
-            {
-                return false;
-            }
-            else if (value == null)
-            {
-                if (toBeCompared.getItem(key) != null)
-                {
-                    return false;
-                }
-            }
-            else if (!value.equals(toBeCompared.getItem(key)))
-            {
-                return false;
-            }
-        }
-
-        // compare stream content
-        if (!toBeCompared.toTextString().equals(toTextString()))
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode() {
-        Object[] members = {items, randomAccess, scratchFile, isWriting};
-        return Arrays.hashCode(members);
-    }
-
-
-    
-    /**
      * Throws if the random access backing store has been closed. Helpful for catching cases where
      * a user tries to use a COSStream which has outlived its COSDocument.
      */