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–74 unchanged (74 lines)
75 if (options.hasOption(opt))
76 {
77 tokens.add(arg);
78 }
79 else
80 {
81 if (options.hasOption(arg.substring(0, 2)))
82 {
83 // the format is --foo=value or -foo=value
84 // the format is a special properties option (-Dproperty=value)
85 tokens.add(arg.substring(0, 2)); // -D
86 tokens.add(arg.substring(2)); // property=value
87 }
88 else
89 {
90 eatTheRest = stopAtNonOption;
…lines 91–112 unchanged (22 lines)

After

…lines 1–74 unchanged (74 lines)
75 if (options.hasOption(opt))
76 {
77 tokens.add(arg);
78 }
79 else
80 {
81 if (opt.indexOf('=') != -1 && options.hasOption(opt.substring(0, opt.indexOf('='))))
82 {
83 // the format is --foo=value or -foo=value
84 tokens.add(arg.substring(0, arg.indexOf('='))); // --foo
85 tokens.add(arg.substring(arg.indexOf('=') + 1)); // value
86 }
87 else if (options.hasOption(arg.substring(0, 2)))
88 {
89 // the format is a special properties option (-Dproperty=value)
90 tokens.add(arg.substring(0, 2)); // -D
91 tokens.add(arg.substring(2)); // property=value
92 }
93 else
94 {
…lines 95–117 unchanged (23 lines)

Before

program
block_comment "/**\n * Licensed to the Apache Software Foundation (ASF) unde"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli"
; ";"
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 "List"
; ";"
block_comment "/**\n * The class GnuParser provides an implementation of the"...
class_declaration
modifiers
public "public"
class "class"
identifier "GnuParser"
superclass
extends "extends"
type_identifier "Parser"
class_body
{ "{"
block_comment "/**\n * <p>This flatten method does so using the followin"...
method_declaration
modifiers
protected "protected"
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "flatten"
formal_parameters
( "("
formal_parameter
type_identifier "Options"
identifier "options"
, ","
formal_parameter
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "arguments"
, ","
formal_parameter
boolean_type "boolean"
identifier "stopAtNonOption"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "List"
variable_declarator
identifier "tokens"
= "="
object_creation_expression
new "new"
type_identifier "ArrayList"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "eatTheRest"
= "="
false "false"
; ";"
for_statement
for "for"
( "("
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "i"
= "="
decimal_integer_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
field_access
identifier "arguments"
. "."
identifier "length"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "arg"
= "="
array_access
identifier "arguments"
[ "["
identifier "i"
] "]"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
string_literal
" "\""
string_fragment "--"
" "\""
. "."
identifier "equals"
argument_list
( "("
identifier "arg"
) ")"
) ")"
block (+22 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
string_literal
" "\""
string_fragment "-"
" "\""
. "."
identifier "equals"
argument_list
( "("
identifier "arg"
) ")"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
string_literal
" "\""
string_fragment "-"
" "\""
) ")"
; ";"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "arg"
. "."
identifier "startsWith"
argument_list
( "("
string_literal
" "\""
string_fragment "-"
" "\""
) ")"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "opt"
= "="
method_invocation
identifier "Util"
. "."
identifier "stripLeadingHyphens"
argument_list
( "("
identifier "arg"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "options"
. "."
identifier "hasOption"
argument_list
( "("
identifier "opt"
) ")"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "arg"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "options"
. "."
identifier "hasOption"
argument_list
( "("
method_invocation
identifier "arg"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
decimal_integer_literal "2"
) ")"
) ")"
) ")"
block
{ "{"
line_comment "// the format is --foo=value or -foo=value"
line_comment "// the format is a special properties option (-Dproperty=val"...
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "arg"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
decimal_integer_literal "2"
) ")"
) ")"
; ";"
line_comment "// -D"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "arg"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "2"
) ")"
) ")"
; ";"
line_comment "// property=value"
} "}"
else "else"
block
{ "{"
expression_statement
assignment_expression
identifier "eatTheRest"
= "="
identifier "stopAtNonOption"
; ";"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "arg"
) ")"
; ";"
} "}"
} "}"
} "}"
else "else"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "arg"
) ")"
; ";"
} "}"
if_statement (+45 nodes collapsed)
} "}"
return_statement (+31 nodes collapsed)
} "}"
} "}"

