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 214851

Summary: IllegalArgumentException: Cannot decrease processed workunit count (500) to lower value than before (1000)
Product: java Reporter: facilityderek <facilityderek>
Component: FindBugsAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED FIXED    
Severity: normal CC: alexvsimon, everflux, gtzabari, itreppert, jlahoda, lhochet, MackSix, mmirilovic, sentrox, theanuradha, zdenek.rod
Priority: P3    
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 190135
Attachments: stacktrace
stacktrace

Description facilityderek 2012-06-27 08:44:36 UTC
This bug was originally marked as duplicate of bug 213803, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201206220002)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.0-b21, Java(TM) SE Runtime Environment, 1.7.0_04-b20
OS: Windows 7

User Comments:
facilityderek: Working in latest nightly build Dev 201206110001. 
Ran Findbugs analysis on web project ...success.

Working on several individual files in same project.
Made changes and cleared FB issues
Ran findbugs against each individual file several times clearing problems in groups of 3-5 issues....success

Ran Findbugs analysis on web project ...failed throwing exception.
Think this was supposed to be fixed in this build.

everflux: Maven project, used "source->inspect" and ran "all analyzers"

sentrox: - Select a project (maven)
- Choose Source -> Inspect from Main Menu
- Inspect (Current Project, FindBugs)

facilityderek: Still happening during cobe analysis

theanuradha: when run the inspect on open projects

GUEST: running Source | Inspect | findbugs

itreppert: this time it already stopped at 1% of inspecting "Open Projects"

itreppert: This time it went to 23%

zdenek.rod: I lunched Inspect and slected FindBug on maven project.

gtzabari: Source -> Inspect -> Inspect -> Exception thrown

facilityderek: Doing an inspection on web application code base. All analyzers. This was working fine until recently. No recent updates that I'm aware of.




Stacktrace: 
java.lang.IllegalArgumentException: Cannot decrease processed workunit count (500) to lower value than before (1000)
   at org.netbeans.modules.progress.spi.InternalHandle.progress(InternalHandle.java:267)
   at org.netbeans.api.progress.ProgressHandle.progress(ProgressHandle.java:184)
   at org.netbeans.api.progress.ProgressHandle.progress(ProgressHandle.java:164)
   at org.netbeans.modules.analysis.spi.Analyzer$Context.progress(Analyzer.java:182)
   at org.netbeans.modules.findbugs.AnalyzerImpl$1.finishPerClassAnalysis(AnalyzerImpl.java:231)
   at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1227)
Comment 1 facilityderek 2012-06-27 08:44:41 UTC
Created attachment 121433 [details]
stacktrace
Comment 2 Jan Peska 2012-06-27 09:21:34 UTC
Seems to be related to Find Bugs too. Reassigning.
Comment 3 Jan Lahoda 2012-07-13 09:59:27 UTC
Most of the reports are from version 1.13 of the findbugs integration module, which does not contain fix for bug #213803. One from version 1.14:
http://statistics.netbeans.org/exceptions/exception.do?id=599815

Unclear how that could happen.
Comment 4 Exceptions Reporter 2013-01-31 12:40:53 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=190135
Comment 5 Marian Mirilovic 2013-02-03 17:50:03 UTC
Honza, 
please re-evaluate. Thanks in advance.
Comment 6 Jan Lahoda 2013-02-03 19:31:57 UTC
From what I can tell, there appear to be about three reports for findbugs version 1.14:
http://statistics.netbeans.org/exceptions/exception.do?id=599815
http://statistics.netbeans.org/exceptions/exception.do?id=605528
http://statistics.netbeans.org/exceptions/exception.do?id=654364

I still do not see how this could happen, so a way to reproduce would be very welcome. Without that the most I can do is to suppress the exception, which would basically mean we will never find the root cause.
Comment 7 mgf 2013-02-23 10:44:20 UTC
I also ran into this - once (in 7.3). I do something like

    final ProgressHandle handle = ProgressHandleFactory.createHandle ( "xx" );
    final AtomicInteger progressCounter = new AtomicInteger ( 0 );

And then do things in many threads, each calling

    handle.progress ( progressCounter.incrementAndGet () );

when done. And one of them generated an exception.

Maybe change the API to have a

    handle.increment ()

type function or don't check for lower values, simply use the max of the new value and the current max in

    handle.progress ( value );

Regards
MG
Comment 8 MackSix 2013-05-14 19:22:55 UTC
Created attachment 134443 [details]
stacktrace

Run Inspect, All Analyzers on PHP project causes this.
Comment 9 MackSix 2013-05-14 19:39:33 UTC
(In reply to comment #6)
<snip>
> I still do not see how this could happen, so a way to reproduce would be very
> welcome. Without that the most I can do is to suppress the exception, which
> would basically mean we will never find the root cause.
<snip>

It's reproducible for me. 

1. Create new default PHP project
2. Run Source>>Inspect with "All Analyzers" on the PHP project. 

This happens every time. 

Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_11; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_11-b21
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)


Product Version: NetBeans IDE Dev (Build 201305102300)
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-b11
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 10 Quality Engineering 2013-05-28 14:16:19 UTC
Integrated into 'main-golden', will be available in build *201305281155* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f51564646454
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #214851: support for zero sized work units.