Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–231 unchanged (231 lines)
232
233 // Check for _allowMultipleMatches - false and at least there is one token - which is _currToken
234 // check for no buffered context _exposedContext - null
235 // If all the conditions matches then check for scalar / non-scalar property
236 if (!_allowMultipleMatches && (_currToken != null) && (_exposedContext == null)) {
237 //if not scalar and ended successfully, and !includePath, then return null
238 if (_currToken.isStructEnd()) {
239 if (_headContext.isStartHandled()) {
240 return (_currToken = null);
241 }
242 } else if (_currToken.isScalarValue()) {
243 //else if scalar, and scalar not present in obj/array and !includePath and INCLUDE_ALL matched once
244 // then return null
245 if (!_headContext.isStartHandled() && (_itemFilter == TokenFilter.INCLUDE_ALL)) {
246 return (_currToken = null);
247 }
248 }
249 }
250 // Anything buffered?
251 TokenFilterContext ctxt = _exposedContext;
252
253 if (ctxt != null) {
254 while (true) {
255 JsonToken t = ctxt.nextTokenToRead();
…lines 256–910 unchanged (655 lines)

After

…lines 1–231 unchanged (231 lines)
232
233 // Check for _allowMultipleMatches - false and at least there is one token - which is _currToken
234 // check for no buffered context _exposedContext - null
235 // If all the conditions matches then check for scalar / non-scalar property
236 if (!_allowMultipleMatches && (_currToken != null) && (_exposedContext == null)) {
237 //if not scalar and ended successfully, and !includePath, then return null
238 if (!_includePath) {
239 if (_currToken.isStructEnd()) {
240 if (_headContext.isStartHandled()) {
241 return (_currToken = null);
242 }
243 } else if (_currToken.isScalarValue()) {
244 //else if scalar, and scalar not present in obj/array and !includePath and INCLUDE_ALL matched once
245 // then return null
246 if (!_headContext.isStartHandled() && (_itemFilter == TokenFilter.INCLUDE_ALL)) {
247 return (_currToken = null);
248 }
249 }
250 }
251 }
252 // Anything buffered?
253 TokenFilterContext ctxt = _exposedContext;
254
255 if (ctxt != null) {
256 while (true) {
…lines 257–912 unchanged (656 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "filter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "OutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "math"
. "."
identifier "BigDecimal"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "math"
. "."
identifier "BigInteger"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "util"
. "."
identifier "JsonParserDelegate"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "JsonTokenId"
. "."
asterisk
* "*"
; ";"
block_comment "/**\n * Specialized {@link JsonParserDelegate} that allows us"...
class_declaration
modifiers
public "public"
class "class"
identifier "FilteringParserDelegate"
superclass
extends "extends"
type_identifier "JsonParserDelegate"
class_body
{ "{"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Object consulted to determine whether to write pa"...
field_declaration
modifiers
protected "protected"
type_identifier "TokenFilter"
variable_declarator
identifier "rootFilter"
; ";"
block_comment "/**\n * Flag that determines whether filtering will conti"...
field_declaration
modifiers
protected "protected"
boolean_type "boolean"
variable_declarator
identifier "_allowMultipleMatches"
; ";"
block_comment "/**\n * Flag that determines whether path leading up to i"...
field_declaration
modifiers
protected "protected"
boolean_type "boolean"
variable_declarator
identifier "_includePath"
; ";"
block_comment "/* NOTE: this feature is included in the first version (2.6)"...
field_declaration
modifiers
marker_annotation
@ "@"
identifier "Deprecated"
protected "protected"
boolean_type "boolean"
variable_declarator
identifier "_includeImmediateParent"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Last token retrieved via {@link #nextToken}, if a"...
field_declaration
modifiers
protected "protected"
type_identifier "JsonToken"
variable_declarator
identifier "_currToken"
; ";"
block_comment "/**\n * Last cleared token, if any: that is, value that w"...
field_declaration
modifiers
protected "protected"
type_identifier "JsonToken"
variable_declarator
identifier "_lastClearedToken"
; ";"
block_comment "/**\n * During traversal this is the actual \"open\" parse "...
field_declaration
modifiers
protected "protected"
type_identifier "TokenFilterContext"
variable_declarator
identifier "_headContext"
; ";"
block_comment "/**\n * In cases where {@link #_headContext} is \"ahead\" o"...
field_declaration
modifiers
protected "protected"
type_identifier "TokenFilterContext"
variable_declarator
identifier "_exposedContext"
; ";"
block_comment "/**\n * State that applies to the item within container, "...
field_declaration
modifiers
protected "protected"
type_identifier "TokenFilter"
variable_declarator
identifier "_itemFilter"
; ";"
block_comment "/**\n * Number of tokens for which {@link TokenFilter#INC"...
field_declaration
modifiers
protected "protected"
integral_type
int "int"
variable_declarator
identifier "_matchCount"
; ";"
block_comment "/*\n /****************************************************"...
constructor_declaration (+70 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
public "public"
type_identifier "TokenFilter"
identifier "getFilter"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "rootFilter"
; ";"
} "}"
block_comment "/**\n * Accessor for finding number of matches, where spe"...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMatchCount"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_matchCount"
; ";"
} "}"
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "JsonToken"
identifier "getCurrentToken"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_currToken"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "JsonToken"
identifier "currentToken"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_currToken"
; ";"
} "}"
method_declaration (+49 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration (+65 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+22 nodes collapsed)
line_comment "// !!! TODO: Verify it works as expected: copied from standa"...
method_declaration (+96 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+38 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "JsonToken"
identifier "getLastClearedToken"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_lastClearedToken"
; ";"
} "}"
method_declaration (+31 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "JsonToken"
identifier "nextToken"
formal_parameters
( "("
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
line_comment "// 23-May-2017, tatu: To be honest, code here is rather hair"...
line_comment "// conditionals; and it seems odd to return `null` but NO"...
line_comment "// as closed... would love a rewrite to simplify/clear up"...
line_comment "// Check for _allowMultipleMatches - false and at least ther"...
line_comment "// check for no buffered context _exposedContext - null"
line_comment "// If all the conditions matches then check for scalar / non"...
if_statement
if "if"
parenthesized_expression (+24 nodes collapsed)
block
{ "{"
line_comment "//if not scalar and ended successfully, and !includePath, th"...
if_statement (+97 nodes collapsed)
} "}"
line_comment "// Anything buffered?"
local_variable_declaration
type_identifier "TokenFilterContext"
variable_declarator
identifier "ctxt"
= "="
identifier "_exposedContext"
; ";"
if_statement (+165 nodes collapsed)
line_comment "// If not, need to read more. If we got any:"
local_variable_declaration
type_identifier "JsonToken"
variable_declarator
identifier "t"
= "="
method_invocation
identifier "delegate"
. "."
identifier "nextToken"
argument_list
( "("
) ")"
; ";"
if_statement (+23 nodes collapsed)
line_comment "// otherwise... to include or not?"
local_variable_declaration
type_identifier "TokenFilter"
variable_declarator
identifier "f"
; ";"
switch_expression (+1032 nodes collapsed)
line_comment "// We get here if token was not yet found; offlined handling"
return_statement
return "return"
method_invocation
identifier "_nextToken2"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Offlined handling for cases where there was no bu"...
method_declaration (+1061 nodes collapsed)
block_comment "/**\n * Method called when a new potentially included con"...
method_declaration (+873 nodes collapsed)
method_declaration (+167 nodes collapsed)
method_declaration (+58 nodes collapsed)
block_comment "/**\n * Need to override, re-implement similar to how met"...
method_declaration (+152 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+27 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+32 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+27 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+27 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+28 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+31 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+27 nodes collapsed)
method_declaration (+36 nodes collapsed)
method_declaration (+38 nodes collapsed)
method_declaration (+24 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+31 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "filter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "OutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "math"
. "."
identifier "BigDecimal"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "math"
. "."
identifier "BigInteger"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "util"
. "."
identifier "JsonParserDelegate"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "JsonTokenId"
. "."
asterisk
* "*"
; ";"
block_comment "/**\n * Specialized {@link JsonParserDelegate} that allows us"...
class_declaration
modifiers
public "public"
class "class"
identifier "FilteringParserDelegate"
superclass
extends "extends"
type_identifier "JsonParserDelegate"
class_body
{ "{"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Object consulted to determine whether to write pa"...
field_declaration
modifiers
protected "protected"
type_identifier "TokenFilter"
variable_declarator
identifier "rootFilter"
; ";"
block_comment "/**\n * Flag that determines whether filtering will conti"...
field_declaration
modifiers
protected "protected"
boolean_type "boolean"
variable_declarator
identifier "_allowMultipleMatches"
; ";"
block_comment "/**\n * Flag that determines whether path leading up to i"...
field_declaration
modifiers
protected "protected"
boolean_type "boolean"
variable_declarator
identifier "_includePath"
; ";"
block_comment "/* NOTE: this feature is included in the first version (2.6)"...
field_declaration
modifiers
marker_annotation
@ "@"
identifier "Deprecated"
protected "protected"
boolean_type "boolean"
variable_declarator
identifier "_includeImmediateParent"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Last token retrieved via {@link #nextToken}, if a"...
field_declaration
modifiers
protected "protected"
type_identifier "JsonToken"
variable_declarator
identifier "_currToken"
; ";"
block_comment "/**\n * Last cleared token, if any: that is, value that w"...
field_declaration
modifiers
protected "protected"
type_identifier "JsonToken"
variable_declarator
identifier "_lastClearedToken"
; ";"
block_comment "/**\n * During traversal this is the actual \"open\" parse "...
field_declaration
modifiers
protected "protected"
type_identifier "TokenFilterContext"
variable_declarator
identifier "_headContext"
; ";"
block_comment "/**\n * In cases where {@link #_headContext} is \"ahead\" o"...
field_declaration
modifiers
protected "protected"
type_identifier "TokenFilterContext"
variable_declarator
identifier "_exposedContext"
; ";"
block_comment "/**\n * State that applies to the item within container, "...
field_declaration
modifiers
protected "protected"
type_identifier "TokenFilter"
variable_declarator
identifier "_itemFilter"
; ";"
block_comment "/**\n * Number of tokens for which {@link TokenFilter#INC"...
field_declaration
modifiers
protected "protected"
integral_type
int "int"
variable_declarator
identifier "_matchCount"
; ";"
block_comment "/*\n /****************************************************"...
constructor_declaration (+70 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
public "public"
type_identifier "TokenFilter"
identifier "getFilter"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "rootFilter"
; ";"
} "}"
block_comment "/**\n * Accessor for finding number of matches, where spe"...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMatchCount"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_matchCount"
; ";"
} "}"
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "JsonToken"
identifier "getCurrentToken"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_currToken"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "JsonToken"
identifier "currentToken"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_currToken"
; ";"
} "}"
method_declaration (+49 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration (+65 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+22 nodes collapsed)
line_comment "// !!! TODO: Verify it works as expected: copied from standa"...
method_declaration (+96 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+38 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "JsonToken"
identifier "getLastClearedToken"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_lastClearedToken"
; ";"
} "}"
method_declaration (+31 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "JsonToken"
identifier "nextToken"
formal_parameters
( "("
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
line_comment "// 23-May-2017, tatu: To be honest, code here is rather hair"...
line_comment "// conditionals; and it seems odd to return `null` but NO"...
line_comment "// as closed... would love a rewrite to simplify/clear up"...
line_comment "// Check for _allowMultipleMatches - false and at least ther"...
line_comment "// check for no buffered context _exposedContext - null"
line_comment "// If all the conditions matches then check for scalar / non"...
if_statement
if "if"
parenthesized_expression (+24 nodes collapsed)
block
{ "{"
line_comment "//if not scalar and ended successfully, and !includePath, th"...
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
identifier "_includePath"
) ")"
block
{ "{"
if_statement (+97 nodes collapsed)
} "}"
} "}"
line_comment "// Anything buffered?"
local_variable_declaration
type_identifier "TokenFilterContext"
variable_declarator
identifier "ctxt"
= "="
identifier "_exposedContext"
; ";"
if_statement (+165 nodes collapsed)
line_comment "// If not, need to read more. If we got any:"
local_variable_declaration
type_identifier "JsonToken"
variable_declarator
identifier "t"
= "="
method_invocation
identifier "delegate"
. "."
identifier "nextToken"
argument_list
( "("
) ")"
; ";"
if_statement (+23 nodes collapsed)
line_comment "// otherwise... to include or not?"
local_variable_declaration
type_identifier "TokenFilter"
variable_declarator
identifier "f"
; ";"
switch_expression (+1032 nodes collapsed)
line_comment "// We get here if token was not yet found; offlined handling"
return_statement
return "return"
method_invocation
identifier "_nextToken2"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Offlined handling for cases where there was no bu"...
method_declaration (+1061 nodes collapsed)
block_comment "/**\n * Method called when a new potentially included con"...
method_declaration (+873 nodes collapsed)
method_declaration (+167 nodes collapsed)
method_declaration (+58 nodes collapsed)
block_comment "/**\n * Need to override, re-implement similar to how met"...
method_declaration (+152 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+27 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+32 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+27 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+27 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+28 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+31 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+27 nodes collapsed)
method_declaration (+36 nodes collapsed)
method_declaration (+38 nodes collapsed)
method_declaration (+24 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+31 nodes collapsed)
} "}"