Project Coin try-with-resources support (exception handling, part 1)

This commit is contained in:
Roman Shevchenko
2011-02-18 15:37:38 +01:00
parent 40046e9177
commit 91e642ac49
4 changed files with 57 additions and 11 deletions
@@ -0,0 +1,31 @@
import java.io.*;
import java.lang.Exception;
class C {
void m0() throws Exception {
try (FileReader reader = new FileReader(new File("input.txt"))) {
reader.read();
} catch (Exception e) {
<error descr="Cannot resolve symbol 'reader'">reader</error> = null;
}
<error descr="Cannot resolve symbol 'reader'">reader</error> = null;
}
void m1() {
try (final FileReader reader = new FileReader(new File("input.txt"))) {
reader.read();
}
catch (IOException ignore) { }
try (final FileReader reader = new FileReader(new File("input.txt"))) {
System.out.println("Try.");
}
catch (IOException ignore) { }
}
/*void m2() throws IOException {
try (final FileReader reader = new FileReader(new File("input.txt"))) {
reader.read();
}
}*/
}