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–121 unchanged (121 lines)
122 }
123 }
124
125 // single hyphen
126 else if ("-".equals(token))
127 {
128 processSingleHyphen(token);
129 }
130 else if (token.startsWith("-"))
131 {
132 if (token.length() == 2)
133 {
134 processOptionToken(token, stopAtNonOption);
…lines 135–206 unchanged (72 lines)
207 {
208 eatTheRest = true;
209 tokens.add("--");
210 tokens.add(value);
211 }
212 }
213 private void processSingleHyphen(String hyphen)
214 {
215 tokens.add(hyphen);
216 }
217
218 /**
219 * <p>If an {@link Option} exists for <code>token</code> then
220 * set the current option and add the token to the processed
221 * list.</p>
222 *
…lines 223–234 unchanged (12 lines)
235 currentOption = options.getOption(token);
236 tokens.add(token);
237 }
238 else if (stopAtNonOption)
239 {
240 eatTheRest = true;
241 }
242 }
243
244 /**
245 * <p>Breaks <code>token</code> into its constituent parts
246 * using the following algorithm.
247 * <ul>
…lines 248–301 unchanged (54 lines)

After

…lines 1–121 unchanged (121 lines)
122 }
123 }
124
125 // single hyphen
126 else if ("-".equals(token))
127 {
128 tokens.add(token);
129 }
130 else if (token.startsWith("-"))
131 {
132 if (token.length() == 2)
133 {
134 processOptionToken(token, stopAtNonOption);
…lines 135–206 unchanged (72 lines)
207 {
208 eatTheRest = true;
209 tokens.add("--");
210 tokens.add(value);
211 }
212 }
213
214 /**
215 * <p>If an {@link Option} exists for <code>token</code> then
216 * set the current option and add the token to the processed
217 * list.</p>
218 *
219 * <p>If an {@link Option} does not exist and <code>stopAtNonOption</code>
…lines 220–230 unchanged (11 lines)
231 currentOption = options.getOption(token);
232 tokens.add(token);
233 }
234 else if (stopAtNonOption)
235 {
236 eatTheRest = true;
237 tokens.add(token);
238 }
239 }
240
241 /**
242 * <p>Breaks <code>token</code> into its constituent parts
243 * using the following algorithm.
…lines 244–298 unchanged (55 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 "Arrays"
; ";"
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"
; ";"
block_comment "/**\n * The class PosixParser provides an implementation of t"...
class_declaration
modifiers
public "public"
class "class"
identifier "PosixParser"
superclass
extends "extends"
type_identifier "Parser"
class_body
{ "{"
block_comment "/** holder for flattened tokens */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "tokens"
= "="
object_creation_expression
new "new"
type_identifier "ArrayList"
argument_list
( "("
) ")"
; ";"
block_comment "/** specifies if bursting should continue */"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "eatTheRest"
; ";"
block_comment "/** holder for the current option */"
field_declaration
modifiers
private "private"
type_identifier "Option"
variable_declarator
identifier "currentOption"
; ";"
block_comment "/** the command line Options */"
field_declaration
modifiers
private "private"
type_identifier "Options"
variable_declarator
identifier "options"
; ";"
block_comment "/**\n * Resets the members to their original state i.e. r"...
method_declaration (+32 nodes collapsed)
block_comment "/**\n * <p>An implementation of {@link Parser}'s abstract"...
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
{ "{"
expression_statement
method_invocation
identifier "init"
argument_list
( "("
) ")"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "options"
= "="
identifier "options"
; ";"
line_comment "// an iterator for the command line tokens"
local_variable_declaration
type_identifier "Iterator"
variable_declarator
identifier "iter"
= "="
method_invocation
method_invocation
identifier "Arrays"
. "."
identifier "asList"
argument_list
( "("
identifier "arguments"
) ")"
. "."
identifier "iterator"
argument_list
( "("
) ")"
; ";"
line_comment "// process each command line token"
while_statement
while "while"
parenthesized_expression
( "("
method_invocation
identifier "iter"
. "."
identifier "hasNext"
argument_list
( "("
) ")"
) ")"
block
{ "{"
line_comment "// get the next command line token"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "token"
= "="
cast_expression
( "("
type_identifier "String"
) ")"
method_invocation
identifier "iter"
. "."
identifier "next"
argument_list
( "("
) ")"
; ";"
line_comment "// handle SPECIAL TOKEN"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "token"
. "."
identifier "startsWith"
argument_list
( "("
string_literal
" "\""
string_fragment "--"
" "\""
) ")"
) ")"
block (+99 nodes collapsed)
line_comment "// single hyphen"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
string_literal
" "\""
string_fragment "-"
" "\""
. "."
identifier "equals"
argument_list
( "("
identifier "token"
) ")"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "processSingleHyphen"
argument_list
( "("
identifier "token"
) ")"
; ";"
} "}"
else "else"
if_statement (+121 nodes collapsed)
expression_statement
method_invocation
identifier "gobble"
argument_list
( "("
identifier "iter"
) ")"
; ";"
} "}"
return_statement (+31 nodes collapsed)
} "}"
block_comment "/**\n * Adds the remaining tokens to the processed tokens"...
method_declaration (+54 nodes collapsed)
block_comment "/**\n * <p>If there is a current option and it can have a"...
method_declaration (+125 nodes collapsed)
method_declaration
modifiers
private "private"
void_type "void"
identifier "processSingleHyphen"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "hyphen"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "hyphen"
) ")"
; ";"
} "}"
block_comment "/**\n * <p>If an {@link Option} exists for <code>token</c"...
method_declaration
modifiers
private "private"
void_type "void"
identifier "processOptionToken"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "token"
, ","
formal_parameter
boolean_type "boolean"
identifier "stopAtNonOption"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "options"
. "."
identifier "hasOption"
argument_list
( "("
identifier "token"
) ")"
) ")"
block (+26 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
identifier "stopAtNonOption"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "eatTheRest"
= "="
true "true"
; ";"
} "}"
} "}"
block_comment "/**\n * <p>Breaks <code>token</code> into its constituent"...
method_declaration (+217 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 "Arrays"
; ";"
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"
; ";"
block_comment "/**\n * The class PosixParser provides an implementation of t"...
class_declaration
modifiers
public "public"
class "class"
identifier "PosixParser"
superclass
extends "extends"
type_identifier "Parser"
class_body
{ "{"
block_comment "/** holder for flattened tokens */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "tokens"
= "="
object_creation_expression
new "new"
type_identifier "ArrayList"
argument_list
( "("
) ")"
; ";"
block_comment "/** specifies if bursting should continue */"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "eatTheRest"
; ";"
block_comment "/** holder for the current option */"
field_declaration
modifiers
private "private"
type_identifier "Option"
variable_declarator
identifier "currentOption"
; ";"
block_comment "/** the command line Options */"
field_declaration
modifiers
private "private"
type_identifier "Options"
variable_declarator
identifier "options"
; ";"
block_comment "/**\n * Resets the members to their original state i.e. r"...
method_declaration (+32 nodes collapsed)
block_comment "/**\n * <p>An implementation of {@link Parser}'s abstract"...
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
{ "{"
expression_statement
method_invocation
identifier "init"
argument_list
( "("
) ")"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "options"
= "="
identifier "options"
; ";"
line_comment "// an iterator for the command line tokens"
local_variable_declaration
type_identifier "Iterator"
variable_declarator
identifier "iter"
= "="
method_invocation
method_invocation
identifier "Arrays"
. "."
identifier "asList"
argument_list
( "("
identifier "arguments"
) ")"
. "."
identifier "iterator"
argument_list
( "("
) ")"
; ";"
line_comment "// process each command line token"
while_statement
while "while"
parenthesized_expression
( "("
method_invocation
identifier "iter"
. "."
identifier "hasNext"
argument_list
( "("
) ")"
) ")"
block
{ "{"
line_comment "// get the next command line token"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "token"
= "="
cast_expression
( "("
type_identifier "String"
) ")"
method_invocation
identifier "iter"
. "."
identifier "next"
argument_list
( "("
) ")"
; ";"
line_comment "// handle SPECIAL TOKEN"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "token"
. "."
identifier "startsWith"
argument_list
( "("
string_literal
" "\""
string_fragment "--"
" "\""
) ")"
) ")"
block (+99 nodes collapsed)
line_comment "// single hyphen"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
string_literal
" "\""
string_fragment "-"
" "\""
. "."
identifier "equals"
argument_list
( "("
identifier "token"
) ")"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "token"
) ")"
; ";"
} "}"
else "else"
if_statement (+121 nodes collapsed)
expression_statement
method_invocation
identifier "gobble"
argument_list
( "("
identifier "iter"
) ")"
; ";"
} "}"
return_statement (+31 nodes collapsed)
} "}"
block_comment "/**\n * Adds the remaining tokens to the processed tokens"...
method_declaration (+54 nodes collapsed)
block_comment "/**\n * <p>If there is a current option and it can have a"...
method_declaration (+125 nodes collapsed)
block_comment "/**\n * <p>If an {@link Option} exists for <code>token</c"...
method_declaration
modifiers
private "private"
void_type "void"
identifier "processOptionToken"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "token"
, ","
formal_parameter
boolean_type "boolean"
identifier "stopAtNonOption"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "options"
. "."
identifier "hasOption"
argument_list
( "("
identifier "token"
) ")"
) ")"
block (+26 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
identifier "stopAtNonOption"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "eatTheRest"
= "="
true "true"
; ";"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "token"
) ")"
; ";"
} "}"
} "}"
block_comment "/**\n * <p>Breaks <code>token</code> into its constituent"...
method_declaration (+217 nodes collapsed)
} "}"