convert anonymous to inner: collapse diamonds (IDEA-87265)

This commit is contained in:
Anna Kozlova
2012-06-13 11:40:34 +04:00
parent e945668dbe
commit 7d414e9817
6 changed files with 43 additions and 4 deletions
@@ -1,6 +1,6 @@
public class Foo {
public<T> void foo() {
Predicate<T> predicate = new MyPredicate<T>();
Predicate<T> predicate = new MyPredicate<>();
}
private interface Predicate<K> {
@@ -0,0 +1,14 @@
public class Foo {
public<T> void foo() {
Predicate<T> predicate = ne<caret>w Predicate<T>() {
@Override
public boolean test(T t) {
return false;
}
};
}
private interface Predicate<K> {
boolean test(K t);
}
}
@@ -0,0 +1,16 @@
public class Foo {
public<T> void foo() {
Predicate<T> predicate = new MyPredicate<>();
}
private interface Predicate<K> {
boolean test(K t);
}
private static class MyPredicate<T> implements Predicate<T> {
@Override
public boolean test(T t) {
return false;
}
}
}
@@ -2,7 +2,7 @@ import java.util.*;
class A<K, V> {
public Iterator<Map.Entry<K, V>> iterator(long revision) {
return new MyIterator<K, V>();
return new MyIterator<>();
}
private static class MyIterator<K, V> implements Iterator<Map.Entry<K, V>> {