initexc.java: New file.
* libjava.lang/initexc.java: New file. * libjava.lang/initexc.out: New file. From-SVN: r58761
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
public class initexc
|
||||
{
|
||||
public static class fail
|
||||
{
|
||||
static
|
||||
{
|
||||
throw new NullPointerException("nope");
|
||||
}
|
||||
|
||||
public static int val ()
|
||||
{
|
||||
return 23;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main (String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.out.println (fail.val ());
|
||||
}
|
||||
catch (ExceptionInInitializerError _)
|
||||
{
|
||||
// Ok.
|
||||
}
|
||||
try
|
||||
{
|
||||
System.out.println (fail.val ());
|
||||
}
|
||||
catch (NoClassDefFoundError _)
|
||||
{
|
||||
// Ok.
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user