Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4400184

java.util.prefs.Preferences sync() IllegalStateException not thrown jdk1.4 b45

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • core-libs
    • None
    • beta
    • x86
    • windows_nt
    • Verified

      jdk1.4 build45

      java.util.prefs.Preferences sync()

      In the test program :
       node created, node removed
      and then sync() called - IllegalStateException not thrown.

      --------------Test Program--------------------
       
       
      import java.util.prefs.*;
      import java.util.*;
       
      /**
       *
       *SyncTest : removeNode() call and check that IllegalStateException is thrown when sync() is called
       */
      public class SyncTest {
          
          public static void main(String[] args) throws Exception {
         try {
                 Preferences userRoot = Preferences.userRoot();
                 Preferences N1 = userRoot.node("N1");
                 Preferences N2 = N1.node("N2");
                 N1.put("k1","v1");
                 N2.put("k2","v2");
                 N2.removeNode();
                 N2.sync();
                 System.out.println("SyncTest() Fail");
             } catch(IllegalStateException ise) {
                 System.out.println("Expected IllegalStateException thrown SyncTest() Pass");
             } catch(Exception e) {
                 System.out.println("Exception thrown = " + e);
                 System.out.println("SyncTest() Fail");
                 e.printStackTrace();
             }
          }
      }


         
        

            kkladkosunw Konstantin Kladko (Inactive)
            spandeorcl Shantaram Pande (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: