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

We should never be using CompletableFuture.completionStage

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

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

      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.

              wburns@redhat.com Will Burns
              wburns@redhat.com Will Burns
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: