jdk-24/test/langtools/tools/javac/FinallyWarn.java

19 lines
406 B
Java
Raw Normal View History

2007-12-01 00:00:00 +00:00
/*
* @test /nodynamiccopyright/
2007-12-01 00:00:00 +00:00
* @bug 4821353
* @summary new warning "finally cannot complete normally" should not be enabled by default
* @author gafter
*
* @compile/fail/ref=FinallyWarn.out -XDrawDiagnostics -Xlint:finally -Werror FinallyWarn.java
2007-12-01 00:00:00 +00:00
* @compile -Werror FinallyWarn.java
*/
class FinallyWarn {
void f() {
try {
} finally {
return;
}
}
}