< prev index next >

test/langtools/tools/javac/valhalla/lworld-values/ArrayRelationsTest.java

Print this page




  69             throw new AssertionError("Missing NPE");
  70         }
  71 
  72         // round trip;
  73         Object o = oa = la = qa;
  74         qa = (ArrayRelationsTest[]) (la = (ArrayRelationsTest? []) (oa = (Object []) o));
  75         qa [0] = new ArrayRelationsTest();
  76 
  77         npe = false;
  78         try {
  79             la[0] = null;
  80         } catch (NullPointerException e) {
  81             npe = true;
  82         }
  83         if (!npe) {
  84             throw new AssertionError("Missing NPE");
  85         }
  86 
  87         la = new ArrayRelationsTest? [10];
  88 
  89         // NOTE: The following line should trigger a CCE, but doesn't ATM - this will
  90         // start failing when the VM is fixed. Flip the condition then.
  91         cce = false;
  92         try {
  93             qa = (ArrayRelationsTest[]) la;
  94         } catch (ClassCastException c) {
  95             cce = true;
  96         }
  97         if (cce) {  // <----- Flip this condition.
  98             throw new AssertionError("Unexpected CCE behavior");
  99         }
 100     }
 101 }


  69             throw new AssertionError("Missing NPE");
  70         }
  71 
  72         // round trip;
  73         Object o = oa = la = qa;
  74         qa = (ArrayRelationsTest[]) (la = (ArrayRelationsTest? []) (oa = (Object []) o));
  75         qa [0] = new ArrayRelationsTest();
  76 
  77         npe = false;
  78         try {
  79             la[0] = null;
  80         } catch (NullPointerException e) {
  81             npe = true;
  82         }
  83         if (!npe) {
  84             throw new AssertionError("Missing NPE");
  85         }
  86 
  87         la = new ArrayRelationsTest? [10];
  88 


  89         cce = false;
  90         try {
  91             qa = (ArrayRelationsTest[]) la;
  92         } catch (ClassCastException c) {
  93             cce = true;
  94         }
  95         if (!cce) {
  96             throw new AssertionError("Unexpected CCE behavior");
  97         }
  98     }
  99 }
< prev index next >