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–175 unchanged (175 lines)
176 * @param map The Map to populate.
177 * @return the given map.
178 */
179 <M extends Map<String, String>> M putIn(final M map) {
180 for (final Entry<String, Integer> entry : mapping.entrySet()) {
181 final int col = entry.getValue().intValue();
182 map.put(entry.getKey(), values[col]);
183 }
184 return map;
185 }
186
187 /**
188 * Returns the number of values in this record.
189 *
…lines 190–226 unchanged (37 lines)

After

…lines 1–175 unchanged (175 lines)
176 * @param map The Map to populate.
177 * @return the given map.
178 */
179 <M extends Map<String, String>> M putIn(final M map) {
180 for (final Entry<String, Integer> entry : mapping.entrySet()) {
181 final int col = entry.getValue().intValue();
182 if (col < values.length) {
183 map.put(entry.getKey(), values[col]);
184 }
185 }
186 return map;
187 }
188
189 /**
190 * Returns the number of values in this record.
…lines 191–228 unchanged (38 lines)

Before

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "csv"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
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 "HashMap"
; ";"
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 "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
. "."
identifier "Entry"
; ";"
block_comment "/**\n * A CSV record parsed from a CSV file.\n *\n * @version $"...
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "CSVRecord"
super_interfaces
implements "implements"
type_list
type_identifier "Serializable"
, ","
generic_type
type_identifier "Iterable"
type_arguments
< "<"
type_identifier "String"
> ">"
class_body
{ "{"
field_declaration (+21 nodes collapsed)
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
block_comment "/** The accumulated comments (if any) */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "comment"
; ";"
block_comment "/** The column name to index mapping. */"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
variable_declarator
identifier "mapping"
; ";"
block_comment "/** The record number. */"
field_declaration
modifiers
private "private"
final "final"
integral_type
long "long"
variable_declarator
identifier "recordNumber"
; ";"
block_comment "/** The values of the record */"
field_declaration
modifiers
private "private"
final "final"
array_type
type_identifier "String"
dimensions
[ "["
] "]"
variable_declarator
identifier "values"
; ";"
constructor_declaration (+87 nodes collapsed)
block_comment "/**\n * Returns a value by {@link Enum}.\n *\n * @p"...
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Returns a value by index.\n *\n * @param i\n"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Returns a value by name.\n *\n * @param nam"...
method_declaration (+167 nodes collapsed)
block_comment "/**\n * Returns the comment for this record, if any.\n "...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getComment"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "comment"
; ";"
} "}"
block_comment "/**\n * Returns the number of this record in the parsed C"...
method_declaration
modifiers
public "public"
integral_type
long "long"
identifier "getRecordNumber"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "recordNumber"
; ";"
} "}"
block_comment "/**\n * Returns true if this record is consistent, false "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Checks whether a given column is mapped, i.e. its"...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Checks whether a given columns is mapped and has "...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Returns an iterator over the values of this recor"...
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Puts all values of this record into the given Map"...
method_declaration
type_parameters
< "<"
type_parameter
type_identifier "M"
type_bound
extends "extends"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "String"
> ">"
> ">"
type_identifier "M"
identifier "putIn"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
type_identifier "M"
identifier "map"
) ")"
block
{ "{"
enhanced_for_statement
for "for"
( "("
modifiers
final "final"
generic_type
type_identifier "Entry"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
identifier "entry"
: ":"
method_invocation
identifier "mapping"
. "."
identifier "entrySet"
argument_list
( "("
) ")"
) ")"
block
{ "{"
local_variable_declaration (+22 nodes collapsed)
expression_statement (+22 nodes collapsed)
} "}"
return_statement
return "return"
identifier "map"
; ";"
} "}"
block_comment "/**\n * Returns the number of values in this record.\n "...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "size"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "values"
. "."
identifier "length"
; ";"
} "}"
block_comment "/**\n * Converts the values to a List.\n *\n * TODO"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Copies this record into a new Map. The new map is"...
method_declaration (+43 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "values"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "values"
; ";"
} "}"
} "}"

After

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "csv"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
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 "HashMap"
; ";"
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 "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
. "."
identifier "Entry"
; ";"
block_comment "/**\n * A CSV record parsed from a CSV file.\n *\n * @version $"...
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "CSVRecord"
super_interfaces
implements "implements"
type_list
type_identifier "Serializable"
, ","
generic_type
type_identifier "Iterable"
type_arguments
< "<"
type_identifier "String"
> ">"
class_body
{ "{"
field_declaration (+21 nodes collapsed)
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
block_comment "/** The accumulated comments (if any) */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "comment"
; ";"
block_comment "/** The column name to index mapping. */"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
variable_declarator
identifier "mapping"
; ";"
block_comment "/** The record number. */"
field_declaration
modifiers
private "private"
final "final"
integral_type
long "long"
variable_declarator
identifier "recordNumber"
; ";"
block_comment "/** The values of the record */"
field_declaration
modifiers
private "private"
final "final"
array_type
type_identifier "String"
dimensions
[ "["
] "]"
variable_declarator
identifier "values"
; ";"
constructor_declaration (+87 nodes collapsed)
block_comment "/**\n * Returns a value by {@link Enum}.\n *\n * @p"...
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Returns a value by index.\n *\n * @param i\n"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Returns a value by name.\n *\n * @param nam"...
method_declaration (+167 nodes collapsed)
block_comment "/**\n * Returns the comment for this record, if any.\n "...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getComment"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "comment"
; ";"
} "}"
block_comment "/**\n * Returns the number of this record in the parsed C"...
method_declaration
modifiers
public "public"
integral_type
long "long"
identifier "getRecordNumber"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "recordNumber"
; ";"
} "}"
block_comment "/**\n * Returns true if this record is consistent, false "...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Checks whether a given column is mapped, i.e. its"...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Checks whether a given columns is mapped and has "...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Returns an iterator over the values of this recor"...
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Puts all values of this record into the given Map"...
method_declaration
type_parameters
< "<"
type_parameter
type_identifier "M"
type_bound
extends "extends"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "String"
> ">"
> ">"
type_identifier "M"
identifier "putIn"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
type_identifier "M"
identifier "map"
) ")"
block
{ "{"
enhanced_for_statement
for "for"
( "("
modifiers
final "final"
generic_type
type_identifier "Entry"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
identifier "entry"
: ":"
method_invocation
identifier "mapping"
. "."
identifier "entrySet"
argument_list
( "("
) ")"
) ")"
block
{ "{"
local_variable_declaration (+22 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "col"
< "<"
field_access
identifier "values"
. "."
identifier "length"
) ")"
block
{ "{"
expression_statement (+22 nodes collapsed)
} "}"
} "}"
return_statement
return "return"
identifier "map"
; ";"
} "}"
block_comment "/**\n * Returns the number of values in this record.\n "...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "size"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "values"
. "."
identifier "length"
; ";"
} "}"
block_comment "/**\n * Converts the values to a List.\n *\n * TODO"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Copies this record into a new Map. The new map is"...
method_declaration (+43 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "values"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "values"
; ";"
} "}"
} "}"