< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEParser.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -121,10 +121,15 @@
             return !parsed;
         }
 
         @Override
         public MIMEEvent next() {
+
+            if (parsed) {
+                throw new NoSuchElementException();
+            }
+
             switch(state) {
                 case START_MESSAGE :
                     if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.START_MESSAGE);}
                     state = STATE.SKIP_PREAMBLE;
                     return MIMEEvent.START_MESSAGE;
< prev index next >