rschmitt commented on a change in pull request #106: Immutable HttpEntity classes URL: https://github.com/apache/httpcomponents-core/pull/106#discussion_r256966826
########## File path: httpcore5/src/main/java/org/apache/hc/core5/http/io/entity/ByteBufferEntity.java ########## @@ -34,85 +34,79 @@ import java.nio.channels.Channels; import java.nio.channels.WritableByteChannel; +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; /** * An entity that delivers the contents of a {@link ByteBuffer}. */ +@Contract(threading = ThreadingBehavior.IMMUTABLE_CONDITIONAL) Review comment: I think this is a stretch, considering that you're mutating the supplied `ByteBuffer` without duplicating it ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org