Requires N:M mapping

This mapping has 8 all-to-all groups: every node on one side corresponds to every node on the other, and none is deleted or inserted. Each member carries an all N:M badge; selecting one highlights all of its counterparts, in the tree and in the code view alike.

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–107 unchanged (107 lines)
108 // get the next command line token
109 String token = (String) iter.next();
110
111 // handle long option --foo or --foo=bar
112 if (token.startsWith("--"))
113 {
114 if (token.indexOf('=') != -1)
115 {
116 tokens.add(token.substring(0, token.indexOf('=')));
117 tokens.add(token.substring(token.indexOf('=') + 1, token.length()));
118 }
119 else
120 {
121 tokens.add(token);
122 }
123 }
124
125 // single hyphen
126 else if ("-".equals(token))
127 {
…lines 128–298 unchanged (171 lines)

After

…lines 1–107 unchanged (107 lines)
108 // get the next command line token
109 String token = (String) iter.next();
110
111 // handle long option --foo or --foo=bar
112 if (token.startsWith("--"))
113 {
114 int pos = token.indexOf('=');
115 String opt = pos == -1 ? token : token.substring(0, pos); // --foo
116
117 if (!options.hasOption(opt) && stopAtNonOption)
118 {
119 process(token);
120 }
121 else
122 {
123 tokens.add(opt);
124 if (pos != -1) {
125 tokens.add(token.substring(pos + 1));
126 }
127 }
128 }
129
130 // single hyphen
131 else if ("-".equals(token))
132 {
…lines 133–303 unchanged (171 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 long option --foo or --foo=bar"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "token"
. "."
identifier "startsWith"
argument_list
( "("
string_literal
" "\""
string_fragment "--"
" "\""
) ")"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation all 3:1
identifier "token" all 3:1
. "." all 3:1
identifier "indexOf" all 3:1
argument_list all 3:1
( "(" all 3:1
character_literal "'='" all 3:1
) ")" all 3:1
!= "!="
unary_expression
- "-"
decimal_integer_literal "1"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "token"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
method_invocation all 3:1
identifier "token" all 3:1
. "." all 3:1
identifier "indexOf" all 3:1
argument_list all 3:1
( "(" all 3:1
character_literal "'='" all 3:1
) ")" all 3:1
) ")"
) ")"
; ";"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "token"
. "."
identifier "substring"
argument_list
( "("
binary_expression
method_invocation all 3:1
identifier "token" all 3:1
. "." all 3:1
identifier "indexOf" all 3:1
argument_list all 3:1
( "(" all 3:1
character_literal "'='" all 3:1
) ")" all 3:1
+ "+"
decimal_integer_literal "1"
, ","
method_invocation
identifier "token"
. "."
identifier "length"
argument_list
( "("
) ")"
) ")"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "token"
) ")"
; ";"
} "}"
} "}"
line_comment "// single hyphen"
else "else"
if_statement (+151 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 (+73 nodes collapsed)
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 long option --foo or --foo=bar"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "token"
. "."
identifier "startsWith"
argument_list
( "("
string_literal
" "\""
string_fragment "--"
" "\""
) ")"
) ")"
block
{ "{"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "pos"
= "="
method_invocation all 3:1
identifier "token" all 3:1
. "." all 3:1
identifier "indexOf" all 3:1
argument_list all 3:1
( "(" all 3:1
character_literal "'='" all 3:1
) ")" all 3:1
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "opt"
= "="
ternary_expression
binary_expression
identifier "pos"
== "=="
unary_expression
- "-"
decimal_integer_literal "1"
? "?"
identifier "token"
: ":"
method_invocation
identifier "token"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
identifier "pos"
) ")"
; ";"
line_comment "// --foo"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
unary_expression
! "!"
method_invocation
identifier "options"
. "."
identifier "hasOption"
argument_list
( "("
identifier "opt"
) ")"
&& "&&"
identifier "stopAtNonOption"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "process"
argument_list
( "("
identifier "token"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
identifier "opt"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "pos"
!= "!="
unary_expression
- "-"
decimal_integer_literal "1"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "tokens"
. "."
identifier "add"
argument_list
( "("
method_invocation
identifier "token"
. "."
identifier "substring"
argument_list
( "("
binary_expression
identifier "pos"
+ "+"
decimal_integer_literal "1"
) ")"
) ")"
; ";"
} "}"
} "}"
} "}"
line_comment "// single hyphen"
else "else"
if_statement (+151 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 (+73 nodes collapsed)
block_comment "/**\n * <p>Breaks <code>token</code> into its constituent"...
method_declaration (+217 nodes collapsed)
} "}"