|
From: <caw...@us...> - 2007-01-15 15:29:23
|
Revision: 1771
http://svn.sourceforge.net/rubyeclipse/?rev=1771&view=rev
Author: cawilliams
Date: 2007-01-15 07:29:21 -0800 (Mon, 15 Jan 2007)
Log Message:
-----------
fix broken test
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtCompiler.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/CleanRdtCompiler.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IncrementalRdtCompiler.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IncrementalRdtCompiler.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtCompiler.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtCompiler.java 2007-01-15 15:20:55 UTC (rev 1770)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/AbstractRdtCompiler.java 2007-01-15 15:29:21 UTC (rev 1771)
@@ -38,7 +38,7 @@
protected abstract List<IFile> getFilesToCompile();
protected abstract void analyzeFiles() throws CoreException;
- protected static List compilers(MarkerManager markerManager) {
+ protected static List<SingleFileCompiler> singleFileCompilers(MarkerManager markerManager) {
return ListUtil.create(new RubyCodeAnalyzer(markerManager),
new TaskCompiler(markerManager));
}
@@ -46,21 +46,25 @@
public void compile(IProgressMonitor monitor) throws CoreException {
analyzeFiles();
List<IFile> files = getFilesToCompile();
- int fileCount = files.size();
- monitor.beginTask("Building "+project.getName() + "...", fileCount * (singleFileCompilers.size() + multiFileCompilers.size() + 2));
+ int filesToClear = getFilesToClear().size();
+ int taskCount = (filesToClear * 2) + (files.size() * (singleFileCompilers.size() + multiFileCompilers.size()));
+
+ monitor.beginTask("Building "+project.getName() + "...", taskCount);
monitor.subTask("Removing Markers...");
removeMarkers(markerManager);
- monitor.worked(fileCount);
+ monitor.worked(filesToClear);
monitor.subTask("Removing Search Indices...");
flushIndexEntries(symbolIndex);
- monitor.worked(fileCount);
+ monitor.worked(filesToClear);
compileFiles(files, monitor);
monitor.done();
}
- private void compileFiles(List<IFile> list, IProgressMonitor monitor) throws CoreException {
+ protected abstract List getFilesToClear();
+
+ private void compileFiles(List<IFile> list, IProgressMonitor monitor) throws CoreException {
for (MultipleFileCompiler compiler : multiFileCompilers) {
if (monitor.isCanceled())
return;
@@ -76,8 +80,8 @@
}
private void compileFile(IFile file, IProgressMonitor monitor) throws CoreException {
- for (Iterator cIter = singleFileCompilers.iterator(); cIter.hasNext();) {
- SingleFileCompiler fileCompiler = (SingleFileCompiler) cIter.next();
+ for (Iterator<SingleFileCompiler> cIter = singleFileCompilers.iterator(); cIter.hasNext();) {
+ SingleFileCompiler fileCompiler = cIter.next();
fileCompiler.compileFile(file);
monitor.worked(1);
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/CleanRdtCompiler.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/CleanRdtCompiler.java 2007-01-15 15:20:55 UTC (rev 1770)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/CleanRdtCompiler.java 2007-01-15 15:29:21 UTC (rev 1771)
@@ -22,7 +22,7 @@
private CleanRdtCompiler(IProject project, SymbolIndex symbolIndex,
MarkerManager markerManager) {
- this(project,symbolIndex, markerManager, compilers(markerManager));
+ this(project,symbolIndex, markerManager, singleFileCompilers(markerManager));
}
protected void flushIndexEntries(SymbolIndex symbolIndex) {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IncrementalRdtCompiler.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IncrementalRdtCompiler.java 2007-01-15 15:20:55 UTC (rev 1770)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IncrementalRdtCompiler.java 2007-01-15 15:29:21 UTC (rev 1771)
@@ -20,7 +20,7 @@
private final IResourceDelta rootDelta;
public IncrementalRdtCompiler(IProject project, IResourceDelta delta,
- SymbolIndex symbolIndex, IMarkerManager markerManager, List singleCompilers) {
+ SymbolIndex symbolIndex, IMarkerManager markerManager, List<SingleFileCompiler> singleCompilers) {
super(project, symbolIndex, markerManager, singleCompilers);
this.rootDelta = delta;
}
@@ -32,7 +32,7 @@
private IncrementalRdtCompiler(IProject project, IResourceDelta delta,
SymbolIndex symbolIndex, MarkerManager manager) {
- this(project, delta, symbolIndex, manager, compilers(manager));
+ this(project, delta, symbolIndex, manager, singleFileCompilers(manager));
}
protected void removeMarkers(IMarkerManager markerManager) {
@@ -77,4 +77,9 @@
filesToClear.addAll(filesToCompile);
}
+ @Override
+ protected List getFilesToClear() {
+ return filesToClear;
+ }
+
}
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IncrementalRdtCompiler.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IncrementalRdtCompiler.java 2007-01-15 15:20:55 UTC (rev 1770)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IncrementalRdtCompiler.java 2007-01-15 15:29:21 UTC (rev 1771)
@@ -25,7 +25,7 @@
monitor.assertTaskBegun("Building test...", 2);
monitor.assertDone(2);
- List subTasks = ListUtil.create(REMOVING_MARKERS_SUB_TASK);
+ List subTasks = ListUtil.create(REMOVING_MARKERS_SUB_TASK, REMOVING_INDICES_SUB_TASK);
monitor.assertSubTasks(subTasks);
assertMarkersRemoved(ListUtil.create(t1));
assertIndexFlushed(ListUtil.create(t1));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|