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–110 unchanged (110 lines)
111 public List getValues(final Option option,
112 List defaultValues) {
113 // initialize the return list
114 List valueList = (List) values.get(option);
115
116 // grab the correct default values
117 if ((valueList == null) || valueList.isEmpty()) {
118 valueList = defaultValues;
119 }
120
121 // augment the list with the default values
122 if ((valueList == null) || valueList.isEmpty()) {
123 valueList = (List) this.defaultValues.get(option);
124 }
125 // if there are more default values as specified, add them to
126 // the list.
127 // copy the list first
128
129 return valueList == null ? Collections.EMPTY_LIST : valueList;
130 }
131
132 public List getUndefaultedValues(Option option) {
133 // First grab the command line values
134 List valueList = (List) values.get(option);
…lines 135–266 unchanged (132 lines)

After

…lines 1–110 unchanged (110 lines)
111 public List getValues(final Option option,
112 List defaultValues) {
113 // initialize the return list
114 List valueList = (List) values.get(option);
115
116 // grab the correct default values
117 if (defaultValues == null || defaultValues.isEmpty()) {
118 defaultValues = (List) this.defaultValues.get(option);
119 }
120
121 // augment the list with the default values
122 if (defaultValues != null && !defaultValues.isEmpty()) {
123 if (valueList == null || valueList.isEmpty()) {
124 valueList = defaultValues;
125 } else {
126 // if there are more default values as specified, add them to
127 // the list.
128 if (defaultValues.size() > valueList.size()) {
129 // copy the list first
130 valueList = new ArrayList(valueList);
131 for (int i=valueList.size(); i<defaultValues.size(); i++) {
132 valueList.add(defaultValues.get(i));
133 }
134 }
135 }
136 }
137
138 return valueList == null ? Collections.EMPTY_LIST : valueList;
139 }
140
141 public List getUndefaultedValues(Option option) {
142 // First grab the command line values
…lines 143–275 unchanged (133 lines)

Before

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "commandline"
; ";"
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 "Collections"
; ";"
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
identifier "java"
. "."
identifier "util"
. "."
identifier "Properties"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "Argument"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "Option"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "WriteableCommandLine"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "option"
. "."
identifier "PropertyOption"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "resource"
. "."
identifier "ResourceConstants"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "resource"
. "."
identifier "ResourceHelper"
; ";"
block_comment "/**\n * A WriteableCommandLine implementation allowing Option"...
class_declaration
modifiers
public "public"
class "class"
identifier "WriteableCommandLineImpl"
superclass
extends "extends"
type_identifier "CommandLineImpl"
super_interfaces
implements "implements"
type_list
type_identifier "WriteableCommandLine"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "optionToProperties"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
line_comment "// private final Properties properties = new Properties()"...
field_declaration
modifiers
private "private"
final "final"
type_identifier "List"
variable_declarator
identifier "options"
= "="
object_creation_expression
new "new"
type_identifier "ArrayList"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "nameToOption"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "values"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "switches"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "defaultValues"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "defaultSwitches"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "List"
variable_declarator
identifier "normalised"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Set"
variable_declarator
identifier "prefixes"
; ";"
block_comment "/**\n * Creates a new WriteableCommandLineImpl rooted on "...
constructor_declaration (+45 nodes collapsed)
method_declaration (+94 nodes collapsed)
method_declaration (+105 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+36 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "List"
identifier "getValues"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
type_identifier "Option"
identifier "option"
, ","
formal_parameter
type_identifier "List"
identifier "defaultValues"
) ")"
block
{ "{"
line_comment "// initialize the return list"
local_variable_declaration
type_identifier "List"
variable_declarator
identifier "valueList"
= "="
cast_expression
( "("
type_identifier "List"
) ")"
method_invocation
identifier "values"
. "."
identifier "get"
argument_list
( "("
identifier "option"
) ")"
; ";"
line_comment "// grab the correct default values"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
parenthesized_expression
( "("
binary_expression
identifier "valueList"
== "=="
null_literal "null"
) ")"
|| "||"
method_invocation
identifier "valueList"
. "."
identifier "isEmpty"
argument_list
( "("
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "valueList"
= "="
identifier "defaultValues"
; ";"
} "}"
line_comment "// augment the list with the default values"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
parenthesized_expression
( "("
binary_expression
identifier "valueList"
== "=="
null_literal "null"
) ")"
|| "||"
method_invocation
identifier "valueList"
. "."
identifier "isEmpty"
argument_list
( "("
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "valueList"
= "="
cast_expression
( "("
type_identifier "List"
) ")"
method_invocation
field_access
this "this"
. "."
identifier "defaultValues"
. "."
identifier "get"
argument_list
( "("
identifier "option"
) ")"
; ";"
} "}"
line_comment "// if there are more default values as specified, add them t"...
line_comment "// the list."
line_comment "// copy the list first"
return_statement
return "return"
ternary_expression
binary_expression
identifier "valueList"
== "=="
null_literal "null"
? "?"
field_access
identifier "Collections"
. "."
identifier "EMPTY_LIST"
: ":"
identifier "valueList"
; ";"
} "}"
method_declaration (+59 nodes collapsed)
method_declaration (+97 nodes collapsed)
method_declaration (+32 nodes collapsed)
method_declaration (+93 nodes collapsed)
method_declaration (+39 nodes collapsed)
method_declaration (+75 nodes collapsed)
method_declaration (+70 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration (+89 nodes collapsed)
method_declaration (+173 nodes collapsed)
method_declaration (+22 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+60 nodes collapsed)
method_declaration (+60 nodes collapsed)
method_declaration (+22 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "commandline"
; ";"
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 "Collections"
; ";"
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
identifier "java"
. "."
identifier "util"
. "."
identifier "Properties"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "Argument"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "Option"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "WriteableCommandLine"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "option"
. "."
identifier "PropertyOption"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "resource"
. "."
identifier "ResourceConstants"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "resource"
. "."
identifier "ResourceHelper"
; ";"
block_comment "/**\n * A WriteableCommandLine implementation allowing Option"...
class_declaration
modifiers
public "public"
class "class"
identifier "WriteableCommandLineImpl"
superclass
extends "extends"
type_identifier "CommandLineImpl"
super_interfaces
implements "implements"
type_list
type_identifier "WriteableCommandLine"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "optionToProperties"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
line_comment "// private final Properties properties = new Properties()"...
field_declaration
modifiers
private "private"
final "final"
type_identifier "List"
variable_declarator
identifier "options"
= "="
object_creation_expression
new "new"
type_identifier "ArrayList"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "nameToOption"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "values"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "switches"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "defaultValues"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Map"
variable_declarator
identifier "defaultSwitches"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "List"
variable_declarator
identifier "normalised"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Set"
variable_declarator
identifier "prefixes"
; ";"
block_comment "/**\n * Creates a new WriteableCommandLineImpl rooted on "...
constructor_declaration (+45 nodes collapsed)
method_declaration (+94 nodes collapsed)
method_declaration (+105 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+36 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "List"
identifier "getValues"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
type_identifier "Option"
identifier "option"
, ","
formal_parameter
type_identifier "List"
identifier "defaultValues"
) ")"
block
{ "{"
line_comment "// initialize the return list"
local_variable_declaration
type_identifier "List"
variable_declarator
identifier "valueList"
= "="
cast_expression
( "("
type_identifier "List"
) ")"
method_invocation
identifier "values"
. "."
identifier "get"
argument_list
( "("
identifier "option"
) ")"
; ";"
line_comment "// grab the correct default values"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "defaultValues"
== "=="
null_literal "null"
|| "||"
method_invocation
identifier "defaultValues"
. "."
identifier "isEmpty"
argument_list
( "("
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "defaultValues"
= "="
cast_expression
( "("
type_identifier "List"
) ")"
method_invocation
field_access
this "this"
. "."
identifier "defaultValues"
. "."
identifier "get"
argument_list
( "("
identifier "option"
) ")"
; ";"
} "}"
line_comment "// augment the list with the default values"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "defaultValues"
!= "!="
null_literal "null"
&& "&&"
unary_expression
! "!"
method_invocation
identifier "defaultValues"
. "."
identifier "isEmpty"
argument_list
( "("
) ")"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "valueList"
== "=="
null_literal "null"
|| "||"
method_invocation
identifier "valueList"
. "."
identifier "isEmpty"
argument_list
( "("
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "valueList"
= "="
identifier "defaultValues"
; ";"
} "}"
else "else"
block
{ "{"
line_comment "// if there are more default values as specified, add them t"...
line_comment "// the list."
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "defaultValues"
. "."
identifier "size"
argument_list
( "("
) ")"
> ">"
method_invocation
identifier "valueList"
. "."
identifier "size"
argument_list
( "("
) ")"
) ")"
block
{ "{"
line_comment "// copy the list first"
expression_statement
assignment_expression
identifier "valueList"
= "="
object_creation_expression
new "new"
type_identifier "ArrayList"
argument_list
( "("
identifier "valueList"
) ")"
; ";"
for_statement
for "for"
( "("
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "i"
= "="
method_invocation
identifier "valueList"
. "."
identifier "size"
argument_list
( "("
) ")"
; ";"
binary_expression
identifier "i"
< "<"
method_invocation
identifier "defaultValues"
. "."
identifier "size"
argument_list
( "("
) ")"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "valueList"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "defaultValues"
. "."
identifier "get"
argument_list
( "("
identifier "i"
) ")"
) ")"
; ";"
} "}"
} "}"
} "}"
} "}"
return_statement
return "return"
ternary_expression
binary_expression
identifier "valueList"
== "=="
null_literal "null"
? "?"
field_access
identifier "Collections"
. "."
identifier "EMPTY_LIST"
: ":"
identifier "valueList"
; ";"
} "}"
method_declaration (+59 nodes collapsed)
method_declaration (+97 nodes collapsed)
method_declaration (+32 nodes collapsed)
method_declaration (+93 nodes collapsed)
method_declaration (+39 nodes collapsed)
method_declaration (+75 nodes collapsed)
method_declaration (+70 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration (+89 nodes collapsed)
method_declaration (+173 nodes collapsed)
method_declaration (+22 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+60 nodes collapsed)
method_declaration (+60 nodes collapsed)
method_declaration (+22 nodes collapsed)
} "}"