test/tools/javac/assert/Position.java

Tue, 03 Jun 2008 13:26:47 -0700

author
jjg
date
Tue, 03 Jun 2008 13:26:47 -0700
changeset 46
7708bd6d800d
parent 1
9a66ca7c79fa
child 289
84061bd68019
permissions
-rw-r--r--

4075303: Use javap to enquire aboput a specific inner class
4348375: Javap is not internationalized
4459541: "javap -l" shows line numbers as signed short; they should be unsigned
4501660: change diagnostic of -help as 'print this help message and exit'
4776241: unused source file in javap...
4870651: javap should recognize generics, varargs, enum
4876942: javap invoked without args does not print help screen
4880663: javap could output whitespace between class name and opening brace
4975569: javap doesn't print new flag bits
6271787: javap dumps LocalVariableTypeTable attribute in hex, needs to print a table
6305779: javap: support annotations
6439940: Clean up javap implementation
6469569: wrong check of searchpath in JavapEnvironment
6474890: javap does not open .zip files in -classpath
6587786: Javap throws error : "ERROR:Could not find <classname>" for JRE classes
6622215: javap ignores certain relevant access flags
6622216: javap names some attributes incorrectly
6622232: javap gets whitespace confused
6622260: javap prints negative bytes incorrectly in hex
Reviewed-by: ksrini

duke@1 1 /*
duke@1 2 * @test /nodynamiccopyright/
duke@1 3 * @bug 4469737
duke@1 4 * @summary Verify the source position for assertions.
duke@1 5 * @author gafter
duke@1 6 *
duke@1 7 * @compile -source 1.4 Position.java
duke@1 8 * @run main Position
duke@1 9 */
duke@1 10
duke@1 11 public class Position {
duke@1 12 static public void main(String[] args) {
duke@1 13 Position.class.getClassLoader().setClassAssertionStatus("U", true);
duke@1 14 new U().main();
duke@1 15 }
duke@1 16 }
duke@1 17 class U {
duke@1 18 void main() {
duke@1 19 try {
duke@1 20 assert false; // line 20
duke@1 21 } catch (Throwable t) {
duke@1 22 if (t.getStackTrace()[0].getLineNumber() == 20) {
duke@1 23 return; // passed
duke@1 24 }
duke@1 25 }
duke@1 26 throw new Error("failed 4469737");
duke@1 27 }
duke@1 28 }

mercurial