Skip to content

Commit b9ca341

Browse files
committed
Bug fix: randomize createTemporaryDirectory(String, Class) again
Callers of the createTemporaryDirectory(String, Class) method (I am looking at you, imagej-updater!) started to expect multiple calls to return different values. So let's pseudo-randomize: have a global counter... Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 3bed0ce commit b9ca341

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/scijava/test/TestUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ public static File createTemporaryDirectory(final String prefix) throws IOExcept
8181
public static File createTemporaryDirectory(final String prefix,
8282
final Class<?> forClass) throws IOException
8383
{
84-
return createTemporaryDirectory(prefix, forClass, "");
84+
return createTemporaryDirectory(prefix, forClass, "" + temporaryDirectoryCounter++);
8585
}
8686

87+
private static int temporaryDirectoryCounter = 1;
88+
8789
/**
8890
* Makes a temporary directory for use with unit tests.
8991
* <p>

0 commit comments

Comments
 (0)