Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8010015

Need test for 8006825,classfile attribution in inner class of lambda expression.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8
    • Component/s: tools

      Description

      This is in type-annotations repository.
      Classfile Attribution is different in inner class of lambda expression.
      A type-annotations(as defined in below sample) on a field in an inner class not in a lambda expression results in RuntimeTypeAnnotations_attibute and RuntimeAnnotations_attribute. On a field in an innner class in a lambda expression, it leaves off the RuntimeAnnotations_attribute.

      @Retention(RUNTIME) @Target({TYPE_USE,FIELD}) @interface A { }

      class Test7{
          interface MapFun<T, R> { R m( T n); }
          MapFun<Class<?>,String> cs;
          void test() {
              cs = c -> {
                       class innerClass {
                           @A Class<?> icc = null;
                           innerClass(Class<?> _c) { icc = _c; }
                           String getString() { return icc.toString(); }
                       }
                       return new innerClass(c).getString();
              };
              System.out.println("cs.m : " + cs.m(Integer.class));
          }

          public static void main(String... args) {new Test7().test(); }
      }

        Attachments

          Activity

            People

            • Assignee:
              ssides Steve Sides
              Reporter:
              ssides Steve Sides
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: