<div dir="ltr"><div dir="ltr">On Mon, Mar 6, 2023 at 8:45 PM Alan Bateman <<a href="mailto:Alan.Bateman@oracle.com" target="_blank">Alan.Bateman@oracle.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Changing ZOS.putNextEntry to ignore the method/size provided by the <br>
caller would change long standing behavior, and Hyrum's Law has it that <br>
somebody will notice. </blockquote><div><br></div><div>I was not thinking of changing anything if the caller actually specified a method. This would be just for the default/unspecified case, in which case ZipEntry.method is -1.</div><div><br></div><div>So:</div><div><br></div>if (e.method == -1) {<br><br></div><div class="gmail_quote"> if (e.isDirectory()) {</div><div class="gmail_quote"> // New code:</div><div class="gmail_quote"> e.setMethod(STORED);</div><div class="gmail_quote"> e.setSize(0);</div><div class="gmail_quote"> e.setCrc(0);</div><div class="gmail_quote"> } else {</div><div class="gmail_quote"> // Today's code:</div><div class="gmail_quote"> e.method = method; // use default method</div><div class="gmail_quote"> }<br><div>} </div><div><br></div><div>But I guess this doesn't completely alleviate concerns, since there might be code out there doing:</div><div><br></div><div>zo.putNextEntry("directory/");</div><div>zo.write("Hello".getBytes());</div><div><br></div><div>(This would be very weird code, but people might have found it convenient to attach data to directories somehow). </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This may be something for an API note rather than <br>
an implementation change.<br></blockquote><div><br></div><div>Am I right that this would not be a specification change, so it would not require a CSR?</div><div><br></div><div>Thanks,</div><div> </div></div></div>