1568N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1568N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1568N/A *
1568N/A * This code is free software; you can redistribute it and/or modify it
1568N/A * under the terms of the GNU General Public License version 2 only, as
1568N/A * published by the Free Software Foundation.
1568N/A *
1568N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1568N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1568N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1568N/A * version 2 for more details (a copy is included in the LICENSE file that
1568N/A * accompanied this code).
1568N/A *
1568N/A * You should have received a copy of the GNU General Public License version
1568N/A * 2 along with this work; if not, write to the Free Software Foundation,
1568N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1568N/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.
1568N/A */
1568N/A
1568N/A/*
1568N/A * @test
5853N/A * @bug 4703132 7197662
1568N/A * @summary flush() throws an IllegalStateException on a removed node
5853N/A * @run main/othervm -Djava.util.prefs.userRoot=. ConflictInFlush
1568N/A * @author Sucheta Dambalkar
1568N/A */
1568N/A
1568N/Aimport java.util.prefs.*;
1568N/A
1568N/Apublic final class ConflictInFlush{
1568N/A
1568N/A public static void main(String args[]) {
1568N/A Preferences root = Preferences.userRoot();
1568N/A try {
1568N/A Preferences node = root.node("1/2/3");
1568N/A node.flush();
1568N/A System.out.println("Node "+node+" has been created");
1568N/A System.out.println("Removing node "+node);
1568N/A node.removeNode();
1568N/A node.flush();
1568N/A }catch (BackingStoreException bse){
1568N/A bse.printStackTrace();
1568N/A }
1568N/A
1568N/A }
1568N/A}