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 120742

Summary: Error processing when opening persistence storage for a project should be improved
Product: cnd Reporter: Vladimir Kvashin <vkvashin>
Component: Code ModelAssignee: Vladimir Kvashin <vkvashin>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: Sun   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 127727    
Bug Blocks:    

Description Vladimir Kvashin 2007-10-31 23:53:11 UTC
This concerns situations when for some reason persistence data for a project is inconsistent.
(For example, index file exists, but data file does not, etc.)
Error processing for such situations should be improved.
There should be two different modes:
1) creating a set of persistence files 
2) opening a set of persistence files
In the 2-nd mode any inconsistence or IOException should be thrown and caught somewhere on upper level; in the case of
such exception, persistence for a project is considered corrupted, it's cleaned and created from scratch (via 1-st mode).

Unfortunately now it's not the case:
a) there are places where files are silently created if they don't exist (which breaks consistency in some cases)
b) return values are used instead of exceptions; in the situation of complex code this makes it error prone

All these should be refactored.
Comment 1 Jesse Grodnik 2007-12-19 22:51:25 UTC
This refactoring is planned for Netbeans 6.1.
Comment 2 Vladimir Kvashin 2008-03-28 16:35:52 UTC
The only known end-user consequence is that if user manually deletes some (but not all) persistence files
and then opens correspondent projects in the IDE,
he/she will get a lot of assertions and the language model will be broken.

But the described action is rather weird thing to do.

The workaround is - to delete the entire project storage (or all persistence data).

This still should be fixed; but it isn't a P2 defect.
Downgrading to P3.
Comment 3 Vladimir Voskresensky 2009-05-05 11:41:11 UTC

*** This issue has been marked as a duplicate of 158277 ***