mcimadamore@360: /* mcimadamore@360: * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. mcimadamore@360: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@360: * mcimadamore@360: * This code is free software; you can redistribute it and/or modify it mcimadamore@360: * under the terms of the GNU General Public License version 2 only, as mcimadamore@360: * published by the Free Software Foundation. mcimadamore@360: * mcimadamore@360: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@360: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@360: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@360: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@360: * accompanied this code). mcimadamore@360: * mcimadamore@360: * You should have received a copy of the GNU General Public License version mcimadamore@360: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@360: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@360: * mcimadamore@360: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, mcimadamore@360: * CA 95054 USA or visit www.sun.com if you need additional information or mcimadamore@360: * have any questions. mcimadamore@360: */ mcimadamore@360: mcimadamore@360: /* mcimadamore@360: * @test mcimadamore@360: * @bug 6869075 mcimadamore@360: * @summary regression: javac crashes when compiling compound string assignment with generics mcimadamore@360: * @author mcimadamore mcimadamore@360: */ mcimadamore@360: mcimadamore@360: public class T6869075 { mcimadamore@360: mcimadamore@360: static class Foo { mcimadamore@360: X x; mcimadamore@360: Foo (X x) { mcimadamore@360: this.x = x; mcimadamore@360: } mcimadamore@360: } mcimadamore@360: mcimadamore@360: static void test1(Foo foo) { mcimadamore@360: String start = foo.x; mcimadamore@360: equals(foo.x += "foo", start + "foo"); mcimadamore@360: } mcimadamore@360: mcimadamore@360: static void test2(Foo foo) { mcimadamore@360: String start = foo.x; mcimadamore@360: equals((foo.x += "foo"), (start + "foo")); mcimadamore@360: } mcimadamore@360: mcimadamore@360: static void test3(Foo foo) { mcimadamore@360: String start = foo.x; mcimadamore@360: equals(((foo.x += "foo")), ((start + "foo"))); mcimadamore@360: } mcimadamore@360: mcimadamore@360: public static void main(String[] args) { mcimadamore@360: test1(new Foo("Hello!")); mcimadamore@360: test2(new Foo("Hello!")); mcimadamore@360: test3(new Foo("Hello!")); mcimadamore@360: } mcimadamore@360: mcimadamore@360: static void equals(String found, String req) { mcimadamore@360: if (!found.equals(req)) { mcimadamore@360: throw new AssertionError("Error (expected: "+ req + mcimadamore@360: " - found: " + found + ")"); mcimadamore@360: } mcimadamore@360: } mcimadamore@360: }