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

24 lines
675 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 6379327
* @summary Erroneous catch block not detected with anonymous class declaration
* @author Peter Jones, Wei Tao
* @compile/fail/ref=T6379327.out -XDrawDiagnostics T6379327.java
2007-12-01 00:00:00 +00:00
*/
import java.security.*;
public class T6379327 {
public static void meth(String[] args) {
2007-12-01 00:00:00 +00:00
final String name = args[0];
try {
new PrivilegedExceptionAction() {
public Object run() throws ClassNotFoundException {
return Class.forName(name);
}
};
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}