rschmitt commented on a change in pull request #106: Immutable HttpEntity 
classes
URL: 
https://github.com/apache/httpcomponents-core/pull/106#discussion_r256972993
 
 

 ##########
 File path: 
httpcore5/src/main/java/org/apache/hc/core5/http/io/entity/SerializableEntity.java
 ##########
 @@ -59,29 +62,35 @@
      *        stored in an internal buffer
      * @throws IOException in case of an I/O error
      */
-    public SerializableEntity(final Serializable ser, final boolean bufferize) 
throws IOException {
-        super();
+    public SerializableEntity(
+            final Serializable ser, final boolean bufferize, final ContentType 
contentType,
+            final String contentEncoding) throws IOException {
+        super(contentType, contentEncoding);
         Args.notNull(ser, "Source object");
         if (bufferize) {
             createBytes(ser);
+            this.objRef = null;
 
 Review comment:
   I don't understand what's happening here. Why are you nulling this field out 
after `createBytes` has assigned 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

Reply via email to