Add Javadoc and remove all Checkstyle issues from API and natives.
This commit is contained in:
@@ -76,10 +76,10 @@ public final class NativeCodeLoader<T> implements Supplier<T> {
|
||||
}
|
||||
|
||||
static final BooleanSupplier MACOS = () ->
|
||||
System.getProperty("os.name", "").equalsIgnoreCase("Mac OS X") &&
|
||||
System.getProperty("os.arch").equals("x86_64");
|
||||
System.getProperty("os.name", "").equalsIgnoreCase("Mac OS X")
|
||||
&& System.getProperty("os.arch").equals("x86_64");
|
||||
static final BooleanSupplier LINUX = () ->
|
||||
System.getProperties().getProperty("os.name", "").equalsIgnoreCase("Linux") &&
|
||||
System.getProperty("os.arch").equals("amd64");
|
||||
System.getProperties().getProperty("os.name", "").equalsIgnoreCase("Linux")
|
||||
&& System.getProperty("os.arch").equals("amd64");
|
||||
static final BooleanSupplier ALWAYS = () -> true;
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ public class Natives {
|
||||
};
|
||||
}
|
||||
|
||||
public static final NativeCodeLoader<VelocityCompressorFactory> compressor = new NativeCodeLoader<>(
|
||||
public static final NativeCodeLoader<VelocityCompressorFactory> compress = new NativeCodeLoader<>(
|
||||
ImmutableList.of(
|
||||
new NativeCodeLoader.Variant<>(NativeCodeLoader.MACOS,
|
||||
copyAndLoadNative("/macosx/velocity-compress.dylib"), "native (macOS)",
|
||||
|
@@ -20,13 +20,13 @@ class VelocityCompressorTest {
|
||||
|
||||
@BeforeAll
|
||||
static void checkNatives() {
|
||||
Natives.compressor.getLoadedVariant();
|
||||
Natives.compress.getLoadedVariant();
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnabledOnOs({MAC, LINUX})
|
||||
void nativeIntegrityCheck() throws DataFormatException {
|
||||
VelocityCompressor compressor = Natives.compressor.get().create(Deflater.DEFAULT_COMPRESSION);
|
||||
VelocityCompressor compressor = Natives.compress.get().create(Deflater.DEFAULT_COMPRESSION);
|
||||
if (compressor instanceof JavaVelocityCompressor) {
|
||||
compressor.dispose();
|
||||
fail("Loaded regular compressor");
|
||||
|
@@ -28,7 +28,7 @@ class VelocityCipherTest {
|
||||
void nativeIntegrityCheck() throws GeneralSecurityException {
|
||||
VelocityCipherFactory factory = Natives.cipher.get();
|
||||
if (factory == JavaVelocityCipher.FACTORY) {
|
||||
fail("Loaded regular compressor");
|
||||
fail("Loaded regular cipher");
|
||||
}
|
||||
check(factory);
|
||||
}
|
||||
|
Reference in New Issue
Block a user