Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 62648 Details for
Bug 176320
Non linear progress in open type dialog
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
176320.txt (text/plain), 3.38 KB, created by
Jerome Lanneluc
on 2007-04-02 07:10:34 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2007-04-02 07:10:34 EDT
Size:
3.38 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/processing/JobManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java,v >retrieving revision 1.90 >diff -u -r1.90 JobManager.java >--- search/org/eclipse/jdt/internal/core/search/processing/JobManager.java 16 Mar 2007 18:28:59 -0000 1.90 >+++ search/org/eclipse/jdt/internal/core/search/processing/JobManager.java 2 Apr 2007 11:10:22 -0000 >@@ -205,16 +205,13 @@ > throw new OperationCanceledException(); > > case IJob.WaitUntilReady : >- int awaitingWork; >- IJob previousJob = null; >- IJob currentJob; > IProgressMonitor subProgress = null; > try { >- int totalWork = this.awaitingJobsCount(); >- if (progress != null && totalWork > 0) { >- subProgress = new SubProgressMonitor(progress, concurrentJobWork / 2); >+ int totalWork = 1000; >+ if (progress != null) { >+ subProgress = new SubProgressMonitor(progress, concurrentJobWork * 8 / 10); > subProgress.beginTask("", totalWork); //$NON-NLS-1$ >- concurrentJobWork = concurrentJobWork / 2; >+ concurrentJobWork = concurrentJobWork * 2 / 10; > } > // use local variable to avoid potential NPE (see bug 20435 NPE when searching java method > // and bug 42760 NullPointerException in JobManager when searching) >@@ -226,18 +223,35 @@ > synchronized(this) { > this.awaitingClients++; > } >- while ((awaitingWork = awaitingJobsCount()) > 0) { >+ IJob previousJob = null; >+ int awaitingJobsCount; >+ int lastJobsCount = totalWork; >+ float lastWorked = 0; >+ float totalWorked = 0; >+ while ((awaitingJobsCount = awaitingJobsCount()) > 0) { > if (subProgress != null && subProgress.isCanceled()) > throw new OperationCanceledException(); >- currentJob = currentJob(); >+ IJob currentJob = currentJob(); > // currentJob can be null when jobs have been added to the queue but job manager is not enabled > if (currentJob != null && currentJob != previousJob) { > if (VERBOSE) > Util.verbose("-> NOT READY - waiting until ready - " + searchJob);//$NON-NLS-1$ > if (subProgress != null) { > subProgress.subTask( >- Messages.bind(Messages.manager_filesToIndex, Integer.toString(awaitingWork))); >- subProgress.worked(1); >+ Messages.bind(Messages.manager_filesToIndex, Integer.toString(awaitingJobsCount))); >+ // ratio of the amount of work relative to the total work >+ float ratio = awaitingJobsCount < totalWork ? 1 : ((float) totalWork) / awaitingJobsCount; >+ if (lastJobsCount > awaitingJobsCount) { >+ totalWorked += (lastJobsCount - awaitingJobsCount) * ratio; >+ } else { >+ // more jobs were added, just increment by the ratio >+ totalWorked += ratio; >+ } >+ if (totalWorked - lastWorked >= 1) { >+ subProgress.worked((int) (totalWorked - lastWorked)); >+ lastWorked = totalWorked; >+ } >+ lastJobsCount = awaitingJobsCount; > } > previousJob = currentJob; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 176320
: 62648