test/tools/javac/annotations/typeAnnotations/classfile/SyntheticParameters.java

Print this page
rev 2608 : 8029012: parameter_index for type annotation not updated after outer.this added
Summary: Fix javac's handling of type annotations when synthetic parameters are added
Reviewed-by: jjg, mcimadamore
rev 2609 : 8065132: Parameter annotations not updated when synthetic parameters are prepended
Summary: Cause javac to add synthetic parameters to Runtime[In]VisibleParameterAnnotations attributes
Reviewed-by: jjg, jfranck

@@ -22,14 +22,16 @@
  */
 
 /*
  * @test SyntheticParameters
  * @summary Test generation of annotations on inner class parameters.
- * @build ClassfileInspector
+ * @library /lib/annotations/
  * @run main SyntheticParameters
  */
 
+import annotations.classfile.ClassfileInspector;
+
 import java.io.*;
 import java.lang.annotation.*;
 
 import com.sun.tools.classfile.*;
 

@@ -109,11 +111,12 @@
                      },
                      null);
 
     public static void main(String... args) throws Exception {
         new SyntheticParameters().run(
-            new ClassFile[] { getClassFile(Inner_class), getClassFile(Foo_class) },
+            new ClassFile[] { getClassFile(Inner_class, Inner.class),
+                              getClassFile(Foo_class, Foo.class) },
             new Expected[] { Inner_expected, Foo_expected });
     }
 
     public class Inner {
         public Inner(@A int a) {}