rschmitt commented on a change in pull request #106: Immutable HttpEntity
classes
URL:
https://github.com/apache/httpcomponents-core/pull/106#discussion_r256969017
##########
File path:
httpcore5/src/main/java/org/apache/hc/core5/http/io/entity/InputStreamEntity.java
##########
@@ -31,87 +31,52 @@
import java.io.InputStream;
import java.io.OutputStream;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.util.Args;
/**
- * A streamed, non-repeatable entity that obtains its content from
- * an {@link InputStream}.
+ * A streamed, non-repeatable entity that obtains its content from an {@link
InputStream}.
*
* @since 4.0
*/
+@Contract(threading = ThreadingBehavior.IMMUTABLE_CONDITIONAL)
Review comment:
I don't really see how an `InputStream` wrapper could be regarded as
immutable, unless `IMMUTABLE_CONDITIONAL` specifically means "immutable" in the
Java Memory Model sense (all final fields, not made visible to other threads
during construction), which has significantly weaker guarantees than true
immutability.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]