-
Bug
-
Resolution: Not an Issue
-
P3
-
8, 10, 11, 12
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Given two lambdas that invoke a statement and do not return a value, one lambda is being mapped to Runnable while the another is mapped to Supplier. The only difference between the two is that the latter throws an exception.
I am expecting both lambdas to map to the same type.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run testcase
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
add(Runnable)
add(Runnable)
ACTUAL -
add(Runnable)
add(Supplier)
---------- BEGIN SOURCE ----------
public class Bug
{
public static void add(Runnable runnable)
{
System.out.println("add(Runnable)");
}
public static void add(java.util.function.Supplier<Integer> supplier)
{
System.out.println("add(Supplier)");
}
public static void main(String[] args)
{
add(() -> System.out.println());
add(() ->
{
System.out.println();
throw new RuntimeException();
});
}
}
---------- END SOURCE ----------
FREQUENCY : always
Given two lambdas that invoke a statement and do not return a value, one lambda is being mapped to Runnable while the another is mapped to Supplier. The only difference between the two is that the latter throws an exception.
I am expecting both lambdas to map to the same type.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run testcase
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
add(Runnable)
add(Runnable)
ACTUAL -
add(Runnable)
add(Supplier)
---------- BEGIN SOURCE ----------
public class Bug
{
public static void add(Runnable runnable)
{
System.out.println("add(Runnable)");
}
public static void add(java.util.function.Supplier<Integer> supplier)
{
System.out.println("add(Supplier)");
}
public static void main(String[] args)
{
add(() -> System.out.println());
add(() ->
{
System.out.println();
throw new RuntimeException();
});
}
}
---------- END SOURCE ----------
FREQUENCY : always