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