Undo fix for #330 due to regression in other areas (need more tests)
diff --git a/src/main/java/com/fasterxml/jackson/core/filter/FilteringParserDelegate.java b/src/main/java/com/fasterxml/jackson/core/filter/FilteringParserDelegate.java
index 5274f33..6fd5f82 100644
--- a/src/main/java/com/fasterxml/jackson/core/filter/FilteringParserDelegate.java
+++ b/src/main/java/com/fasterxml/jackson/core/filter/FilteringParserDelegate.java
@@ -233,20 +233,17 @@
// Check for _allowMultipleMatches - false and at least there is one token - which is _currToken
// check for no buffered context _exposedContext - null
// If all the conditions matches then check for scalar / non-scalar property
+
if (!_allowMultipleMatches && (_currToken != null) && (_exposedContext == null)) {
- //if not scalar and ended successfully, and !includePath, then return null
- if (!_includePath) {
- if (_currToken.isStructEnd()) {
- if (_headContext.isStartHandled()) {
- return (_currToken = null);
- }
- } else if (_currToken.isScalarValue()) {
- //else if scalar, and scalar not present in obj/array and !includePath and INCLUDE_ALL matched once
- // then return null
- if (!_headContext.isStartHandled() && (_itemFilter == TokenFilter.INCLUDE_ALL)) {
- return (_currToken = null);
- }
- }
+ // if not scalar and ended successfully, then return null
+ if ((_currToken.isStructEnd() && _headContext.isStartHandled()) ){
+ return (_currToken = null);
+ }
+ // else if scalar, and scalar not present in obj/array and !includePath and INCLUDE_ALL
+ // matched once, return null
+ if (_currToken.isScalarValue() && !_headContext.isStartHandled() && !_includePath
+ && (_itemFilter == TokenFilter.INCLUDE_ALL)) {
+ return (_currToken = null);
}
}
// Anything buffered?