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 230086

Summary: Unable to report canceled scanning
Product: editor Reporter: Tomas Danek <musilt2>
Component: Parsing & IndexingAssignee: Svata Dedic <sdedic>
Status: VERIFIED FIXED    
Severity: normal CC: mmirilovic, sdedic
Priority: P2    
Version: 7.3   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description Tomas Danek 2013-05-22 09:17:03 UTC
Product Version: NetBeans IDE Dev (Build 201305212300)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b12
System: Mac OS X version 10.8.3 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/dev
Cache directory: /Users/tomas/Library/Caches/NetBeans/dev
--------------------
- open some NB module (e.g. uihandler)
- scanning start, try to cancel it by [x] button next to progress bar
- dialog is shown with information that scanning cannot be canceled but next time as data is gathered it should be possible to send a report instead of this dialog
- try to invoke cancel again, but [x] button in now disabled (popup on progress shows action "cancel process" which should be disabled as well) -> no chance to report scanning exception
Comment 1 Tomas Zezula 2013-05-22 09:27:14 UTC
The progress can be canceled just once, but the exception should be sent by the first cancel.
Comment 2 Svata Dedic 2013-05-22 10:59:00 UTC
Some time ago, I added a code that prevents report from being done within 3 minutes after scanning starts. This was consulted with Tomas Zezula - and the reason was mainly because reports, which collected data from just a short period of time after scan starts typically did not provide any useful results and only created garbage in exception reporter.
The time the reporting is blocked can be configured using 
-J-Dorg.netbeans.modules.parsing.impl.indexing.LogContext.cancelTreshold=x 
on the commandline, 'x' is a value in seconds, can be 0.

The blocking code can be improved, e.g. display a message immediately, that the report will be delayed, and the report could be actually created after the necessary time elapses. Please provide an alternative idea.

I think the inability to repeatedly request cancel should be filed as a separate issue (enhancement ?) against Progress API. The Background scanning task returns false from its cancel method, but Progress UI still tracks the task as 'cancel pending' for an infinite period of time.
Comment 3 Svata Dedic 2013-05-22 20:15:51 UTC
Fixed in http://hg.netbeans.org/jet-main/rev/49f396c522bd
Comment 4 Quality Engineering 2013-05-26 02:24:00 UTC
Integrated into 'main-golden', will be available in build *201305252300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/49f396c522bd
User: Svata Dedic <sdedic@netbeans.org>
Log: #230086: if scan is cancelled early, delay the report data collection. Implemented self-profiling, default off
Comment 5 Quality Engineering 2013-05-27 23:33:51 UTC
Integrated into 'releases', will be available in build *201305272201* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/532a3ea016e0
User: Svata Dedic <sdedic@netbeans.org>
Log: #230000, #230086: Scan cancel exception msg contains indexer name, if scan is cancelled early, the report will be delayed [backport from trunk]
Comment 6 Tomas Danek 2013-05-28 09:03:28 UTC
Svato, please increase also spec. version, so that this fix could be reachable via UC, thanks.
Comment 7 Marian Mirilovic 2013-05-29 10:43:00 UTC
keeping candidate keyword to be sure it's fixed in NB 7.3.1
Comment 8 Svata Dedic 2013-05-29 11:10:28 UTC
Incremented in http://hg.netbeans.org/releases/rev/c5a923d254bc
Comment 9 Quality Engineering 2013-05-29 15:38:24 UTC
Integrated into 'releases', will be available in build *201305291404* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/c5a923d254bc
User: Svata Dedic <sdedic@netbeans.org>
Log: #230086: incrementing spec version
Comment 10 Tomas Danek 2013-05-30 07:51:24 UTC
verified in bits from staging UC.