Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-14578

We should never be using CompletableFuture.completionStage

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 15.0.0.Dev01, 14.0.8.Final
    • None
    • Core
    • None

    Description

      When we upgraded to JDK 11 we now have access to a new method on CompletableFuture named completedStage. This is very similar to completedFuture, but prevents Future based methods and toCompletionStage causes a new allocation.

      This can be problematic as many places use toCompletableFuture for already completed stages to prevent lambda and other allocations.

      We need to add a code style check to prevent this as well, as many people may not notice using the wrong method.

      Attachments

        Activity

          People

            wburns@redhat.com Will Burns
            wburns@redhat.com Will Burns
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: