1498N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1498N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1498N/A *
1498N/A * This code is free software; you can redistribute it and/or modify it
1498N/A * under the terms of the GNU General Public License version 2 only, as
1498N/A * published by the Free Software Foundation.
1498N/A *
1498N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1498N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1498N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1498N/A * version 2 for more details (a copy is included in the LICENSE file that
1498N/A * accompanied this code).
1498N/A *
1498N/A * You should have received a copy of the GNU General Public License version
1498N/A * 2 along with this work; if not, write to the Free Software Foundation,
1498N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1498N/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.
1498N/A */
1498N/A
1498N/A/*
1498N/A * @test
1498N/A * @bug 6656586
1498N/A * @summary Test that Cursor.predefined array is not used in
1498N/ACursor.getPredefinedCursor() method
1498N/A * @author Artem Ananiev
1498N/A * @run main PredefinedPrivate
1498N/A */
1498N/A
1498N/Aimport java.awt.*;
1498N/A
1498N/Apublic class PredefinedPrivate {
1498N/A public static void main(String args[]) {
1498N/A new MyCursor();
1498N/A if (Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR) instanceof MyCursor) {
1498N/A throw new RuntimeException("Test FAILED: getPredefinedCursor() returned modified cursor");
1498N/A }
1498N/A }
1498N/A}
1498N/A
1498N/Aclass MyCursor extends Cursor {
1498N/A public MyCursor() {
1498N/A super(DEFAULT_CURSOR);
1498N/A Cursor.predefined[DEFAULT_CURSOR] = this;
1498N/A }
1498N/A}