<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Feb 26, 2018, at 1:29 PM, Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com" class="">maurizio.cimadamore@oracle.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class=""><div class=""><div class="moz-cite-prefix" style="font-family: Helvetica; font-size: 16px; 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; background-color: rgb(255, 255, 255);">On 26/02/18 20:17, John Rose wrote:<br class=""></div><blockquote type="cite" cite="mid:521F736B-E297-4F6D-8A62-CD44BE36114C@oracle.com" style="font-family: Helvetica; font-size: 16px; 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; background-color: rgb(255, 255, 255);" class=""><pre wrap="" class="">Any <b class="moz-txt-star"><span class="moz-txt-tag">*</span>finite choice<span class="moz-txt-tag">*</span></b> of end-quotes has the same problem, with
a non-zero probability that decreases (but does not vanish)
with the number of available end-quotes. The only way to
break out of the box is to allow the user an unlimited range
of successively "stronger" end-quotes (i.e., less likely ones).</pre></blockquote><span style="font-family: Helvetica; font-size: 16px; 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; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class="">In reality there is a 'finite' upper bound for this length, which is given by 2^16 /2 = 2 ^ 15. That's the maximum delimiter size you could encode in a Java String which you can also symmetrically close - and it's an edge case, as it will contain the empty string.</span><br style="font-family: Helvetica; font-size: 16px; 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; background-color: rgb(255, 255, 255);" class=""></div></blockquote><div><br class=""></div>That's only true for constant pool strings; there is no such defined limit</div><div>in the JLS. And condy lifts the limit in the constant pool.</div><div><br class=""></div><div>This is the point at which we need to note that there is a soft upper bound</div><div>to raw string literals, which is the amount of stuff you are willing to paste</div><div>into your Java source file before it isn't Java source any more. Probably</div><div>a half-page of code will be the usual jumbo size, with occasional multi-page</div><div>outliers. That's maybe 1kb (30 lines of 30 chars). Still, that is plenty long</div><div>enough to encounter lots of odd corner-case end quotes.</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 16px; 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; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class="">So, yes, on paper, I agree with the argument, in practice, I guess I'd me more in favor of limiting the number of repetitions</span></div></blockquote></div><br class=""><div class="">Pick your puzzler. I'd rather not leave a single string un-representable; that</div><div class="">would lead to a different kind of puzzler, *as well as* a hard limitation.</div><div class=""><br class=""></div><div class="">Test question: Does the JLS have a maximum length for identifiers?</div><div class="">It does not. Even though long identifiers hypothetically lead to "puzzlers"</div><div class="">involving abuses of the notation. Ridiculously long or difficult-to-read</div><div class="">identifiers are naturally avoided in practice, and the same will be true</div><div class="">for ridiculously long end-quotes.</div><div class=""><br class=""></div><div class=""><a href="http://merriam-webster.com/dictionary/abusus+non+tollit+usum" class="">http://merriam-webster.com/dictionary/abusus+non+tollit+usum</a></div><div class=""><br class=""></div><div class="">— John</div></body></html>