diff -r 000000000000 -r 959103a6100f test/tools/javac/assert/Position.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/assert/Position.java Wed Apr 27 01:34:52 2016 +0800 @@ -0,0 +1,28 @@ +/* + * @test /nodynamiccopyright/ + * @bug 4469737 + * @summary Verify the source position for assertions. + * @author gafter + */ + + +public class Position { + static public void main(String[] args) { + Position.class.getClassLoader().setClassAssertionStatus("U", true); + new U().main(); + } +} + + +class U { + void main() { + try { + assert false; // line 20 + } catch (Throwable t) { + if (t.getStackTrace()[0].getLineNumber() == 20) { + return; // passed + } + } + throw new Error("failed 4469737"); + } +}