8210674: Need to add examples for use of javac properties introduced by Raw String Literals
authorjlaskey
Thu, 13 Sep 2018 14:15:27 -0300
changeset 51725 ccea318862ae
parent 51724 8abb0fa2c334
child 51726 a3989376ade2
8210674: Need to add examples for use of javac properties introduced by Raw String Literals Reviewed-by: vromero, jjg
test/langtools/tools/javac/diags/examples.not-yet.txt
test/langtools/tools/javac/diags/examples/RawStringLiteral.java
--- a/test/langtools/tools/javac/diags/examples.not-yet.txt	Thu Sep 13 12:07:01 2018 +0100
+++ b/test/langtools/tools/javac/diags/examples.not-yet.txt	Thu Sep 13 14:15:27 2018 -0300
@@ -42,7 +42,6 @@
 compiler.err.type.var.more.than.once                    # UNUSED
 compiler.err.type.var.more.than.once.in.result          # UNUSED
 compiler.err.unexpected.type
-compiler.err.unicode.backtick                           # Need to address
 compiler.err.unsupported.cross.fp.lit                   # Scanner: host system dependent
 compiler.misc.bad.class.signature                       # bad class file
 compiler.misc.bad.const.pool.tag                        # bad class file
@@ -64,7 +63,6 @@
 compiler.misc.fatal.err.cant.locate.meth                # Resolve, from Lower
 compiler.misc.fatal.err.cant.close                      # JavaCompiler
 compiler.misc.feature.not.supported.in.source.plural    # cannot happen (for now)
-compiler.misc.feature.raw.string.literals               # Need to address
 compiler.misc.file.does.not.contain.package
 compiler.misc.illegal.start.of.class.file
 compiler.misc.inferred.do.not.conform.to.lower.bounds   # cannot happen?
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/diags/examples/RawStringLiteral.java	Thu Sep 13 14:15:27 2018 -0300
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.unicode.backtick
+// key: compiler.misc.feature.raw.string.literals
+// key: compiler.warn.preview.feature.use.plural
+// options: --enable-preview -source 12 -Xlint:preview
+
+class RawStringLiteral {
+    String m() {
+        return `abc` + \u0060`def`;
+    }
+}
+
+