static public int test_0_npe_still_happens() { OpenFinal x = null; SealedFinal y = null; try { y.method1(); return(1); } catch (NullReferenceException e) { ;//ok } try { y.method2(); return(2); } catch (NullReferenceException e) { ;//ok } try { y.method3(); return(3); } catch (NullReferenceException e) { ;//ok } try { x.method4(); return(4); } catch (NullReferenceException e) { ;//ok } try { x.method5(); return(5); } catch (NullReferenceException e) { ;//ok } return(0); }
static public int test_0_sealed_class_devirt_right_method() { SealedFinal x = new SealedFinal(); if (x.method1() != 4) { return(1); } if (x.method2() != 2) { return(2); } if (x.method3() != 1) { return(1); } return(0); }
static public int test_0_sealed_class_devirt_right_method () { SealedFinal x = new SealedFinal (); if (x.method1 () != 4) return 1; if (x.method2 () != 2) return 2; if (x.method3 () != 1) return 1; return 0; }