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 2016/04/29 23:43:30 UTC

svn commit: r1741701 - /webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessageAdapter.java

Author: veithen
Date: Fri Apr 29 21:43:30 2016
New Revision: 1741701

URL: http://svn.apache.org/viewvc?rev=1741701&view=rev
Log:
Code simplification.

Modified:
    webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessageAdapter.java

Modified: webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessageAdapter.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessageAdapter.java?rev=1741701&r1=1741700&r2=1741701&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessageAdapter.java (original)
+++ webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/MIMEMessageAdapter.java Fri Apr 29 21:43:30 2016
@@ -44,9 +44,6 @@ final class MIMEMessageAdapter extends A
     private final int contentLength;
     private final CountingInputStream filterIS;
 
-    /** <code>boolean</code> Indicating if any streams have been directly requested */
-    private boolean streamsRequested;
-
     /** <code>boolean</code> Indicating if any data handlers have been directly requested */
     private boolean partsRequested;
 
@@ -72,7 +69,7 @@ final class MIMEMessageAdapter extends A
     }
 
     private void requestParts() {
-        if (streamsRequested) {
+        if (streams != null) {
             throw new IllegalStateException("The attachments stream can only be accessed once; either by using the IncomingAttachmentStreams class or by getting a collection of AttachmentPart objects. They cannot both be called within the life time of the same service request.");
         }
         partsRequested = true;
@@ -137,8 +134,6 @@ final class MIMEMessageAdapter extends A
                             "collection of AttachmentPart objects. They cannot both be called within the life time of the same service request.");
         }
         
-        streamsRequested = true;
-        
         if (streams == null) {
             streams = new IncomingAttachmentStreams(message);
         }