james-mime4j-dev mailing list archives

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

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

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

Modified: james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java
URL: http://svn.apache.org/viewvc/james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java?rev=894493&r1=894492&r2=894493&view=diff
==============================================================================
--- james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java
(original)
+++ james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java
Tue Dec 29 22:08:29 2009
@@ -277,6 +277,10 @@
     }
     
     private EntityStateMachine nextMimeEntity() {
+    	return nextMimeEntity(EntityStates.T_START_BODYPART, EntityStates.T_END_BODYPART);
+    }
+    
+    private EntityStateMachine nextMimeEntity(int startState, int endState) {
         if (recursionMode == RecursionMode.M_RAW) {
             RawEntity message = new RawEntity(mimeStream);
             return message;
@@ -289,8 +293,8 @@
                     lineSource, 
                     stream,
                     body, 
-                    EntityStates.T_START_BODYPART, 
-                    EntityStates.T_END_BODYPART,
+                    startState, 
+                    endState,
                     config);
             mimeentity.setRecursionMode(recursionMode);
             return mimeentity;



Mime
View raw message