Reduce calls to MethodHandles.lookup() in jdk.internal.net.http.Stream

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 23
    • Affects Version/s: None
    • Component/s: core-libs
    • b20

      Is

                  STREAM_STATE = MethodHandles.lookup()
                          .findVarHandle(Stream.class, "streamState", int.class);
                  DEREGISTERED = MethodHandles.lookup()
                          .findVarHandle(Stream.class, "deRegistered", boolean.class);

      Can be
                  
                  MethodHandles.Lookup lookup = MethodHandles.lookup();
                  STREAM_STATE = lookup
                          .findVarHandle(Stream.class, "streamState", int.class);
                  DEREGISTERED = lookup
                          .findVarHandle(Stream.class, "deRegistered", boolean.class);

            Assignee:
            Nizar Benalla
            Reporter:
            Per-Ake Minborg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: