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 199641

Summary: DefaultDataObject.fixCookieSet() reads file content too early
Product: platform Reporter: Alexander Simon <alexvsimon>
Component: Data SystemsAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED WORKSFORME    
Severity: normal CC: issues, mmirilovic
Priority: P3 Keywords: PERFORMANCE
Version: 7.0.1   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 199642    
Bug Blocks:    
Attachments: An attempt to base the editorcookie presence just on mimetype
call stack of fixing cookies set for file with undefined MIME type (file name: names.rl)

Description Alexander Simon 2011-06-23 06:44:32 UTC
File object has method "getMIMEType()". This method called at mime resolving time. But file system does not delegate mime resolving to file object in two cases.

First: MIMESupport.CachedFileObject does not call "getMIMEType()" for delegated file object.

Second: DefaultDataObject.fixCookieSet() use first 2048 bytes of file object for implicit "text" mime resolving. This implicit mime resolving should be moved at mime resolving time or called just before editing file object.

This is requirements of remote file system.
Comment 1 Jaroslav Tulach 2011-06-23 09:24:11 UTC
I've reported the FileUtil.getMIMEType problem as bug 199642 (at the same moment you reported this one). Let's track the problem there and let use this bug for the fixCookieSet problem.
Comment 2 Jaroslav Tulach 2011-06-27 09:34:03 UTC
As far as I can tell, the fixCookieSet is called only when you select the DefaultDataObject - e.g. it is not called while the DDO is being displayed.
Comment 3 Jaroslav Tulach 2011-06-30 06:48:26 UTC
Created attachment 109159 [details]
An attempt to base the editorcookie presence just on mimetype
Comment 4 Jaroslav Tulach 2012-05-13 18:32:28 UTC
Does this still remain a problem? If so, please reopen.
Comment 5 Marian Mirilovic 2012-05-13 20:49:58 UTC
(In reply to comment #4)
> Does this still remain a problem? If so, please reopen.

.. and WONTFIX ?
Comment 6 Alexander Simon 2012-05-14 07:03:34 UTC
Second problem still exists.
Method DefaultDataObject.fixCookieSet() is called when node is shown in favorites tree.
Comment 7 Alexander Simon 2012-05-14 07:05:30 UTC
Created attachment 119398 [details]
call stack of fixing cookies set for file with undefined MIME type (file name: names.rl)