uschindler commented on code in PR #13205: URL: https://github.com/apache/lucene/pull/13205#discussion_r1536623095
########## lucene/core/src/java/org/apache/lucene/store/IOContext.java: ########## @@ -111,42 +94,6 @@ private IOContext(Context context, MergeInfo mergeInfo) { * @param readOnce The new {@link IOContext} object will use this value for readOnce. */ public IOContext(IOContext ctxt, boolean readOnce) { - this.context = ctxt.context; - this.mergeInfo = ctxt.mergeInfo; - this.flushInfo = ctxt.flushInfo; - this.readOnce = readOnce; - this.load = false; - } - - @Override - public int hashCode() { - return Objects.hash(context, flushInfo, mergeInfo, readOnce, load); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (getClass() != obj.getClass()) return false; - IOContext other = (IOContext) obj; - if (context != other.context) return false; - if (!Objects.equals(flushInfo, other.flushInfo)) return false; - if (!Objects.equals(mergeInfo, other.mergeInfo)) return false; - if (readOnce != other.readOnce) return false; - if (load != other.load) return false; - return true; - } - - @Override - public String toString() { - return "IOContext [context=" - + context - + ", mergeInfo=" - + mergeInfo - + ", flushInfo=" - + flushInfo - + ", readOnce=" - + readOnce - + "]"; + this(ctxt.context, ctxt.mergeInfo, ctxt.flushInfo, readOnce, ctxt.load); Review Comment: this ctor should possibly be removed and replaced by a method `asReadOnce()` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org