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–58 unchanged (58 lines)
59 * should be removed.
60 *
61 * @return The string without the leading and trailing quotes.
62 */
63 static String stripLeadingAndTrailingQuotes(String str)
64 {
65 if (str.startsWith("\""))
66 {
67 str = str.substring(1, str.length());
68 }
69 int length = str.length();
70 if (str.endsWith("\""))
71 {
72 str = str.substring(0, length - 1);
73 }
74
75 return str;
76 }
77}
78

After

…lines 1–58 unchanged (58 lines)
59 * should be removed.
60 *
61 * @return The string without the leading and trailing quotes.
62 */
63 static String stripLeadingAndTrailingQuotes(String str)
64 {
65 int length = str.length();
66 if (length > 1 && str.startsWith("\"") && str.endsWith("\"") && str.substring(1, length - 1).indexOf('"') == -1)
67 {
68 str = str.substring(1, length - 1);
69 }
70
71 return str;
72 }
73}
74

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"
; ";"
block_comment "/**\n * Contains useful helper methods for classes within thi"...
class_declaration
class "class"
identifier "Util"
class_body
{ "{"
block_comment "/**\n * Remove the hyphens from the begining of <code>str"...
method_declaration (+111 nodes collapsed)
block_comment "/**\n * Remove the leading and trailing quotes from <code"...
method_declaration
modifiers
static "static"
type_identifier "String"
identifier "stripLeadingAndTrailingQuotes"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "str"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "str"
. "."
identifier "startsWith"
argument_list
( "("
string_literal
" "\""
escape_sequence "\\\""
" "\""
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "str"
= "="
method_invocation
identifier "str"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "1"
, ","
method_invocation
identifier "str"
. "."
identifier "length"
argument_list
( "("
) ")"
) ")"
; ";"
} "}"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "length"
= "="
method_invocation
identifier "str"
. "."
identifier "length"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "str"
. "."
identifier "endsWith"
argument_list
( "("
string_literal
" "\""
escape_sequence "\\\""
" "\""
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "str"
= "="
method_invocation
identifier "str"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
binary_expression
identifier "length"
- "-"
decimal_integer_literal "1"
) ")"
; ";"
} "}"
return_statement
return "return"
identifier "str"
; ";"
} "}"
} "}"

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"
; ";"
block_comment "/**\n * Contains useful helper methods for classes within thi"...
class_declaration
class "class"
identifier "Util"
class_body
{ "{"
block_comment "/**\n * Remove the hyphens from the begining of <code>str"...
method_declaration (+111 nodes collapsed)
block_comment "/**\n * Remove the leading and trailing quotes from <code"...
method_declaration
modifiers
static "static"
type_identifier "String"
identifier "stripLeadingAndTrailingQuotes"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "str"
) ")"
block
{ "{"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "length"
= "="
method_invocation
identifier "str"
. "."
identifier "length"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
binary_expression
binary_expression
identifier "length"
> ">"
decimal_integer_literal "1"
&& "&&"
method_invocation
identifier "str"
. "."
identifier "startsWith"
argument_list
( "("
string_literal
" "\""
escape_sequence "\\\""
" "\""
) ")"
&& "&&"
method_invocation
identifier "str"
. "."
identifier "endsWith"
argument_list
( "("
string_literal
" "\""
escape_sequence "\\\""
" "\""
) ")"
&& "&&"
binary_expression
method_invocation
method_invocation
identifier "str"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "1"
, ","
binary_expression
identifier "length"
- "-"
decimal_integer_literal "1"
) ")"
. "."
identifier "indexOf"
argument_list
( "("
character_literal "'\"'"
) ")"
== "=="
unary_expression
- "-"
decimal_integer_literal "1"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "str"
= "="
method_invocation
identifier "str"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "1"
, ","
binary_expression
identifier "length"
- "-"
decimal_integer_literal "1"
) ")"
; ";"
} "}"
return_statement
return "return"
identifier "str"
; ";"
} "}"
} "}"