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

Comparing jsr166/src/main/java/util/concurrent/Executors.java (file contents):
Revision 1.77 by jsr166, Sat May 5 17:09:23 2012 UTC vs.
Revision 1.78 by dl, Tue Jul 3 23:14:20 2012 UTC

# Line 536 | Line 536 | public class Executors {
536                  return AccessController.doPrivileged(
537                      new PrivilegedExceptionAction<T>() {
538                          public T run() throws Exception {
539                            ClassLoader savedcl = null;
539                              Thread t = Thread.currentThread();
540 <                            try {
541 <                                ClassLoader cl = t.getContextClassLoader();
543 <                                if (ccl != cl) {
544 <                                    t.setContextClassLoader(ccl);
545 <                                    savedcl = cl;
546 <                                }
540 >                            ClassLoader cl = t.getContextClassLoader();
541 >                            if (ccl == cl) {
542                                  return task.call();
543 <                            } finally {
544 <                                if (savedcl != null)
545 <                                    t.setContextClassLoader(savedcl);
546 <                            }
543 >                            } else {
544 >                                t.setContextClassLoader(ccl);
545 >                                try {
546 >                                    return task.call();
547 >                                } finally {
548 >                                    t.setContextClassLoader(cl);
549 >                                }
550 >                            }
551                          }
552                      }, acc);
553              } catch (PrivilegedActionException e) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines