undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
This commit is contained in:
commit
0a580b313d
70422 changed files with 17213626 additions and 0 deletions
18
test/langtools/tools/javac/lambda/MethodReference67.java
Normal file
18
test/langtools/tools/javac/lambda/MethodReference67.java
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8012685
|
||||
* @summary Spurious raw types warning when using unbound method references
|
||||
* @compile/fail/ref=MethodReference67.out -Werror -Xlint:rawtypes -XDrawDiagnostics MethodReference67.java
|
||||
*/
|
||||
import java.util.*;
|
||||
|
||||
class MethodReference67 {
|
||||
interface Foo<X> {
|
||||
void m(List<X> lx, X x);
|
||||
}
|
||||
|
||||
void test() {
|
||||
Foo<String> fs1 = List::add; //no raw warnings here!
|
||||
Foo fs2 = List::add;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue