Polish
This commit is contained in:
@@ -34,16 +34,16 @@ public class ByteArrayStartsWith extends TypeSafeMatcher<byte[]> {
|
||||
|
||||
@Override
|
||||
public void describeTo(Description description) {
|
||||
description.appendText("a byte array starting with ").appendValue(bytes);
|
||||
description.appendText("a byte array starting with ").appendValue(this.bytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean matchesSafely(byte[] item) {
|
||||
if (item.length < bytes.length) {
|
||||
if (item.length < this.bytes.length) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
if (item[i] != bytes[i]) {
|
||||
for (int i = 0; i < this.bytes.length; i++) {
|
||||
if (item[i] != this.bytes[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,17 @@ public class ExecutableArchiveLauncherTests {
|
||||
assertArrayEquals(urls, ((URLClassLoader) classLoader).getURLs());
|
||||
}
|
||||
|
||||
private void doWithTccl(ClassLoader classLoader, Callable<?> action) throws Exception {
|
||||
ClassLoader old = Thread.currentThread().getContextClassLoader();
|
||||
try {
|
||||
Thread.currentThread().setContextClassLoader(classLoader);
|
||||
action.call();
|
||||
}
|
||||
finally {
|
||||
Thread.currentThread().setContextClassLoader(old);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class UnitTestExecutableArchiveLauncher extends
|
||||
ExecutableArchiveLauncher {
|
||||
|
||||
@@ -103,15 +114,4 @@ public class ExecutableArchiveLauncherTests {
|
||||
}
|
||||
}
|
||||
|
||||
private void doWithTccl(ClassLoader classLoader, Callable<?> action) throws Exception {
|
||||
ClassLoader old = Thread.currentThread().getContextClassLoader();
|
||||
try {
|
||||
Thread.currentThread().setContextClassLoader(classLoader);
|
||||
action.call();
|
||||
}
|
||||
finally {
|
||||
Thread.currentThread().setContextClassLoader(old);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ public class JarFileArchiveTests {
|
||||
|
||||
private void setup(boolean unpackNested) throws Exception {
|
||||
this.rootJarFile = this.temporaryFolder.newFile();
|
||||
this.rootJarFileUrl = rootJarFile.toURI().toString();
|
||||
System.out.println(rootJarFileUrl);
|
||||
this.rootJarFileUrl = this.rootJarFile.toURI().toString();
|
||||
System.out.println(this.rootJarFileUrl);
|
||||
TestJarCreator.createTestJar(this.rootJarFile, unpackNested);
|
||||
this.archive = new JarFileArchive(this.rootJarFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user