test/script/basic/JDK-8062624.js

Wed, 03 Jun 2015 18:08:57 +0200

author
hannesw
date
Wed, 03 Jun 2015 18:08:57 +0200
changeset 1396
d5a9705a27b1
parent 1088
b49b6786afad
permissions
-rw-r--r--

8066237: Fuzzing bug: Parser error on optimistic recompilation
Reviewed-by: lagergren, attila

hannesw@1088 1 /*
hannesw@1088 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
hannesw@1088 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
hannesw@1088 4 *
hannesw@1088 5 * This code is free software; you can redistribute it and/or modify it
hannesw@1088 6 * under the terms of the GNU General Public License version 2 only, as
hannesw@1088 7 * published by the Free Software Foundation.
hannesw@1088 8 *
hannesw@1088 9 * This code is distributed in the hope that it will be useful, but WITHOUT
hannesw@1088 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
hannesw@1088 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
hannesw@1088 12 * version 2 for more details (a copy is included in the LICENSE file that
hannesw@1088 13 * accompanied this code).
hannesw@1088 14 *
hannesw@1088 15 * You should have received a copy of the GNU General Public License version
hannesw@1088 16 * 2 along with this work; if not, write to the Free Software Foundation,
hannesw@1088 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
hannesw@1088 18 *
hannesw@1088 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
hannesw@1088 20 * or visit www.oracle.com if you need additional information or have any
hannesw@1088 21 * questions.
hannesw@1088 22 */
hannesw@1088 23
hannesw@1088 24 /**
hannesw@1088 25 * JDK-8062624: java.lang.String methods not available on concatenated strings
hannesw@1088 26 *
hannesw@1088 27 * @test
hannesw@1088 28 * @run
hannesw@1088 29 */
hannesw@1088 30
hannesw@1088 31 function testStringMethods(s) {
hannesw@1088 32 print(s.startsWith("f"));
hannesw@1088 33 print(s.endsWith("r"));
hannesw@1088 34 print(Java.from(s.getBytes()));
hannesw@1088 35 print(Java.from(s.bytes));
hannesw@1088 36 }
hannesw@1088 37
hannesw@1088 38 var s = "f";
hannesw@1088 39 testStringMethods(s);
hannesw@1088 40 s = s + "oo";
hannesw@1088 41 testStringMethods(s);
hannesw@1088 42 testStringMethods("abc");
hannesw@1088 43 s += "bar";
hannesw@1088 44 s = "baz" + s;
hannesw@1088 45 testStringMethods(s);

mercurial