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–111 unchanged (111 lines)
112 * @throws IllegalStateException if the StopWatch is not running.
113 */
114 public void stop() {
115 if(this.runningState != STATE_RUNNING && this.runningState != STATE_SUSPENDED) {
116 throw new IllegalStateException("Stopwatch is not running. ");
117 }
118 stopTime = System.currentTimeMillis();
119 this.runningState = STATE_STOPPED;
120 }
121
122 /**
123 * <p>Resets the stopwatch. Stops it if need be. </p>
124 *
125 * <p>This method clears the internal values to allow the object to be reused.</p>
…lines 126–264 unchanged (139 lines)

After

…lines 1–111 unchanged (111 lines)
112 * @throws IllegalStateException if the StopWatch is not running.
113 */
114 public void stop() {
115 if(this.runningState != STATE_RUNNING && this.runningState != STATE_SUSPENDED) {
116 throw new IllegalStateException("Stopwatch is not running. ");
117 }
118 if(this.runningState == STATE_RUNNING) {
119 stopTime = System.currentTimeMillis();
120 }
121 this.runningState = STATE_STOPPED;
122 }
123
124 /**
125 * <p>Resets the stopwatch. Stops it if need be. </p>
126 *
…lines 127–266 unchanged (140 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 "lang"
. "."
identifier "time"
; ";"
block_comment "/**\n * <p><code>StopWatch</code> provides a convenient API f"...
class_declaration
modifiers
public "public"
class "class"
identifier "StopWatch"
class_body
{ "{"
line_comment "// running states"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_UNSTARTED"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_RUNNING"
= "="
decimal_integer_literal "1"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_STOPPED"
= "="
decimal_integer_literal "2"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_SUSPENDED"
= "="
decimal_integer_literal "3"
; ";"
line_comment "// split state"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_UNSPLIT"
= "="
decimal_integer_literal "10"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_SPLIT"
= "="
decimal_integer_literal "11"
; ";"
block_comment "/**\n * The current running state of the StopWatch. \n "...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "runningState"
= "="
identifier "STATE_UNSTARTED"
; ";"
block_comment "/**\n * Whether the stopwatch has a split time recorded. "...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "splitState"
= "="
identifier "STATE_UNSPLIT"
; ";"
block_comment "/**\n * The start time.\n */"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "startTime"
= "="
unary_expression
- "-"
decimal_integer_literal "1"
; ";"
block_comment "/**\n * The stop time.\n */"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "stopTime"
= "="
unary_expression
- "-"
decimal_integer_literal "1"
; ";"
block_comment "/**\n * <p>Constructor.</p>\n */"
constructor_declaration
modifiers
public "public"
identifier "StopWatch"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * <p>Start the stopwatch.</p>\n * \n * <p>Thi"...
method_declaration (+96 nodes collapsed)
block_comment "/**\n * <p>Stop the stopwatch.</p>\n * \n * <p>This"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "stop"
formal_parameters
( "("
) ")"
block
{ "{"
if_statement (+37 nodes collapsed)
expression_statement
assignment_expression
identifier "stopTime"
= "="
method_invocation
identifier "System"
. "."
identifier "currentTimeMillis"
argument_list
( "("
) ")"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "runningState"
= "="
identifier "STATE_STOPPED"
; ";"
} "}"
block_comment "/**\n * <p>Resets the stopwatch. Stops it if need be. </p"...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * <p>Split the time.</p>\n * \n * <p>This met"...
method_declaration (+60 nodes collapsed)
block_comment "/**\n * <p>Remove a split.</p>\n * \n * <p>This met"...
method_declaration (+56 nodes collapsed)
block_comment "/**\n * <p>Suspend the stopwatch for later resumption.</p"...
method_declaration (+60 nodes collapsed)
block_comment "/**\n * <p>Resume the stopwatch after a suspend.</p>\n "...
method_declaration (+74 nodes collapsed)
block_comment "/**\n * <p>Get the time on the stopwatch.</p>\n * \n "...
method_declaration (+114 nodes collapsed)
block_comment "/**\n * <p>Get the split time on the stopwatch.</p>\n "...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * <p>Gets a summary of the time that the stopwatch "...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * <p>Gets a summary of the split time that the stop"...
method_declaration (+26 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 "lang"
. "."
identifier "time"
; ";"
block_comment "/**\n * <p><code>StopWatch</code> provides a convenient API f"...
class_declaration
modifiers
public "public"
class "class"
identifier "StopWatch"
class_body
{ "{"
line_comment "// running states"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_UNSTARTED"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_RUNNING"
= "="
decimal_integer_literal "1"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_STOPPED"
= "="
decimal_integer_literal "2"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_SUSPENDED"
= "="
decimal_integer_literal "3"
; ";"
line_comment "// split state"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_UNSPLIT"
= "="
decimal_integer_literal "10"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "STATE_SPLIT"
= "="
decimal_integer_literal "11"
; ";"
block_comment "/**\n * The current running state of the StopWatch. \n "...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "runningState"
= "="
identifier "STATE_UNSTARTED"
; ";"
block_comment "/**\n * Whether the stopwatch has a split time recorded. "...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "splitState"
= "="
identifier "STATE_UNSPLIT"
; ";"
block_comment "/**\n * The start time.\n */"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "startTime"
= "="
unary_expression
- "-"
decimal_integer_literal "1"
; ";"
block_comment "/**\n * The stop time.\n */"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "stopTime"
= "="
unary_expression
- "-"
decimal_integer_literal "1"
; ";"
block_comment "/**\n * <p>Constructor.</p>\n */"
constructor_declaration
modifiers
public "public"
identifier "StopWatch"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * <p>Start the stopwatch.</p>\n * \n * <p>Thi"...
method_declaration (+96 nodes collapsed)
block_comment "/**\n * <p>Stop the stopwatch.</p>\n * \n * <p>This"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "stop"
formal_parameters
( "("
) ")"
block
{ "{"
if_statement (+37 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
field_access
this "this"
. "."
identifier "runningState"
== "=="
identifier "STATE_RUNNING"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "stopTime"
= "="
method_invocation
identifier "System"
. "."
identifier "currentTimeMillis"
argument_list
( "("
) ")"
; ";"
} "}"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "runningState"
= "="
identifier "STATE_STOPPED"
; ";"
} "}"
block_comment "/**\n * <p>Resets the stopwatch. Stops it if need be. </p"...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * <p>Split the time.</p>\n * \n * <p>This met"...
method_declaration (+60 nodes collapsed)
block_comment "/**\n * <p>Remove a split.</p>\n * \n * <p>This met"...
method_declaration (+56 nodes collapsed)
block_comment "/**\n * <p>Suspend the stopwatch for later resumption.</p"...
method_declaration (+60 nodes collapsed)
block_comment "/**\n * <p>Resume the stopwatch after a suspend.</p>\n "...
method_declaration (+74 nodes collapsed)
block_comment "/**\n * <p>Get the time on the stopwatch.</p>\n * \n "...
method_declaration (+114 nodes collapsed)
block_comment "/**\n * <p>Get the split time on the stopwatch.</p>\n "...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * <p>Gets a summary of the time that the stopwatch "...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * <p>Gets a summary of the split time that the stop"...
method_declaration (+26 nodes collapsed)
} "}"