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 190934

Summary: API review of a new Parser.cancel method
Product: editor Reporter: Tomas Zezula <tzezula>
Component: Parsing & IndexingAssignee: Tomas Zezula <tzezula>
Status: RESOLVED FIXED    
Severity: normal Keywords: API_REVIEW_FAST
Priority: P2    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter:
Bug Depends on:    
Bug Blocks: 190933    
Attachments: diff file

Description Tomas Zezula 2010-10-12 08:07:06 UTC
The parsing api does not cancel parser when a new ParserResultTask with higher priority or UserTask is scheduled. This causes several slownesses in the editor and affects responsiveness of the editor.

This API change deprecates the Parser.cancel() method, the deprecated method behaves as before the change, and adds a new cancel method with parameters describing the cancel reason. This method is called even in case when a new task was added. The parser can use the provided information to determine if it should stop and which data are obsolete.
Comment 1 Tomas Zezula 2010-10-12 08:24:35 UTC
Created attachment 102360 [details]
diff file
Comment 2 Jan Lahoda 2010-10-13 11:42:21 UTC
Overall seems fine to me, except that SourceModificationEvent might need another constructor for compatibility:
     @Deprecated
     protected SourceModificationEvent (Object source) {
         this(source, true);
     }
Comment 3 Tomas Zezula 2010-10-13 12:00:08 UTC
Thanks Honzo, I've overlooked that the constructor is protected.
Comment 4 Petr Pisl 2010-10-13 12:57:16 UTC
I think, it's fine to me.
Comment 5 Tomas Zezula 2010-10-13 17:39:59 UTC
I will integrate it tomorrow.
Comment 6 Tomas Zezula 2010-10-18 13:17:03 UTC
Fixed jet-main d1171e687187