diff --git a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/MarshallingContexts.java b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/MarshallingContexts.java index 917d1b8c8..7073d9085 100644 --- a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/MarshallingContexts.java +++ b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/MarshallingContexts.java @@ -25,7 +25,9 @@ /** * Providers of marshalling contexts. */ -public interface MarshallingContexts { +public final class MarshallingContexts { + + private MarshallingContexts() {} /** * Yields a marshalling context that writes to the given output stream. @@ -34,7 +36,7 @@ public interface MarshallingContexts { * @return the marshalling context * @throws IOException if the context cannot be created */ - static MarshallingContext of(OutputStream os) throws IOException { + public static MarshallingContext of(OutputStream os) throws IOException { return new MarshallingContextImpl(os); } } \ No newline at end of file diff --git a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/UnmarshallingContexts.java b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/UnmarshallingContexts.java index e1304168c..0c7da372c 100644 --- a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/UnmarshallingContexts.java +++ b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/UnmarshallingContexts.java @@ -25,7 +25,9 @@ /** * Providers of unmarshalling contexts. */ -public interface UnmarshallingContexts { +public final class UnmarshallingContexts { + + private UnmarshallingContexts() {} /** * Creates an unmarshalling context. @@ -33,7 +35,7 @@ public interface UnmarshallingContexts { * @param is the input stream of the context * @throws IOException if the context cannot be created */ - static UnmarshallingContext of(InputStream is) throws IOException { + public static UnmarshallingContext of(InputStream is) throws IOException { return new UnmarshallingContextImpl(is); } } \ No newline at end of file diff --git a/io-hotmoka-node/src/main/java/io/hotmoka/node/internal/ConsensusConfigImpl.java b/io-hotmoka-node/src/main/java/io/hotmoka/node/internal/ConsensusConfigImpl.java index 055c05984..92c3b57b2 100644 --- a/io-hotmoka-node/src/main/java/io/hotmoka/node/internal/ConsensusConfigImpl.java +++ b/io-hotmoka-node/src/main/java/io/hotmoka/node/internal/ConsensusConfigImpl.java @@ -616,10 +616,9 @@ protected ConsensusConfigBuilderImpl(Toml toml) throws NoSuchAlgorithmException if (maxErrorLength != null) setMaxErrorLength(maxErrorLength); - // TODO: remove all type conversions below var maxDependencies = toml.getLong("max_dependencies"); if (maxDependencies != null) - setMaxDependencies((int) (long) maxDependencies); + setMaxDependencies(maxDependencies); var maxCumulativeSizeOfDependencies = toml.getLong("max_cumulative_size_of_dependencies"); if (maxCumulativeSizeOfDependencies != null) diff --git a/io-hotmoka-verification/src/main/java/io/hotmoka/verification/TakamakaClassLoaders.java b/io-hotmoka-verification/src/main/java/io/hotmoka/verification/TakamakaClassLoaders.java index 705129a5a..7a2442bf0 100644 --- a/io-hotmoka-verification/src/main/java/io/hotmoka/verification/TakamakaClassLoaders.java +++ b/io-hotmoka-verification/src/main/java/io/hotmoka/verification/TakamakaClassLoaders.java @@ -24,7 +24,9 @@ /** * A provider of class loaders used to access the definition of the classes of a Takamaka program. */ -public interface TakamakaClassLoaders { +public final class TakamakaClassLoaders { + + private TakamakaClassLoaders() {} /** * Yields a class loader with the given jars, given as byte arrays. @@ -35,7 +37,7 @@ public interface TakamakaClassLoaders { * @return the class loader * @throws ClassNotFoundException if some class of the Takamaka runtime cannot be loaded */ - static TakamakaClassLoader of(Stream jars, long verificationVersion) throws ClassNotFoundException { + public static TakamakaClassLoader of(Stream jars, long verificationVersion) throws ClassNotFoundException { return new TakamakaClassLoaderImpl(jars, verificationVersion); } } \ No newline at end of file diff --git a/io-hotmoka-verification/src/main/java/io/hotmoka/verification/VerifiedJars.java b/io-hotmoka-verification/src/main/java/io/hotmoka/verification/VerifiedJars.java index 439e9c247..2d5df4bfd 100644 --- a/io-hotmoka-verification/src/main/java/io/hotmoka/verification/VerifiedJars.java +++ b/io-hotmoka-verification/src/main/java/io/hotmoka/verification/VerifiedJars.java @@ -25,7 +25,9 @@ /** * A provider of jars that have undergone static verification, before being installed into blockchain. */ -public interface VerifiedJars { +public final class VerifiedJars { + + private VerifiedJars() {} /** * Creates a verified jar from the given file. This verification @@ -43,7 +45,7 @@ public interface VerifiedJars { * @throws ClassNotFoundException if some class of the Takamaka program cannot be loaded * @throws UnsupportedVerificationVersionException if the verification version is not available */ - static VerifiedJar of(byte[] jar, TakamakaClassLoader classLoader, boolean duringInitialization, boolean allowSelfCharged, boolean skipsVerification) throws IOException, ClassNotFoundException, UnsupportedVerificationVersionException { + public static VerifiedJar of(byte[] jar, TakamakaClassLoader classLoader, boolean duringInitialization, boolean allowSelfCharged, boolean skipsVerification) throws IOException, ClassNotFoundException, UnsupportedVerificationVersionException { return new VerifiedJarImpl(jar, classLoader, duringInitialization, allowSelfCharged, skipsVerification); } } \ No newline at end of file diff --git a/io-hotmoka-whitelisting/src/main/java/io/hotmoka/whitelisting/ResolvingClassLoaders.java b/io-hotmoka-whitelisting/src/main/java/io/hotmoka/whitelisting/ResolvingClassLoaders.java index 12ff3fb86..3549919f4 100644 --- a/io-hotmoka-whitelisting/src/main/java/io/hotmoka/whitelisting/ResolvingClassLoaders.java +++ b/io-hotmoka-whitelisting/src/main/java/io/hotmoka/whitelisting/ResolvingClassLoaders.java @@ -24,7 +24,9 @@ /** * A provider of resolving class loaders. */ -public interface ResolvingClassLoaders { +public final class ResolvingClassLoaders { + + private ResolvingClassLoaders() {} /** * Yields a resolving class loader that loads classes from the given jars, provided as byte arrays. @@ -34,7 +36,7 @@ public interface ResolvingClassLoaders { * set of white-listing annotations used by the class loader * @return the class loader */ - static ResolvingClassLoader of(Stream jars, long verificationVersion) { + public static ResolvingClassLoader of(Stream jars, long verificationVersion) { return new ResolvingClassLoaderImpl(jars, verificationVersion); } } \ No newline at end of file