Make Disposable interface implement Closeable

This commit is contained in:
Andrew Steinborn
2020-07-29 05:34:15 -04:00
parent c2db8d4ac1
commit 89f98ce57d
12 changed files with 18 additions and 17 deletions

View File

@@ -4,7 +4,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.condition.OS.LINUX;
import static org.junit.jupiter.api.condition.OS.MAC;
import com.velocitypowered.natives.util.BufferPreference;
import com.velocitypowered.natives.util.Natives;
@@ -43,7 +42,7 @@ class VelocityCompressorTest {
void nativeIntegrityCheck() throws DataFormatException {
VelocityCompressor compressor = Natives.compress.get().create(Deflater.DEFAULT_COMPRESSION);
if (compressor.preferredBufferType() != BufferPreference.DIRECT_REQUIRED) {
compressor.dispose();
compressor.close();
fail("Loaded regular compressor");
}
check(compressor, () -> Unpooled.directBuffer(TEST_DATA.length + 32));
@@ -97,7 +96,7 @@ class VelocityCompressorTest {
source.release();
dest.release();
decompressed.release();
compressor.dispose();
compressor.close();
}
}
}

View File

@@ -12,7 +12,6 @@ import java.util.Random;
import java.util.function.Supplier;
import javax.crypto.spec.SecretKeySpec;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
class VelocityCipherTest {
@@ -62,8 +61,8 @@ class VelocityCipherTest {
} finally {
source.release();
workingBuf.release();
decrypt.dispose();
encrypt.dispose();
decrypt.close();
encrypt.close();
}
}
}