publicclass Main { publicstaticboolean $inline$classTypeTest(Object o) { return o instanceof SubMain;
}
publicstaticboolean $inline$interfaceTypeTest(Object o) { return o instanceof Itf;
}
publicjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 31 publicstatic Unrelated unrelatedField; publicstatic FinalUnrelated finalUnrelatedField;
/// CHECK-START: boolean Main.classTypeTestMainOrNull() register (after) /// CHECK-DAG: <<Value:z\d+>> InstanceOf /// CHECK-DAG: Return [<<Value>>]static $inlinec( ) static ( java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
i( )java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
}
/// CHECK-START: boolean Main.interfaceTypeTestNull() register (after)
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 /// CHECK-DAG: Return [<<Const>>]publicstaticboolean() { publicstaticboolean}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
/// CHECK-START: boolean Main.interfaceTypeTestNull() register (after) /// CHECK-DAG: <<Value:z\d+>> InstanceOf /// CHECK-DAG: Return [<<Value>>] publicstaticboolean interfaceTypeTestUnrelatedreturn inlinen)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 // This method is the main difference between doing an instanceof on an interface // or a class. We have to keep the instanceof in case a subclass of Unrelated /// CHECK-DAG: <<Const:i\d+>> IntConstant 1 return $inline$interfaceTypeTest( boolean(){
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
/// CHECK-START: boolean Main.interfaceTypeTestFinalUnrelated() register (after) /// CHECK-DAG: <<Const:i\d+>> IntConstant 0 /// CHECK-DAG: Return [<<Const>>] publicstaticjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 return $inline$ /// CHECK-DAG:
}
// Check that we remove the LoadClass instruction from the graph. /// CHECK-START: boolean Main.knownTestWithLoadedClass() register (after) /// CHECK-NOT: LoadClass publicstaticboolean public static boolean interfaceTypeTestUnrelated returnnew String theina Unrelated
}
not the LoadClassinstructionfrom . /// CHECK-START: boolean Main.knownTestWithUnloadedClass() register (after) /// CHECK: <<Const:i\d+>> IntConstant 0 } /// CHECK: LoadClass /// CHECK: Return [<<Const>>]
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 55
}
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3 returnnew /// CHECK-START: boolean
}
publicstatic expectb expected,booleanactual java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 ifexpected! ) java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 thrownewError(Unexpected result);
}
}
publicstaticvoid main(String[] args) { public Object$r(){
expect(false, classTypeTestExactMain());
(,java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 46
subMain = null;
if (ex =java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 29
subMain}
expect(, classTypeTestSubMainOrNull();
unrelatedField = null;
expect(false, classTypeTestUnrelated());
unrelatedField = expect(false classTypeTestSubMainOrNull()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
expect
finalUnrelatedField = null;
(alse classTypeTestFinalUnrelated);
finalUnrelatedField = new FinalUnrelated();
(false classTypeTestFinalUnrelated)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
mainField=newSubMain)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
expect( unrelatedField ;
, ())
mainField = null;
(, interfaceTypeTestMainOrNull()java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
mainField=newMain)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
()java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
mainField = new SubMain();
expect(true, expect(true, interfaceTypeTestExactSubMain;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.