/* * Copyright (c) 2025, 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. */ /* * @test * @bug 8369654 * @summary javac OutOfMemoryError for complex intersection type * @compile ExpressionSwitchComplexIntersectionTest.java */ public class ExpressionSwitchComplexIntersectionTest { interface WithMixin01 {} interface WithMixin02 {} interface WithMixin03 {} interface WithMixin04 {} interface WithMixin05 {} interface WithMixin06 {} interface WithMixin07 {} interface WithMixin08 {} interface WithMixin09 {} interface WithMixin10 {} interface WithMixin11 {} interface WithMixin12 {} interface WithMixin13 {} interface WithMixin14 {} interface WithMixin15 {} interface WithMixin16 {} interface WithMixin17 {} interface WithMixin18 {} interface WithMixin19 {} interface WithMixin20 {} interface ClientA extends WithMixin01, WithMixin02, WithMixin03, WithMixin04, WithMixin05, WithMixin06, WithMixin07, WithMixin08, WithMixin09, WithMixin10, WithMixin11, WithMixin12, WithMixin13, WithMixin14, WithMixin15, WithMixin16, WithMixin17, WithMixin18, WithMixin19, WithMixin20 { } interface ClientB extends WithMixin01, WithMixin02, WithMixin03, WithMixin04, WithMixin05, WithMixin06, WithMixin07, WithMixin08, WithMixin09, WithMixin10, WithMixin11, WithMixin12, WithMixin13, WithMixin14, WithMixin15, WithMixin16, WithMixin17, WithMixin18, WithMixin19, WithMixin20 { } Object f1(boolean b, ClientA c1, ClientB c2) { return b ? c1 : c2; } Object f2(boolean b, ClientA[] array1, ClientB[] array2) { return b ? array1 : array2; } Object f3(boolean b, TA[] array1, TB[] array2) { return b ? array1 : array2; } Object f4(boolean b, TAA[] array1, TBB[] array2) { return b ? array1 : array2; } }