Skip to content

Commit 4930ae9

Browse files
committed
8268592: JDK-8262891 causes an NPE in Lint.augment
Reviewed-by: vromero
1 parent 9ac63a6 commit 4930ae9

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

  • src/jdk.compiler/share/classes/com/sun/tools/javac/comp
  • test/langtools/tools/javac/T8268592

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,10 @@ class SnippetAliveAnalyzer extends AliveAnalyzer {
15771577
public void visitClassDef(JCClassDecl tree) {
15781578
//skip
15791579
}
1580+
@Override
1581+
public void visitLambda(JCLambda tree) {
1582+
//skip
1583+
}
15801584
public boolean isAlive() {
15811585
return super.alive != Liveness.DEAD;
15821586
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright (c) 2021, Alphabet LLC. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/* @test
25+
* @bug 8268592
26+
* @summary JDK-8262891 causes an NPE in Lint.augment
27+
* @compile T8268592.java
28+
*/
29+
30+
import java.util.Collection;
31+
import java.util.function.Function;
32+
import java.util.function.Supplier;
33+
34+
abstract class T {
35+
36+
abstract <T> T r(Function<String, Supplier<T>> x);
37+
38+
enum E {
39+
ONE
40+
}
41+
42+
abstract <T> Supplier<T> f(Function<T, Supplier<T>> x);
43+
44+
public void updateAcl(E e, Supplier<Void> v) {
45+
r(
46+
(String t) -> {
47+
switch (e) {
48+
case ONE:
49+
return f(
50+
a -> {
51+
Collection<String> m = null;
52+
return v;
53+
});
54+
default:
55+
return v;
56+
}
57+
});
58+
}
59+
}

0 commit comments

Comments
 (0)