< prev index next >

src/java.net.http/share/classes/jdk/internal/net/http/PullPublisher.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -101,23 +101,15 @@
                     subscriber.onError(t);
                     return;
                 }
 
                 while (demand.tryDecrement() && !cancelled) {
-                    T next;
-                    try {
-                        if (!iter.hasNext()) {
-                            break;
-                        }
-                        next = iter.next();
-                    } catch (Throwable t1) {
-                        completed = true;
-                        pullScheduler.stop();
-                        subscriber.onError(t1);
-                        return;
+                    if (!iter.hasNext()) {
+                        break;
+                    } else {
+                        subscriber.onNext(iter.next());
                     }
-                    subscriber.onNext(next);
                 }
                 if (!iter.hasNext() && !cancelled) {
                     completed = true;
                     pullScheduler.stop();
                     subscriber.onComplete();

@@ -129,11 +121,11 @@
         public void request(long n) {
             if (cancelled)
                 return;  // no-op
 
             if (n <= 0) {
-                error = new IllegalArgumentException("non-positive subscription request: " + n);
+                error = new IllegalArgumentException("illegal non-positive request:" + n);
             } else {
                 demand.increase(n);
             }
             pullScheduler.runOrSchedule();
         }
< prev index next >