mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
redundant cast: ensure lambda return statements are not mixed with those from containing method (IDEA-138724)
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
import java.util.Optional;
|
||||
|
||||
class CommandTest {
|
||||
public Object getObject() {
|
||||
Optional<Object> o = Optional.of("x");
|
||||
return o.map(bx -> {
|
||||
return (Object)"";
|
||||
})
|
||||
.orElse(new Integer(1));
|
||||
}
|
||||
|
||||
public Object getObject1() {
|
||||
Optional<Object> o = Optional.of("x");
|
||||
return o.map(bx -> {
|
||||
return (<warning descr="Casting 'new Object()' to 'Object' is redundant">Object</warning>)new Object();
|
||||
})
|
||||
.orElse(new Integer(1));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user