7025468: Tests using diamond with anonymous inner classes needs to be reverted

Rémi Forax forax at univ-mlv.fr
Tue Mar 8 10:17:47 UTC 2011


  Le 08/03/2011 11:06, Alan Bateman a écrit :
> I need a reviewer for a small fix to two tests that no longer compile 
> in the jdk7/tl forest as they were using diamond with anonymous inner 
> classes.
>
> Thanks,
> Alan.

Looks good.
Rémi

>
>
> diff --git a/test/java/nio/file/DirectoryStream/Basic.java 
> b/test/java/nio/file/DirectoryStream/Basic.java
> --- a/test/java/nio/file/DirectoryStream/Basic.java
> +++ b/test/java/nio/file/DirectoryStream/Basic.java
> @@ -69,7 +69,7 @@ public class Basic {
>             throw new RuntimeException("entry not found");
>
>         // check filtering: f* should match foo
> -        DirectoryStream.Filter<Path> filter = new 
> DirectoryStream.Filter<>() {
> +        DirectoryStream.Filter<Path> filter = new 
> DirectoryStream.Filter<Path>() {
>             private PathMatcher matcher =
>                 dir.getFileSystem().getPathMatcher("glob:f*");
>             public boolean accept(Path file) {
> diff --git a/test/java/util/PriorityQueue/NoNulls.java 
> b/test/java/util/PriorityQueue/NoNulls.java
> --- a/test/java/util/PriorityQueue/NoNulls.java
> +++ b/test/java/util/PriorityQueue/NoNulls.java
> @@ -53,7 +53,7 @@ public class NoNulls {
> public class NoNulls {
>     void test(String[] args) throws Throwable {
>         final Comparator<String> nullTolerantComparator
> -            = new Comparator<>() {
> +            = new Comparator<String>() {
>             public int compare(String x, String y) {
>                 return (x == null ? -1 :
>                         y == null ? 1 :
> @@ -65,7 +65,7 @@ public class NoNulls {
>         nullSortedSet.add(null);
>
>         final PriorityQueue<String> nullPriorityQueue
> -            = new PriorityQueue<>() {
> +            = new PriorityQueue<String>() {
>             public Object[] toArray() { return new Object[] { null };}};
>
>         final Collection<String> nullCollection = new ArrayList<>();




More information about the core-libs-dev mailing list