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–300 unchanged (300 lines)
301 if (_inputStart >= 0) return _inputBuffer;
302 if (_resultArray != null) return _resultArray;
303 if (_resultString != null) {
304 return (_resultArray = _resultString.toCharArray());
305 }
306 // Nope; but does it fit in just one segment?
307 if (!_hasSegments) return _currentSegment;
308 // Nope, need to have/create a non-segmented array and return it
309 return contentsAsArray();
310 }
311
312 /*
313 /**********************************************************
…lines 314–734 unchanged (421 lines)

After

…lines 1–300 unchanged (300 lines)
301 if (_inputStart >= 0) return _inputBuffer;
302 if (_resultArray != null) return _resultArray;
303 if (_resultString != null) {
304 return (_resultArray = _resultString.toCharArray());
305 }
306 // Nope; but does it fit in just one segment?
307 if (!_hasSegments && _currentSegment != null) return _currentSegment;
308 // Nope, need to have/create a non-segmented array and return it
309 return contentsAsArray();
310 }
311
312 /*
313 /**********************************************************
…lines 314–734 unchanged (421 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "util"
; ";"
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
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "io"
. "."
identifier "NumberInput"
; ";"
block_comment "/**\n * TextBuffer is a class similar to {@link StringBuffer}"...
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "TextBuffer"
class_body
{ "{"
field_declaration (+22 nodes collapsed)
block_comment "/**\n * Let's start with sizable but not huge buffer, wil"...
field_declaration
modifiers
final "final"
static "static"
integral_type
int "int"
variable_declarator
identifier "MIN_SEGMENT_LEN"
= "="
decimal_integer_literal "1000"
; ";"
block_comment "/**\n * Let's limit maximum segment length to something s"...
field_declaration
modifiers
final "final"
static "static"
integral_type
int "int"
variable_declarator
identifier "MAX_SEGMENT_LEN"
= "="
hex_integer_literal "0x40000"
; ";"
block_comment "/*\n /****************************************************"...
field_declaration
modifiers
private "private"
final "final"
type_identifier "BufferRecycler"
variable_declarator
identifier "_allocator"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Shared input buffer; stored here in case some inp"...
field_declaration
modifiers
private "private"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
variable_declarator
identifier "_inputBuffer"
; ";"
block_comment "/**\n * Character offset of first char in input buffer; -"...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "_inputStart"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "_inputLen"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * List of segments prior to currently active segmen"...
field_declaration
modifiers
private "private"
generic_type
type_identifier "ArrayList"
type_arguments
< "<"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
> ">"
variable_declarator
identifier "_segments"
; ";"
block_comment "/**\n * Flag that indicates whether _seqments is non-empt"...
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "_hasSegments"
= "="
false "false"
; ";"
line_comment "// // // Currently used segment; not (yet) contained in _seq"...
block_comment "/**\n * Amount of characters in segments in {@link _segme"...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "_segmentSize"
; ";"
field_declaration
modifiers
private "private"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
variable_declarator
identifier "_currentSegment"
; ";"
block_comment "/**\n * Number of characters in currently active (last) s"...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "_currentSize"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * String that will be constructed when the whole co"...
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "_resultString"
; ";"
field_declaration
modifiers
private "private"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
variable_declarator
identifier "_resultArray"
; ";"
block_comment "/*\n /****************************************************"...
constructor_declaration
modifiers
public "public"
identifier "TextBuffer"
formal_parameters
( "("
formal_parameter
type_identifier "BufferRecycler"
identifier "allocator"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
identifier "_allocator"
= "="
identifier "allocator"
; ";"
} "}"
block_comment "/**\n * Method called to indicate that the underlying buf"...
method_declaration (+88 nodes collapsed)
block_comment "/**\n * Method called to clear out any content text buffe"...
method_declaration (+67 nodes collapsed)
block_comment "/**\n * Method called to initialize the buffer with a sha"...
method_declaration (+78 nodes collapsed)
method_declaration (+124 nodes collapsed)
method_declaration (+68 nodes collapsed)
block_comment "/**\n * Helper method used to find a buffer to use, ideal"...
method_declaration (+68 nodes collapsed)
method_declaration (+38 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * @return Number of characters currently stored by "...
method_declaration (+78 nodes collapsed)
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Method that can be used to check whether textual "...
method_declaration (+49 nodes collapsed)
method_declaration
modifiers
public "public"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
identifier "getTextBuffer"
formal_parameters
( "("
) ")"
block
{ "{"
line_comment "// Are we just using shared input buffer?"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "_inputStart"
>= ">="
decimal_integer_literal "0"
) ")"
return_statement
return "return"
identifier "_inputBuffer"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "_resultArray"
!= "!="
null_literal "null"
) ")"
return_statement
return "return"
identifier "_resultArray"
; ";"
if_statement (+28 nodes collapsed)
line_comment "// Nope; but does it fit in just one segment?"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
identifier "_hasSegments"
) ")"
return_statement
return "return"
identifier "_currentSegment"
; ";"
line_comment "// Nope, need to have/create a non-segmented array and retur"...
return_statement
return "return"
method_invocation
identifier "contentsAsArray"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/*\n /****************************************************"...
method_declaration (+304 nodes collapsed)
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Convenience method for converting contents of the"...
method_declaration (+134 nodes collapsed)
block_comment "/**\n * Convenience method for converting contents of the"...
method_declaration (+30 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method called to make sure that buffer is not usi"...
method_declaration (+31 nodes collapsed)
method_declaration (+102 nodes collapsed)
method_declaration (+251 nodes collapsed)
method_declaration (+249 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+105 nodes collapsed)
method_declaration (+115 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getCurrentSegmentSize"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_currentSize"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
block_comment "/**\n * @since 2.6\n */"
method_declaration (+92 nodes collapsed)
method_declaration (+170 nodes collapsed)
block_comment "/**\n * Method called to expand size of the current segme"...
method_declaration (+108 nodes collapsed)
block_comment "/**\n * Method called to expand size of the current segme"...
method_declaration (+70 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Note: calling this method may not be as efficient"...
method_declaration (+22 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method called if/when we need to append content w"...
method_declaration (+149 nodes collapsed)
block_comment "/**\n * Method called when current segment is full, to al"...
method_declaration (+169 nodes collapsed)
method_declaration (+309 nodes collapsed)
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 "util"
; ";"
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
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
identifier "io"
. "."
identifier "NumberInput"
; ";"
block_comment "/**\n * TextBuffer is a class similar to {@link StringBuffer}"...
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "TextBuffer"
class_body
{ "{"
field_declaration (+22 nodes collapsed)
block_comment "/**\n * Let's start with sizable but not huge buffer, wil"...
field_declaration
modifiers
final "final"
static "static"
integral_type
int "int"
variable_declarator
identifier "MIN_SEGMENT_LEN"
= "="
decimal_integer_literal "1000"
; ";"
block_comment "/**\n * Let's limit maximum segment length to something s"...
field_declaration
modifiers
final "final"
static "static"
integral_type
int "int"
variable_declarator
identifier "MAX_SEGMENT_LEN"
= "="
hex_integer_literal "0x40000"
; ";"
block_comment "/*\n /****************************************************"...
field_declaration
modifiers
private "private"
final "final"
type_identifier "BufferRecycler"
variable_declarator
identifier "_allocator"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Shared input buffer; stored here in case some inp"...
field_declaration
modifiers
private "private"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
variable_declarator
identifier "_inputBuffer"
; ";"
block_comment "/**\n * Character offset of first char in input buffer; -"...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "_inputStart"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "_inputLen"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * List of segments prior to currently active segmen"...
field_declaration
modifiers
private "private"
generic_type
type_identifier "ArrayList"
type_arguments
< "<"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
> ">"
variable_declarator
identifier "_segments"
; ";"
block_comment "/**\n * Flag that indicates whether _seqments is non-empt"...
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "_hasSegments"
= "="
false "false"
; ";"
line_comment "// // // Currently used segment; not (yet) contained in _seq"...
block_comment "/**\n * Amount of characters in segments in {@link _segme"...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "_segmentSize"
; ";"
field_declaration
modifiers
private "private"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
variable_declarator
identifier "_currentSegment"
; ";"
block_comment "/**\n * Number of characters in currently active (last) s"...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "_currentSize"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * String that will be constructed when the whole co"...
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "_resultString"
; ";"
field_declaration
modifiers
private "private"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
variable_declarator
identifier "_resultArray"
; ";"
block_comment "/*\n /****************************************************"...
constructor_declaration
modifiers
public "public"
identifier "TextBuffer"
formal_parameters
( "("
formal_parameter
type_identifier "BufferRecycler"
identifier "allocator"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
identifier "_allocator"
= "="
identifier "allocator"
; ";"
} "}"
block_comment "/**\n * Method called to indicate that the underlying buf"...
method_declaration (+88 nodes collapsed)
block_comment "/**\n * Method called to clear out any content text buffe"...
method_declaration (+67 nodes collapsed)
block_comment "/**\n * Method called to initialize the buffer with a sha"...
method_declaration (+78 nodes collapsed)
method_declaration (+124 nodes collapsed)
method_declaration (+68 nodes collapsed)
block_comment "/**\n * Helper method used to find a buffer to use, ideal"...
method_declaration (+68 nodes collapsed)
method_declaration (+38 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * @return Number of characters currently stored by "...
method_declaration (+78 nodes collapsed)
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Method that can be used to check whether textual "...
method_declaration (+49 nodes collapsed)
method_declaration
modifiers
public "public"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
identifier "getTextBuffer"
formal_parameters
( "("
) ")"
block
{ "{"
line_comment "// Are we just using shared input buffer?"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "_inputStart"
>= ">="
decimal_integer_literal "0"
) ")"
return_statement
return "return"
identifier "_inputBuffer"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "_resultArray"
!= "!="
null_literal "null"
) ")"
return_statement
return "return"
identifier "_resultArray"
; ";"
if_statement (+28 nodes collapsed)
line_comment "// Nope; but does it fit in just one segment?"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
unary_expression
! "!"
identifier "_hasSegments"
&& "&&"
binary_expression
identifier "_currentSegment"
!= "!="
null_literal "null"
) ")"
return_statement
return "return"
identifier "_currentSegment"
; ";"
line_comment "// Nope, need to have/create a non-segmented array and retur"...
return_statement
return "return"
method_invocation
identifier "contentsAsArray"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/*\n /****************************************************"...
method_declaration (+304 nodes collapsed)
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Convenience method for converting contents of the"...
method_declaration (+134 nodes collapsed)
block_comment "/**\n * Convenience method for converting contents of the"...
method_declaration (+30 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method called to make sure that buffer is not usi"...
method_declaration (+31 nodes collapsed)
method_declaration (+102 nodes collapsed)
method_declaration (+251 nodes collapsed)
method_declaration (+249 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+105 nodes collapsed)
method_declaration (+115 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getCurrentSegmentSize"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "_currentSize"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
block_comment "/**\n * @since 2.6\n */"
method_declaration (+92 nodes collapsed)
method_declaration (+170 nodes collapsed)
block_comment "/**\n * Method called to expand size of the current segme"...
method_declaration (+108 nodes collapsed)
block_comment "/**\n * Method called to expand size of the current segme"...
method_declaration (+70 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Note: calling this method may not be as efficient"...
method_declaration (+22 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Method called if/when we need to append content w"...
method_declaration (+149 nodes collapsed)
block_comment "/**\n * Method called when current segment is full, to al"...
method_declaration (+169 nodes collapsed)
method_declaration (+309 nodes collapsed)
method_declaration (+31 nodes collapsed)
} "}"