-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
7
-
generic
-
generic
ccc write-up specifies:
"...the name of the variable may not be...redeclared as an exception parameter of a catch clause in a try statement of the directly enclosing method or initializer block"
but this code compiles without error:
public class negtest06 {
String test1( ) {
String ret = null;
try {
try ( java.io.FileInputStream str = new java.io.FileInputStream("foo.txt") ) {
ret = str.getClass().getSimpleName();
} catch( Exception str) {}
} catch ( Exception str ) {}
return ret;
}
}
"...the name of the variable may not be...redeclared as an exception parameter of a catch clause in a try statement of the directly enclosing method or initializer block"
but this code compiles without error:
public class negtest06 {
String test1( ) {
String ret = null;
try {
try ( java.io.FileInputStream str = new java.io.FileInputStream("foo.txt") ) {
ret = str.getClass().getSimpleName();
} catch( Exception str) {}
} catch ( Exception str ) {}
return ret;
}
}
- relates to
-
JDK-6911256 Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
- Closed