Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-29682

Put back Framework#doPrivileged methods

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11.3, 2021.0
    • Component/s: Runtime
    • Tags:
    • Upgrade notes:
      Hide

      Added:

      public static <E extends Throwable> void doPrivilegedThrowing(ThrowableRunnable<E> runnable) throws E
      public static <T, E extends Throwable> T doPrivilegedThrowing(ThrowableSupplier<T, E> supplier) throws E 

      These APIs allow using lambda throwing exceptions.

      Show
      Added: public static <E extends Throwable> void doPrivilegedThrowing(ThrowableRunnable<E> runnable) throws E public static <T, E extends Throwable> T doPrivilegedThrowing(ThrowableSupplier<T, E> supplier) throws E These APIs allow using lambda throwing exceptions.
    • Team:
      PLATFORM
    • Sprint:
      nxplatform #18
    • Story Points:
      2

      Description

      NXP-27375 introduces new methods on the Framework class:

      • Framework#doPrivileged(ThrowableRunnable<E> runnable)
      • Framework#doPrivileged(ThrowableSupplier<T, E> supplier)

      Issue is that old methods with Runnable and Supplier were removed, and new methods are not compatible with the old ones. This can cause exceptions like

      java.lang.NoSuchMethodError: 'java.lang.Object org.nuxeo.runtime.api.Framework.doPrivileged(java.util.function.Supplier)'
      

      For instance, the following was working on 10.10 but do not work anymore on 11.x:

      Runnable runnable = ...
      Framework.doPrivileged(runnable);
      

      We want to put back previous methods and rename the current ones to doPrivilegedThrowing.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h