Remove exceptions
This commit is contained in:
parent
d103367b43
commit
a97a5ee9b5
@ -68,7 +68,7 @@ public class SourcesGenerator {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SourcesGenerator.class);
|
||||
private static final boolean OVERRIDE_ALL_NULLABLE_METHODS = false;
|
||||
private static final String SERIAL_VERSION = "1";
|
||||
private static final String SERIAL_VERSION = "2";
|
||||
|
||||
private final DataModel dataModel;
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
package it.cavallium.data.generator;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface DataInitializer<T> {
|
||||
|
||||
@NotNull T initialize() throws IOException;
|
||||
@NotNull T initialize();
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
package it.cavallium.data.generator;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface DataUpgrader<T, U> {
|
||||
|
||||
@NotNull U upgrade(@NotNull T data) throws IOException;
|
||||
@NotNull U upgrade(@NotNull T data);
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
package it.cavallium.data.generator.nativedata;
|
||||
|
||||
import it.cavallium.data.generator.DataUpgrader;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class UpgradeUtil {
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <A, B> List<B> upgradeArray(List<A> from, DataUpgrader<A, B> upgrader)
|
||||
throws IOException {
|
||||
public static <A, B> List<B> upgradeArray(List<A> from, DataUpgrader<A, B> upgrader) {
|
||||
Object[] array;
|
||||
if (from instanceof ImmutableWrappedArrayList<A> immutableWrappedArrayList) {
|
||||
array = immutableWrappedArrayList.a;
|
||||
@ -20,7 +18,7 @@ public class UpgradeUtil {
|
||||
return (ImmutableWrappedArrayList<B>) new ImmutableWrappedArrayList<>(array);
|
||||
}
|
||||
|
||||
public static <A, B> B upgradeNullable(A nullableValue, DataUpgrader<A, B> upgrader) throws IOException {
|
||||
public static <A, B> B upgradeNullable(A nullableValue, DataUpgrader<A, B> upgrader) {
|
||||
if (nullableValue == null) {
|
||||
return null;
|
||||
} else {
|
||||
|
@ -4,7 +4,6 @@ import it.cavallium.stream.SafeByteArrayInputStream;
|
||||
import it.cavallium.stream.SafeByteArrayOutputStream;
|
||||
import it.cavallium.stream.SafeDataInputStream;
|
||||
import it.cavallium.stream.SafeDataOutputStream;
|
||||
import java.io.IOException;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@ -12,7 +11,7 @@ import org.junit.jupiter.api.Test;
|
||||
public class TestInt52Serializer {
|
||||
|
||||
@Test
|
||||
public void testInt52Serialization() throws IOException {
|
||||
public void testInt52Serialization() {
|
||||
for (int i = 0; i <= 300; i++) {
|
||||
testInt52Serialization(i);
|
||||
}
|
||||
@ -21,7 +20,7 @@ public class TestInt52Serializer {
|
||||
testInt52Serialization(999619292661L);
|
||||
}
|
||||
|
||||
public void testInt52Serialization(long n) throws IOException {
|
||||
public void testInt52Serialization(long n) {
|
||||
var serializer = new Int52Serializer();
|
||||
byte[] out;
|
||||
try (var baos = new SafeByteArrayOutputStream()) {
|
||||
@ -37,7 +36,7 @@ public class TestInt52Serializer {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInt52OptionalSerialization() throws IOException {
|
||||
public void testInt52OptionalSerialization() {
|
||||
testInt52OptionalSerialization(null);
|
||||
for (long i = 0; i <= 300; i++) {
|
||||
testInt52OptionalSerialization(i);
|
||||
@ -45,7 +44,7 @@ public class TestInt52Serializer {
|
||||
testInt52OptionalSerialization(0xF_FF_FF_FF_FF_FF_FFL);
|
||||
}
|
||||
|
||||
public void testInt52OptionalSerialization(@Nullable Long n) throws IOException {
|
||||
public void testInt52OptionalSerialization(@Nullable Long n) {
|
||||
var serializer = new NullableInt52Serializer();
|
||||
byte[] out;
|
||||
try (var baos = new SafeByteArrayOutputStream()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user