ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ForkJoinTask.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ForkJoinTask.java (file contents):
Revision 1.105 by jsr166, Wed Dec 9 04:41:07 2015 UTC vs.
Revision 1.106 by jsr166, Fri Dec 11 23:12:20 2015 UTC

# Line 543 | Line 543 | public abstract class ForkJoinTask<V> im
543          if (e == null || (ex = e.ex) == null)
544              return null;
545          if (e.thrower != Thread.currentThread().getId()) {
546            Class<? extends Throwable> ec = ex.getClass();
546              try {
547                  Constructor<?> noArgCtor = null;
548 <                Constructor<?>[] cs = ec.getConstructors();// public ctors only
549 <                for (int i = 0; i < cs.length; ++i) {
551 <                    Constructor<?> c = cs[i];
548 >                // public ctors only
549 >                for (Constructor<?> c : ex.getClass().getConstructors()) {
550                      Class<?>[] ps = c.getParameterTypes();
551                      if (ps.length == 0)
552                          noArgCtor = c;
553 <                    else if (ps.length == 1 && ps[0] == Throwable.class) {
554 <                        Throwable wx = (Throwable)c.newInstance(ex);
557 <                        return (wx == null) ? ex : wx;
558 <                    }
553 >                    else if (ps.length == 1 && ps[0] == Throwable.class)
554 >                        return (Throwable)c.newInstance(ex);
555                  }
556                  if (noArgCtor != null) {
557 <                    Throwable wx = (Throwable)(noArgCtor.newInstance());
558 <                    if (wx != null) {
559 <                        wx.initCause(ex);
564 <                        return wx;
565 <                    }
557 >                    Throwable wx = (Throwable)noArgCtor.newInstance();
558 >                    wx.initCause(ex);
559 >                    return wx;
560                  }
561              } catch (Exception ignore) {
562              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines