This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 18785 - DataLoaderTest failed
Summary: DataLoaderTest failed
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: phamernik
URL:
Keywords: TEST
: 18898 18996 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-12-18 15:35 UTC by Jesse Glick
Modified: 2008-12-22 23:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Excerpt from test log (5.82 KB, text/plain)
2001-12-18 15:37 UTC, Jesse Glick
Details
Results as formatted by XTest (4.85 KB, text/html)
2001-12-18 15:38 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-12-18 15:35:47 UTC
[r33 dec 18] Unit test for DataLoader got one error and one failure plus several
exceptions on console.
Comment 1 Jesse Glick 2001-12-18 15:37:21 UTC
Created attachment 3876 [details]
Excerpt from test log
Comment 2 Jesse Glick 2001-12-18 15:38:57 UTC
Created attachment 3877 [details]
Results as formatted by XTest
Comment 3 Jesse Glick 2001-12-20 11:36:22 UTC
Seems to be reproducible for me at least, happened to me again today.
Comment 4 phamernik 2001-12-21 10:13:05 UTC
This problem seems to be regression caused by bugfix #12136 in
DataObjectPool:
http://www.netbeans.org/source/browse/openide/src/org/openide/loaders/DataObjectPool.java.diff?r1=1.53&r2=1.53.8.1

Comment 5 phamernik 2002-01-03 15:51:02 UTC
*** Issue 18996 has been marked as a duplicate of this issue. ***
Comment 6 phamernik 2002-01-03 15:52:31 UTC
*** Issue 18898 has been marked as a duplicate of this issue. ***
Comment 7 rmatous 2002-01-03 15:53:41 UTC
You are right, that it is regression caused by bugfix #12136. Petr if
you have no objections I`m ready to apply this patch:

Index: DataObjectPool.java
===================================================================
RCS file: /cvs/openide/src/org/openide/loaders/DataObjectPool.java,v
retrieving revision 1.53.8.1
diff -c -r1.53.8.1 DataObjectPool.java
*** DataObjectPool.java	13 Dec 2001 13:21:19 -0000	1.53.8.1
--- DataObjectPool.java	3 Jan 2002 15:45:26 -0000
***************
*** 153,159 ****
      }
  
      /** Rescans all fileobjects in given set.
!     * @param s set of FileObjects
      * @return set of DataObjects that refused to be revalidated
      */
      public Set revalidate (Set s) {
--- 153,159 ----
      }
  
      /** Rescans all fileobjects in given set.
!     * @param s mutable set of FileObjects
      * @return set of DataObjects that refused to be revalidated
      */
      public Set revalidate (Set s) {
***************
*** 636,642 ****
  	Validator() {}
  
          /** Enters the section.
!         * @param set set of files that should be processed
          * @return the set of files concatenated with any previous sets
          */
          private synchronized Set enter (Set set) {
--- 636,642 ----
  	Validator() {}
  
          /** Enters the section.
!         * @param set mutable set of files that should be processed
          * @return the set of files concatenated with any previous sets
          */
          private synchronized Set enter (Set set) {
***************
*** 654,673 ****
              if (files == null) {
                  files = set;
              } else {
!                 try {
!                     files.addAll (set);
!                 }
!                 catch (UnsupportedOperationException e) {
!                     // In some exceptional cases the files variable
is instance of class 
!                     // that doesn't support 'add' operation. 
!                     // Then the exception is thrown and it is 
necessary to create 
!                     // a new different Set that allows modifications.
!                     // For more info see #11450
!                     HashSet newFiles = new HashSet ();
!                     newFiles.addAll (files);
!                     newFiles.addAll (set);
!                     files = newFiles;
!                 }                    
              }
  
              return files;
--- 654,660 ----
              if (files == null) {
                  files = set;
              } else {
!                 files.addAll (set);
              }
  
              return files;
***************
*** 753,759 ****
          }
  
          /** Rescans all fileobjects in given set.
!         * @param s set of FileObjects
          * @return set of objects that refused to be revalidated
          */
          public Set revalidate (Set s) {
--- 740,746 ----
          }
  
          /** Rescans all fileobjects in given set.
!         * @param s mutable set of FileObjects
          * @return set of objects that refused to be revalidated
          */
          public Set revalidate (Set s) {
Index: DefaultDataObject.java
===================================================================
RCS file: /cvs/openide/src/org/openide/loaders/DefaultDataObject.java,v
retrieving revision 1.18
diff -c -r1.18 DefaultDataObject.java
*** DefaultDataObject.java	22 Nov 2001 08:57:05 -0000	1.18
--- DefaultDataObject.java	3 Jan 2002 15:45:26 -0000
***************
*** 82,88 ****
                      getPrimaryFile ().rename (lock,
name.substring(0, pos), 
                          name.substring(pos+1, name.length()));
                      DataObjectPool.POOL.revalidate(
!                        
java.util.Collections.singleton(getPrimaryFile ())
                      );
                  }
              }
--- 82,88 ----
                      getPrimaryFile ().rename (lock,
name.substring(0, pos), 
                          name.substring(pos+1, name.length()));
                      DataObjectPool.POOL.revalidate(
!                         new HashSet
(java.util.Collections.singleton(getPrimaryFile ()))
                      );
                  }
              }
Index: MultiFileLoader.java
===================================================================
RCS file: /cvs/openide/src/org/openide/loaders/MultiFileLoader.java,v
retrieving revision 1.22
diff -c -r1.22 MultiFileLoader.java
*** MultiFileLoader.java	7 Oct 2001 23:19:52 -0000	1.22
--- MultiFileLoader.java	3 Jan 2002 15:45:26 -0000
***************
*** 156,162 ****
          FileObject primary = obj.getPrimaryFile ();
          
          Set refusing = DataObjectPool.POOL.revalidate (
!             Collections.singleton(primary)
          );
              // ok, the obj is discarded
          DataObject result = DataObjectPool.POOL.find (primary);
--- 156,162 ----
          FileObject primary = obj.getPrimaryFile ();
          
          Set refusing = DataObjectPool.POOL.revalidate (
!             new HashSet (Collections.singleton(primary))
          );
              // ok, the obj is discarded
          DataObject result = DataObjectPool.POOL.find (primary);


Comment 8 rmatous 2002-01-04 13:49:04 UTC
Patch applied in release33:
MultiFileLoader.java 1.22.14.1
DataObjectPool.java  1.53.8.2
DefaultDataObject.java 1.18.2.1

Only mutable sets are accepted in method revalidate.
Comment 9 Jesse Glick 2002-01-04 17:12:56 UTC
Good, the new patch looks much safer anyway...
Comment 10 Jan Zajicek 2002-01-07 13:29:32 UTC
Verified - 200201070331.
Comment 11 Quality Engineering 2003-07-01 16:20:12 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.