diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndexManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndexManager.java index ff7be452df5..b9553056e6e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndexManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndexManager.java @@ -6,9 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.index; import org.eclipse.cdt.core.index.IIndexManager; @@ -16,7 +15,6 @@ import org.eclipse.cdt.core.model.ICProject; import org.eclipse.core.runtime.CoreException; public interface IWritableIndexManager extends IIndexManager { - /** * Returns a writable index or null if the project does not exist or is not yet * registered with the pdom manager. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexerProgress.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexerProgress.java index 2a630de225f..f4ca6367fe3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexerProgress.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/IndexerProgress.java @@ -6,18 +6,16 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.pdom; public class IndexerProgress { - public int fRequestedFilesCount; public int fCompletedSources; - public int fPrimaryHeaderCount; // headers parsed that were actually requested - public int fCompletedHeaders; // all headers including those found through inclusions - public int fTimeEstimate; // fall-back for the time where no file-count is available + public int fPrimaryHeaderCount; // Headers parsed that were actually requested + public int fCompletedHeaders; // All headers including those found through inclusions + public int fTimeEstimate; // Fall-back for the time where no file-count is available public IndexerProgress() { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java index 715dbfb1f31..4371732a671 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java @@ -111,9 +111,7 @@ import org.eclipse.core.runtime.preferences.InstanceScope; import com.ibm.icu.text.MessageFormat; /** - * The PDOM Provider. This is likely temporary since I hope - * to integrate the PDOM directly into the core once it has - * stabilized. + * Manages PDOM updates and events associated with them. Provides methods for index access. */ public class PDOMManager implements IWritableIndexManager, IListener { private static final String TRACE_INDEXER_SETUP = CCorePlugin.PLUGIN_ID + "/debug/indexer/setup"; //$NON-NLS-1$ @@ -697,10 +695,10 @@ public class PDOMManager implements IWritableIndexManager, IListener { } else { if (fCurrentTask != null) { IndexerProgress info= fCurrentTask.getProgressInformation(); - fSourceCount+= info.fCompletedSources; - fHeaderCount+= info.fCompletedHeaders; + fSourceCount += info.fCompletedSources; + fHeaderCount += info.fCompletedHeaders; // for the ticks we don't consider additional headers - fTickCount+= info.fCompletedSources + info.fPrimaryHeaderCount; + fTickCount += info.fCompletedSources + info.fPrimaryHeaderCount; } result= fCurrentTask= fTaskQueue.removeFirst(); } @@ -1138,26 +1136,26 @@ public class PDOMManager implements IWritableIndexManager, IListener { int sourceCount, sourceEstimate, headerCount, tickCount, tickEstimate; String detail= null; synchronized (fTaskQueue) { - // add historic data + // Add historic data. sourceCount= sourceEstimate= fSourceCount; headerCount= fHeaderCount; tickCount= tickEstimate= fTickCount; - // add future data + // Add future data. for (IPDOMIndexerTask task : fTaskQueue) { final IndexerProgress info= task.getProgressInformation(); - sourceEstimate+= info.fRequestedFilesCount; - tickEstimate+= info.getEstimatedTicks(); + sourceEstimate += info.fRequestedFilesCount; + tickEstimate += info.getEstimatedTicks(); } - // add current data + // Add current data. if (fCurrentTask != null) { final IndexerProgress info= fCurrentTask.getProgressInformation(); - sourceCount+= info.fCompletedSources; - sourceEstimate+= info.fRequestedFilesCount - info.fPrimaryHeaderCount; - headerCount+= info.fCompletedHeaders; - // for the ticks we don't consider additional headers - tickCount+= info.fCompletedSources + info.fPrimaryHeaderCount; - tickEstimate+= info.getEstimatedTicks(); + sourceCount += info.fCompletedSources; + sourceEstimate += info.fRequestedFilesCount - info.fPrimaryHeaderCount; + headerCount += info.fCompletedHeaders; + // For the ticks we don't consider additional headers. + tickCount += info.fCompletedSources + info.fPrimaryHeaderCount; + tickEstimate += info.getEstimatedTicks(); detail= PDOMIndexerJob.sMonitorDetail; } } @@ -1171,9 +1169,9 @@ public class PDOMManager implements IWritableIndexManager, IListener { job.subTask(msg); if (tickCount > 0 && tickCount <= tickEstimate) { - int newTick= tickCount*base/tickEstimate; + int newTick= tickCount * base / tickEstimate; if (newTick > currentTicks) { - job.worked(newTick-currentTicks); + job.worked(newTick - currentTicks); return newTick; } }