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

1package com.fasterxml.jackson.databind.node;
2
3import com.fasterxml.jackson.annotation.JsonAutoDetect;
4import com.fasterxml.jackson.core.*;
5import com.fasterxml.jackson.databind.JsonNode;
6import com.fasterxml.jackson.databind.SerializerProvider;
7import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
8
9import java.io.IOException;
…lines 10–317 unchanged (308 lines)
318 * @param properties Properties to add
319 *
320 * @return This node after adding/replacing property values (to allow chaining)
321 *
322 * @since 2.1
323 */
324 public JsonNode setAll(Map<String,? extends JsonNode> properties)
325 {
326 for (Map.Entry<String,? extends JsonNode> en : properties.entrySet()) {
327 JsonNode n = en.getValue();
328 if (n == null) {
329 n = nullNode();
330 }
…lines 331–807 unchanged (477 lines)

After

1package com.fasterxml.jackson.databind.node;
2
3import com.fasterxml.jackson.annotation.JsonAutoDetect;
4import com.fasterxml.jackson.annotation.JsonIgnore;
5import com.fasterxml.jackson.core.*;
6import com.fasterxml.jackson.databind.JsonNode;
7import com.fasterxml.jackson.databind.SerializerProvider;
8import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
9
10import java.io.IOException;
…lines 11–318 unchanged (308 lines)
319 * @param properties Properties to add
320 *
321 * @return This node after adding/replacing property values (to allow chaining)
322 *
323 * @since 2.1
324 */
325 @JsonIgnore // work-around for [databind#815]
326 public JsonNode setAll(Map<String,? extends JsonNode> properties)
327 {
328 for (Map.Entry<String,? extends JsonNode> en : properties.entrySet()) {
329 JsonNode n = en.getValue();
330 if (n == null) {
331 n = nullNode();
…lines 332–809 unchanged (478 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "annotation"
. "."
identifier "JsonAutoDetect"
; ";"
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
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "JsonNode"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "SerializerProvider"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsontype"
. "."
identifier "TypeSerializer"
; ";"
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 "math"
. "."
identifier "BigDecimal"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Arrays"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "LinkedHashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * Node that maps to JSON Object structures in JSON cont"...
class_declaration
modifiers
public "public"
class "class"
identifier "ObjectNode"
superclass
extends "extends"
generic_type
type_identifier "ContainerNode"
type_arguments
< "<"
type_identifier "ObjectNode"
> ">"
class_body
{ "{"
line_comment "// Note: LinkedHashMap for backwards compatibility"
field_declaration
modifiers
protected "protected"
final "final"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "JsonNode"
> ">"
variable_declarator
identifier "_children"
; ";"
constructor_declaration (+38 nodes collapsed)
block_comment "/**\n * @since 2.4\n */"
constructor_declaration (+37 nodes collapsed)
method_declaration (+32 nodes collapsed)
block_comment "/* Question: should this delegate to `JsonNodeFactory`? It d"...
line_comment "// note: co-variant for type safety"
method_declaration (+98 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+21 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration (+35 nodes collapsed)
method_declaration (+22 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+35 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Method to use for accessing all fields (with both"...
method_declaration (+45 nodes collapsed)
method_declaration (+133 nodes collapsed)
method_declaration (+133 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+116 nodes collapsed)
method_declaration (+154 nodes collapsed)
method_declaration (+160 nodes collapsed)
method_declaration (+114 nodes collapsed)
method_declaration (+148 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method that can be called to serialize this node "...
method_declaration (+113 nodes collapsed)
method_declaration (+122 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method that will set specified field, replacing o"...
method_declaration (+56 nodes collapsed)
block_comment "/**\n * Method for adding given properties to this object"...
method_declaration
modifiers
public "public"
type_identifier "JsonNode"
identifier "setAll"
formal_parameters
( "("
formal_parameter
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
wildcard
? "?"
extends "extends"
type_identifier "JsonNode"
> ">"
identifier "properties"
) ")"
block (+90 nodes collapsed)
block_comment "/**\n * Method for adding all properties of the given Obj"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Method for replacing value of specific property w"...
method_declaration (+54 nodes collapsed)
block_comment "/**\n * Method for removing field entry from this ObjectN"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Method for removing specified field properties ou"...
method_declaration (+39 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method that will set specified field, replacing o"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Method for removing field entry from this ObjectN"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Method for removing specified field properties ou"...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Method for removing all field properties, such th"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Method for adding given properties to this object"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Method for adding all properties of the given Obj"...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Method for removing all field properties out of t"...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Method for removing all field properties out of t"...
method_declaration (+32 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method that will construct an ArrayNode and add i"...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Method that will construct an ObjectNode and add "...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * @return This node (to allow chaining)\n */"
method_declaration (+34 nodes collapsed)
block_comment "/**\n * @return This node (to allow chaining)\n */"
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+54 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+72 nodes collapsed)
block_comment "/**\n * @since 2.3\n */"
method_declaration (+28 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration (+191 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+34 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "annotation"
. "."
identifier "JsonAutoDetect"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "annotation"
. "."
identifier "JsonIgnore"
; ";"
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
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "JsonNode"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "SerializerProvider"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsontype"
. "."
identifier "TypeSerializer"
; ";"
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 "math"
. "."
identifier "BigDecimal"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Arrays"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "LinkedHashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * Node that maps to JSON Object structures in JSON cont"...
class_declaration
modifiers
public "public"
class "class"
identifier "ObjectNode"
superclass
extends "extends"
generic_type
type_identifier "ContainerNode"
type_arguments
< "<"
type_identifier "ObjectNode"
> ">"
class_body
{ "{"
line_comment "// Note: LinkedHashMap for backwards compatibility"
field_declaration
modifiers
protected "protected"
final "final"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "JsonNode"
> ">"
variable_declarator
identifier "_children"
; ";"
constructor_declaration (+38 nodes collapsed)
block_comment "/**\n * @since 2.4\n */"
constructor_declaration (+37 nodes collapsed)
method_declaration (+32 nodes collapsed)
block_comment "/* Question: should this delegate to `JsonNodeFactory`? It d"...
line_comment "// note: co-variant for type safety"
method_declaration (+98 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+21 nodes collapsed)
method_declaration (+21 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration (+35 nodes collapsed)
method_declaration (+22 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+35 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Method to use for accessing all fields (with both"...
method_declaration (+45 nodes collapsed)
method_declaration (+133 nodes collapsed)
method_declaration (+133 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+116 nodes collapsed)
method_declaration (+154 nodes collapsed)
method_declaration (+160 nodes collapsed)
method_declaration (+114 nodes collapsed)
method_declaration (+148 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method that can be called to serialize this node "...
method_declaration (+113 nodes collapsed)
method_declaration (+122 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method that will set specified field, replacing o"...
method_declaration (+56 nodes collapsed)
block_comment "/**\n * Method for adding given properties to this object"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "JsonIgnore"
line_comment "// work-around for [databind#815]"
public "public"
type_identifier "JsonNode"
identifier "setAll"
formal_parameters
( "("
formal_parameter
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
wildcard
? "?"
extends "extends"
type_identifier "JsonNode"
> ">"
identifier "properties"
) ")"
block (+90 nodes collapsed)
block_comment "/**\n * Method for adding all properties of the given Obj"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Method for replacing value of specific property w"...
method_declaration (+54 nodes collapsed)
block_comment "/**\n * Method for removing field entry from this ObjectN"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Method for removing specified field properties ou"...
method_declaration (+39 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method that will set specified field, replacing o"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Method for removing field entry from this ObjectN"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Method for removing specified field properties ou"...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Method for removing all field properties, such th"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Method for adding given properties to this object"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Method for adding all properties of the given Obj"...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Method for removing all field properties out of t"...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Method for removing all field properties out of t"...
method_declaration (+32 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method that will construct an ArrayNode and add i"...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Method that will construct an ObjectNode and add "...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * @return This node (to allow chaining)\n */"
method_declaration (+34 nodes collapsed)
block_comment "/**\n * @return This node (to allow chaining)\n */"
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Alternative method that we need to avoid bumping "...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Method for setting value of a field to specified "...
method_declaration (+54 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+72 nodes collapsed)
block_comment "/**\n * @since 2.3\n */"
method_declaration (+28 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration (+191 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+34 nodes collapsed)
} "}"