OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [initexc.java] - Blame information for rev 765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
public class initexc
2
{
3
  public static class fail
4
  {
5
    static
6
    {
7
      // Static initializers must be able to complete normally.
8
      if (true)
9
        throw new NullPointerException("nope");
10
    }
11
 
12
    public static int val ()
13
    {
14
      return 23;
15
    }
16
  }
17
 
18
  public static void main (String[] args)
19
  {
20
    try
21
      {
22
        System.out.println (fail.val ());
23
      }
24
    catch (ExceptionInInitializerError _)
25
      {
26
        // Ok.
27
      }
28
    try
29
      {
30
        System.out.println (fail.val ());
31
      }
32
    catch (NoClassDefFoundError _)
33
      {
34
        // Ok.
35
      }
36
  }
37
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.