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.
- create a DataObjectFileset - put a DataObject in it and store it in a Context - restart the IDE and get the fileset from the Context - find the DataObject that you stored in the fileset - contains () returns false - toDataObjectSet().contains() also returns false on the other hand: (DataObject []) FileSets.toDataObjectSet (links, false).toArray (new DataObject [] {}) contains the data object...
btw: remove (data object) also does not work for a data object that is in the array mentioned above
It sounds like serious defect.
after more investigation this is what I found: The problem is that URLs in the fileset retrieved from persistent format and URLs created for files in IDE are not equal even if they point to the same file. One problem is that the HOST of URL is not same. For URL created from files the host is null (using URLMapper.findURL(fo, URLMapper.INTERNAL)), for the URL created by the fileset reader it is an empty string (using new URL (String)).
Created attachment 11190 [details] commit log
The problem was in using new URL(String) to create urls when reading from disk as oposed to using new URI(String).toURL() to get url for filesystems. The URLs differ in host. When using new URL(String) the host is set to "". In the new URI(String) the host is set to null. On 1.4.1 there is probably a bug that new URI().toURL() sets the host in url to "" even though it is null on the URI. On 1.4.2 this was 'fixed' so that the null host is copied into URL. MasterFSURLMapper uses file.toURI().toURL() to create URLs. If I change this to file.toURL() other things in IDE do not work (NPE in FileUtil #277). I expect then using URI is the policy. Jesse, is that correct? Thanks.
Yes, file.toURI().toURL() should be used generally in the trunk (it is 1.4-specific). File.toURL has a number of bugs and problems which will never be fixed - for some strange reason it is not @deprecated, but consider it deprecated.
As described in http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss the current work on projects prototype has been stopped. Marking issue as VERIFIED --->
---> CLOSED