<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="">Hi Mark,<br class=""><div><br class=""></div><div>Thank you for the feedback.<br class=""><blockquote type="cite" class=""><div class="">On Apr 9, 2020, at 4:51 PM, mark sheppard <<a href="mailto:macanaoire@hotmail.com" class="">macanaoire@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class="Apple-interchange-newline">Hi Lance,</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">     In the ByteArrayChannel is there any merit in making </div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">the readonly member variable final to exhibit its immutable characteristic</div></div></blockquote><div><br class=""></div>Yes, I would agree and Intellij analyze code also suggests that along with removing final from  begin/endRead as the methods are final.</div><div><br class=""></div><div>This might be better to do in a separate cleanup<br class=""><blockquote type="cite" class=""><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">i.e. it appears to be set during construction only,</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">and the closed member variable volatile to ensure consistency of reads </div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">for concurrent  isOpen and closed method  invocations ?</div></div></blockquote><div><br class=""></div>It might be better to use  begin/endRead calls in the isOpen method.   </div><div><br class=""></div><div>Best</div><div>Lance</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">regards</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Mark</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""> </div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><hr tabindex="-1" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 907.46875px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span><div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>nio-dev <<a href="mailto:nio-dev-bounces@openjdk.java.net" class="">nio-dev-bounces@openjdk.java.net</a>> on behalf of Lance Andersen <<a href="mailto:lance.andersen@oracle.com" class="">lance.andersen@oracle.com</a>><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Thursday 9 April 2020 18:20<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Alan Bateman <<a href="mailto:Alan.Bateman@oracle.com" class="">Alan.Bateman@oracle.com</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>nio-dev <<a href="mailto:nio-dev@openjdk.java.net" class="">nio-dev@openjdk.java.net</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: RFR: JDK-8241883: (zipfs) SeekableByteChannel:close followed by SeekableByteChannel:close will throw an NPE</font><div class=""> </div></div><div class="" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; line-break: after-white-space;"><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Apr 9, 2020, at 3:03 AM, Alan Bateman <<a href="mailto:Alan.Bateman@oracle.com" class="">Alan.Bateman@oracle.com</a>> wrote:</div><br class="x_Apple-interchange-newline"><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""></div>In the case of the close method above, ByteArrayChannel::toByteArray uses a readLock  ByteArrayChannel::close uses a writeLock</div><br class=""></blockquote>The patch adds a new lock and doesn't appear use the readLock. Would it be possible to generate a webrev with the full patch as it's not possible to see the fully implications of what is proposed here.<br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">Of course, and can be found at: <a href="http://cr.openjdk.java.net/~lancea/8241883/webrev.00/index.html" class="">http://cr.openjdk.java.net/~lancea/8241883/webrev.00/index.html</a></div><div class=""><br class=""></div><div class="">I modified the patch to use the beginWrite() from ByteArrayChannel per Christoph’s suggestion (I had done that originally but talked myself out of that for some reason â€¦)</div><blockquote type="cite" class=""><div class=""><div class=""><br class="">-Alan<br class=""></div></div></blockquote></div><br class=""><div class=""><div class=""><span class="x_Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><span class="x_Apple-style-span" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" class=""><span class=""><span id="cid:E1C4E2F0-ECD0-4C9D-ADB4-B16CA7BCB7FC@home"><oracle_sig_logo.gif></span></span></a><div class="" style="font-family: Helvetica; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" class=""><span class="x_Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><span class="x_Apple-style-span" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"></span></span></a><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" class=""><span class="x_Apple-style-span" style="border-collapse: separate; font-family: Helvetica; border-spacing: 0px;"><span class="x_Apple-style-span" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><span class="x_Apple-style-span" style="border-collapse: separate; font-family: Helvetica; border-spacing: 0px;"></span></span></span></a><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" class=""><br class=""></a><span class="" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037</span><br class="" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font color="#FF0000" class="" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">Oracle</font><span class="" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"> Java Engineering </span><br class="" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><span class="" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">1 Network Drive </span><br class="" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><span class="" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">Burlington, MA 01803</span><br class="" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><a href="mailto:Lance.Andersen@oracle.com" class="" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">Lance.Andersen@oracle.com</a></div></span></span></div></div></div></div></blockquote></div><br class=""><div class="">
<div class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><span class="Apple-style-span" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" class=""><span><img apple-inline="yes" id="AF428977-5E0F-409D-9976-7BBF382B2E97" src="cid:E1C4E2F0-ECD0-4C9D-ADB4-B16CA7BCB7FC@home" class=""></span></a><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; " class=""><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><span class="Apple-style-span" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "></span></span></a><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; border-spacing: 0px; -webkit-text-decorations-in-effect: none;  "><span class="Apple-style-span" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; border-spacing: 0px; -webkit-text-decorations-in-effect: none;  "></span></span></span></a><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" class=""><br class=""></a><span style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class="">Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037</span><br style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class=""><font color="#FF0000" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class="">Oracle</font><span style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class=""> Java Engineering </span><br style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class=""><span style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class="">1 Network Drive </span><br style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class=""><span style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class="">Burlington, MA 01803</span><br style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class=""><a href="mailto:Lance.Andersen@oracle.com" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class="">Lance.Andersen@oracle.com</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; " class=""><br class=""></div><br class="Apple-interchange-newline">
</span></span></div>
</div><br class=""></body></html>