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

jshell does not support raw string literals

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 12
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b12
    • CPU:
      generic
    • OS:
      generic

      Description

      > jshell --enable-preview

      | Welcome to JShell -- Version 12-internal
      | For an introduction type: /help intro

      jshell> String a = `abc`;
      Exception in thread "main" java.lang.IllegalArgumentException
      at jdk.compiler/com.sun.tools.javac.util.JCDiagnostic.<init>(JCDiagnostic.java:600)
      at jdk.compiler/com.sun.tools.javac.util.JCDiagnostic$Factory.create(JCDiagnostic.java:283)
      at jdk.compiler/com.sun.tools.javac.util.JCDiagnostic$Factory.error(JCDiagnostic.java:111)
      at jdk.compiler/com.sun.tools.javac.util.AbstractLog.error(AbstractLog.java:155)
      at jdk.compiler/com.sun.tools.javac.parser.JavaTokenizer.lexError(JavaTokenizer.java:148)
      at jdk.compiler/com.sun.tools.javac.parser.JavaTokenizer.checkSourceLevel(JavaTokenizer.java:129)
      at jdk.compiler/com.sun.tools.javac.parser.JavaTokenizer.readToken(JavaTokenizer.java:650)
      at jdk.compiler/com.sun.tools.javac.parser.Scanner.nextToken(Scanner.java:115)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer$Matched.advance(CompletenessAnalyzer.java:459)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer$Matched.nextCT(CompletenessAnalyzer.java:533)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer$Matched.next(CompletenessAnalyzer.java:467)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer$Parser.nextToken(CompletenessAnalyzer.java:574)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer$Parser.parseDeclaration(CompletenessAnalyzer.java:648)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer$Parser.lambda$disambiguateDeclarationVsExpression$0(CompletenessAnalyzer.java:708)
      at jdk.jshell/jdk.jshell.TaskFactory.lambda$parse$6(TaskFactory.java:253)
      at jdk.jshell/jdk.jshell.TaskFactory.lambda$runTask$4(TaskFactory.java:213)
      at jdk.compiler/com.sun.tools.javac.api.JavacTaskPool.getTask(JavacTaskPool.java:182)
      at jdk.jshell/jdk.jshell.TaskFactory.runTask(TaskFactory.java:206)
      at jdk.jshell/jdk.jshell.TaskFactory.parse(TaskFactory.java:140)
      at jdk.jshell/jdk.jshell.TaskFactory.parse(TaskFactory.java:238)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer.lambda$scan$1(CompletenessAnalyzer.java:90)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer$Parser.disambiguateDeclarationVsExpression(CompletenessAnalyzer.java:688)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer$Parser.parseUnit(CompletenessAnalyzer.java:632)
      at jdk.jshell/jdk.jshell.CompletenessAnalyzer.scan(CompletenessAnalyzer.java:91)
      at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.analyzeCompletion(SourceCodeAnalysisImpl.java:183)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$2.isComplete(ConsoleIOContext.java:115)
      at jdk.internal.le/jdk.internal.jline.extra.EditingHistory.add(EditingHistory.java:172)
      at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.finishBuffer(ConsoleReader.java:738)
      at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.accept(ConsoleReader.java:2030)
      at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2756)
      at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2383)
      at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2371)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:142)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.getInput(JShellTool.java:1261)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1174)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:975)
      at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:254)
      at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:120)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rfield Robert Field
                Reporter:
                jlaskey Jim Laskey
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: