summaryrefslogtreecommitdiff
path: root/src/test/resources/org/javacs/example/Bad.java
blob: eef47650a6c72de6c0b88cf0d2c79bf145cc2f31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.TreeScanner;
import org.eclipse.lsp4j.Location;
import org.eclipse.lsp4j.LocationImpl;

import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;

public class Bad {
    // This is a really evil input that causes the Attr phase to throw a null pointer exception
    public void test(Stream<?> stream) {
        stream.flatMap(compilationUnit -> {
            compilationUnit.accept(new Foo() {
                @Override
                public void callback() {
                    // Do nothing
                }
            });
        });
    }
}