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 68077 - MimeSupport is likely a bit fragile
Summary: MimeSupport is likely a bit fragile
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: rmatous
URL:
Keywords: RANDOM, TEST
Depends on:
Blocks:
 
Reported: 2005-11-04 08:29 UTC by Jaroslav Tulach
Modified: 2008-12-22 21:51 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Nov 04, 2005 failure (83.94 KB, text/html)
2005-11-04 08:30 UTC, Jaroslav Tulach
Details
Failure in wrong loader (74.49 KB, text/html)
2005-11-08 08:43 UTC, Jaroslav Tulach
Details
Failure in wrong result from lookup (69.18 KB, text/html)
2005-11-08 08:44 UTC, Jaroslav Tulach
Details
Nov 14, 2005 failure (74.61 KB, text/html)
2005-11-15 07:30 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2005-11-04 08:29:57 UTC
The newly introduced org.netbeans.core.filesystems.FileEntityResolverTest 
seems to fail randomly.
Comment 1 Jaroslav Tulach 2005-11-04 08:30:21 UTC
Created attachment 26616 [details]
Nov 04, 2005 failure
Comment 2 Jaroslav Tulach 2005-11-04 19:05:43 UTC
#68077: More logging and possibly a fix as there could be problem with cache in   
MIMESupport   
  
core/test/unit/src/org/netbeans/core/filesystems/FileEntityResolverTest.java,v  
<--  FileEntityResolverTest.java 
new revision: 1.4; 
Comment 3 Jaroslav Tulach 2005-11-08 08:43:51 UTC
Created attachment 26695 [details]
Failure in wrong loader
Comment 4 Jaroslav Tulach 2005-11-08 08:44:31 UTC
Created attachment 26696 [details]
Failure in wrong result from lookup
Comment 5 Jaroslav Tulach 2005-11-08 08:44:51 UTC
. 
Comment 6 Jaroslav Tulach 2005-11-09 15:05:32 UTC
Logging in XMLDataObject improved. Let's wait for next failures: 
 
Checking in 
core/test/unit/src/org/netbeans/core/filesystems/FileEntityResolverTest.java; 
/cvs/core/test/unit/src/org/netbeans/core/filesystems/FileEntityResolverTest.java,v  
<--  FileEntityResolverTest.java 
new revision: 1.5; previous revision: 1.4 
done 
Checking in openide/loaders/src/org/openide/loaders/XMLDataObject.java; 
/cvs/openide/loaders/src/org/openide/loaders/XMLDataObject.java,v  <--  
XMLDataObject.java 
new revision: 1.20; previous revision: 1.19 
Comment 7 Jaroslav Tulach 2005-11-15 07:30:22 UTC
. 
Comment 8 Jaroslav Tulach 2005-11-15 07:30:59 UTC
Created attachment 26945 [details]
Nov 14, 2005 failure
Comment 9 Jaroslav Tulach 2005-11-15 09:00:26 UTC
It seems to me that the problem is in MIMESupport. The previous log shows that 
the resolver is correctly registered to the lookup: 
 
[TEST-testNewResolverShallInfluenceExistingDataObjects] THREAD:main MSG:What 
is the result: 
[MIMEResolverImpl.Impl[MultiFileObject@da3a1e[Services/MIMEResolver/Lenkaresolver.xml], 
null]] 
 
but later when mimetype is queried, it is returned as content/unknown: 
[org.openide.loaders.DataObject.Validator] THREAD:Refresh Loader Pool 
MSG:Iterate: AbstractFileObject@17494c8[X.lenka] 
[org.openide.loaders.DataObject.Validator] THREAD:Refresh Loader Pool 
MSG:Original: 
org.openide.loaders.DefaultDataObject@1e808ca[AbstractFileObject@17494c8
[X.lenka]] 
[TEST-testNewResolverShallInfluenceExistingDataObjects] THREAD:Refresh Loader 
Pool MSG:findPrimaryFile: AbstractFileObject@17494c8[X.lenka] with mime: 
content/unknown 
 
 
What happens inside fileObject.getMIMEType() is unknown to me. Please add 
there a bit of logging and close the bug so we can find the reason of the 
failure next time it happens. 
Comment 10 rmatous 2005-11-15 18:12:56 UTC
/cvs/openide/fs/src/org/openide/filesystems/MIMESupport.java,v  <--  new
revision: 1.7; previous revision: 1.6

/cvs/openide/fs/test/unit/src/org/openide/filesystems/MIMESupportTest.java,v 
<--  new revision: 1.2; previous revision: 1.1

/cvs/core/test/unit/src/org/netbeans/core/filesystems/FileEntityResolverTest.java,v
 new revision: 1.6; previous revision: 1.5

There were two bugs in MIMESupport:
- if content of MIMEResolvers in lookup has changed then cahed mimetypes
resolved by last call weren't thrown away 

- if content of MIMEResolvers in lookup has changed then MIMESupport stoped
listen on changes in lookup it all (introduced in one of the last revisions)

Jarda, please review my commit cause this piece of code is really fragile.
Hopefully this will help with failing tests. If not then will be reopened.