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–506 unchanged (506 lines)
507 * @param commandLine the command line
508 * @param trigger the trigger to be checked
509 * @return a flag whether this element looks like an option
510 */
511 private boolean looksLikeOption(final WriteableCommandLine commandLine,
512 final String trigger) {
513 return commandLine.looksLikeOption(trigger);
514 }
515}
516
517
518class ReverseStringComparator implements Comparator {
519 private static final Comparator instance = new ReverseStringComparator();
520
…lines 521–541 unchanged (21 lines)

After

…lines 1–506 unchanged (506 lines)
507 * @param commandLine the command line
508 * @param trigger the trigger to be checked
509 * @return a flag whether this element looks like an option
510 */
511 private boolean looksLikeOption(final WriteableCommandLine commandLine,
512 final String trigger) {
513 Option oldOption = commandLine.getCurrentOption();
514 try {
515 commandLine.setCurrentOption(this);
516 return commandLine.looksLikeOption(trigger);
517 } finally {
518 commandLine.setCurrentOption(oldOption);
519 }
520 }
521}
522
523
524class ReverseStringComparator implements Comparator {
525 private static final Comparator instance = new ReverseStringComparator();
…lines 526–547 unchanged (22 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 "option"
; ";"
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 "Collection"
; ";"
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 "Comparator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashSet"
; ";"
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 "ListIterator"
; ";"
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 "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "SortedMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "TreeMap"
; ";"
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 "DisplaySetting"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "Group"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "HelpLine"
; ";"
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 "OptionException"
; ";"
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 "resource"
. "."
identifier "ResourceConstants"
; ";"
block_comment "/**\n * An implementation of Group\n */"
class_declaration
modifiers
public "public"
class "class"
identifier "GroupImpl"
superclass
extends "extends"
type_identifier "OptionImpl"
super_interfaces
implements "implements"
type_list
type_identifier "Group"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "name"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "description"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "List"
variable_declarator
identifier "options"
; ";"
field_declaration
modifiers
private "private"
final "final"
integral_type
int "int"
variable_declarator
identifier "minimum"
; ";"
field_declaration
modifiers
private "private"
final "final"
integral_type
int "int"
variable_declarator
identifier "maximum"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "List"
variable_declarator
identifier "anonymous"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "SortedMap"
variable_declarator
identifier "optionMap"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Set"
variable_declarator
identifier "prefixes"
; ";"
block_comment "/**\n * Creates a new GroupImpl using the specified param"...
constructor_declaration (+383 nodes collapsed)
method_declaration (+201 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "Set"
identifier "getPrefixes"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "prefixes"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration (+449 nodes collapsed)
method_declaration (+288 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getPreferredName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "name"
; ";"
} "}"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getDescription"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "description"
; ";"
} "}"
method_declaration (+45 nodes collapsed)
method_declaration (+649 nodes collapsed)
method_declaration (+334 nodes collapsed)
block_comment "/**\n * Gets the member Options of thie Group.\n * Not"...
method_declaration
modifiers
public "public"
type_identifier "List"
identifier "getOptions"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "options"
; ";"
} "}"
block_comment "/**\n * Gets the anonymous Arguments of this Group.\n "...
method_declaration
modifiers
public "public"
type_identifier "List"
identifier "getAnonymous"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "anonymous"
; ";"
} "}"
method_declaration (+105 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMinimum"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "minimum"
; ";"
} "}"
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMaximum"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "maximum"
; ";"
} "}"
block_comment "/**\n * Tests whether this option is required. For groups"...
method_declaration (+44 nodes collapsed)
method_declaration (+144 nodes collapsed)
block_comment "/**\n * Helper method for testing whether an element of t"...
method_declaration
modifiers
private "private"
boolean_type "boolean"
identifier "looksLikeOption"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
type_identifier "WriteableCommandLine"
identifier "commandLine"
, ","
formal_parameter
modifiers
final "final"
type_identifier "String"
identifier "trigger"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "commandLine"
. "."
identifier "looksLikeOption"
argument_list
( "("
identifier "trigger"
) ")"
; ";"
} "}"
} "}"
class_declaration (+117 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 "option"
; ";"
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 "Collection"
; ";"
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 "Comparator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashSet"
; ";"
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 "ListIterator"
; ";"
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 "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "SortedMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "TreeMap"
; ";"
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 "DisplaySetting"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "Group"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli2"
. "."
identifier "HelpLine"
; ";"
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 "OptionException"
; ";"
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 "resource"
. "."
identifier "ResourceConstants"
; ";"
block_comment "/**\n * An implementation of Group\n */"
class_declaration
modifiers
public "public"
class "class"
identifier "GroupImpl"
superclass
extends "extends"
type_identifier "OptionImpl"
super_interfaces
implements "implements"
type_list
type_identifier "Group"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "name"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "description"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "List"
variable_declarator
identifier "options"
; ";"
field_declaration
modifiers
private "private"
final "final"
integral_type
int "int"
variable_declarator
identifier "minimum"
; ";"
field_declaration
modifiers
private "private"
final "final"
integral_type
int "int"
variable_declarator
identifier "maximum"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "List"
variable_declarator
identifier "anonymous"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "SortedMap"
variable_declarator
identifier "optionMap"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Set"
variable_declarator
identifier "prefixes"
; ";"
block_comment "/**\n * Creates a new GroupImpl using the specified param"...
constructor_declaration (+383 nodes collapsed)
method_declaration (+201 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "Set"
identifier "getPrefixes"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "prefixes"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration (+449 nodes collapsed)
method_declaration (+288 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getPreferredName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "name"
; ";"
} "}"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getDescription"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "description"
; ";"
} "}"
method_declaration (+45 nodes collapsed)
method_declaration (+649 nodes collapsed)
method_declaration (+334 nodes collapsed)
block_comment "/**\n * Gets the member Options of thie Group.\n * Not"...
method_declaration
modifiers
public "public"
type_identifier "List"
identifier "getOptions"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "options"
; ";"
} "}"
block_comment "/**\n * Gets the anonymous Arguments of this Group.\n "...
method_declaration
modifiers
public "public"
type_identifier "List"
identifier "getAnonymous"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "anonymous"
; ";"
} "}"
method_declaration (+105 nodes collapsed)
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMinimum"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "minimum"
; ";"
} "}"
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMaximum"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "maximum"
; ";"
} "}"
block_comment "/**\n * Tests whether this option is required. For groups"...
method_declaration (+44 nodes collapsed)
method_declaration (+144 nodes collapsed)
block_comment "/**\n * Helper method for testing whether an element of t"...
method_declaration
modifiers
private "private"
boolean_type "boolean"
identifier "looksLikeOption"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
type_identifier "WriteableCommandLine"
identifier "commandLine"
, ","
formal_parameter
modifiers
final "final"
type_identifier "String"
identifier "trigger"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Option"
variable_declarator
identifier "oldOption"
= "="
method_invocation
identifier "commandLine"
. "."
identifier "getCurrentOption"
argument_list
( "("
) ")"
; ";"
try_statement
try "try"
block
{ "{"
expression_statement
method_invocation
identifier "commandLine"
. "."
identifier "setCurrentOption"
argument_list
( "("
this "this"
) ")"
; ";"
return_statement
return "return"
method_invocation
identifier "commandLine"
. "."
identifier "looksLikeOption"
argument_list
( "("
identifier "trigger"
) ")"
; ";"
} "}"
finally_clause
finally "finally"
block
{ "{"
expression_statement
method_invocation
identifier "commandLine"
. "."
identifier "setCurrentOption"
argument_list
( "("
identifier "oldOption"
) ")"
; ";"
} "}"
} "}"
} "}"
class_declaration (+117 nodes collapsed)