Skip to content

Failed

org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest.test443596 - 12 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

Failing for the past 1 build (Since Failed #44 )
Took 0.83 sec.

Error Message

test443596 - Javac found error(s) but Eclipse only found warning(s).
----------- Expected ------------
----------\n
1. WARNING in X.java (at line 4)\n
 public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n
                                                            ^^^\n
Type safety: Potential heap pollution via varargs parameter arg\n
----------\n

------------ but was ------------
X.java:4: warning: [unchecked] Possible heap pollution from parameterized vararg type Predicate<? super T>\n
    public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n
                                                               ^\n
  where T is a type-variable:\n
    T extends Object declared in method <T>and(Predicate<? super T>...)\n
X.java:8: error: no suitable method found for and(Predicate<CAP#1>,Predicate<CAP#2>)\n
        public void error(Predicate<?> arg) { and(predicate, in(arg)); } // no compile\n
                                              ^\n
    method X.<T#1>and(Predicate<? super T#1>...) is not applicable\n
      (cannot infer type-variable(s) T#1,T#2\n
        (varargs mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#3>))\n
    method X.<T#4>and(Predicate<? super T#4>,Predicate<? super T#4>) is not applicable\n
      (cannot infer type-variable(s) T#4,T#2\n
        (argument mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#5>))\n
  where E,T#1,T#2,T#3,T#4,T#5 are type-variables:\n
    E extends Object declared in class FilteredCollection\n
    T#1 extends Object declared in method <T#1>and(Predicate<? super T#1>...)\n
    T#2 extends Object declared in method <T#2>in(Predicate<? extends T#2>)\n
    T#3 extends CAP#1\n
    T#4 extends Object declared in method <T#4>and(Predicate<? super T#4>,Predicate<? super T#4>)\n
    T#5 extends CAP#1\n
  where CAP#1,CAP#2 are fresh type-variables:\n
    CAP#1 extends Object super: E from capture of ? super E\n
    CAP#2 extends Object from capture of ?\n
1 error\n
1 warning\n

--------- Difference is ----------
 expected:<[----------\n
1. WARNING in X.java (at line 4)\n
 public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n
                                                            ^^^\n
Type safety: Potential heap pollution via varargs parameter arg\n
----------]\n
> but was:<[X.java:4: warning: [unchecked] Possible heap pollution from parameterized vararg type Predicate<? super T>\n
    public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n
                                                               ^\n
  where T is a type-variable:\n
    T extends Object declared in method <T>and(Predicate<? super T>...)\n
X.java:8: error: no suitable method found for and(Predicate<CAP#1>,Predicate<CAP#2>)\n
        public void error(Predicate<?> arg) { and(predicate, in(arg)); } // no compile\n
                                              ^\n
    method X.<T#1>and(Predicate<? super T#1>...) is not applicable\n
      (cannot infer type-variable(s) T#1,T#2\n
        (varargs mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#3>))\n
    method X.<T#4>and(Predicate<? super T#4>,Predicate<? super T#4>) is not applicable\n
      (cannot infer type-variable(s) T#4,T#2\n
        (argument mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#5>))\n
  where E,T#1,T#2,T#3,T#4,T#5 are type-variables:\n
    E extends Object declared in class FilteredCollection\n
    T#1 extends Object declared in method <T#1>and(Predicate<? super T#1>...)\n
    T#2 extends Object declared in method <T#2>in(Predicate<? extends T#2>)\n
    T#3 extends CAP#1\n
    T#4 extends Object declared in method <T#4>and(Predicate<? super T#4>,Predicate<? super T#4>)\n
    T#5 extends CAP#1\n
  where CAP#1,CAP#2 are fresh type-variables:\n
    CAP#1 extends Object super: E from capture of ? super E\n
    CAP#2 extends Object from capture of ?\n
1 error\n
1 warning]\n
>

Stacktrace

junit.framework.ComparisonFailure: 
test443596 - Javac found error(s) but Eclipse only found warning(s).
----------- Expected ------------
----------\n
1. WARNING in X.java (at line 4)\n
	public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n
	                                                           ^^^\n
Type safety: Potential heap pollution via varargs parameter arg\n
----------\n

------------ but was ------------
X.java:4: warning: [unchecked] Possible heap pollution from parameterized vararg type Predicate<? super T>\n
    public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n
                                                               ^\n
  where T is a type-variable:\n
    T extends Object declared in method <T>and(Predicate<? super T>...)\n
X.java:8: error: no suitable method found for and(Predicate<CAP#1>,Predicate<CAP#2>)\n
        public void error(Predicate<?> arg) { and(predicate, in(arg)); } // no compile\n
                                              ^\n
    method X.<T#1>and(Predicate<? super T#1>...) is not applicable\n
      (cannot infer type-variable(s) T#1,T#2\n
        (varargs mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#3>))\n
    method X.<T#4>and(Predicate<? super T#4>,Predicate<? super T#4>) is not applicable\n
      (cannot infer type-variable(s) T#4,T#2\n
        (argument mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#5>))\n
  where E,T#1,T#2,T#3,T#4,T#5 are type-variables:\n
    E extends Object declared in class FilteredCollection\n
    T#1 extends Object declared in method <T#1>and(Predicate<? super T#1>...)\n
    T#2 extends Object declared in method <T#2>in(Predicate<? extends T#2>)\n
    T#3 extends CAP#1\n
    T#4 extends Object declared in method <T#4>and(Predicate<? super T#4>,Predicate<? super T#4>)\n
    T#5 extends CAP#1\n
  where CAP#1,CAP#2 are fresh type-variables:\n
    CAP#1 extends Object super: E from capture of ? super E\n
    CAP#2 extends Object from capture of ?\n
1 error\n
1 warning\n

--------- Difference is ----------
 expected:<[----------\n
1. WARNING in X.java (at line 4)\n
	public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n
	                                                           ^^^\n
Type safety: Potential heap pollution via varargs parameter arg\n
----------]\n
> but was:<[X.java:4: warning: [unchecked] Possible heap pollution from parameterized vararg type Predicate<? super T>\n
    public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }\n
                                                               ^\n
  where T is a type-variable:\n
    T extends Object declared in method <T>and(Predicate<? super T>...)\n
X.java:8: error: no suitable method found for and(Predicate<CAP#1>,Predicate<CAP#2>)\n
        public void error(Predicate<?> arg) { and(predicate, in(arg)); } // no compile\n
                                              ^\n
    method X.<T#1>and(Predicate<? super T#1>...) is not applicable\n
      (cannot infer type-variable(s) T#1,T#2\n
        (varargs mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#3>))\n
    method X.<T#4>and(Predicate<? super T#4>,Predicate<? super T#4>) is not applicable\n
      (cannot infer type-variable(s) T#4,T#2\n
        (argument mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#5>))\n
  where E,T#1,T#2,T#3,T#4,T#5 are type-variables:\n
    E extends Object declared in class FilteredCollection\n
    T#1 extends Object declared in method <T#1>and(Predicate<? super T#1>...)\n
    T#2 extends Object declared in method <T#2>in(Predicate<? extends T#2>)\n
    T#3 extends CAP#1\n
    T#4 extends Object declared in method <T#4>and(Predicate<? super T#4>,Predicate<? super T#4>)\n
    T#5 extends CAP#1\n
  where CAP#1,CAP#2 are fresh type-variables:\n
    CAP#1 extends Object super: E from capture of ? super E\n
    CAP#2 extends Object from capture of ?\n
1 error\n
1 warning]\n
>
	at org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest.test443596(GenericsRegressionTest.java:5186)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest#test443596 - 12
X.java [
public final class X {
    static interface Predicate<T> { boolean test(T object); }
    public static <T> Predicate<T> in(Predicate<? extends T> arg) { return null; }
    public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }
    public static <T> Predicate<T> and(Predicate<? super T> arg0, Predicate<? super T> arg1) { return null; }
    static class FilteredCollection<E> {
        Predicate<? super E> predicate;
        public void error(Predicate<?> arg) { and(predicate, in(arg)); } // no compile
    }
}

]


Full results sent to /tmp/genie.jdt/comptest/run.1565715170219/12_20190813_125251.txt

Standard Error

--- javac err: ---
X.java:4: warning: [unchecked] Possible heap pollution from parameterized vararg type Predicate<? super T>
    public static <T> Predicate<T> and(Predicate<? super T>... arg) { return null; }
                                                               ^
  where T is a type-variable:
    T extends Object declared in method <T>and(Predicate<? super T>...)
X.java:8: error: no suitable method found for and(Predicate<CAP#1>,Predicate<CAP#2>)
        public void error(Predicate<?> arg) { and(predicate, in(arg)); } // no compile
                                              ^
    method X.<T#1>and(Predicate<? super T#1>...) is not applicable
      (cannot infer type-variable(s) T#1,T#2
        (varargs mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#3>))
    method X.<T#4>and(Predicate<? super T#4>,Predicate<? super T#4>) is not applicable
      (cannot infer type-variable(s) T#4,T#2
        (argument mismatch; Predicate<CAP#1> cannot be converted to Predicate<? super T#5>))
  where E,T#1,T#2,T#3,T#4,T#5 are type-variables:
    E extends Object declared in class FilteredCollection
    T#1 extends Object declared in method <T#1>and(Predicate<? super T#1>...)
    T#2 extends Object declared in method <T#2>in(Predicate<? extends T#2>)
    T#3 extends CAP#1
    T#4 extends Object declared in method <T#4>and(Predicate<? super T#4>,Predicate<? super T#4>)
    T#5 extends CAP#1
  where CAP#1,CAP#2 are fresh type-variables:
    CAP#1 extends Object super: E from capture of ? super E
    CAP#2 extends Object from capture of ?
1 error
1 warning

----------------------------------------