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–233 unchanged (233 lines)
234 {
235 opt = Util.stripLeadingHyphens(opt);
236
237 List<String> matchingOpts = new ArrayList<String>();
238
239 // for a perfect match return the single option only
240
241 for (String longOpt : longOpts.keySet())
242 {
243 if (longOpt.startsWith(opt))
244 {
245 matchingOpts.add(longOpt);
246 }
…lines 247–324 unchanged (78 lines)

After

…lines 1–233 unchanged (233 lines)
234 {
235 opt = Util.stripLeadingHyphens(opt);
236
237 List<String> matchingOpts = new ArrayList<String>();
238
239 // for a perfect match return the single option only
240 if(longOpts.keySet().contains(opt)) {
241 return Collections.singletonList(opt);
242 }
243
244 for (String longOpt : longOpts.keySet())
245 {
246 if (longOpt.startsWith(opt))
247 {
248 matchingOpts.add(longOpt);
…lines 249–327 unchanged (79 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 "io"
. "."
identifier "Serializable"
; ";"
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 "HashMap"
; ";"
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 "LinkedHashMap"
; ";"
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"
; ";"
block_comment "/**\n * Main entry-point into the library.\n * <p>\n * Options "...
class_declaration
modifiers
public "public"
class "class"
identifier "Options"
super_interfaces
implements "implements"
type_list
type_identifier "Serializable"
class_body
{ "{"
block_comment "/** The serial version UID. */"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
block_comment "/** a map of the options with the character key */"
field_declaration (+29 nodes collapsed)
block_comment "/** a map of the options with the long key */"
field_declaration (+29 nodes collapsed)
block_comment "/** a map of the required options */"
line_comment "// N.B. This can contain either a String (addOption) or an O"...
line_comment "// TODO this seems wrong"
field_declaration (+25 nodes collapsed)
block_comment "/** a map of the option groups */"
field_declaration (+29 nodes collapsed)
block_comment "/**\n * Add the specified option group.\n *\n * @pa"...
method_declaration (+99 nodes collapsed)
block_comment "/**\n * Lists the OptionGroups that are members of this O"...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Add an option that only contains a short name.\n "...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Add an option that only contains a short-name.\n "...
method_declaration (+40 nodes collapsed)
block_comment "/**\n * Add an option that contains a short-name and a lo"...
method_declaration (+50 nodes collapsed)
block_comment "/**\n * Adds an option instance\n *\n * @param opt "...
method_declaration (+136 nodes collapsed)
block_comment "/**\n * Retrieve a read-only list of options in this set\n"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Returns the Options for use by the HelpFormatter."...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Returns the required options.\n *\n * @retu"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Retrieve the {@link Option} matching the long or "...
method_declaration (+65 nodes collapsed)
block_comment "/**\n * Returns the options with a long name starting wit"...
method_declaration
modifiers
public "public"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "String"
> ">"
identifier "getMatchingOptions"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "opt"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "opt"
= "="
method_invocation
identifier "Util"
. "."
identifier "stripLeadingHyphens"
argument_list
( "("
identifier "opt"
) ")"
; ";"
local_variable_declaration (+22 nodes collapsed)
line_comment "// for a perfect match return the single option only"
enhanced_for_statement (+43 nodes collapsed)
return_statement
return "return"
identifier "matchingOpts"
; ";"
} "}"
block_comment "/**\n * Returns whether the named {@link Option} is a mem"...
method_declaration (+48 nodes collapsed)
block_comment "/**\n * Returns whether the named {@link Option} is a mem"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Returns whether the named {@link Option} is a mem"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Returns the OptionGroup the <code>opt</code> belo"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Dump state, suitable for debugging.\n *\n *"...
method_declaration (+101 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 "io"
. "."
identifier "Serializable"
; ";"
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 "HashMap"
; ";"
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 "LinkedHashMap"
; ";"
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"
; ";"
block_comment "/**\n * Main entry-point into the library.\n * <p>\n * Options "...
class_declaration
modifiers
public "public"
class "class"
identifier "Options"
super_interfaces
implements "implements"
type_list
type_identifier "Serializable"
class_body
{ "{"
block_comment "/** The serial version UID. */"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
block_comment "/** a map of the options with the character key */"
field_declaration (+29 nodes collapsed)
block_comment "/** a map of the options with the long key */"
field_declaration (+29 nodes collapsed)
block_comment "/** a map of the required options */"
line_comment "// N.B. This can contain either a String (addOption) or an O"...
line_comment "// TODO this seems wrong"
field_declaration (+25 nodes collapsed)
block_comment "/** a map of the option groups */"
field_declaration (+29 nodes collapsed)
block_comment "/**\n * Add the specified option group.\n *\n * @pa"...
method_declaration (+99 nodes collapsed)
block_comment "/**\n * Lists the OptionGroups that are members of this O"...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Add an option that only contains a short name.\n "...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Add an option that only contains a short-name.\n "...
method_declaration (+40 nodes collapsed)
block_comment "/**\n * Add an option that contains a short-name and a lo"...
method_declaration (+50 nodes collapsed)
block_comment "/**\n * Adds an option instance\n *\n * @param opt "...
method_declaration (+136 nodes collapsed)
block_comment "/**\n * Retrieve a read-only list of options in this set\n"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Returns the Options for use by the HelpFormatter."...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Returns the required options.\n *\n * @retu"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Retrieve the {@link Option} matching the long or "...
method_declaration (+65 nodes collapsed)
block_comment "/**\n * Returns the options with a long name starting wit"...
method_declaration
modifiers
public "public"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "String"
> ">"
identifier "getMatchingOptions"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "opt"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "opt"
= "="
method_invocation
identifier "Util"
. "."
identifier "stripLeadingHyphens"
argument_list
( "("
identifier "opt"
) ")"
; ";"
local_variable_declaration (+22 nodes collapsed)
line_comment "// for a perfect match return the single option only"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
method_invocation
identifier "longOpts"
. "."
identifier "keySet"
argument_list
( "("
) ")"
. "."
identifier "contains"
argument_list
( "("
identifier "opt"
) ")"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "Collections"
. "."
identifier "singletonList"
argument_list
( "("
identifier "opt"
) ")"
; ";"
} "}"
enhanced_for_statement (+43 nodes collapsed)
return_statement
return "return"
identifier "matchingOpts"
; ";"
} "}"
block_comment "/**\n * Returns whether the named {@link Option} is a mem"...
method_declaration (+48 nodes collapsed)
block_comment "/**\n * Returns whether the named {@link Option} is a mem"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Returns whether the named {@link Option} is a mem"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Returns the OptionGroup the <code>opt</code> belo"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Dump state, suitable for debugging.\n *\n *"...
method_declaration (+101 nodes collapsed)
} "}"