Archiviert
13
0

Undo mocking when we're done with the test.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2014-03-13 03:34:51 +01:00
Ursprung 38c62c4cfd
Commit f4f8817fd5
2 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -19,6 +19,7 @@ package com.comphenix.protocol.utility;
import java.util.Map;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
@ -60,12 +61,15 @@ class CachedPackage {
*/
public Class<?> getPackageClass(String className) {
try {
Class<?> result = cache.get(className);
Class<?> result = cache.get(Preconditions.checkNotNull(className, "className cannot be NULL"));
// Concurrency is not a problem - we don't care if we look up a class twice
if (result == null) {
// Look up the class dynamically
result = source.loadClass(combine(packageName, className));
if (result == null)
throw new IllegalArgumentException("Source " + source + " returned NULL for " + className);
cache.put(className, result);
}
return result;

Datei anzeigen

@ -45,6 +45,7 @@ public class MinecraftReflectionTest {
@AfterClass
public static void undoMocking() {
// NOP
MinecraftReflection.minecraftPackage = null;
}
@Test