Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/javax/swing/GroupLayout/6613904/bug6613904.java
38918 views
/*1* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 661390426* @summary javax.swing.GroupLayout.createParallelGroup(..) doesn't throw IllegalArgumentException for null arg27* @author Pavel Porvatov28*/2930import javax.swing.*;3132public class bug6613904 {33public static void main(String[] args) {34SwingUtilities.invokeLater(new Runnable() {35public void run() {36GroupLayout groupLayout = new GroupLayout(new JPanel());3738try {39groupLayout.createParallelGroup(null);4041throw new RuntimeException("groupLayout.createParallelGroup(null) doesn't throw IAE");42} catch (IllegalArgumentException e) {43// Ok44}4546try {47groupLayout.createParallelGroup(null, true);4849throw new RuntimeException("groupLayout.createParallelGroup(null, true) doesn't throw IAE");50} catch (IllegalArgumentException e) {51// Ok52}5354try {55groupLayout.createParallelGroup(null, false);5657throw new RuntimeException("groupLayout.createParallelGroup(null, false) doesn't throw IAE");58} catch (IllegalArgumentException e) {59// Ok60}61}62});63}64}656667