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–12 unchanged (12 lines)
13
14 private static final long serialVersionUID = 4475297236197939568L;
15 private Class<?>[] extraInterfaces;
16 private String name;
17 private Object spiedInstance;
18 private Answer<Object> defaultAnswer;
19 private MockName mockName;
20
21 public MockSettings serializable() {
22 return this.extraInterfaces(java.io.Serializable.class);
23 }
24
25 public MockSettings extraInterfaces(Class<?>... extraInterfaces) {
26 if (extraInterfaces == null || extraInterfaces.length == 0) {
27 new Reporter().extraInterfacesRequiresAtLeastOneInterface();
28 }
…lines 29–67 unchanged (39 lines)
68
69 public Answer<Object> getDefaultAnswer() {
70 return defaultAnswer;
71 }
72
73 public boolean isSerializable() {
74 return extraInterfaces != null && java.util.Arrays.asList(extraInterfaces).contains(java.io.Serializable.class);
75 }
76
77 public void initiateMockName(Class classToMock) {
78 mockName = new MockName(name, classToMock);
79 }
80}

After

…lines 1–13 unchanged (13 lines)
14 private static final long serialVersionUID = 4475297236197939568L;
15 private Class<?>[] extraInterfaces;
16 private String name;
17 private Object spiedInstance;
18 private Answer<Object> defaultAnswer;
19 private MockName mockName;
20 private boolean serializable;
21
22 public MockSettings serializable() {
23 this.serializable = true;
24 return this;
25 }
26
27 public MockSettings extraInterfaces(Class<?>... extraInterfaces) {
28 if (extraInterfaces == null || extraInterfaces.length == 0) {
29 new Reporter().extraInterfacesRequiresAtLeastOneInterface();
30 }
…lines 31–69 unchanged (39 lines)
70
71 public Answer<Object> getDefaultAnswer() {
72 return defaultAnswer;
73 }
74
75 public boolean isSerializable() {
76 return serializable;
77 }
78
79 public void initiateMockName(Class classToMock) {
80 mockName = new MockName(name, classToMock);
81 }
82}

Before

program
block_comment "/*\r\n * Copyright (c) 2007 Mockito contributors\r\n * This prog"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "creation"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "MockSettings"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "exceptions"
. "."
identifier "Reporter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "util"
. "."
identifier "MockName"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "stubbing"
. "."
identifier "Answer"
; ";"
class_declaration
modifiers
public "public"
class "class"
identifier "MockSettingsImpl"
super_interfaces
implements "implements"
type_list
type_identifier "MockSettings"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "4475297236197939568L"
; ";"
field_declaration
modifiers
private "private"
array_type
generic_type
type_identifier "Class"
type_arguments
< "<"
wildcard
? "?"
> ">"
dimensions
[ "["
] "]"
variable_declarator
identifier "extraInterfaces"
; ";"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "name"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Object"
variable_declarator
identifier "spiedInstance"
; ";"
field_declaration
modifiers
private "private"
generic_type
type_identifier "Answer"
type_arguments
< "<"
type_identifier "Object"
> ">"
variable_declarator
identifier "defaultAnswer"
; ";"
field_declaration
modifiers
private "private"
type_identifier "MockName"
variable_declarator
identifier "mockName"
; ";"
method_declaration
modifiers
public "public"
type_identifier "MockSettings"
identifier "serializable"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
this "this"
. "."
identifier "extraInterfaces"
argument_list
( "("
class_literal
scoped_type_identifier
scoped_type_identifier
type_identifier "java"
. "."
type_identifier "io"
. "."
type_identifier "Serializable"
. "."
class "class"
) ")"
; ";"
} "}"
method_declaration (+146 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "MockName"
identifier "getMockName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mockName"
; ";"
} "}"
method_declaration (+25 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "Object"
identifier "getSpiedInstance"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "spiedInstance"
; ";"
} "}"
method_declaration (+27 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+37 nodes collapsed)
method_declaration
modifiers
public "public"
generic_type
type_identifier "Answer"
type_arguments
< "<"
type_identifier "Object"
> ">"
identifier "getDefaultAnswer"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultAnswer"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isSerializable"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
binary_expression
identifier "extraInterfaces"
!= "!="
null_literal "null"
&& "&&"
method_invocation
method_invocation
field_access
field_access
identifier "java"
. "."
identifier "util"
. "."
identifier "Arrays"
. "."
identifier "asList"
argument_list
( "("
identifier "extraInterfaces"
) ")"
. "."
identifier "contains"
argument_list
( "("
class_literal
scoped_type_identifier
scoped_type_identifier
type_identifier "java"
. "."
type_identifier "io"
. "."
type_identifier "Serializable"
. "."
class "class"
) ")"
; ";"
} "}"
method_declaration (+28 nodes collapsed)
} "}"

After

program
block_comment "/*\r\n * Copyright (c) 2007 Mockito contributors\r\n * This prog"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "creation"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "MockSettings"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "exceptions"
. "."
identifier "Reporter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "util"
. "."
identifier "MockName"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "stubbing"
. "."
identifier "Answer"
; ";"
class_declaration
modifiers
public "public"
class "class"
identifier "MockSettingsImpl"
super_interfaces
implements "implements"
type_list
type_identifier "MockSettings"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "4475297236197939568L"
; ";"
field_declaration
modifiers
private "private"
array_type
generic_type
type_identifier "Class"
type_arguments
< "<"
wildcard
? "?"
> ">"
dimensions
[ "["
] "]"
variable_declarator
identifier "extraInterfaces"
; ";"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "name"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Object"
variable_declarator
identifier "spiedInstance"
; ";"
field_declaration
modifiers
private "private"
generic_type
type_identifier "Answer"
type_arguments
< "<"
type_identifier "Object"
> ">"
variable_declarator
identifier "defaultAnswer"
; ";"
field_declaration
modifiers
private "private"
type_identifier "MockName"
variable_declarator
identifier "mockName"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "serializable"
; ";"
method_declaration
modifiers
public "public"
type_identifier "MockSettings"
identifier "serializable"
formal_parameters
( "("
) ")"
block
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "serializable"
= "="
true "true"
; ";"
return_statement
return "return"
this "this"
; ";"
} "}"
method_declaration (+146 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "MockName"
identifier "getMockName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mockName"
; ";"
} "}"
method_declaration (+25 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "Object"
identifier "getSpiedInstance"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "spiedInstance"
; ";"
} "}"
method_declaration (+27 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+37 nodes collapsed)
method_declaration
modifiers
public "public"
generic_type
type_identifier "Answer"
type_arguments
< "<"
type_identifier "Object"
> ">"
identifier "getDefaultAnswer"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultAnswer"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isSerializable"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "serializable"
; ";"
} "}"
method_declaration (+28 nodes collapsed)
} "}"