<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Adding an API Note will require a CSR.
<div class=""><br class="">
</div>
<div class="">And yes, what we often think as the right change tends to bite us (given this code has been in the wild since the 90s) so best to err on the side of documentation vs. assuming this change would not cause more problems than it is worth.</div>
<div class=""><br class="">
</div>
<div class="">Best</div>
<div class="">Lance<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Mar 6, 2023, at 3:20 PM, Eirik Bjørsnøs <<a href="mailto:eirbjo@gmail.com" class="">eirbjo@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">On Mon, Mar 6, 2023 at 8:45 PM Alan Bateman <<a href="mailto:Alan.Bateman@oracle.com" target="_blank" class="">Alan.Bateman@oracle.com</a>> wrote:<br class="">
</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 class="">
caller would change long standing behavior, and Hyrum's Law has it that <br class="">
somebody will notice. </blockquote>
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">So:</div>
<div class=""><br class="">
</div>
if (e.method == -1) {<br class="">
<br class="">
</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 class="">
<div class="">} </div>
<div class=""><br class="">
</div>
<div class="">But I guess this doesn't completely alleviate concerns, since there might be code out there doing:</div>
<div class=""><br class="">
</div>
<div class="">zo.putNextEntry("directory/");</div>
<div class="">zo.write("Hello".getBytes());</div>
<div class=""><br class="">
</div>
<div class="">(This would be very weird code, but people might have found it convenient to attach data to directories somehow). </div>
<div class=""><br class="">
</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 class="">
an implementation change.<br class="">
</blockquote>
<div class=""><br class="">
</div>
<div class="">Am I right that this would not be a specification change, so it would not require a CSR?</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class=""> </div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
<div class=""><span><img apple-inline="yes" id="00276503-7131-4745-99EB-0A92186FFA17" src="cid:E1C4E2F0-ECD0-4C9D-ADB4-B16CA7BCB7FC@home" class=""></span>
<div dir="auto" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div><br class="Apple-interchange-newline">
<br class="Apple-interchange-newline">
<br class="Apple-interchange-newline">
<br class="">
<br class="">
<br class="">
Lance Andersen | Principal Member of Technical Staff | +1.781.442.2037</div>
<div>Oracle Java Engineering <br class="">
1 Network Drive <br class="">
Burlington, MA 01803<br class="">
<a href="mailto:Lance.Andersen@oracle.com" class="">Lance.Andersen@oracle.com</a></div>
</div>
<br class="Apple-interchange-newline" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">
<br class="Apple-interchange-newline" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">
</div>
<br class="">
</div>
</body>
</html>