langtools/test/tools/javac/annotations/typeAnnotations/classfile/SyntheticParameters.java
changeset 29050 76df9080086c
parent 27853 746c658e8d35
child 30730 d3ce7619db2c
equal deleted inserted replaced
28895:6efe265424e3 29050:76df9080086c
    42     private static final Expected Inner_expected =
    42     private static final Expected Inner_expected =
    43         new Expected("SyntheticParameters$Inner",
    43         new Expected("SyntheticParameters$Inner",
    44                      null,
    44                      null,
    45                      new ExpectedMethodTypeAnnotation[] {
    45                      new ExpectedMethodTypeAnnotation[] {
    46                          (ExpectedMethodTypeAnnotation)
    46                          (ExpectedMethodTypeAnnotation)
    47                          // Assert there is no annotation on the
       
    48                          // this$0 parameter.
       
    49                          new ExpectedMethodTypeAnnotation.Builder(
       
    50                              "<init>",
       
    51                              "A",
       
    52                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
       
    53                              false,
       
    54                              0).setParameterIndex(0).build(),
       
    55                          (ExpectedMethodTypeAnnotation)
       
    56                          // Assert there is an annotation on the
    47                          // Assert there is an annotation on the
    57                          // first parameter.
    48                          // first parameter.
    58                          new ExpectedMethodTypeAnnotation.Builder(
    49                          new ExpectedMethodTypeAnnotation.Builder(
    59                              "<init>",
    50                              "<init>",
    60                              "A",
    51                              "A",
    61                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
    52                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
    62                              false,
    53                              false,
    63                              1).setParameterIndex(1).build(),
    54                              1).setParameterIndex(0).build()
    64                          (ExpectedMethodTypeAnnotation)
       
    65                          new ExpectedMethodTypeAnnotation.Builder(
       
    66                              "foo",
       
    67                              "A",
       
    68                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
       
    69                              false,
       
    70                              1).setParameterIndex(0).build(),
       
    71                          (ExpectedMethodTypeAnnotation)
       
    72                          new ExpectedMethodTypeAnnotation.Builder(
       
    73                              "foo",
       
    74                              "A",
       
    75                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
       
    76                              false,
       
    77                              0).setParameterIndex(1).build()
       
    78                      },
    55                      },
    79                      null);
    56                      null);
    80     private static final Expected Foo_expected =
    57     private static final Expected Foo_expected =
    81         new Expected("SyntheticParameters$Foo",
    58         new Expected("SyntheticParameters$Foo",
    82                      null,
    59                      null,
    87                          new ExpectedMethodTypeAnnotation.Builder(
    64                          new ExpectedMethodTypeAnnotation.Builder(
    88                              "<init>",
    65                              "<init>",
    89                              "A",
    66                              "A",
    90                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
    67                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
    91                              false,
    68                              false,
    92                              0).setParameterIndex(0).build(),
    69                              1).setParameterIndex(0).build()                     },
    93                          (ExpectedMethodTypeAnnotation)
       
    94                          // Assert there is no annotation on the
       
    95                          // $enum$ordinal parameter.
       
    96                          new ExpectedMethodTypeAnnotation.Builder(
       
    97                              "<init>",
       
    98                              "A",
       
    99                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
       
   100                              false,
       
   101                              0).setParameterIndex(1).build(),
       
   102                          (ExpectedMethodTypeAnnotation)
       
   103                          // Assert there is an annotation on the
       
   104                          // first parameter.
       
   105                          new ExpectedMethodTypeAnnotation.Builder(
       
   106                              "<init>",
       
   107                              "A",
       
   108                              TypeAnnotation.TargetType.METHOD_FORMAL_PARAMETER,
       
   109                              false,
       
   110                              1).setParameterIndex(2).build()
       
   111                      },
       
   112                      null);
    70                      null);
   113 
    71 
   114     public static void main(String... args) throws Exception {
    72     public static void main(String... args) throws Exception {
   115         new SyntheticParameters().run(
    73         new SyntheticParameters().run(
   116             new ClassFile[] { getClassFile(Inner_class, Inner.class),
    74             new ClassFile[] { getClassFile(Inner_class, Inner.class),