204N/A/*
2362N/A * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
204N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
204N/A *
204N/A * This code is free software; you can redistribute it and/or modify it
204N/A * under the terms of the GNU General Public License version 2 only, as
204N/A * published by the Free Software Foundation.
204N/A *
204N/A * This code is distributed in the hope that it will be useful, but WITHOUT
204N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
204N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
204N/A * version 2 for more details (a copy is included in the LICENSE file that
204N/A * accompanied this code).
204N/A *
204N/A * You should have received a copy of the GNU General Public License version
204N/A * 2 along with this work; if not, write to the Free Software Foundation,
204N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
204N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
204N/A */
204N/A
204N/A/*
204N/A @test
204N/A @bug 6255653
204N/A @summary REGRESSION: Override isLightweight() causes access violation in awt.dll
204N/A @author Andrei Dmitriev: area=awt-component
204N/A @run main IsLightweightCrash
204N/A*/
204N/A
204N/A/*
204N/A * The test may not crash for several times so iteratively continue up to some limit.
204N/A */
204N/A
204N/Aimport java.awt.*;
204N/A
204N/Apublic class IsLightweightCrash {
204N/A public static int ITERATIONS = 20;
204N/A
204N/A public static void main(String []s)
204N/A {
204N/A for (int i = 0; i < ITERATIONS; i++){
204N/A showFrame(i);
204N/A }
204N/A }
204N/A
204N/A private static void showFrame(int i){
204N/A System.out.println("iteration = "+i);
204N/A Frame f = new Frame();
204N/A f.add(new AHeavyweightComponent());
204N/A f.setVisible(true);
204N/A f.setVisible(false);
204N/A }
204N/A}
204N/A
204N/Aclass AHeavyweightComponent extends Component {
204N/A public boolean isLightweight() { return false; }
204N/A}