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–91 unchanged (91 lines)
92 return;
93 }
94
95 // if no option has already been selected or the
96 // same option is being reselected then set the
97 // selected member variable
98 if (selected == null || selected.equals(option.getOpt()))
99 {
100 selected = option.getOpt();
101 }
102 else
103 {
104 throw new AlreadySelectedException(this, option);
105 }
106 }
…lines 107–176 unchanged (70 lines)

After

…lines 1–91 unchanged (91 lines)
92 return;
93 }
94
95 // if no option has already been selected or the
96 // same option is being reselected then set the
97 // selected member variable
98 if (selected == null || selected.equals(option.getKey()))
99 {
100 selected = option.getKey();
101 }
102 else
103 {
104 throw new AlreadySelectedException(this, option);
105 }
106 }
…lines 107–176 unchanged (70 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 "Collection"
; ";"
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 "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * A group of mutually exclusive options.\n *\n * @author "...
class_declaration
modifiers
public "public"
class "class"
identifier "OptionGroup"
super_interfaces
implements "implements"
type_list
type_identifier "Serializable"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
block_comment "/** hold the options */"
field_declaration
modifiers
private "private"
type_identifier "Map"
variable_declarator
identifier "optionMap"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
block_comment "/** the name of the selected option */"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "selected"
; ";"
block_comment "/** specified whether this group is required */"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "required"
; ";"
block_comment "/**\n * Add the specified <code>Option</code> to this gro"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * @return the names of the options in this group as"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * @return the options in this group as a <code>Coll"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Set the selected option of this group to <code>na"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "setSelected"
formal_parameters
( "("
formal_parameter
type_identifier "Option"
identifier "option"
) ")"
throws
throws "throws"
type_identifier "AlreadySelectedException"
block
{ "{"
if_statement (+22 nodes collapsed)
line_comment "// if no option has already been selected or the "
line_comment "// same option is being reselected then set the"
line_comment "// selected member variable"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "selected"
== "=="
null_literal "null"
|| "||"
method_invocation
identifier "selected"
. "."
identifier "equals"
argument_list
( "("
method_invocation
identifier "option"
. "."
identifier "getOpt"
argument_list
( "("
) ")"
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "selected"
= "="
method_invocation
identifier "option"
. "."
identifier "getOpt"
argument_list
( "("
) ")"
; ";"
} "}"
else "else"
block
{ "{"
throw_statement
throw "throw"
object_creation_expression
new "new"
type_identifier "AlreadySelectedException"
argument_list
( "("
this "this"
, ","
identifier "option"
) ")"
; ";"
} "}"
} "}"
block_comment "/**\n * @return the selected option name\n */"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getSelected"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "selected"
; ";"
} "}"
block_comment "/**\n * @param required specifies if this group is requir"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns whether this option group is required.\n "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isRequired"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "required"
; ";"
} "}"
block_comment "/**\n * Returns the stringified version of this OptionGro"...
method_declaration (+245 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 "Collection"
; ";"
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 "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * A group of mutually exclusive options.\n *\n * @author "...
class_declaration
modifiers
public "public"
class "class"
identifier "OptionGroup"
super_interfaces
implements "implements"
type_list
type_identifier "Serializable"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
block_comment "/** hold the options */"
field_declaration
modifiers
private "private"
type_identifier "Map"
variable_declarator
identifier "optionMap"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
block_comment "/** the name of the selected option */"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "selected"
; ";"
block_comment "/** specified whether this group is required */"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "required"
; ";"
block_comment "/**\n * Add the specified <code>Option</code> to this gro"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * @return the names of the options in this group as"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * @return the options in this group as a <code>Coll"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Set the selected option of this group to <code>na"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "setSelected"
formal_parameters
( "("
formal_parameter
type_identifier "Option"
identifier "option"
) ")"
throws
throws "throws"
type_identifier "AlreadySelectedException"
block
{ "{"
if_statement (+22 nodes collapsed)
line_comment "// if no option has already been selected or the "
line_comment "// same option is being reselected then set the"
line_comment "// selected member variable"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "selected"
== "=="
null_literal "null"
|| "||"
method_invocation
identifier "selected"
. "."
identifier "equals"
argument_list
( "("
method_invocation
identifier "option"
. "."
identifier "getKey"
argument_list
( "("
) ")"
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "selected"
= "="
method_invocation
identifier "option"
. "."
identifier "getKey"
argument_list
( "("
) ")"
; ";"
} "}"
else "else"
block
{ "{"
throw_statement
throw "throw"
object_creation_expression
new "new"
type_identifier "AlreadySelectedException"
argument_list
( "("
this "this"
, ","
identifier "option"
) ")"
; ";"
} "}"
} "}"
block_comment "/**\n * @return the selected option name\n */"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getSelected"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "selected"
; ";"
} "}"
block_comment "/**\n * @param required specifies if this group is requir"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns whether this option group is required.\n "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isRequired"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "required"
; ";"
} "}"
block_comment "/**\n * Returns the stringified version of this OptionGro"...
method_declaration (+245 nodes collapsed)
} "}"