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

SwingWorker.get throws CancellationException

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 11
    • client-libs
    • None
    • minimal
    • Java API
    • SE

      Summary

      The specification of SwingWorker.get methods fail to declared unchecked exceptions declared to be thrown by the methods being overridden.

      Problem

      CancellationException is not specified in SwingWorker.get

      Solution

      The spec will copy the text from the parent class, if @throws CancellationException {@inheritDoc} will be added. The final text will be "Throws: CancellationException - if the computation was cancelled"

      Specification

      src/java.desktop/share/classes/javax/swing/SwingWorker.java
      
            * </pre>
      +     *
      +     * @throws CancellationException {@inheritDoc}
            */
           public final T get() throws InterruptedException, ExecutionException {
      
           /**
            * {@inheritDoc}
            * <p>
            * Please refer to {@link #get} for more details.
      +     *
      +     * @throws CancellationException {@inheritDoc}
            */
           public final T get(long timeout, TimeUnit unit) throws InterruptedException,

            serb Sergey Bylokhov
            ydanilev Yury Danilevich (Inactive)
            Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: