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–69 unchanged (69 lines)
70 txt = txt.replaceAll("^tough", "tou2f");
71 txt = txt.replaceAll("^enough", "enou2f"); // 2.0 only
72 txt = txt.replaceAll("^trough", "trou2f"); // 2.0 only - note the spec says ^enough here again, c+p error I assume
73 txt = txt.replaceAll("^gn", "2n");
74
75 // End
76 txt = txt.replaceAll("^mb", "m2");
77
78 // 4. Handle replacements
79 txt = txt.replaceAll("cq", "2q");
80 txt = txt.replaceAll("ci", "si");
81 txt = txt.replaceAll("ce", "se");
82 txt = txt.replaceAll("cy", "sy");
…lines 83–186 unchanged (104 lines)

After

…lines 1–69 unchanged (69 lines)
70 txt = txt.replaceAll("^tough", "tou2f");
71 txt = txt.replaceAll("^enough", "enou2f"); // 2.0 only
72 txt = txt.replaceAll("^trough", "trou2f"); // 2.0 only - note the spec says ^enough here again, c+p error I assume
73 txt = txt.replaceAll("^gn", "2n");
74
75 // End
76 txt = txt.replaceAll("mb$", "m2");
77
78 // 4. Handle replacements
79 txt = txt.replaceAll("cq", "2q");
80 txt = txt.replaceAll("ci", "si");
81 txt = txt.replaceAll("ce", "se");
82 txt = txt.replaceAll("cy", "sy");
…lines 83–186 unchanged (104 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 "codec"
. "."
identifier "language"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "EncoderException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "StringEncoder"
; ";"
block_comment "/**\n * Encodes a string into a Caverphone value.\n * \n * This"...
class_declaration
modifiers
public "public"
class "class"
identifier "Caverphone"
super_interfaces
implements "implements"
type_list
type_identifier "StringEncoder"
class_body
{ "{"
block_comment "/**\n * Creates an instance of the Caverphone encoder\n "...
constructor_declaration
modifiers
public "public"
identifier "Caverphone"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Encodes the given String into a Caverphone value."...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "caverphone"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "txt"
) ")"
block
{ "{"
line_comment "// NOTE: Version 1.0 of Caverphone is easily derivable from "...
line_comment "// by commenting out the 2.0 lines and adding in the 1.0 lin"...
if_statement (+31 nodes collapsed)
line_comment "// 1. Convert to lowercase"
expression_statement (+22 nodes collapsed)
line_comment "// 2. Remove anything not A-Z"
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "[^a-z]"
" "\""
, ","
string_literal
" "\""
" "\""
) ")"
; ";"
line_comment "// 2.5. Remove final e"
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "e$"
" "\""
, ","
string_literal
" "\""
" "\""
) ")"
; ";"
line_comment "// 2.0 only"
line_comment "// 3. Handle various start options"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only - note the spec says ^enough here again, c+p err"...
expression_statement (+21 nodes collapsed)
line_comment "// End "
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "^mb"
" "\""
, ","
string_literal
" "\""
string_fragment "m2"
" "\""
) ")"
; ";"
line_comment "// 4. Handle replacements"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "//txt = txt.replaceAll(\"wy\", \"Wy\"); // 1.0 only"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
line_comment "//txt = txt.replaceAll(\"why\", \"Why\"); // 1.0 only"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
line_comment "//txt = txt.replaceAll(\"ry\", \"Ry\"); // 1.0 only"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
line_comment "//txt = txt.replaceAll(\"ly\", \"Ly\"); // 1.0 only"
expression_statement (+21 nodes collapsed)
line_comment "//txt = txt.replaceAll(\"j\", \"y\"); // 1.0 only"
line_comment "//txt = txt.replaceAll(\"y3\", \"Y3\"); // 1.0 only"
line_comment "//txt = txt.replaceAll(\"y\", \"2\"); // 1.0 only"
line_comment "// 5. Handle removals"
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "2"
" "\""
, ","
string_literal
" "\""
" "\""
) ")"
; ";"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "3"
" "\""
, ","
string_literal
" "\""
" "\""
) ")"
; ";"
line_comment "// 6. put ten 1s on the end"
expression_statement
assignment_expression
identifier "txt"
= "="
binary_expression
binary_expression
identifier "txt"
+ "+"
string_literal
" "\""
string_fragment "111111"
" "\""
+ "+"
string_literal
" "\""
string_fragment "1111"
" "\""
; ";"
line_comment "// 1.0 only has 6 1s"
line_comment "// 7. take the first six characters as the code"
return_statement
return "return"
method_invocation
identifier "txt"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
decimal_integer_literal "10"
) ")"
; ";"
line_comment "// 1.0 truncates to 6"
} "}"
block_comment "/**\n * Encodes an Object using the caverphone algorithm."...
method_declaration (+60 nodes collapsed)
block_comment "/**\n * Encodes a String using the Caverphone algorithm. "...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Tests if the caverphones of two strings are ident"...
method_declaration (+39 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 "codec"
. "."
identifier "language"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "EncoderException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "StringEncoder"
; ";"
block_comment "/**\n * Encodes a string into a Caverphone value.\n * \n * This"...
class_declaration
modifiers
public "public"
class "class"
identifier "Caverphone"
super_interfaces
implements "implements"
type_list
type_identifier "StringEncoder"
class_body
{ "{"
block_comment "/**\n * Creates an instance of the Caverphone encoder\n "...
constructor_declaration
modifiers
public "public"
identifier "Caverphone"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Encodes the given String into a Caverphone value."...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "caverphone"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "txt"
) ")"
block
{ "{"
line_comment "// NOTE: Version 1.0 of Caverphone is easily derivable from "...
line_comment "// by commenting out the 2.0 lines and adding in the 1.0 lin"...
if_statement (+31 nodes collapsed)
line_comment "// 1. Convert to lowercase"
expression_statement (+22 nodes collapsed)
line_comment "// 2. Remove anything not A-Z"
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "[^a-z]"
" "\""
, ","
string_literal
" "\""
" "\""
) ")"
; ";"
line_comment "// 2.5. Remove final e"
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "e$"
" "\""
, ","
string_literal
" "\""
" "\""
) ")"
; ";"
line_comment "// 2.0 only"
line_comment "// 3. Handle various start options"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only - note the spec says ^enough here again, c+p err"...
expression_statement (+21 nodes collapsed)
line_comment "// End "
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "mb$"
" "\""
, ","
string_literal
" "\""
string_fragment "m2"
" "\""
) ")"
; ";"
line_comment "// 4. Handle replacements"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "//txt = txt.replaceAll(\"wy\", \"Wy\"); // 1.0 only"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
line_comment "//txt = txt.replaceAll(\"why\", \"Why\"); // 1.0 only"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
line_comment "//txt = txt.replaceAll(\"ry\", \"Ry\"); // 1.0 only"
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
line_comment "//txt = txt.replaceAll(\"ly\", \"Ly\"); // 1.0 only"
expression_statement (+21 nodes collapsed)
line_comment "//txt = txt.replaceAll(\"j\", \"y\"); // 1.0 only"
line_comment "//txt = txt.replaceAll(\"y3\", \"Y3\"); // 1.0 only"
line_comment "//txt = txt.replaceAll(\"y\", \"2\"); // 1.0 only"
line_comment "// 5. Handle removals"
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "2"
" "\""
, ","
string_literal
" "\""
" "\""
) ")"
; ";"
expression_statement (+21 nodes collapsed)
line_comment "// 2.0 only"
expression_statement
assignment_expression
identifier "txt"
= "="
method_invocation
identifier "txt"
. "."
identifier "replaceAll"
argument_list
( "("
string_literal
" "\""
string_fragment "3"
" "\""
, ","
string_literal
" "\""
" "\""
) ")"
; ";"
line_comment "// 6. put ten 1s on the end"
expression_statement
assignment_expression
identifier "txt"
= "="
binary_expression
binary_expression
identifier "txt"
+ "+"
string_literal
" "\""
string_fragment "111111"
" "\""
+ "+"
string_literal
" "\""
string_fragment "1111"
" "\""
; ";"
line_comment "// 1.0 only has 6 1s"
line_comment "// 7. take the first six characters as the code"
return_statement
return "return"
method_invocation
identifier "txt"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
decimal_integer_literal "10"
) ")"
; ";"
line_comment "// 1.0 truncates to 6"
} "}"
block_comment "/**\n * Encodes an Object using the caverphone algorithm."...
method_declaration (+60 nodes collapsed)
block_comment "/**\n * Encodes a String using the Caverphone algorithm. "...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Tests if the caverphones of two strings are ident"...
method_declaration (+39 nodes collapsed)
} "}"