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.audio;
2
3public enum AudioSource {
4 OUTPUT("output"),
5 MIC("mic");
6
7 private final String name;
8
9 AudioSource(String name) {
10 this.name = name;
11 }
12
13 public static AudioSource findByName(String name) {
14 for (AudioSource audioSource : AudioSource.values()) {
15 if (name.equals(audioSource.name)) {
16 return audioSource;
17 }
18 }
…lines 19–23 unchanged (5 lines)

After

1package com.genymobile.scrcpy.audio;
2
3public enum AudioSource {
4 OUTPUT("output"),
5 MIC("mic"),
6 PLAYBACK("playback");
7
8 private final String name;
9
10 AudioSource(String name) {
11 this.name = name;
12 }
13
14 public boolean isDirect() {
15 return this != PLAYBACK;
16 }
17
18 public static AudioSource findByName(String name) {
19 for (AudioSource audioSource : AudioSource.values()) {
20 if (name.equals(audioSource.name)) {
21 return audioSource;
22 }
…lines 23–28 unchanged (6 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
. "."
identifier "audio"
; ";"
enum_declaration
modifiers
public "public"
enum "enum"
identifier "AudioSource"
enum_body
{ "{"
enum_constant
identifier "OUTPUT"
argument_list
( "("
string_literal
" "\""
string_fragment "output"
" "\""
) ")"
, ","
enum_constant
identifier "MIC"
argument_list
( "("
string_literal
" "\""
string_fragment "mic"
" "\""
) ")"
enum_body_declarations
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "name"
; ";"
constructor_declaration
identifier "AudioSource"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "name"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "name"
= "="
identifier "name"
; ";"
} "}"
method_declaration (+59 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
. "."
identifier "audio"
; ";"
enum_declaration
modifiers
public "public"
enum "enum"
identifier "AudioSource"
enum_body
{ "{"
enum_constant
identifier "OUTPUT"
argument_list
( "("
string_literal
" "\""
string_fragment "output"
" "\""
) ")"
, ","
enum_constant
identifier "MIC"
argument_list
( "("
string_literal
" "\""
string_fragment "mic"
" "\""
) ")"
, ","
enum_constant
identifier "PLAYBACK"
argument_list
( "("
string_literal
" "\""
string_fragment "playback"
" "\""
) ")"
enum_body_declarations
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "name"
; ";"
constructor_declaration
identifier "AudioSource"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "name"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "name"
= "="
identifier "name"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isDirect"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
this "this"
!= "!="
identifier "PLAYBACK"
; ";"
} "}"
method_declaration (+59 nodes collapsed)
} "}"