hannesw@1088: /* hannesw@1088: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. hannesw@1088: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1088: * hannesw@1088: * This code is free software; you can redistribute it and/or modify it hannesw@1088: * under the terms of the GNU General Public License version 2 only, as hannesw@1088: * published by the Free Software Foundation. hannesw@1088: * hannesw@1088: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1088: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1088: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1088: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1088: * accompanied this code). hannesw@1088: * hannesw@1088: * You should have received a copy of the GNU General Public License version hannesw@1088: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1088: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1088: * hannesw@1088: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1088: * or visit www.oracle.com if you need additional information or have any hannesw@1088: * questions. hannesw@1088: */ hannesw@1088: hannesw@1088: /** hannesw@1088: * JDK-8062624: java.lang.String methods not available on concatenated strings hannesw@1088: * hannesw@1088: * @test hannesw@1088: * @run hannesw@1088: */ hannesw@1088: hannesw@1088: function testStringMethods(s) { hannesw@1088: print(s.startsWith("f")); hannesw@1088: print(s.endsWith("r")); hannesw@1088: print(Java.from(s.getBytes())); hannesw@1088: print(Java.from(s.bytes)); hannesw@1088: } hannesw@1088: hannesw@1088: var s = "f"; hannesw@1088: testStringMethods(s); hannesw@1088: s = s + "oo"; hannesw@1088: testStringMethods(s); hannesw@1088: testStringMethods("abc"); hannesw@1088: s += "bar"; hannesw@1088: s = "baz" + s; hannesw@1088: testStringMethods(s);