mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-29 18:17:08 +07:00
GitOrigin-RevId: fdb6c97e5b7501a3e582c9764a5eb62d2d2e1467
43 lines
923 B
Java
43 lines
923 B
Java
class C {
|
|
public Object convert(Object value) {
|
|
switch (value) {
|
|
case Integer ignored -> {
|
|
return value;
|
|
}
|
|
case Number v -> {
|
|
return v.toString();
|
|
}
|
|
default -> {
|
|
return value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public Object convert2(Object value) {
|
|
switch (value) {
|
|
case Integer ignored -> <weak_warning descr="Branch in 'switch' is a duplicate of the default branch">{
|
|
return value;
|
|
}</weak_warning>
|
|
case String v -> {
|
|
return v + "1";
|
|
}
|
|
default -> {
|
|
return value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public Object convert3(Object value) {
|
|
switch (value) {
|
|
case String v -> {
|
|
return v + "1";
|
|
}
|
|
case Integer ignored -> <weak_warning descr="Branch in 'switch' is a duplicate of the default branch">{
|
|
return value;
|
|
}</weak_warning>
|
|
default -> {
|
|
return value;
|
|
}
|
|
}
|
|
}
|
|
} |