<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Yes, as a general rule, the compiler and runtime should be
      mutually consistent.</p>
    <p>This discussion probably also applies to javac reading names in
      source files and having those names propagate to class files.</p>
    <p>-- Jon</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 3/6/23 3:07 PM, Archie Cobbs wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CANSoFxvrO7zG_OPDBNrhQJuMsAj3_Fo4k__xTiYDQC5+8bVQAA@mail.gmail.com">
      
      <div dir="ltr">
        <div dir="ltr">On Mon, Mar 6, 2023 at 4:01 PM Jonathan Gibbons
          <<a href="mailto:jonathan.gibbons@oracle.com" moz-do-not-send="true" class="moz-txt-link-freetext">jonathan.gibbons@oracle.com</a>>
          wrote:</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">
            <div>
              <p>More on changing PoolReader ... ideally, this should be
                tied back to details in JVMS, and/or the spec updated to
                define the expected behavior of the VM and javac for
                similar but different equivalent names.</p>
            </div>
          </blockquote>
          <div>Funny you should mention it :) See the PR I just filed (<a href="https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/12893__;!!ACWV5N9M2RV99hQ!ISI9uy1X6lKTbsrTk8a0Y6vFyGFZc8MWhHsrhGsOhQycEB5EfevTYiXZlgu7BiSlFArVXPkX-JOfD6APKlBPht6Yo9g$" moz-do-not-send="true">link</a>), quoting:</div>
          <div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <p dir="auto">JVMS ยง4.4.7 describes "Modified UTF-8" for
                encoded strings, and it does not allow for non-standard
                encodings. Instead, you'll get something like this:</p>
              <div class="gmail-snippet-clipboard-content
                gmail-notranslate gmail-position-relative
                gmail-overflow-auto">
                <pre class="gmail-notranslate"><code class="gmail-notranslate">$ java Test
Error: LinkageError occurred while loading main class Test
        java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file Test
</code></pre>
              </div>
              <p dir="auto">So the compiler should also reject any
                invalid classfiles containing them.</p>
            </blockquote>
            <p>-Archie<br>
            </p>
          </div>
        </div>
        -- <br>
        <div dir="ltr" class="gmail_signature">Archie L. Cobbs<br>
        </div>
      </div>
    </blockquote>
  </body>
</html>