aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 4469737 aoqi@0: * @summary Verify the source position for assertions. aoqi@0: * @author gafter aoqi@0: */ aoqi@0: aoqi@0: aoqi@0: public class Position { aoqi@0: static public void main(String[] args) { aoqi@0: Position.class.getClassLoader().setClassAssertionStatus("U", true); aoqi@0: new U().main(); aoqi@0: } aoqi@0: } aoqi@0: aoqi@0: aoqi@0: class U { aoqi@0: void main() { aoqi@0: try { aoqi@0: assert false; // line 20 aoqi@0: } catch (Throwable t) { aoqi@0: if (t.getStackTrace()[0].getLineNumber() == 20) { aoqi@0: return; // passed aoqi@0: } aoqi@0: } aoqi@0: throw new Error("failed 4469737"); aoqi@0: } aoqi@0: }