mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 16:39:37 +07:00
lambda -> method ref: avoid Object::getClass as the type depends on qualifier (IDEA-150967)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class Test {
|
||||
|
||||
public <T> void some(Stream<AtomicReference<T>> stream) {
|
||||
stream.map((Function<AtomicReference<T>, ? extends Class<? extends AtomicReference>>) AtomicReference<T>::getClass);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class Test {
|
||||
|
||||
public <T> void some(Stream<AtomicReference<T>> stream) {
|
||||
stream.map(t -> t.getCl<caret>ass());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user