mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-02 14:38:28 +00:00
8171325: NPE in Check.clearLocalClassNameIndexes
Reviewed-by: mcimadamore
This commit is contained in:
parent
c2d9172419
commit
a9a05f2aff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -436,8 +436,10 @@ public class Check {
|
||||
}
|
||||
|
||||
void clearLocalClassNameIndexes(ClassSymbol c) {
|
||||
localClassNameIndexes.remove(new Pair<>(
|
||||
c.owner.enclClass().flatname, c.name));
|
||||
if (c.owner != null && c.owner.kind != NIL) {
|
||||
localClassNameIndexes.remove(new Pair<>(
|
||||
c.owner.enclClass().flatname, c.name));
|
||||
}
|
||||
}
|
||||
|
||||
public void newRound() {
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8171325
|
||||
* @summary NPE in Check.clearLocalClassNameIndexes
|
||||
* @compile/fail/ref=NPEClearingLocalClassNameIndexesTest.out -XDrawDiagnostics NPEClearingLocalClassNameIndexesTest.java
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class NPEClearingLocalClassNameIndexesTest {
|
||||
<A> void f(List<A> t) {}
|
||||
<B, C> C g(C u, Function<B, C> v) { return null; }
|
||||
<D> D g(Supplier<D> w) { return null; }
|
||||
|
||||
public void test() {
|
||||
f(g((String) null, task -> g(new NoSuch() {})));
|
||||
f(g((String) null, task -> g(new NoSuch<int>() {})));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
NPEClearingLocalClassNameIndexesTest.java:18:9: compiler.err.cant.apply.symbol: kindname.method, f, java.util.List<A>, java.lang.String, kindname.class, NPEClearingLocalClassNameIndexesTest, (compiler.misc.incompatible.upper.lower.bounds: C, java.lang.Object,java.util.List<A>, java.lang.String)
|
||||
NPEClearingLocalClassNameIndexesTest.java:18:42: compiler.err.cant.resolve.location: kindname.class, NoSuch, , , (compiler.misc.location: kindname.class, NPEClearingLocalClassNameIndexesTest, null)
|
||||
NPEClearingLocalClassNameIndexesTest.java:19:9: compiler.err.cant.apply.symbol: kindname.method, f, java.util.List<A>, java.lang.String, kindname.class, NPEClearingLocalClassNameIndexesTest, (compiler.misc.incompatible.upper.lower.bounds: C, java.lang.Object,java.util.List<A>, java.lang.String)
|
||||
NPEClearingLocalClassNameIndexesTest.java:19:42: compiler.err.cant.resolve.location: kindname.class, NoSuch, , , (compiler.misc.location: kindname.class, NPEClearingLocalClassNameIndexesTest, null)
|
||||
NPEClearingLocalClassNameIndexesTest.java:19:49: compiler.err.type.found.req: int, (compiler.misc.type.req.ref)
|
||||
5 errors
|
||||
Loading…
x
Reference in New Issue
Block a user