java-topology/test/langtools/tools/javac/lambda/Intersection02.java
russell@unturf.com 0a580b313d 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.
2026-03-26 17:11:57 -04:00

18 lines
486 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8010101
* @summary Intersection type cast issues redundant unchecked warning
* @compile/fail/ref=Intersection02.out -Werror -Xlint:unchecked -XDrawDiagnostics Intersection02.java
*/
import java.io.Serializable;
import java.util.List;
class Intersection02 {
interface P<X> { }
void test(List<String> ls) {
Object o1 = (List<String> & Serializable)ls;
Object o2 = (List<String> & Serializable & P<String>)ls;
}
}