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–186 unchanged (186 lines)
187 // [Issue#133]: beware of super long indexes; assume we never
188 // have arrays over 2 billion entries so ints are fine.
189 if (len == 0 || len > 10) {
190 return -1;
191 }
192 for (int i = 0; i < len; ++i) {
193 char c = str.charAt(i++);
194 if (c > '9' || c < '0') {
195 return -1;
196 }
197 }
198 if (len == 10) {
199 long l = NumberInput.parseLong(str);
…lines 200–270 unchanged (71 lines)

After

…lines 1–186 unchanged (186 lines)
187 // [Issue#133]: beware of super long indexes; assume we never
188 // have arrays over 2 billion entries so ints are fine.
189 if (len == 0 || len > 10) {
190 return -1;
191 }
192 for (int i = 0; i < len; ++i) {
193 char c = str.charAt(i);
194 if (c > '9' || c < '0') {
195 return -1;
196 }
197 }
198 if (len == 10) {
199 long l = NumberInput.parseLong(str);
…lines 200–270 unchanged (71 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "io"
. "."
identifier "NumberInput"
; ";"
block_comment "/**\n * Implementation of\n * <a href=\"http://tools.ietf.org/h"...
class_declaration
modifiers
public "public"
class "class"
identifier "JsonPointer"
class_body
{ "{"
block_comment "/**\n * Marker instance used to represent segment that ma"...
field_declaration
modifiers
protected "protected"
final "final"
static "static"
type_identifier "JsonPointer"
variable_declarator
identifier "EMPTY"
= "="
object_creation_expression
new "new"
type_identifier "JsonPointer"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Reference to rest of the pointer beyond currently"...
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "JsonPointer"
variable_declarator
identifier "_nextSegment"
; ";"
block_comment "/**\n * We will retain representation of the pointer, as "...
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "String"
variable_declarator
identifier "_asString"
; ";"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "String"
variable_declarator
identifier "_matchingPropertyName"
; ";"
field_declaration
modifiers
protected "protected"
final "final"
integral_type
int "int"
variable_declarator
identifier "_matchingElementIndex"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Constructor used for creating \"empty\" instance, u"...
constructor_declaration (+40 nodes collapsed)
block_comment "/**\n * Constructor used for creating non-empty Segments\n"...
constructor_declaration (+51 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Factory method that parses given input and constr"...
method_declaration (+107 nodes collapsed)
block_comment "/**\n * Alias for {@link #compile}; added to make instanc"...
method_declaration (+24 nodes collapsed)
block_comment "/* Factory method that composes a pointer instance, given a "...
block_comment "/* TODO!\n public static JsonPointer fromSegment(String..."...
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "matches"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "_nextSegment"
== "=="
null_literal "null"
; ";"
} "}"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getMatchingProperty"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_matchingPropertyName"
; ";"
} "}"
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMatchingIndex"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_matchingElementIndex"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "mayMatchProperty"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "_matchingPropertyName"
!= "!="
null_literal "null"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "mayMatchElement"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "_matchingElementIndex"
>= ">="
decimal_integer_literal "0"
; ";"
} "}"
method_declaration (+46 nodes collapsed)
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Accessor for getting a \"sub-pointer\", instance wh"...
method_declaration
modifiers
public "public"
type_identifier "JsonPointer"
identifier "tail"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_nextSegment"
; ";"
} "}"
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "String"
identifier "toString"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_asString"
; ";"
} "}"
method_declaration (+25 nodes collapsed)
method_declaration (+82 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
private "private"
final "final"
static "static"
integral_type
int "int"
identifier "_parseIndex"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "str"
) ")"
block
{ "{"
local_variable_declaration
modifiers
final "final"
integral_type
int "int"
variable_declarator
identifier "len"
= "="
method_invocation
identifier "str"
. "."
identifier "length"
argument_list
( "("
) ")"
; ";"
line_comment "// [Issue#133]: beware of super long indexes; assume we neve"...
line_comment "// have arrays over 2 billion entries so ints are fine."
if_statement (+24 nodes collapsed)
for_statement
for "for"
( "("
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "i"
= "="
decimal_integer_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
identifier "len"
; ";"
update_expression
++ "++"
identifier "i"
) ")"
block
{ "{"
local_variable_declaration
integral_type
char "char"
variable_declarator
identifier "c"
= "="
method_invocation
identifier "str"
. "."
identifier "charAt"
argument_list
( "("
update_expression
identifier "i"
++ "++"
) ")"
; ";"
if_statement (+24 nodes collapsed)
} "}"
if_statement (+48 nodes collapsed)
return_statement
return "return"
method_invocation
identifier "NumberInput"
. "."
identifier "parseInt"
argument_list
( "("
identifier "str"
) ")"
; ";"
} "}"
method_declaration (+174 nodes collapsed)
block_comment "/**\n * Method called to parse tail of pointer path, when"...
method_declaration (+255 nodes collapsed)
method_declaration (+81 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "io"
. "."
identifier "NumberInput"
; ";"
block_comment "/**\n * Implementation of\n * <a href=\"http://tools.ietf.org/h"...
class_declaration
modifiers
public "public"
class "class"
identifier "JsonPointer"
class_body
{ "{"
block_comment "/**\n * Marker instance used to represent segment that ma"...
field_declaration
modifiers
protected "protected"
final "final"
static "static"
type_identifier "JsonPointer"
variable_declarator
identifier "EMPTY"
= "="
object_creation_expression
new "new"
type_identifier "JsonPointer"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Reference to rest of the pointer beyond currently"...
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "JsonPointer"
variable_declarator
identifier "_nextSegment"
; ";"
block_comment "/**\n * We will retain representation of the pointer, as "...
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "String"
variable_declarator
identifier "_asString"
; ";"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "String"
variable_declarator
identifier "_matchingPropertyName"
; ";"
field_declaration
modifiers
protected "protected"
final "final"
integral_type
int "int"
variable_declarator
identifier "_matchingElementIndex"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Constructor used for creating \"empty\" instance, u"...
constructor_declaration (+40 nodes collapsed)
block_comment "/**\n * Constructor used for creating non-empty Segments\n"...
constructor_declaration (+51 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Factory method that parses given input and constr"...
method_declaration (+107 nodes collapsed)
block_comment "/**\n * Alias for {@link #compile}; added to make instanc"...
method_declaration (+24 nodes collapsed)
block_comment "/* Factory method that composes a pointer instance, given a "...
block_comment "/* TODO!\n public static JsonPointer fromSegment(String..."...
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "matches"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "_nextSegment"
== "=="
null_literal "null"
; ";"
} "}"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getMatchingProperty"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_matchingPropertyName"
; ";"
} "}"
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMatchingIndex"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_matchingElementIndex"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "mayMatchProperty"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "_matchingPropertyName"
!= "!="
null_literal "null"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "mayMatchElement"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "_matchingElementIndex"
>= ">="
decimal_integer_literal "0"
; ";"
} "}"
method_declaration (+46 nodes collapsed)
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Accessor for getting a \"sub-pointer\", instance wh"...
method_declaration
modifiers
public "public"
type_identifier "JsonPointer"
identifier "tail"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_nextSegment"
; ";"
} "}"
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "String"
identifier "toString"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_asString"
; ";"
} "}"
method_declaration (+25 nodes collapsed)
method_declaration (+82 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration
modifiers
private "private"
final "final"
static "static"
integral_type
int "int"
identifier "_parseIndex"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "str"
) ")"
block
{ "{"
local_variable_declaration
modifiers
final "final"
integral_type
int "int"
variable_declarator
identifier "len"
= "="
method_invocation
identifier "str"
. "."
identifier "length"
argument_list
( "("
) ")"
; ";"
line_comment "// [Issue#133]: beware of super long indexes; assume we neve"...
line_comment "// have arrays over 2 billion entries so ints are fine."
if_statement (+24 nodes collapsed)
for_statement
for "for"
( "("
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "i"
= "="
decimal_integer_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
identifier "len"
; ";"
update_expression
++ "++"
identifier "i"
) ")"
block
{ "{"
local_variable_declaration
integral_type
char "char"
variable_declarator
identifier "c"
= "="
method_invocation
identifier "str"
. "."
identifier "charAt"
argument_list
( "("
identifier "i"
) ")"
; ";"
if_statement (+24 nodes collapsed)
} "}"
if_statement (+48 nodes collapsed)
return_statement
return "return"
method_invocation
identifier "NumberInput"
. "."
identifier "parseInt"
argument_list
( "("
identifier "str"
) ")"
; ";"
} "}"
method_declaration (+174 nodes collapsed)
block_comment "/**\n * Method called to parse tail of pointer path, when"...
method_declaration (+255 nodes collapsed)
method_declaration (+81 nodes collapsed)
} "}"