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.
[r33 dec 18] Unit test for DataLoader got one error and one failure plus several exceptions on console.
Created attachment 3876 [details] Excerpt from test log
Created attachment 3877 [details] Results as formatted by XTest
Seems to be reproducible for me at least, happened to me again today.
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
*** Issue 18996 has been marked as a duplicate of this issue. ***
*** Issue 18898 has been marked as a duplicate of this issue. ***
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);
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.
Good, the new patch looks much safer anyway...
Verified - 200201070331.
Resolved for 3.4.x or earlier, no new info since then -> closing.