You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2011/07/31 09:43:37 UTC

svn commit: r1152556 - /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java

Author: veithen
Date: Sun Jul 31 07:43:36 2011
New Revision: 1152556

URL: http://svn.apache.org/viewvc?rev=1152556&view=rev
Log:
Reviewed the implementation of Attachments#removeDataHandler:
* Removed a comment making an incorrect statement about the behavior of getNextPartDataHandler; the method actually returns null (instead of throwing an exception) when the end of the stream is reached
* Avoid fetching additional MIME parts after the part requested for removal has been found

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java?rev=1152556&r1=1152555&r2=1152556&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java Sun Jul 31 07:43:36 2011
@@ -377,11 +377,10 @@ public class Attachments implements OMAt
         if (attachmentsMap.containsKey(blobContentID)) {
             attachmentsMap.remove(blobContentID);
         } else if (!noStreams) {
-            //This loop will be terminated by the Exceptions thrown if the Mime
-            // part searching was not found
             while (this.getNextPartDataHandler() != null) {
                 if (attachmentsMap.containsKey(blobContentID)) {
                     attachmentsMap.remove(blobContentID);
+                    break;
                 }
             }
         }