--- old/test/tools/javac/TryWithResources/T7022711.java 2015-10-19 06:34:49.599907675 +0300 +++ new/test/tools/javac/TryWithResources/T7022711.java 2015-10-19 06:34:49.515907673 +0300 @@ -9,10 +9,20 @@ class T7022711 { public static void main (String args[]) throws Exception { + // declared resource try (DataInputStream is = new DataInputStream(new FileInputStream("x"))) { while (true) { is.getChar(); // method not found } + } catch (EOFException e) { + } + + // resource as variable + DataInputStream is = new DataInputStream(new FileInputStream("x")); + try (is) { + while (true) { + is.getChar(); // method not found + } } catch (EOFException e) { } }