An interesting case. AST mapping is a 3:1 map, and the painting is a 3:1 update.

This mapping has 1 multi-map group: several pairings are equally correct there. The code view shows one arbitrary valid pairing, not the only one.

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

1package com.genymobile.scrcpy.wrappers;
2
3import com.genymobile.scrcpy.Ln;
4
5import android.annotation.SuppressLint;
6import android.os.Build;
7import android.os.IInterface;
8
9import java.lang.reflect.InvocationTargetException;
10import java.lang.reflect.Method;
11
12public final class PowerManager {
13 private final IInterface manager;
14 private Method isScreenOnMethod;
15
…lines 16–31 unchanged (16 lines)
32 }
33
34 public boolean isScreenOn() {
35 try {
36 Method method = getIsScreenOnMethod();
37 return (boolean) method.invoke(manager);
38 } catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) {
39 Ln.e("Could not invoke method", e);
40 return false;
41 }
42 }
43}
44

After

1package com.genymobile.scrcpy.wrappers;
2
3import com.genymobile.scrcpy.Ln;
4
5import android.annotation.SuppressLint;
6import android.os.Build;
7import android.os.IInterface;
8
9import java.lang.reflect.Method;
10
11public final class PowerManager {
12 private final IInterface manager;
13 private Method isScreenOnMethod;
14
…lines 15–30 unchanged (16 lines)
31 }
32
33 public boolean isScreenOn() {
34 try {
35 Method method = getIsScreenOnMethod();
36 return (boolean) method.invoke(manager);
37 } catch (ReflectiveOperationException e) {
38 Ln.e("Could not invoke method", e);
39 return false;
40 }
41 }
42}
43

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
. "."
identifier "wrappers"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
. "."
identifier "Ln"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "annotation"
. "."
identifier "SuppressLint"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "os"
. "."
identifier "Build"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "os"
. "."
identifier "IInterface"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "lang"
. "."
identifier "reflect"
. "."
identifier "InvocationTargetException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "lang"
. "."
identifier "reflect"
. "."
identifier "Method"
; ";"
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "PowerManager"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "IInterface"
variable_declarator
identifier "manager"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Method"
variable_declarator
identifier "isScreenOnMethod"
; ";"
method_declaration (+43 nodes collapsed)
constructor_declaration (+22 nodes collapsed)
method_declaration (+94 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isScreenOn"
formal_parameters
( "("
) ")"
block
{ "{"
try_statement
try "try"
block (+29 nodes collapsed)
catch_clause
catch "catch"
( "("
catch_formal_parameter
catch_type
type_identifier "InvocationTargetException" any 3:1
| "|"
type_identifier "IllegalAccessException" any 3:1
| "|"
type_identifier "NoSuchMethodException" any 3:1
identifier "e"
) ")"
block (+22 nodes collapsed)
} "}"
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
. "."
identifier "wrappers"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
. "."
identifier "Ln"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "annotation"
. "."
identifier "SuppressLint"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "os"
. "."
identifier "Build"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "os"
. "."
identifier "IInterface"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "lang"
. "."
identifier "reflect"
. "."
identifier "Method"
; ";"
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "PowerManager"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "IInterface"
variable_declarator
identifier "manager"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Method"
variable_declarator
identifier "isScreenOnMethod"
; ";"
method_declaration (+43 nodes collapsed)
constructor_declaration (+22 nodes collapsed)
method_declaration (+94 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isScreenOn"
formal_parameters
( "("
) ")"
block
{ "{"
try_statement
try "try"
block (+29 nodes collapsed)
catch_clause
catch "catch"
( "("
catch_formal_parameter
catch_type
type_identifier "ReflectiveOperationException" any 3:1
identifier "e"
) ")"
block (+22 nodes collapsed)
} "}"
} "}"