diff -r 6cdc6ed98780 -r b99d7e355d4b src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Loader.java --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Loader.java Thu Aug 08 10:10:38 2013 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Loader.java Fri Aug 23 09:57:21 2013 +0100 @@ -94,11 +94,15 @@ @SuppressWarnings({"StringEquality"}) protected final void reportUnexpectedChildElement(TagName ea, boolean canRecover) throws SAXException { - if(canRecover && !UnmarshallingContext.getInstance().parent.hasEventHandler()) + if (canRecover) { // this error happens particurly often (when input documents contain a lot of unexpected elements to be ignored), // so don't bother computing all the messages and etc if we know that // there's no event handler to receive the error in the end. See #286 - return; + UnmarshallingContext context = UnmarshallingContext.getInstance(); + if (!context.parent.hasEventHandler() // is somebody listening? + || !context.shouldErrorBeReported()) // should we report error? + return; + } if(ea.uri!=ea.uri.intern() || ea.local!=ea.local.intern()) reportError(Messages.UNINTERNED_STRINGS.format(), canRecover ); else