7022711: compiler crash in try-with-resources
Reviewed-by: mcimadamore
This commit is contained in:
parent
148841e5e1
commit
36ed816102
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2011, 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
|
||||
@ -163,6 +163,7 @@ public class Kinds {
|
||||
case PARAMETER:
|
||||
case LOCAL_VARIABLE:
|
||||
case EXCEPTION_PARAMETER:
|
||||
case RESOURCE_VARIABLE:
|
||||
return KindName.VAR;
|
||||
|
||||
case CONSTRUCTOR:
|
||||
|
20
langtools/test/tools/javac/TryWithResources/T7022711.java
Normal file
20
langtools/test/tools/javac/TryWithResources/T7022711.java
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 7022711
|
||||
* @summary compiler crash in try-with-resources
|
||||
* @compile/fail/ref=T7022711.out -XDrawDiagnostics T7022711.java
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
|
||||
class T7022711 {
|
||||
public static void main (String args[]) throws Exception {
|
||||
try (DataInputStream is = new DataInputStream(new FileInputStream("x"))) {
|
||||
while (true) {
|
||||
is.getChar(); // method not found
|
||||
}
|
||||
} catch (EOFException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
langtools/test/tools/javac/TryWithResources/T7022711.out
Normal file
2
langtools/test/tools/javac/TryWithResources/T7022711.out
Normal file
@ -0,0 +1,2 @@
|
||||
T7022711.java:14:19: compiler.err.cant.resolve.location.args: kindname.method, getChar, , , (compiler.misc.location.1: kindname.variable, is, java.io.DataInputStream)
|
||||
1 error
|
Loading…
x
Reference in New Issue
Block a user