After

program
block_comment "/**\n * Licensed to the Apache Software Foundation (ASF) unde"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli"
; ";"
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 "List"
; ";"
block_comment "/**\n * The class GnuParser provides an implementation of the"...
class_declaration
modifiers
public "public"
class "class"
identifier "GnuParser"
superclass
extends "extends"
type_identifier "Parser"
class_body
{ "{"
block_comment "/**\n * <p>This flatten method does so using the followin"...
method_declaration
modifiers
protected "protected"
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "flatten"
formal_parameters
( "("
formal_parameter
type_identifier "Options"
identifier "options"
, ","
formal_parameter
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "arguments"
, ","
formal_parameter
boolean_type "boolean"
identifier "stopAtNonOption"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "List"
variable_declarator
identifier "tokens"
= "="
object_creation_expression
new "new"
type_identifier "ArrayList"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "eatTheRest"
= "="
false "false"
; ";"
for_statement
for "for"
( "("
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "i"
= "="
decimal_integer_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
field_access
identifier "arguments"
. "."
identifier "length"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "arg"
= "="
array_access
identifier "arguments"
[ "["
identifier "i"
] "]"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
string_literal
" "\""
string_fragment "--"
" "\""
. "."
identifier "equals"
argument_list
( "("
identifier "arg"
) ")"
) ")"
block (+22 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
string_literal
" "\""
string_fragment "-"
" "\""
. "."
identifier "equals"
argument_list
( "("
identifier "arg"
) ")"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
string_literal
" "\""
string_fragment "-"
" "\""
) ")"
; ";"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "arg"
. "."
identifier "startsWith"
argument_list
( "("
string_literal
" "\""
string_fragment "-"
" "\""
) ")"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "opt"
= "="
method_invocation
identifier "Util"
. "."
identifier "stripLeadingHyphens"
argument_list
( "("
identifier "arg"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "options"
. "."
identifier "hasOption"
argument_list
( "("
identifier "opt"
) ")"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "arg"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
method_invocation
identifier "opt"
. "."
identifier "indexOf"
argument_list
( "("
character_literal "'='"
) ")"
!= "!="
unary_expression
- "-"
decimal_integer_literal "1"
&& "&&"
method_invocation
identifier "options"
. "."
identifier "hasOption"
argument_list
( "("
method_invocation
identifier "opt"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
method_invocation
identifier "opt"
. "."
identifier "indexOf"
argument_list
( "("
character_literal "'='"
) ")"
) ")"
) ")"
) ")"
block
{ "{"
line_comment "// the format is --foo=value or -foo=value"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "arg"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
method_invocation
identifier "arg"
. "."
identifier "indexOf"
argument_list
( "("
character_literal "'='"
) ")"
) ")"
) ")"
; ";"
line_comment "// --foo"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "arg"
. "."
identifier "substring"
argument_list
( "("
binary_expression
method_invocation
identifier "arg"
. "."
identifier "indexOf"
argument_list
( "("
character_literal "'='"
) ")"
+ "+"
decimal_integer_literal "1"
) ")"
) ")"
; ";"
line_comment "// value"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "options"
. "."
identifier "hasOption"
argument_list
( "("
method_invocation
identifier "arg"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
decimal_integer_literal "2"
) ")"
) ")"
) ")"
block
{ "{"
line_comment "// the format is a special properties option (-Dproperty=val"...
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "arg"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
decimal_integer_literal "2"
) ")"
) ")"
; ";"
line_comment "// -D"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "arg"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "2"
) ")"
) ")"
; ";"
line_comment "// property=value"
} "}"
else "else"
block
{ "{"
expression_statement
assignment_expression
identifier "eatTheRest"
= "="
identifier "stopAtNonOption"
; ";"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "arg"
) ")"
; ";"
} "}"
} "}"
} "}"
else "else"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "arg"
) ")"
; ";"
} "}"
if_statement (+45 nodes collapsed)
} "}"
return_statement (+31 nodes collapsed)
} "}"
} "}"