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 ArraySearch {
2 public static int findIndex(String[] array, String target) {
3 for (int i = 0; i <= array.length; i++) {
4 if (array[i].equals(target)) {
5 return i;
6 }
7 }
8 return -1;
9 }
10}
11

After

1public class ArraySearch {
2 public static int findIndex(String[] array, String target) {
3 for (int i = 0; i < array.length; i++) {
4 if (array[i].equals(target)) {
5 return i;
6 }
7 }
8 return -1;
9 }
10}
11

Before

program
class_declaration
modifiers
public "public"
class "class"
identifier "ArraySearch"
class_body
{ "{"
method_declaration
modifiers
public "public"
static "static"
integral_type
int "int"
identifier "findIndex"
formal_parameters
( "("
formal_parameter
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "array"
, ","
formal_parameter
type_identifier "String"
identifier "target"
) ")"
block
{ "{"
for_statement
for "for"
( "("
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "i"
= "="
decimal_integer_literal "0"
; ";"
binary_expression
identifier "i"
<= "<="
field_access
identifier "array"
. "."
identifier "length"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
block (+27 nodes collapsed)
return_statement
return "return"
unary_expression
- "-"
decimal_integer_literal "1"
; ";"
} "}"
} "}"

After

program
class_declaration
modifiers
public "public"
class "class"
identifier "ArraySearch"
class_body
{ "{"
method_declaration
modifiers
public "public"
static "static"
integral_type
int "int"
identifier "findIndex"
formal_parameters
( "("
formal_parameter
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "array"
, ","
formal_parameter
type_identifier "String"
identifier "target"
) ")"
block
{ "{"
for_statement
for "for"
( "("
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "i"
= "="
decimal_integer_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
field_access
identifier "array"
. "."
identifier "length"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
block (+27 nodes collapsed)
return_statement
return "return"
unary_expression
- "-"
decimal_integer_literal "1"
; ";"
} "}"
} "}"