JDK-8210596 : jshell does not support raw string literals
  • Type: Bug
  • Component: tools
  • Sub-Component: jshell
  • Affected Version: 12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2018-09-11
  • Updated: 2018-09-19
  • Resolved: 2018-09-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12 b12Fixed
Related Reports
Blocks :  
Duplicate :  
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)

Comments
The immediate problem seems to be an --enable-preview problem. However, for proper support, line continuation will need to be supported.
13-09-2018

You might wait until I check in https://bugs.openjdk.java.net/browse/JDK-8206981
11-09-2018