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 247812 - Favorites created after deleting will be displayed as "Broken Link"
Summary: Favorites created after deleting will be displayed as "Broken Link"
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-09 06:49 UTC by ebaumann
Modified: 2015-08-28 01:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ebaumann 2014-10-09 06:49:34 UTC
Reproducing:

* Create a Favorite in the "Favorites" window (Ctrl+3)
* If the file will be deleted outside, the Favorite is displayed as "Broken Link" (this is correct)
* If the file is recreated outside, the Favorite remains as "Broken Link" (does not reflect the file status)

I have Favorites to the "Preferences" folder and the "messages.log" file within the "Build" folder (is also a Favorite). After a "Clean", the links are broken, but after a "Build" (and run for Preferences), the links are targeting existing files and are not broken.

The workaround takes time: Either restart the IDE or open the Favorite's properties, put a space after it's file name and press Enter (re-evaluates the file's existence). 

The Favorites' refresh task should check for re-appearance in addition to disappearance.
Comment 1 Ondrej Vrabec 2014-11-21 12:51:42 UTC
Not sure if there is really anything we can do. As a workaround you can add the file to favorites once more and then remove this second link -> as a side effect all nodes are refreshed again.

I think the reason for this is in data systems: When the file is deleted, DataObjectPool.fileDeleted is called and it notifies the DOs listeners (the DataShadow/link instance) that the file was deleted. However when the file is recreated DataObjectPool.fileDataCreated does not notify anyone because no DOs are returned from a call of getTargets (maybe because the original DOs was GCed or because the instance of the FO is a different from the original file - nothing is returned in getTargets - DataObjectPool.POOL.map.get(fo)
Comment 2 Jaroslav Havlin 2015-08-26 12:07:35 UTC
There is also another problem. The mechanism that is already present in NetBeans for re-creation of broken links works only for default (config) filesystem.

Filesystem with project files are excluded, because the OS sometimes asked people to insert floppy disk or CD-ROM (bug 43315).
This problem seems resolved now (probably due to changes in OS and masterfs module), so we can check all filesystems now.

The problem Ondrej described is still valid, but its impact seems smaller and re-activation of broken links in Favorites view works fine after the change.

Fixed in http://hg.netbeans.org/core-main/rev/8e4931d03bef
Please verify.

To restore the original behavior, please start NetBeans with this parameter:
-J-Dorg.openide.loaders.BrokenDataShadow.CHECK_ONLY_DEFAULT=true

Thank you for reporting.
Comment 3 Quality Engineering 2015-08-28 01:23:08 UTC
Integrated into 'main-silver', will be available in build *201508280002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8e4931d03bef
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #247812: Favorites created after deleting will be displayed as "Broken Link"