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

1public class Calculator {
2 public int divide(int a, int b) {
3 return a / b;
4 }
5
6 public static void main(String[] args) {
7 Calculator calculator = new Calculator();
8 int result = calculator.divide(10, 2);
9 System.out.println("Result: " + result);
10 }
11}
12

After

1public class Calculator {
2 public int divide(int a, int b) {
3 System.out.println("Dividing " + a + " by " + b);
4 return a / b;
5 }
6
7 public static void main(String[] args) {
8 Calculator calculator = new Calculator();
9 System.out.println("Starting calculation...");
10 int result = calculator.divide(10, 2);
11 System.out.println("Result: " + result);
12 System.out.println("Calculation complete.");
13 }
14}
15

Before

program
class_declaration
modifiers
public "public"
class "class"
identifier "Calculator"
class_body
{ "{"
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "divide"
formal_parameters
( "("
formal_parameter
integral_type
int "int"
identifier "a"
, ","
formal_parameter
integral_type
int "int"
identifier "b"
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "a"
/ "/"
identifier "b"
; ";"
} "}"
method_declaration
modifiers
public "public"
static "static"
void_type "void"
identifier "main"
formal_parameters
( "("
formal_parameter
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "args"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Calculator"
variable_declarator
identifier "calculator"
= "="
object_creation_expression
new "new"
type_identifier "Calculator"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "result"
= "="
method_invocation
identifier "calculator"
. "."
identifier "divide"
argument_list
( "("
decimal_integer_literal "10"
, ","
decimal_integer_literal "2"
) ")"
; ";"
expression_statement
method_invocation
field_access
identifier "System"
. "."
identifier "out"
. "."
identifier "println"
argument_list
( "("
binary_expression
string_literal
" "\""
string_fragment "Result: "
" "\""
+ "+"
identifier "result"
) ")"
; ";"
} "}"
} "}"

After

program
class_declaration
modifiers
public "public"
class "class"
identifier "Calculator"
class_body
{ "{"
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "divide"
formal_parameters
( "("
formal_parameter
integral_type
int "int"
identifier "a"
, ","
formal_parameter
integral_type
int "int"
identifier "b"
) ")"
block
{ "{"
expression_statement
method_invocation
field_access
identifier "System"
. "."
identifier "out"
. "."
identifier "println"
argument_list
( "("
binary_expression
binary_expression
binary_expression
string_literal
" "\""
string_fragment "Dividing "
" "\""
+ "+"
identifier "a"
+ "+"
string_literal
" "\""
string_fragment " by "
" "\""
+ "+"
identifier "b"
) ")"
; ";"
return_statement
return "return"
binary_expression
identifier "a"
/ "/"
identifier "b"
; ";"
} "}"
method_declaration
modifiers
public "public"
static "static"
void_type "void"
identifier "main"
formal_parameters
( "("
formal_parameter
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "args"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Calculator"
variable_declarator
identifier "calculator"
= "="
object_creation_expression
new "new"
type_identifier "Calculator"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
field_access
identifier "System"
. "."
identifier "out"
. "."
identifier "println"
argument_list
( "("
string_literal
" "\""
string_fragment "Starting calculation..."
" "\""
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "result"
= "="
method_invocation
identifier "calculator"
. "."
identifier "divide"
argument_list
( "("
decimal_integer_literal "10"
, ","
decimal_integer_literal "2"
) ")"
; ";"
expression_statement
method_invocation
field_access
identifier "System"
. "."
identifier "out"
. "."
identifier "println"
argument_list
( "("
binary_expression
string_literal
" "\""
string_fragment "Result: "
" "\""
+ "+"
identifier "result"
) ")"
; ";"
expression_statement
method_invocation
field_access
identifier "System"
. "."
identifier "out"
. "."
identifier "println"
argument_list
( "("
string_literal
" "\""
string_fragment "Calculation complete."
" "\""
) ")"
; ";"
} "}"
} "}"