james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r895031 - /james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java
Date Fri, 01 Jan 2010 16:08:39 GMT
Author: bago
Date: Fri Jan  1 16:08:38 2010
New Revision: 895031

URL: http://svn.apache.org/viewvc?rev=895031&view=rev
Log:
Make sure unread throws an exception if called before the previous unread buffer has been
fully consumed (Thanks to Oleg for reviewing) (MIME4J-58)

Modified:
    james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java

Modified: james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java
URL: http://svn.apache.org/viewvc/james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java?rev=895031&r1=895030&r2=895031&view=diff
==============================================================================
--- james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java
(original)
+++ james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java
Fri Jan  1 16:08:38 2010
@@ -362,6 +362,9 @@
 
 	@Override
 	public boolean unread(ByteArrayBuffer buf) {
+	    if (tempBuffer) {
+	        throw new IllegalStateException("A previous unreaded buffer has not yet been consumed.");
+	    }
 		origBuffer = buffer;
 		origBuflen = buflen;
 		origBufpos = bufpos;



Mime
View raw message