Skip to content

Commit bf22d6a

Browse files
committed
Merge branch 'with-spaces'
This topic branch fixes the problems reported by Christian Dietz that prevented the EclipseHelper to work properly on Windows, or when the directories' absolute paths contained spaces. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 parents a71ebdf + 54b977a commit bf22d6a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/java/org/scijava/annotations/EclipseHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
import java.util.jar.JarFile;
4343
import java.util.jar.Manifest;
4444

45+
import org.scijava.util.FileUtils;
46+
4547
/**
4648
* Helps Eclipse's lack of support for annotation processing in incremental
4749
* build mode.
@@ -198,7 +200,7 @@ private void maybeIndex(final URL url, final ClassLoader loader) {
198200
}
199201
return;
200202
}
201-
File directory = new File(path);
203+
File directory = FileUtils.urlToFile(url);
202204
if (!directory.isDirectory()) {
203205
return;
204206
}

src/test/java/org/scijava/annotations/EclipseHelperTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private File createTempDirectory() throws IOException {
157157
final File testClassesDirectory = new File(directory);
158158
if (testClassesDirectory.isDirectory()) {
159159
final File result =
160-
new File(testClassesDirectory.getParentFile(), "eclipse-test");
160+
new File(testClassesDirectory.getParentFile(), "eclipse test");
161161
if (result.exists()) {
162162
rmRF(result);
163163
}
@@ -166,7 +166,7 @@ private File createTempDirectory() throws IOException {
166166
}
167167
}
168168
// fall back to /tmp/
169-
final File result = File.createTempFile("eclipse-test", "");
169+
final File result = File.createTempFile("eclipse test", "");
170170
result.delete();
171171
result.mkdir();
172172
return result;

0 commit comments

Comments
 (0)