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–65 unchanged (65 lines)
66 ByteString unicode = ByteString.wrap(testString.getBytes(StandardCharsets.UTF_8));
67 ByteString chopped = unicode.substring(2, unicode.size() - 6);
68 assertWithMessage("%s.substring() must have the expected type", classUnderTest)
69 .that(classUnderTest)
70 .isEqualTo(getActualClassName(chopped));
71
72 String roundTripString = chopped.toString(StandardCharsets.UTF_8);
73 assertWithMessage("%s unicode bytes must match", classUnderTest)
74 .that(testString.substring(2, testString.length() - 6))
75 .isEqualTo(roundTripString);
76 }
77
78 @Override
…lines 79–93 unchanged (15 lines)

After

…lines 1–65 unchanged (65 lines)
66 ByteString unicode = ByteString.wrap(testString.getBytes(StandardCharsets.UTF_8));
67 ByteString chopped = unicode.substring(2, unicode.size() - 6);
68 assertWithMessage("%s.substring() must have the expected type", classUnderTest)
69 .that(classUnderTest)
70 .isEqualTo(getActualClassName(chopped));
71
72 String roundTripString = chopped.toStringUtf8();
73 assertWithMessage("%s unicode bytes must match", classUnderTest)
74 .that(testString.substring(2, testString.length() - 6))
75 .isEqualTo(roundTripString);
76 }
77
78 @Override
…lines 79–93 unchanged (15 lines)

Before

program
line_comment "// Protocol Buffers - Google's data interchange format"
line_comment "// Copyright 2008 Google Inc. All rights reserved."
line_comment "//"
line_comment "// Use of this source code is governed by a BSD-style"
line_comment "// license that can be found in the LICENSE file or at"
line_comment "// https://developers.google.com/open-source/licenses/bsd"
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "protobuf"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "truth"
. "."
identifier "Truth"
. "."
identifier "assertWithMessage"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "StandardCharsets"
. "."
identifier "UTF_8"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ByteArrayInputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ByteArrayOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ObjectInputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ObjectOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "UnsupportedEncodingException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "StandardCharsets"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "junit"
. "."
identifier "Before"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "junit"
. "."
identifier "Test"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "junit"
. "."
identifier "runner"
. "."
identifier "RunWith"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "junit"
. "."
identifier "runners"
. "."
identifier "JUnit4"
; ";"
block_comment "/**\n * This class tests {@link BoundedByteString}, which ext"...
class_declaration
modifiers
annotation
@ "@"
identifier "RunWith"
annotation_argument_list
( "("
class_literal
type_identifier "JUnit4"
. "."
class "class"
) ")"
public "public"
class "class"
identifier "BoundedByteStringTest"
superclass
extends "extends"
type_identifier "LiteralByteStringTest"
class_body
{ "{"
method_declaration (+137 nodes collapsed)
method_declaration (+173 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
marker_annotation
@ "@"
identifier "Test"
public "public"
void_type "void"
identifier "testCharsetToString"
formal_parameters
( "("
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "testString"
= "="
string_literal
" "\""
string_fragment "I love unicode "
escape_sequence "\\u1234"
escape_sequence "\\u5678"
string_fragment " characters"
" "\""
; ";"
local_variable_declaration (+24 nodes collapsed)
local_variable_declaration (+25 nodes collapsed)
expression_statement (+32 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "roundTripString"
= "="
method_invocation
identifier "chopped"
. "."
identifier "toString"
argument_list
( "("
field_access
identifier "StandardCharsets"
. "."
identifier "UTF_8"
) ")"
; ";"
expression_statement (+45 nodes collapsed)
} "}"
method_declaration (+174 nodes collapsed)
} "}"

After

program
line_comment "// Protocol Buffers - Google's data interchange format"
line_comment "// Copyright 2008 Google Inc. All rights reserved."
line_comment "//"
line_comment "// Use of this source code is governed by a BSD-style"
line_comment "// license that can be found in the LICENSE file or at"
line_comment "// https://developers.google.com/open-source/licenses/bsd"
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "protobuf"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "truth"
. "."
identifier "Truth"
. "."
identifier "assertWithMessage"
; ";"
import_declaration
import "import"
static "static"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "StandardCharsets"
. "."
identifier "UTF_8"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ByteArrayInputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ByteArrayOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ObjectInputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ObjectOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "UnsupportedEncodingException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "StandardCharsets"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "junit"
. "."
identifier "Before"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "junit"
. "."
identifier "Test"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "junit"
. "."
identifier "runner"
. "."
identifier "RunWith"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "junit"
. "."
identifier "runners"
. "."
identifier "JUnit4"
; ";"
block_comment "/**\n * This class tests {@link BoundedByteString}, which ext"...
class_declaration
modifiers
annotation
@ "@"
identifier "RunWith"
annotation_argument_list
( "("
class_literal
type_identifier "JUnit4"
. "."
class "class"
) ")"
public "public"
class "class"
identifier "BoundedByteStringTest"
superclass
extends "extends"
type_identifier "LiteralByteStringTest"
class_body
{ "{"
method_declaration (+137 nodes collapsed)
method_declaration (+173 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
marker_annotation
@ "@"
identifier "Test"
public "public"
void_type "void"
identifier "testCharsetToString"
formal_parameters
( "("
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "testString"
= "="
string_literal
" "\""
string_fragment "I love unicode "
escape_sequence "\\u1234"
escape_sequence "\\u5678"
string_fragment " characters"
" "\""
; ";"
local_variable_declaration (+24 nodes collapsed)
local_variable_declaration (+25 nodes collapsed)
expression_statement (+32 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "roundTripString"
= "="
method_invocation
identifier "chopped"
. "."
identifier "toStringUtf8"
argument_list
( "("
) ")"
; ";"
expression_statement (+45 nodes collapsed)
} "}"
method_declaration (+174 nodes collapsed)
} "}"