inference variable R has incompatible bounds

Viewed 36

Today i experienced a strange error. The Strange was if i add the below code block in eclipse IDE it shows no error , but the same piece of code i compile it from cmd its showing error as

inference variable R has incompatible bounds

The Code Piece as follows:

import java.util.*;
import java.util.stream.*;
import java.util.function.*;
public class Test{

    public static void main(String[] args){
        int[] x = {1,2,3,4,5,6,1,2,3,1,4,65,3,56,24};
        System.out.println(Arrays.stream(x).boxed().collect(Collectors.groupingBy(Function.identity(),LinkedHashMap::new,Collectors.counting())));
    }
}

I Used same JDK versions(11.0.15 2022-04-19 LTS) both in eclipse as well as cmd prompt to compile it. Is Eclipse is doing some magic here or it is a bug at eclipse IDE.

0 Answers
Related