RFR: 8312821: Javac accepts char literal as template

Jim Laskey jlaskey at openjdk.org
Tue Aug 1 15:34:59 UTC 2023


Embedded expressions in character literals are accepted. Fix is to reject `{` sequence in character literals.

Additional code was added to skip to end of literal when error is detected. This avoids many misleading error messages.

-------------

Commit messages:
 - 8312821 Javac accepts char literal as template

Changes: https://git.openjdk.org/jdk/pull/15106/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15106&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8312821
  Stats: 29 lines in 3 files changed: 14 ins; 3 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/15106.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15106/head:pull/15106

PR: https://git.openjdk.org/jdk/pull/15106


More information about the compiler-dev mailing list