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–49 unchanged (49 lines)
50
51 public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
52 if (new ObjectMethodsGuru().isToString(method)) {
53 return "SmartNull returned by unstubbed " + formatMethodCall() + " method on mock";
54 }
55
56 new Reporter().smartNullPointerException(location);
57 return null;
58 }
59
60 private String formatMethodCall() {
61 String args = Arrays.toString(invocation.getArguments());
62 return invocation.getMethod().getName() + "(" + args.substring(1, args.length() - 1) + ")";
…lines 63–80 unchanged (18 lines)

After

…lines 1–49 unchanged (49 lines)
50
51 public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
52 if (new ObjectMethodsGuru().isToString(method)) {
53 return "SmartNull returned by unstubbed " + formatMethodCall() + " method on mock";
54 }
55
56 new Reporter().smartNullPointerException(obj, location);
57 return null;
58 }
59
60 private String formatMethodCall() {
61 String args = Arrays.toString(invocation.getArguments());
62 return invocation.getMethod().getName() + "(" + args.substring(1, args.length() - 1) + ")";
…lines 63–80 unchanged (18 lines)

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
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "stubbing"
. "."
identifier "defaultanswers"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "lang"
. "."
identifier "reflect"
. "."
identifier "Method"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Arrays"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "Mockito"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "cglib"
. "."
identifier "proxy"
. "."
identifier "MethodInterceptor"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "cglib"
. "."
identifier "proxy"
. "."
identifier "MethodProxy"
; ";"
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
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "creation"
. "."
identifier "jmock"
. "."
identifier "ClassImposterizer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "debugging"
. "."
identifier "Location"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "util"
. "."
identifier "ObjectMethodsGuru"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "invocation"
. "."
identifier "InvocationOnMock"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "stubbing"
. "."
identifier "Answer"
; ";"
block_comment "/**\r\n * Optional Answer that can be used with\r\n * {@link Moc"...
class_declaration
modifiers
public "public"
class "class"
identifier "ReturnsSmartNulls"
super_interfaces
implements "implements"
type_list
generic_type
type_identifier "Answer"
type_arguments
< "<"
type_identifier "Object"
> ">"
, ","
type_identifier "Serializable"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "7618312406617949441L"
; ";"
class_declaration
modifiers
private "private"
final "final"
class "class"
identifier "ThrowingInterceptor"
super_interfaces
implements "implements"
type_list
type_identifier "MethodInterceptor"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "InvocationOnMock"
variable_declarator
identifier "invocation"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Location"
variable_declarator
identifier "location"
= "="
object_creation_expression
new "new"
type_identifier "Location"
argument_list
( "("
) ")"
; ";"
constructor_declaration (+22 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "Object"
identifier "intercept"
formal_parameters (+22 nodes collapsed)
throws
throws "throws"
type_identifier "Throwable"
block
{ "{"
if_statement (+41 nodes collapsed)
expression_statement
method_invocation
object_creation_expression
new "new"
type_identifier "Reporter"
argument_list
( "("
) ")"
. "."
identifier "smartNullPointerException"
argument_list
( "("
identifier "location"
) ")"
; ";"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
method_declaration (+80 nodes collapsed)
} "}"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Answer"
type_arguments
< "<"
type_identifier "Object"
> ">"
variable_declarator
identifier "delegate"
= "="
object_creation_expression
new "new"
type_identifier "ReturnsMoreEmptyValues"
argument_list
( "("
) ")"
; ";"
method_declaration (+119 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
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "stubbing"
. "."
identifier "defaultanswers"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "lang"
. "."
identifier "reflect"
. "."
identifier "Method"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Arrays"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "Mockito"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "cglib"
. "."
identifier "proxy"
. "."
identifier "MethodInterceptor"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "cglib"
. "."
identifier "proxy"
. "."
identifier "MethodProxy"
; ";"
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
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "creation"
. "."
identifier "jmock"
. "."
identifier "ClassImposterizer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "debugging"
. "."
identifier "Location"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "internal"
. "."
identifier "util"
. "."
identifier "ObjectMethodsGuru"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "invocation"
. "."
identifier "InvocationOnMock"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "mockito"
. "."
identifier "stubbing"
. "."
identifier "Answer"
; ";"
block_comment "/**\r\n * Optional Answer that can be used with\r\n * {@link Moc"...
class_declaration
modifiers
public "public"
class "class"
identifier "ReturnsSmartNulls"
super_interfaces
implements "implements"
type_list
generic_type
type_identifier "Answer"
type_arguments
< "<"
type_identifier "Object"
> ">"
, ","
type_identifier "Serializable"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "7618312406617949441L"
; ";"
class_declaration
modifiers
private "private"
final "final"
class "class"
identifier "ThrowingInterceptor"
super_interfaces
implements "implements"
type_list
type_identifier "MethodInterceptor"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "InvocationOnMock"
variable_declarator
identifier "invocation"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Location"
variable_declarator
identifier "location"
= "="
object_creation_expression
new "new"
type_identifier "Location"
argument_list
( "("
) ")"
; ";"
constructor_declaration (+22 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "Object"
identifier "intercept"
formal_parameters (+22 nodes collapsed)
throws
throws "throws"
type_identifier "Throwable"
block
{ "{"
if_statement (+41 nodes collapsed)
expression_statement
method_invocation
object_creation_expression
new "new"
type_identifier "Reporter"
argument_list
( "("
) ")"
. "."
identifier "smartNullPointerException"
argument_list
( "("
identifier "obj"
, ","
identifier "location"
) ")"
; ";"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
method_declaration (+80 nodes collapsed)
} "}"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Answer"
type_arguments
< "<"
type_identifier "Object"
> ">"
variable_declarator
identifier "delegate"
= "="
object_creation_expression
new "new"
type_identifier "ReturnsMoreEmptyValues"
argument_list
( "("
) ")"
; ";"
method_declaration (+119 nodes collapsed)
} "}"