james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r894496 - /james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeTokenStream.java
Date Tue, 29 Dec 2009 22:18:16 GMT
Author: bago
Date: Tue Dec 29 22:18:16 2009
New Revision: 894496

URL: http://svn.apache.org/viewvc?rev=894496&view=rev
Log:
Small refactoring to better show code duplication in MimeTokenStream creating a new MimeEntity

Modified:
    james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeTokenStream.java

Modified: james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeTokenStream.java
URL: http://svn.apache.org/viewvc/james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeTokenStream.java?rev=894496&r1=894495&r2=894496&view=diff
==============================================================================
--- james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeTokenStream.java
(original)
+++ james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeTokenStream.java
Tue Dec 29 22:18:16 2009
@@ -161,15 +161,10 @@
                 stream, 
                 4 * 1024,
                 config.getMaxLineLen());
-        switch (recursionMode) {
-        case M_RAW:
+        if (recursionMode == M_RAW) {
             RawEntity rawentity = new RawEntity(inbuffer);
             currentStateMachine = rawentity;
-            break;
-        case M_NO_RECURSE:
-        case M_FLAT:
-            // expected to be called only at start of paring
-        case M_RECURSE:
+        } else {
             MimeEntity mimeentity = new MimeEntity(
                     lineSource,
                     inbuffer,
@@ -182,7 +177,6 @@
                 mimeentity.skipHeader(contentType);
             }
             currentStateMachine = mimeentity;
-            break;
         }
         entities.add(currentStateMachine);
         state = currentStateMachine.getState();



Mime
View raw message