Skip to content

Commit e2c2d1f

Browse files
committed
Review comments
1 parent 3aeb67a commit e2c2d1f

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/chunkedencoding/ChunkedEncodedPublisher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
import org.reactivestreams.Publisher;
2626
import org.reactivestreams.Subscriber;
2727
import software.amazon.awssdk.annotations.SdkInternalApi;
28-
import software.amazon.awssdk.http.auth.aws.internal.signer.io.ContentLengthAwareSubscriber;
2928
import software.amazon.awssdk.utils.Pair;
3029
import software.amazon.awssdk.utils.Validate;
3130
import software.amazon.awssdk.utils.async.AddingTrailingDataSubscriber;
31+
import software.amazon.awssdk.utils.async.ContentLengthAwareSubscriber;
3232
import software.amazon.awssdk.utils.async.DelegatingSubscriber;
3333
import software.amazon.awssdk.utils.async.FlatteningSubscriber;
3434
import software.amazon.awssdk.utils.internal.MappingSubscriber;
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.http.auth.aws.internal.signer.io;
16+
package software.amazon.awssdk.utils.async;
1717

1818
import java.nio.ByteBuffer;
1919
import org.reactivestreams.Subscriber;
2020
import org.reactivestreams.Subscription;
21-
import software.amazon.awssdk.annotations.SdkInternalApi;
21+
import software.amazon.awssdk.annotations.SdkProtectedApi;
2222

2323
/**
2424
* Decorator subscriber that limits the number of bytes sent to the wrapped subscriber to at most {@code contentLength}. Once
2525
* the given content length is reached, the upstream subscription is cancelled, and the wrapped subscriber is completed.
2626
*/
27-
@SdkInternalApi
27+
@SdkProtectedApi
2828
public class ContentLengthAwareSubscriber implements Subscriber<ByteBuffer> {
2929
private final Subscriber<? super ByteBuffer> subscriber;
3030
private Subscription subscription;
@@ -53,7 +53,9 @@ public void onNext(ByteBuffer byteBuffer) {
5353
byteBuffer.limit(byteBuffer.position() + (int) bytesToRead);
5454
remaining -= bytesToRead;
5555
subscriber.onNext(byteBuffer);
56-
} else if (remaining == 0 && !subscriptionCancelled) {
56+
}
57+
58+
if (remaining == 0 && !subscriptionCancelled) {
5759
subscriptionCancelled = true;
5860
subscription.cancel();
5961
onComplete();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.http.auth.aws;
16+
package software.amazon.awssdk.testutils;
1717

1818
import io.reactivex.Flowable;
1919
import java.nio.ByteBuffer;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.http.auth.aws.internal.signer.io;
16+
package software.amazon.awssdk.utils.async;
1717

1818
import io.reactivex.subscribers.TestSubscriber;
1919
import java.nio.ByteBuffer;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.http.auth.aws.internal.signer.io;
16+
package software.amazon.awssdk.utils.async;
1717

1818
import static org.assertj.core.api.Assertions.assertThat;
19-
import static software.amazon.awssdk.http.auth.aws.PublisherUtils.randomPublisherOfLength;
19+
import static software.amazon.awssdk.testutils.PublisherUtils.randomPublisherOfLength;
2020

2121
import io.reactivex.subscribers.TestSubscriber;
2222
import java.nio.ByteBuffer;

0 commit comments

Comments
 (0)