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–118 unchanged (118 lines)
119 Validate.notEmpty(key);
120 if (attributes == null)
121 return;
122 for (Iterator<String> it = attributes.keySet().iterator(); it.hasNext(); ) {
123 String attrKey = it.next();
124 if (attrKey.equalsIgnoreCase(key))
125 attributes.remove(attrKey);
126 }
127 }
128
129 /**
130 Tests if these attributes contain an attribute with this key.
131 @param key case-sensitive key to check for
…lines 132–343 unchanged (212 lines)

After

…lines 1–118 unchanged (118 lines)
119 Validate.notEmpty(key);
120 if (attributes == null)
121 return;
122 for (Iterator<String> it = attributes.keySet().iterator(); it.hasNext(); ) {
123 String attrKey = it.next();
124 if (attrKey.equalsIgnoreCase(key))
125 it.remove();
126 }
127 }
128
129 /**
130 Tests if these attributes contain an attribute with this key.
131 @param key case-sensitive key to check for
…lines 132–343 unchanged (212 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "SerializationException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "Validate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "AbstractMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "AbstractSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "LinkedHashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * The attributes of an Element.\n * <p>\n * Attributes ar"...
class_declaration
modifiers
public "public"
class "class"
identifier "Attributes"
super_interfaces
implements "implements"
type_list
generic_type
type_identifier "Iterable"
type_arguments
< "<"
type_identifier "Attribute"
> ">"
, ","
type_identifier "Cloneable"
class_body
{ "{"
field_declaration
modifiers
protected "protected"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "dataPrefix"
= "="
string_literal
" "\""
string_fragment "data-"
" "\""
; ";"
field_declaration
modifiers
private "private"
generic_type
type_identifier "LinkedHashMap"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Attribute"
> ">"
variable_declarator
identifier "attributes"
= "="
null_literal "null"
; ";"
line_comment "// linked hash map to preserve insertion order."
line_comment "// null be default as so many elements have no attributes --"...
block_comment "/**\n Get an attribute value by key.\n @param key the "...
method_declaration (+73 nodes collapsed)
block_comment "/**\n * Get an attribute's value by case-insensitive key\n"...
method_declaration (+92 nodes collapsed)
block_comment "/**\n Set a new attribute, or replace an existing one by "...
method_declaration (+41 nodes collapsed)
block_comment "/**\n Set a new boolean attribute, remove attribute if val"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n Set a new attribute, or replace an existing one by "...
method_declaration (+70 nodes collapsed)
block_comment "/**\n Remove an attribute by key. <b>Case sensitive.</b>\n"...
method_declaration (+46 nodes collapsed)
block_comment "/**\n Remove an attribute by key. <b>Case insensitive.</b"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "removeIgnoreCase"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "key"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "Validate"
. "."
identifier "notEmpty"
argument_list
( "("
identifier "key"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "attributes"
== "=="
null_literal "null"
) ")"
return_statement
return "return"
; ";"
for_statement
for "for"
( "("
local_variable_declaration (+24 nodes collapsed)
method_invocation
identifier "it"
. "."
identifier "hasNext"
argument_list
( "("
) ")"
; ";"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "attrKey"
= "="
method_invocation
identifier "it"
. "."
identifier "next"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "attrKey"
. "."
identifier "equalsIgnoreCase"
argument_list
( "("
identifier "key"
) ")"
) ")"
expression_statement
method_invocation
identifier "attributes"
. "."
identifier "remove"
argument_list
( "("
identifier "attrKey"
) ")"
; ";"
} "}"
} "}"
block_comment "/**\n Tests if these attributes contain an attribute with"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n Tests if these attributes contain an attribute with"...
method_declaration (+65 nodes collapsed)
block_comment "/**\n Get the number of attributes in this set.\n @ret"...
method_declaration (+35 nodes collapsed)
block_comment "/**\n Add all the attributes from the incoming set to thi"...
method_declaration (+79 nodes collapsed)
method_declaration (+73 nodes collapsed)
block_comment "/**\n Get the attributes as a List, for iteration. Do not"...
method_declaration (+118 nodes collapsed)
block_comment "/**\n * Retrieves a filtered view of attributes that are "...
method_declaration (+27 nodes collapsed)
block_comment "/**\n Get the HTML representation of these attributes.\n "...
method_declaration (+88 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Checks if these attributes are equal to another s"...
method_declaration (+94 nodes collapsed)
block_comment "/**\n * Calculates the hashcode of these attributes, by i"...
method_declaration (+33 nodes collapsed)
method_declaration (+146 nodes collapsed)
class_declaration (+505 nodes collapsed)
method_declaration (+22 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "SerializationException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "Validate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "AbstractMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "AbstractSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "LinkedHashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * The attributes of an Element.\n * <p>\n * Attributes ar"...
class_declaration
modifiers
public "public"
class "class"
identifier "Attributes"
super_interfaces
implements "implements"
type_list
generic_type
type_identifier "Iterable"
type_arguments
< "<"
type_identifier "Attribute"
> ">"
, ","
type_identifier "Cloneable"
class_body
{ "{"
field_declaration
modifiers
protected "protected"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "dataPrefix"
= "="
string_literal
" "\""
string_fragment "data-"
" "\""
; ";"
field_declaration
modifiers
private "private"
generic_type
type_identifier "LinkedHashMap"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Attribute"
> ">"
variable_declarator
identifier "attributes"
= "="
null_literal "null"
; ";"
line_comment "// linked hash map to preserve insertion order."
line_comment "// null be default as so many elements have no attributes --"...
block_comment "/**\n Get an attribute value by key.\n @param key the "...
method_declaration (+73 nodes collapsed)
block_comment "/**\n * Get an attribute's value by case-insensitive key\n"...
method_declaration (+92 nodes collapsed)
block_comment "/**\n Set a new attribute, or replace an existing one by "...
method_declaration (+41 nodes collapsed)
block_comment "/**\n Set a new boolean attribute, remove attribute if val"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n Set a new attribute, or replace an existing one by "...
method_declaration (+70 nodes collapsed)
block_comment "/**\n Remove an attribute by key. <b>Case sensitive.</b>\n"...
method_declaration (+46 nodes collapsed)
block_comment "/**\n Remove an attribute by key. <b>Case insensitive.</b"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "removeIgnoreCase"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "key"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "Validate"
. "."
identifier "notEmpty"
argument_list
( "("
identifier "key"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "attributes"
== "=="
null_literal "null"
) ")"
return_statement
return "return"
; ";"
for_statement
for "for"
( "("
local_variable_declaration (+24 nodes collapsed)
method_invocation
identifier "it"
. "."
identifier "hasNext"
argument_list
( "("
) ")"
; ";"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "attrKey"
= "="
method_invocation
identifier "it"
. "."
identifier "next"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "attrKey"
. "."
identifier "equalsIgnoreCase"
argument_list
( "("
identifier "key"
) ")"
) ")"
expression_statement
method_invocation
identifier "it"
. "."
identifier "remove"
argument_list
( "("
) ")"
; ";"
} "}"
} "}"
block_comment "/**\n Tests if these attributes contain an attribute with"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n Tests if these attributes contain an attribute with"...
method_declaration (+65 nodes collapsed)
block_comment "/**\n Get the number of attributes in this set.\n @ret"...
method_declaration (+35 nodes collapsed)
block_comment "/**\n Add all the attributes from the incoming set to thi"...
method_declaration (+79 nodes collapsed)
method_declaration (+73 nodes collapsed)
block_comment "/**\n Get the attributes as a List, for iteration. Do not"...
method_declaration (+118 nodes collapsed)
block_comment "/**\n * Retrieves a filtered view of attributes that are "...
method_declaration (+27 nodes collapsed)
block_comment "/**\n Get the HTML representation of these attributes.\n "...
method_declaration (+88 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Checks if these attributes are equal to another s"...
method_declaration (+94 nodes collapsed)
block_comment "/**\n * Calculates the hashcode of these attributes, by i"...
method_declaration (+33 nodes collapsed)
method_declaration (+146 nodes collapsed)
class_declaration (+505 nodes collapsed)
method_declaration (+22 nodes collapsed)
} "}"