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 docData = Charset.forName(charsetName).decode(byteData).toString();
93 }
94 if (doc == null) {
95 // there are times where there is a spurious byte-order-mark at the start of the text. Shouldn't be present
96 // in utf-8. If after decoding, there is a BOM, strip it; otherwise will cause the parser to go straight
97 // into head mode
98
99 doc = parser.parseInput(docData, baseUri);
100 doc.outputSettings().charset(charsetName);
101 }
102 return doc;
103 }
104
…lines 105–134 unchanged (30 lines)

After

…lines 1–91 unchanged (91 lines)
92 docData = Charset.forName(charsetName).decode(byteData).toString();
93 }
94 if (doc == null) {
95 // there are times where there is a spurious byte-order-mark at the start of the text. Shouldn't be present
96 // in utf-8. If after decoding, there is a BOM, strip it; otherwise will cause the parser to go straight
97 // into head mode
98 if (docData.charAt(0) == 65279)
99 docData = docData.substring(1);
100
101 doc = parser.parseInput(docData, baseUri);
102 doc.outputSettings().charset(charsetName);
103 }
104 return doc;
105 }
…lines 106–136 unchanged (31 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Document"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Element"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
. "."
identifier "Parser"
; ";"
import_declaration
import "import"
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "ByteBuffer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "Charset"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "regex"
. "."
identifier "Matcher"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "regex"
. "."
identifier "Pattern"
; ";"
block_comment "/**\n * Internal static utilities for handling data.\n *\n */"
class_declaration
modifiers
public "public"
class "class"
identifier "DataUtil"
class_body
{ "{"
field_declaration (+31 nodes collapsed)
field_declaration
modifiers
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "defaultCharset"
= "="
string_literal
" "\""
string_fragment "UTF-8"
" "\""
; ";"
line_comment "// used if not found in header or meta charset"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "bufferSize"
= "="
hex_integer_literal "0x20000"
; ";"
line_comment "// ~130K."
constructor_declaration
modifiers
private "private"
identifier "DataUtil"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
} "}"
block_comment "/**\n * Loads a file to a Document.\n * @param in file"...
method_declaration (+106 nodes collapsed)
block_comment "/**\n * Parses a Document from an input steam.\n * @pa"...
method_declaration (+59 nodes collapsed)
block_comment "/**\n * Parses a Document from an input steam, using the "...
method_declaration (+57 nodes collapsed)
line_comment "// reads bytes first into a buffer, then decodes with the ap"...
line_comment "// switching the chartset midstream when a meta http-equiv t"...
method_declaration
modifiers
static "static"
type_identifier "Document"
identifier "parseByteData"
formal_parameters
( "("
formal_parameter
type_identifier "ByteBuffer"
identifier "byteData"
, ","
formal_parameter
type_identifier "String"
identifier "charsetName"
, ","
formal_parameter
type_identifier "String"
identifier "baseUri"
, ","
formal_parameter
type_identifier "Parser"
identifier "parser"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "docData"
; ";"
local_variable_declaration
type_identifier "Document"
variable_declarator
identifier "doc"
= "="
null_literal "null"
; ";"
if_statement (+268 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "doc"
== "=="
null_literal "null"
) ")"
block
{ "{"
line_comment "// there are times where there is a spurious byte-order-mark"...
line_comment "// in utf-8. If after decoding, there is a BOM, strip it; ot"...
line_comment "// into head mode"
expression_statement
assignment_expression
identifier "doc"
= "="
method_invocation
identifier "parser"
. "."
identifier "parseInput"
argument_list
( "("
identifier "docData"
, ","
identifier "baseUri"
) ")"
; ";"
expression_statement
method_invocation
method_invocation
identifier "doc"
. "."
identifier "outputSettings"
argument_list
( "("
) ")"
. "."
identifier "charset"
argument_list
( "("
identifier "charsetName"
) ")"
; ";"
} "}"
return_statement
return "return"
identifier "doc"
; ";"
} "}"
method_declaration (+129 nodes collapsed)
block_comment "/**\n * Parse out a charset from a content type header.\n "...
method_declaration (+83 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Document"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Element"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
. "."
identifier "Parser"
; ";"
import_declaration
import "import"
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "ByteBuffer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "Charset"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "regex"
. "."
identifier "Matcher"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "regex"
. "."
identifier "Pattern"
; ";"
block_comment "/**\n * Internal static utilities for handling data.\n *\n */"
class_declaration
modifiers
public "public"
class "class"
identifier "DataUtil"
class_body
{ "{"
field_declaration (+31 nodes collapsed)
field_declaration
modifiers
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "defaultCharset"
= "="
string_literal
" "\""
string_fragment "UTF-8"
" "\""
; ";"
line_comment "// used if not found in header or meta charset"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "bufferSize"
= "="
hex_integer_literal "0x20000"
; ";"
line_comment "// ~130K."
constructor_declaration
modifiers
private "private"
identifier "DataUtil"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
} "}"
block_comment "/**\n * Loads a file to a Document.\n * @param in file"...
method_declaration (+106 nodes collapsed)
block_comment "/**\n * Parses a Document from an input steam.\n * @pa"...
method_declaration (+59 nodes collapsed)
block_comment "/**\n * Parses a Document from an input steam, using the "...
method_declaration (+57 nodes collapsed)
line_comment "// reads bytes first into a buffer, then decodes with the ap"...
line_comment "// switching the chartset midstream when a meta http-equiv t"...
method_declaration
modifiers
static "static"
type_identifier "Document"
identifier "parseByteData"
formal_parameters
( "("
formal_parameter
type_identifier "ByteBuffer"
identifier "byteData"
, ","
formal_parameter
type_identifier "String"
identifier "charsetName"
, ","
formal_parameter
type_identifier "String"
identifier "baseUri"
, ","
formal_parameter
type_identifier "Parser"
identifier "parser"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "docData"
; ";"
local_variable_declaration
type_identifier "Document"
variable_declarator
identifier "doc"
= "="
null_literal "null"
; ";"
if_statement (+268 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "doc"
== "=="
null_literal "null"
) ")"
block
{ "{"
line_comment "// there are times where there is a spurious byte-order-mark"...
line_comment "// in utf-8. If after decoding, there is a BOM, strip it; ot"...
line_comment "// into head mode"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "docData"
. "."
identifier "charAt"
argument_list
( "("
decimal_integer_literal "0"
) ")"
== "=="
decimal_integer_literal "65279"
) ")"
expression_statement
assignment_expression
identifier "docData"
= "="
method_invocation
identifier "docData"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "1"
) ")"
; ";"
expression_statement
assignment_expression
identifier "doc"
= "="
method_invocation
identifier "parser"
. "."
identifier "parseInput"
argument_list
( "("
identifier "docData"
, ","
identifier "baseUri"
) ")"
; ";"
expression_statement
method_invocation
method_invocation
identifier "doc"
. "."
identifier "outputSettings"
argument_list
( "("
) ")"
. "."
identifier "charset"
argument_list
( "("
identifier "charsetName"
) ")"
; ";"
} "}"
return_statement
return "return"
identifier "doc"
; ";"
} "}"
method_declaration (+129 nodes collapsed)
block_comment "/**\n * Parse out a charset from a content type header.\n "...
method_declaration (+83 nodes collapsed)
} "}"