summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/ArrayStore2.java
blob: 1364d39b40ef449d79d2037332774b9fec3ea1dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public class ArrayStore2
{
  public static void main(String[] args)
  {
    new ArrayStore2().a(new Object[2], 3);
  }

  void a(Object[] oa, int i)
  {
    try
    {
      oa[index()] = obj();
    }
    catch (Exception x)
    {
      System.out.println (x.getClass().getName());
    }
  }

  int index()
  {
    System.out.println ("index");
    return 3;
  }

  Object obj()
  {
    System.out.println ("rhs");
    return new Object();
  }
}