Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4266845

3.10.5: Explicitly mention that string literals can't contain \u0022 (") characters

    Details

    • Subcomponent:
    • Resolved In Build:
      rc
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description



      Name: wl91122 Date: 08/30/99


      The JLS, section 3.10.5 does not mention that a String literal
      can't contain \u0022 (") unicode characters.

      The following code:

      public class StringTest {
          {
              System.out.println("Hello\u0022World");
          }
      }

      leads to this error:

      C:\DATA\java>javac StringTest.java
      StringTest.java:3: ')' expected.
              System.out.println("Hello\u0022World");
                                             ^
      StringTest.java:3: String not terminated at end of line.
              System.out.println("Hello\u0022World");
                                                  ^
      2 errors

      (Can be solved by either changing the JLS or by changing the
      compiler)
      (Review ID: 94595)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abuckley Alex Buckley
                Reporter:
                wleesunw William Lee (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: