JDK-8062624.js revision 1094:a22f9ba69baa
10SN/A/*
2157SN/A * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
30SN/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
40SN/A *
50SN/A * This code is free software; you can redistribute it and/or modify it
60SN/A * under the terms of the GNU General Public License version 2 only, as
7157SN/A * published by the Free Software Foundation.
80SN/A *
9157SN/A * This code is distributed in the hope that it will be useful, but WITHOUT
100SN/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
110SN/A * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
120SN/A * version 2 for more details (a copy is included in the LICENSE file that
130SN/A * accompanied this code).
140SN/A *
150SN/A * You should have received a copy of the GNU General Public License version
160SN/A * 2 along with this work; if not, write to the Free Software Foundation,
170SN/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
180SN/A *
190SN/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
200SN/A * or visit www.oracle.com if you need additional information or have any
21157SN/A * questions.
22157SN/A */
23157SN/A
240SN/A/**
250SN/A * JDK-8062624: java.lang.String methods not available on concatenated strings
260SN/A *
270SN/A * @test
280SN/A * @run
290SN/A */
300SN/A
310SN/Afunction testStringMethods(s) {
320SN/A    print(s.startsWith("f"));
330SN/A    print(s.endsWith("r"));
340SN/A    print(Java.from(s.getBytes()));
350SN/A    print(Java.from(s.bytes));
360SN/A}
370SN/A
380SN/Avar s = "f";
390SN/AtestStringMethods(s);
400SN/As = s + "oo";
410SN/AtestStringMethods(s);
420SN/AtestStringMethods("abc");
430SN/As += "bar";
440SN/As = "baz" + s;
450SN/AtestStringMethods(s);
460SN/A