From f28fd274fa044de957bbc64bda7d1904931791b9 Mon Sep 17 00:00:00 2001 From: Fausto Spoto Date: Thu, 31 Aug 2023 18:39:30 +0200 Subject: [PATCH] Clean-up of the Javadocs --- io-hotmoka-annotations/pom.xml | 1 + .../io/hotmoka/annotations/GuardedBy.java | 8 +- .../java/io/hotmoka/annotations/OnThread.java | 6 + .../src/main/java/module-info.java | 3 + .../internal/FieldSignatureMarshaller.java | 2 +- .../internal/FieldSignatureUnmarshaller.java | 2 +- .../ConstructorCallTransactionRequest.java | 4 +- .../GameteCreationTransactionRequest.java | 4 +- .../InstanceMethodCallTransactionRequest.java | 6 +- .../requests/JarStoreTransactionRequest.java | 4 +- .../StaticMethodCallTransactionRequest.java | 4 +- .../beans/requests/TransactionRequest.java | 2 +- ...uctorCallTransactionExceptionResponse.java | 12 +- ...structorCallTransactionFailedResponse.java | 12 +- .../JarStoreTransactionFailedResponse.java | 8 +- ...ethodCallTransactionExceptionResponse.java | 12 +- .../MethodCallTransactionFailedResponse.java | 12 +- .../beans/responses/TransactionResponse.java | 2 +- .../beans/signatures/CodeSignature.java | 4 +- .../beans/signatures/MethodSignature.java | 2 +- .../java/io/hotmoka/beans/updates/Update.java | 8 +- .../beans/updates/UpdateOfEnumEager.java | 4 +- .../beans/updates/UpdateOfEnumLazy.java | 4 +- .../hotmoka/beans/updates/UpdateOfString.java | 2 +- .../io/hotmoka/beans/values/EnumValue.java | 4 +- .../io/hotmoka/beans/values/StorageValue.java | 4 +- .../io/hotmoka/beans/values/StringValue.java | 2 +- .../main/java/io/hotmoka/crypto/Signers.java | 4 +- .../io/hotmoka/exceptions/CheckSupplier.java | 2 +- io-hotmoka-marshalling-api/pom.xml | 1 + .../marshalling/api/MarshallingContext.java | 106 ++++++++++++++--- .../hotmoka/marshalling/api/Unmarshaller.java | 8 ++ .../marshalling/api/UnmarshallingContext.java | 112 ++++++++++++++---- .../src/main/java/module-info.java | 3 + io-hotmoka-marshalling/pom.xml | 1 + .../marshalling/AbstractMarshallable.java | 6 + .../marshalling/UnmarshallingContexts.java | 3 +- .../internal/MarshallingContextImpl.java | 2 +- .../internal/UnmarshallingContextImpl.java | 4 +- .../src/main/java/module-info.java | 4 + .../hotmoka/stores/internal/TrieOfErrors.java | 4 +- .../java/io/hotmoka/tests/Marshallable.java | 4 +- 42 files changed, 294 insertions(+), 108 deletions(-) diff --git a/io-hotmoka-annotations/pom.xml b/io-hotmoka-annotations/pom.xml index 15b3bcfc2..952b3ae66 100644 --- a/io-hotmoka-annotations/pom.xml +++ b/io-hotmoka-annotations/pom.xml @@ -6,6 +6,7 @@ jar io-hotmoka-annotations ${hotmoka.version} + This module defines some standard annotations. io.hotmoka diff --git a/io-hotmoka-annotations/src/main/java/io/hotmoka/annotations/GuardedBy.java b/io-hotmoka-annotations/src/main/java/io/hotmoka/annotations/GuardedBy.java index 540a9fc50..894cf9980 100644 --- a/io-hotmoka-annotations/src/main/java/io/hotmoka/annotations/GuardedBy.java +++ b/io-hotmoka-annotations/src/main/java/io/hotmoka/annotations/GuardedBy.java @@ -32,5 +32,11 @@ @Target( { ElementType.FIELD, ElementType.METHOD }) @Retention(RetentionPolicy.SOURCE) public @interface GuardedBy { - String value(); + + /** + * Yields the description of the lock that must be held to access the annotated element. + * + * @return the description of the lock + */ + String value(); } \ No newline at end of file diff --git a/io-hotmoka-annotations/src/main/java/io/hotmoka/annotations/OnThread.java b/io-hotmoka-annotations/src/main/java/io/hotmoka/annotations/OnThread.java index 1e0ae0bed..9bce5dcf0 100644 --- a/io-hotmoka-annotations/src/main/java/io/hotmoka/annotations/OnThread.java +++ b/io-hotmoka-annotations/src/main/java/io/hotmoka/annotations/OnThread.java @@ -28,5 +28,11 @@ @Target( { ElementType.CONSTRUCTOR, ElementType.METHOD }) @Retention(RetentionPolicy.SOURCE) public @interface OnThread { + + /** + * Yields the description of the thread of executor service that executes the annotated element. + * + * @return the description of the thread of executor service + */ String value(); } \ No newline at end of file diff --git a/io-hotmoka-annotations/src/main/java/module-info.java b/io-hotmoka-annotations/src/main/java/module-info.java index 0030e7de4..6351da4d5 100644 --- a/io-hotmoka-annotations/src/main/java/module-info.java +++ b/io-hotmoka-annotations/src/main/java/module-info.java @@ -14,6 +14,9 @@ limitations under the License. */ +/** + * This module defines some standard annotations. + */ module io.hotmoka.annotations { exports io.hotmoka.annotations; } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/marshalling/internal/FieldSignatureMarshaller.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/marshalling/internal/FieldSignatureMarshaller.java index 749379530..826a32669 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/marshalling/internal/FieldSignatureMarshaller.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/marshalling/internal/FieldSignatureMarshaller.java @@ -39,7 +39,7 @@ public void write(FieldSignature field, MarshallingContext context) throws IOExc context.writeByte(255); field.definingClass.into(context); - context.writeUTF(field.name); + context.writeStringUnshared(field.name); field.type.into(context); } } diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/marshalling/internal/FieldSignatureUnmarshaller.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/marshalling/internal/FieldSignatureUnmarshaller.java index 561ad30c6..271dbb2e5 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/marshalling/internal/FieldSignatureUnmarshaller.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/marshalling/internal/FieldSignatureUnmarshaller.java @@ -44,7 +44,7 @@ public FieldSignature read(UnmarshallingContext context) throws IOException { selector = 256 + selector; if (selector == 255) { - var field = new FieldSignature((ClassType) StorageType.from(context), context.readUTF(), StorageType.from(context)); + var field = new FieldSignature((ClassType) StorageType.from(context), context.readStringUnshared(), StorageType.from(context)); memory.put(memory.size(), field); return field; } diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/ConstructorCallTransactionRequest.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/ConstructorCallTransactionRequest.java index 11cd2abc3..9dc9f0675 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/ConstructorCallTransactionRequest.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/ConstructorCallTransactionRequest.java @@ -173,7 +173,7 @@ public int hashCode() { @Override public void intoWithoutSignature(MarshallingContext context) throws IOException { context.writeByte(SELECTOR); - context.writeUTF(chainId); + context.writeStringUnshared(chainId); super.intoWithoutSignature(context); constructor.into(context); } @@ -187,7 +187,7 @@ public void intoWithoutSignature(MarshallingContext context) throws IOException * @throws IOException if the request cannot be unmarshalled */ public static ConstructorCallTransactionRequest from(UnmarshallingContext context) throws IOException { - String chainId = context.readUTF(); + String chainId = context.readStringUnshared(); StorageReference caller = StorageReference.from(context); BigInteger gasLimit = context.readBigInteger(); BigInteger gasPrice = context.readBigInteger(); diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/GameteCreationTransactionRequest.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/GameteCreationTransactionRequest.java index 41fdd09f1..2a3d51031 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/GameteCreationTransactionRequest.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/GameteCreationTransactionRequest.java @@ -121,7 +121,7 @@ public void into(MarshallingContext context) throws IOException { classpath.into(context); context.writeBigInteger(initialAmount); context.writeBigInteger(redInitialAmount); - context.writeUTF(publicKey); + context.writeStringUnshared(publicKey); } /** @@ -136,7 +136,7 @@ public static GameteCreationTransactionRequest from(UnmarshallingContext context TransactionReference classpath = TransactionReference.from(context); BigInteger initialAmount = context.readBigInteger(); BigInteger redInitialAmount = context.readBigInteger(); - String publicKey = context.readUTF(); + String publicKey = context.readStringUnshared(); return new GameteCreationTransactionRequest(classpath, initialAmount, redInitialAmount, publicKey); } diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/InstanceMethodCallTransactionRequest.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/InstanceMethodCallTransactionRequest.java index e279469dc..7b57b118b 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/InstanceMethodCallTransactionRequest.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/InstanceMethodCallTransactionRequest.java @@ -186,7 +186,7 @@ else if (receiveBigInteger) else context.writeByte(SELECTOR); - context.writeUTF(chainId); + context.writeStringUnshared(chainId); if (receiveInt || receiveLong || receiveBigInteger) { caller.intoWithoutSelector(context); @@ -220,7 +220,7 @@ else if (receiveLong) */ public static InstanceMethodCallTransactionRequest from(UnmarshallingContext context, byte selector) throws IOException { if (selector == SELECTOR) { - String chainId = context.readUTF(); + String chainId = context.readStringUnshared(); StorageReference caller = StorageReference.from(context); BigInteger gasLimit = context.readBigInteger(); BigInteger gasPrice = context.readBigInteger(); @@ -234,7 +234,7 @@ public static InstanceMethodCallTransactionRequest from(UnmarshallingContext con return new InstanceMethodCallTransactionRequest(signature, caller, nonce, chainId, gasLimit, gasPrice, classpath, method, receiver, actuals); } else if (selector == SELECTOR_TRANSFER_INT || selector == SELECTOR_TRANSFER_LONG || selector == SELECTOR_TRANSFER_BIG_INTEGER) { - String chainId = context.readUTF(); + String chainId = context.readStringUnshared(); StorageReference caller = StorageReference.from(context); BigInteger gasLimit = context.readBigInteger(); BigInteger gasPrice = context.readBigInteger(); diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/JarStoreTransactionRequest.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/JarStoreTransactionRequest.java index e8065ba74..9ddd3a707 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/JarStoreTransactionRequest.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/JarStoreTransactionRequest.java @@ -209,7 +209,7 @@ public int hashCode() { @Override public void intoWithoutSignature(MarshallingContext context) throws IOException { context.writeByte(SELECTOR); - context.writeUTF(chainId); + context.writeStringUnshared(chainId); super.intoWithoutSignature(context); context.writeCompactInt(jar.length); context.write(jar); @@ -225,7 +225,7 @@ public void intoWithoutSignature(MarshallingContext context) throws IOException * @throws IOException if the request could noy be unmarshalled */ public static JarStoreTransactionRequest from(UnmarshallingContext context) throws IOException { - String chainId = context.readUTF(); + String chainId = context.readStringUnshared(); StorageReference caller = StorageReference.from(context); BigInteger gasLimit = context.readBigInteger(); BigInteger gasPrice = context.readBigInteger(); diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/StaticMethodCallTransactionRequest.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/StaticMethodCallTransactionRequest.java index cfddc7abd..6d75f4d5d 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/StaticMethodCallTransactionRequest.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/StaticMethodCallTransactionRequest.java @@ -146,7 +146,7 @@ public final void into(MarshallingContext context) throws IOException { @Override public void intoWithoutSignature(MarshallingContext context) throws IOException { context.writeByte(SELECTOR); - context.writeUTF(chainId); + context.writeStringUnshared(chainId); super.intoWithoutSignature(context); } @@ -176,7 +176,7 @@ public String getChainId() { * @throws IOException if the request could not be unmarshalled */ public static StaticMethodCallTransactionRequest from(UnmarshallingContext context) throws IOException { - String chainId = context.readUTF(); + String chainId = context.readStringUnshared(); StorageReference caller = StorageReference.from(context); BigInteger gasLimit = context.readBigInteger(); BigInteger gasPrice = context.readBigInteger(); diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/TransactionRequest.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/TransactionRequest.java index 96ad1ded3..eadfbf848 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/TransactionRequest.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/requests/TransactionRequest.java @@ -92,7 +92,7 @@ public static TransactionRequest from(UnmarshallingContext context) throws IO // this case deals with requests that only exist in a specific type of node; // hence their fully-qualified name must be available after the expansion selector - String className = context.readUTF(); + String className = context.readStringUnshared(); Class clazz; try { diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/ConstructorCallTransactionExceptionResponse.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/ConstructorCallTransactionExceptionResponse.java index 38e3fe183..7eaf1e903 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/ConstructorCallTransactionExceptionResponse.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/ConstructorCallTransactionExceptionResponse.java @@ -121,9 +121,9 @@ public void into(MarshallingContext context) throws IOException { context.writeByte(SELECTOR); super.into(context); intoArrayWithoutSelector(events, context); - context.writeUTF(classNameOfCause); - context.writeUTF(messageOfCause); - context.writeUTF(where); + context.writeStringUnshared(classNameOfCause); + context.writeStringUnshared(messageOfCause); + context.writeStringUnshared(where); } /** @@ -140,9 +140,9 @@ public static ConstructorCallTransactionExceptionResponse from(UnmarshallingCont BigInteger gasConsumedForRAM = context.readBigInteger(); BigInteger gasConsumedForStorage = context.readBigInteger(); Stream events = Stream.of(context.readArray(StorageReference::from, StorageReference[]::new)); - String classNameOfCause = context.readUTF(); - String messageOfCause = context.readUTF(); - String where = context.readUTF(); + String classNameOfCause = context.readStringUnshared(); + String messageOfCause = context.readStringUnshared(); + String where = context.readStringUnshared(); return new ConstructorCallTransactionExceptionResponse(classNameOfCause, messageOfCause, where, updates, events, gasConsumedForCPU, gasConsumedForRAM, gasConsumedForStorage); } } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/ConstructorCallTransactionFailedResponse.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/ConstructorCallTransactionFailedResponse.java index e538ca1ae..3de457f60 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/ConstructorCallTransactionFailedResponse.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/ConstructorCallTransactionFailedResponse.java @@ -131,9 +131,9 @@ public void into(MarshallingContext context) throws IOException { context.writeByte(SELECTOR); super.into(context); context.writeBigInteger(gasConsumedForPenalty); - context.writeUTF(classNameOfCause); - context.writeUTF(messageOfCause); - context.writeUTF(where); + context.writeStringUnshared(classNameOfCause); + context.writeStringUnshared(messageOfCause); + context.writeStringUnshared(where); } /** @@ -150,9 +150,9 @@ public static ConstructorCallTransactionFailedResponse from(UnmarshallingContext BigInteger gasConsumedForRAM = context.readBigInteger(); BigInteger gasConsumedForStorage = context.readBigInteger(); BigInteger gasConsumedForPenalty = context.readBigInteger(); - String classNameOfCause = context.readUTF(); - String messageOfCause = context.readUTF(); - String where = context.readUTF(); + String classNameOfCause = context.readStringUnshared(); + String messageOfCause = context.readStringUnshared(); + String where = context.readStringUnshared(); return new ConstructorCallTransactionFailedResponse(classNameOfCause, messageOfCause, where, updates, gasConsumedForCPU, gasConsumedForRAM, gasConsumedForStorage, gasConsumedForPenalty); } } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/JarStoreTransactionFailedResponse.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/JarStoreTransactionFailedResponse.java index edea4f591..9703ab62c 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/JarStoreTransactionFailedResponse.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/JarStoreTransactionFailedResponse.java @@ -120,8 +120,8 @@ public void into(MarshallingContext context) throws IOException { context.writeByte(SELECTOR); super.into(context); context.writeBigInteger(gasConsumedForPenalty); - context.writeUTF(classNameOfCause); - context.writeUTF(messageOfCause); + context.writeStringUnshared(classNameOfCause); + context.writeStringUnshared(messageOfCause); } /** @@ -138,8 +138,8 @@ public static JarStoreTransactionFailedResponse from(UnmarshallingContext contex BigInteger gasConsumedForRAM = context.readBigInteger(); BigInteger gasConsumedForStorage = context.readBigInteger(); BigInteger gasConsumedForPenalty = context.readBigInteger(); - String classNameOfCause = context.readUTF(); - String messageOfCause = context.readUTF(); + String classNameOfCause = context.readStringUnshared(); + String messageOfCause = context.readStringUnshared(); return new JarStoreTransactionFailedResponse(classNameOfCause, messageOfCause, updates, gasConsumedForCPU, gasConsumedForRAM, gasConsumedForStorage, gasConsumedForPenalty); } } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/MethodCallTransactionExceptionResponse.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/MethodCallTransactionExceptionResponse.java index b4210351f..b6adc0125 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/MethodCallTransactionExceptionResponse.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/MethodCallTransactionExceptionResponse.java @@ -125,9 +125,9 @@ public void into(MarshallingContext context) throws IOException { super.into(context); context.writeBoolean(selfCharged); intoArrayWithoutSelector(events, context); - context.writeUTF(classNameOfCause); - context.writeUTF(messageOfCause); - context.writeUTF(where); + context.writeStringUnshared(classNameOfCause); + context.writeStringUnshared(messageOfCause); + context.writeStringUnshared(where); } /** @@ -145,9 +145,9 @@ public static MethodCallTransactionExceptionResponse from(UnmarshallingContext c BigInteger gasConsumedForStorage = context.readBigInteger(); boolean selfCharged = context.readBoolean(); Stream events = Stream.of(context.readArray(StorageReference::from, StorageReference[]::new)); - String classNameOfCause = context.readUTF(); - String messageOfCause = context.readUTF(); - String where = context.readUTF(); + String classNameOfCause = context.readStringUnshared(); + String messageOfCause = context.readStringUnshared(); + String where = context.readStringUnshared(); return new MethodCallTransactionExceptionResponse(classNameOfCause, messageOfCause, where, selfCharged, updates, events, gasConsumedForCPU, gasConsumedForRAM, gasConsumedForStorage); } } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/MethodCallTransactionFailedResponse.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/MethodCallTransactionFailedResponse.java index 12a3d6036..16cc001c1 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/MethodCallTransactionFailedResponse.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/MethodCallTransactionFailedResponse.java @@ -133,9 +133,9 @@ public void into(MarshallingContext context) throws IOException { super.into(context); context.writeBigInteger(gasConsumedForPenalty); context.writeBoolean(selfCharged); - context.writeUTF(classNameOfCause); - context.writeUTF(messageOfCause); - context.writeUTF(where); + context.writeStringUnshared(classNameOfCause); + context.writeStringUnshared(messageOfCause); + context.writeStringUnshared(where); } /** @@ -153,9 +153,9 @@ public static MethodCallTransactionFailedResponse from(UnmarshallingContext cont BigInteger gasConsumedForStorage = context.readBigInteger(); BigInteger gasConsumedForPenalty = context.readBigInteger(); boolean selfCharged = context.readBoolean(); - String classNameOfCause = context.readUTF(); - String messageOfCause = context.readUTF(); - String where = context.readUTF(); + String classNameOfCause = context.readStringUnshared(); + String messageOfCause = context.readStringUnshared(); + String where = context.readStringUnshared(); return new MethodCallTransactionFailedResponse(classNameOfCause, messageOfCause, where, selfCharged, updates, gasConsumedForCPU, gasConsumedForRAM, gasConsumedForStorage, gasConsumedForPenalty); } diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/TransactionResponse.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/TransactionResponse.java index 7c13aee7f..f6a623a2e 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/TransactionResponse.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/responses/TransactionResponse.java @@ -68,7 +68,7 @@ public static TransactionResponse from(UnmarshallingContext context) throws IOEx // this case deals with responses that only exist in a specific type of node; // hence their fully-qualified name must be available after the expansion selector - String className = context.readUTF(); + String className = context.readStringUnshared(); Class clazz; try { diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/signatures/CodeSignature.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/signatures/CodeSignature.java index 6fb2e22fa..0f1312d60 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/signatures/CodeSignature.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/signatures/CodeSignature.java @@ -425,8 +425,8 @@ else if (selector == VoidMethodSignature.SELECTOR_REWARD) switch (selector) { case ConstructorSignature.SELECTOR: return new ConstructorSignature(definingClass, formals); - case VoidMethodSignature.SELECTOR: return new VoidMethodSignature(definingClass, context.readUTF(), formals); - case NonVoidMethodSignature.SELECTOR: return new NonVoidMethodSignature(definingClass, context.readUTF(), StorageType.from(context), formals); + case VoidMethodSignature.SELECTOR: return new VoidMethodSignature(definingClass, context.readStringUnshared(), formals); + case NonVoidMethodSignature.SELECTOR: return new NonVoidMethodSignature(definingClass, context.readStringUnshared(), StorageType.from(context), formals); default: throw new IOException("unexpected code signature selector: " + selector); } } diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/signatures/MethodSignature.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/signatures/MethodSignature.java index a63567083..967b85036 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/signatures/MethodSignature.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/signatures/MethodSignature.java @@ -68,6 +68,6 @@ public int hashCode() { @Override public void into(MarshallingContext context) throws IOException { super.into(context); - context.writeUTF(methodName); + context.writeStringUnshared(methodName); } } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/Update.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/Update.java index 44962b9d4..8ff9ebef1 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/Update.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/Update.java @@ -131,8 +131,8 @@ public static Update from(UnmarshallingContext context) throws IOException { case UpdateOfByte.SELECTOR: return new UpdateOfByte(StorageReference.from(context), FieldSignature.from(context), context.readByte()); case UpdateOfChar.SELECTOR: return new UpdateOfChar(StorageReference.from(context), FieldSignature.from(context), context.readChar()); case UpdateOfDouble.SELECTOR: return new UpdateOfDouble(StorageReference.from(context), FieldSignature.from(context), context.readDouble()); - case UpdateOfEnumEager.SELECTOR: return new UpdateOfEnumEager(StorageReference.from(context), FieldSignature.from(context), context.readUTF(), context.readUTF()); - case UpdateOfEnumLazy.SELECTOR: return new UpdateOfEnumLazy(StorageReference.from(context), FieldSignature.from(context), context.readUTF(), context.readUTF()); + case UpdateOfEnumEager.SELECTOR: return new UpdateOfEnumEager(StorageReference.from(context), FieldSignature.from(context), context.readStringUnshared(), context.readStringUnshared()); + case UpdateOfEnumLazy.SELECTOR: return new UpdateOfEnumLazy(StorageReference.from(context), FieldSignature.from(context), context.readStringUnshared(), context.readStringUnshared()); case UpdateOfFloat.SELECTOR: return new UpdateOfFloat(StorageReference.from(context), FieldSignature.from(context), context.readFloat()); case UpdateOfInt.SELECTOR: return new UpdateOfInt(StorageReference.from(context), FieldSignature.from(context), context.readInt()); case UpdateOfInt.SELECTOR_SMALL: return new UpdateOfInt(StorageReference.from(context), FieldSignature.from(context), context.readShort()); @@ -153,8 +153,8 @@ public static Update from(UnmarshallingContext context) throws IOException { case UpdateOfStorage.SELECTOR_STORAGE_TREE_INTMAP_NODE_RIGHT: return new UpdateOfStorage(StorageReference.from(context), FieldSignature.STORAGE_TREE_INTMAP_NODE_RIGHT_FIELD, StorageReference.from(context)); case UpdateOfStorage.SELECTOR_STORAGE_TREE_MAP_ROOT: return new UpdateOfStorage(StorageReference.from(context), FieldSignature.STORAGE_TREE_MAP_ROOT_FIELD, StorageReference.from(context)); case UpdateOfStorage.SELECTOR_EVENT_CREATOR: return new UpdateOfStorage(StorageReference.from(context), FieldSignature.EVENT_CREATOR_FIELD, StorageReference.from(context)); - case UpdateOfString.SELECTOR_PUBLIC_KEY: return new UpdateOfString(StorageReference.from(context), FieldSignature.EOA_PUBLIC_KEY_FIELD, context.readUTF()); - case UpdateOfString.SELECTOR: return new UpdateOfString(StorageReference.from(context), FieldSignature.from(context), context.readUTF()); + case UpdateOfString.SELECTOR_PUBLIC_KEY: return new UpdateOfString(StorageReference.from(context), FieldSignature.EOA_PUBLIC_KEY_FIELD, context.readStringUnshared()); + case UpdateOfString.SELECTOR: return new UpdateOfString(StorageReference.from(context), FieldSignature.from(context), context.readStringUnshared()); case UpdateToNullEager.SELECTOR: return new UpdateToNullEager(StorageReference.from(context), FieldSignature.from(context)); case UpdateToNullLazy.SELECTOR: return new UpdateToNullLazy(StorageReference.from(context), FieldSignature.from(context)); default: throw new IOException("unexpected update selector: " + selector); diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfEnumEager.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfEnumEager.java index 0926ddf20..b7ffe2c55 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfEnumEager.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfEnumEager.java @@ -99,7 +99,7 @@ public boolean isEager() { public void into(MarshallingContext context) throws IOException { context.writeByte(SELECTOR); super.into(context); - context.writeUTF(enumClassName); - context.writeUTF(name); + context.writeStringUnshared(enumClassName); + context.writeStringUnshared(name); } } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfEnumLazy.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfEnumLazy.java index 610c1b50d..1bf0b4c8e 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfEnumLazy.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfEnumLazy.java @@ -99,7 +99,7 @@ public boolean isEager() { public void into(MarshallingContext context) throws IOException { context.writeByte(SELECTOR); super.into(context); - context.writeUTF(enumClassName); - context.writeUTF(name); + context.writeStringUnshared(enumClassName); + context.writeStringUnshared(name); } } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfString.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfString.java index c6921265e..9958104b7 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfString.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/updates/UpdateOfString.java @@ -101,6 +101,6 @@ public void into(MarshallingContext context) throws IOException { super.into(context); } - context.writeUTF(value); + context.writeStringUnshared(value); } } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/EnumValue.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/EnumValue.java index cb88ab14d..4a1247328 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/EnumValue.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/EnumValue.java @@ -87,7 +87,7 @@ public int compareTo(StorageValue other) { @Override public void into(MarshallingContext context) throws IOException { context.writeByte(SELECTOR); - context.writeUTF(enumClassName); - context.writeUTF(name); + context.writeStringUnshared(enumClassName); + context.writeStringUnshared(name); } } \ No newline at end of file diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/StorageValue.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/StorageValue.java index b3681cfc2..f64388c51 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/StorageValue.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/StorageValue.java @@ -92,7 +92,7 @@ public static StorageValue from(UnmarshallingContext context) throws IOException case ByteValue.SELECTOR: return new ByteValue(context.readByte()); case CharValue.SELECTOR: return new CharValue(context.readChar()); case DoubleValue.SELECTOR: return new DoubleValue(context.readDouble()); - case EnumValue.SELECTOR: return new EnumValue(context.readUTF(), context.readUTF()); + case EnumValue.SELECTOR: return new EnumValue(context.readStringUnshared(), context.readStringUnshared()); case FloatValue.SELECTOR: return new FloatValue(context.readFloat()); case IntValue.SELECTOR: return new IntValue(context.readInt()); case LongValue.SELECTOR: return new LongValue(context.readLong()); @@ -100,7 +100,7 @@ public static StorageValue from(UnmarshallingContext context) throws IOException case ShortValue.SELECTOR: return new ShortValue(context.readShort()); case StorageReference.SELECTOR: return StorageReference.from(context); case StringValue.SELECTOR_EMPTY_STRING: return new StringValue(""); - case StringValue.SELECTOR: return new StringValue(context.readUTF()); + case StringValue.SELECTOR: return new StringValue(context.readStringUnshared()); default: if (selector < 0) return new IntValue((selector + 256) - IntValue.SELECTOR - 1); diff --git a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/StringValue.java b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/StringValue.java index 913f12948..298c82a47 100644 --- a/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/StringValue.java +++ b/io-hotmoka-beans/src/main/java/io/hotmoka/beans/values/StringValue.java @@ -76,7 +76,7 @@ public void into(MarshallingContext context) throws IOException { context.writeByte(SELECTOR_EMPTY_STRING); else { context.writeByte(SELECTOR); - context.writeUTF(value); + context.writeStringUnshared(value); } } } \ No newline at end of file diff --git a/io-hotmoka-crypto/src/main/java/io/hotmoka/crypto/Signers.java b/io-hotmoka-crypto/src/main/java/io/hotmoka/crypto/Signers.java index f1c0c4b92..31c8106c4 100644 --- a/io-hotmoka-crypto/src/main/java/io/hotmoka/crypto/Signers.java +++ b/io-hotmoka-crypto/src/main/java/io/hotmoka/crypto/Signers.java @@ -9,13 +9,14 @@ /** * Providers of objects that sign values with a private key. */ -public final class Signers { +public final class Signers { private Signers() {} /** * Yields a signer for the given algorithm with the given key pair. * + * @param the type of data that gets signed * @param signature the signing algorithm * @param keys the key pair * @return the signer @@ -27,6 +28,7 @@ public static Signer with(SignatureAlgorithm signature, KeyPai /** * Yields a signer for the given algorithm with the given private key. * + * @param the type of data that gets signed * @param signature the signing algorithm * @param key the private key * @return the signer diff --git a/io-hotmoka-exceptions/src/main/java/io/hotmoka/exceptions/CheckSupplier.java b/io-hotmoka-exceptions/src/main/java/io/hotmoka/exceptions/CheckSupplier.java index fa183f0bb..1e9c72c87 100644 --- a/io-hotmoka-exceptions/src/main/java/io/hotmoka/exceptions/CheckSupplier.java +++ b/io-hotmoka-exceptions/src/main/java/io/hotmoka/exceptions/CheckSupplier.java @@ -123,7 +123,7 @@ else if (exception3.isInstance(cause)) * @param exception1 the class of the first exception * @param exception2 the class of the second exception * @param exception3 the class of the third exception - * @param exception3 the class of the fourth exception + * @param exception4 the class of the fourth exception * @param supplier the supplier * @return the supplied value * @throws T1 if the supplier throws an unchecked exception with this cause diff --git a/io-hotmoka-marshalling-api/pom.xml b/io-hotmoka-marshalling-api/pom.xml index 6a3619758..68773f24f 100644 --- a/io-hotmoka-marshalling-api/pom.xml +++ b/io-hotmoka-marshalling-api/pom.xml @@ -6,6 +6,7 @@ jar io-hotmoka-marshalling-api ${hotmoka.version} + This module defines the API for efficient serialization/deserialization of objects into bytes. io.hotmoka diff --git a/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/MarshallingContext.java b/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/MarshallingContext.java index 70286f245..44cf44504 100644 --- a/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/MarshallingContext.java +++ b/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/MarshallingContext.java @@ -25,62 +25,136 @@ public interface MarshallingContext extends AutoCloseable { /** - * Writes the given object into the output stream. This context must have + * Writes the given object into this context, which must have * an object marshaller registered for the class of the object. * * @param the type of the object * @param clazz the class of the object * @param value the object to marshal - * @throws IOException if the object could not be unmarshalled + * @throws IOException if an I/O error occurs */ void writeObject(Class clazz, C value) throws IOException; /** - * Writes the given string into the output stream. It uses a memory - * to avoid repeated writing of the same string: the second write - * will refer to the first one. + * Writes the given byte into this context. Only the 8 least significant bits + * of {@code b} are written. * - * @param s the string to write - * @throws IOException if the string could not be written + * @param b the byte to write + * @throws IOException if an I/O error occurs */ - void writeStringShared(String s) throws IOException; - void writeByte(int b) throws IOException; + /** + * Writes the given character into this context. Only the 16 least significant bits + * of {@code c} are written. + * + * @param c the character to write + * @throws IOException if an I/O error occurs + */ void writeChar(int c) throws IOException; + /** + * Writes the given integer into this context. This requires that the + * integer will be subsequently read through {@link UnmarshallingContext#readInt()}. + * + * @param i the integer to write + * @throws IOException if an I/O error occurs + */ void writeInt(int i) throws IOException; /** - * Writes the given integer, in a way that compacts small integers. + * Writes the given integer into this context, using compact representations for + * frequent cases. This requires that the integer + * will be subsequently read through {@link UnmarshallingContext#readCompactInt()}. * - * @param i the integer - * @throws IOException if the integer cannot be marshalled + * @param i the integer to write + * @throws IOException if an I/O error occurs */ void writeCompactInt(int i) throws IOException; - void writeUTF(String s) throws IOException; + /** + * Writes the given string into this context. This requires that + * the string will be subsequently extracted through {@link UnmarshallingContext#readStringShared()}. + * In comparison to {@link #writeStringUnshared(String)}, this representation might be smaller + * if the string is likely repeated in the same marshalled object. + * + * @param s the string to write + * @throws IOException if an I/O error occurs + */ + void writeStringShared(String s) throws IOException; + + /** + * Writes the given string into this context. This requires that + * the string will be subsequently extracted through {@link UnmarshallingContext#readStringUnshared()}. + * In comparison to {@link #writeStringShared(String)}, this representation might be smaller + * if the string is unlikely to be repeated in the same marshalled object. + * + * @param s the string to write + * @throws IOException if an I/O error occurs + */ + void writeStringUnshared(String s) throws IOException; + /** + * Writes the given bytes into this context. + * + * @param bytes the bytes to write + * @throws IOException if an I/O error occurs + */ void write(byte[] bytes) throws IOException; + /** + * Writes the given double into this context. + * + * @param d the double to write + * @throws IOException if an I/O error occurs + */ void writeDouble(double d) throws IOException; + /** + * Writes the given float into this context. + * + * @param f the float to write + * @throws IOException if an I/O error occurs + */ void writeFloat(float f) throws IOException; + /** + * Writes the given long into this context. + * + * @param l the long to write + * @throws IOException if an I/O error occurs + */ void writeLong(long l) throws IOException; + /** + * Writes the given short into this context. + * + * @param s the short to write + * @throws IOException if an I/O error occurs + */ void writeShort(int s) throws IOException; + /** + * Writes the given boolean into this context. + * + * @param b the boolean to write + * @throws IOException if an I/O error occurs + */ void writeBoolean(boolean b) throws IOException; /** - * Writes the given big integer, in a compact way. + * Writes the given big integer into this context, in a compact way. * - * @param bi the big integer - * @throws IOException if the big integer could not be written + * @param bi the big integer to write + * @throws IOException if an I/O error occurs */ void writeBigInteger(BigInteger bi) throws IOException; + /** + * Flushes the buffer of the writer into disk, if any. + * + * @throws IOException if an I/O error occurs + */ void flush() throws IOException; @Override diff --git a/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/Unmarshaller.java b/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/Unmarshaller.java index d86658beb..18243278e 100644 --- a/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/Unmarshaller.java +++ b/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/Unmarshaller.java @@ -24,5 +24,13 @@ * @param the type of the marshallable */ public interface Unmarshaller { + + /** + * Yields the marshallable extracted from the given context. + * + * @param context the context + * @return the marshallable + * @throws IOException if an I/O error occurs + */ T from(UnmarshallingContext context) throws IOException; } \ No newline at end of file diff --git a/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/UnmarshallingContext.java b/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/UnmarshallingContext.java index 43de2a7b7..1e43dace9 100644 --- a/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/UnmarshallingContext.java +++ b/io-hotmoka-marshalling-api/src/main/java/io/hotmoka/marshalling/api/UnmarshallingContext.java @@ -26,72 +26,142 @@ public interface UnmarshallingContext extends AutoCloseable { /** - * Yields an object unmarshalled from this context. - * This context must have an object unmarshaller registered for the - * class of the object. + * Extracts an object from this context, which must have an object unmarshaller + * registered for the class of the object. * * @param the type of the object * @param clazz the class of the object * @return the unmarshalled object - * @throws IOException if the object could not be unmarshalled + * @throws IOException if an I/O error occurs */ C readObject(Class clazz) throws IOException; /** - * Yields an array of marshallables unmarshalled from this context. + * Extracts an array of marshallables from this context. * * @param the type of the marshallables * @param unmarshaller the object that unmarshals a single marshallable * @param supplier the creator of the resulting array of marshallables * @return the array - * @throws IOException if some marshallable could not be unmarshalled + * @throws IOException if an I/O error occurs */ - T[] readArray(Unmarshaller unmarshaller, Function supplier) throws IOException; + T[] readArray(Unmarshaller unmarshaller, Function supplier) throws IOException; + /** + * Extracts the next byte from this context. + * + * @return the next byte + * @throws IOException if an I/O error occurs + */ byte readByte() throws IOException; + /** + * Extracts the next character from this context. + * + * @return the next character + * @throws IOException if an I/O error occurs + */ char readChar() throws IOException; + /** + * Extracts the next boolean from this context. + * + * @return the next boolean + * @throws IOException if an I/O error occurs + */ boolean readBoolean() throws IOException; + /** + * Extracts the next integer from this context. This requires that the + * integer was previously marshalled through {@link MarshallingContext#writeInt(int)}. + * + * @return the next integer + * @throws IOException if an I/O error occurs + */ int readInt() throws IOException; /** - * Reads an optimized integer. + * Extracts the next integer from this context, in an optimized way, + * that tries to use smaller representations for frequent cases. + * This requires that the integer was previously marshalled through + * {@link MarshallingContext#writeCompactInt(int)}. * - * @return the integer - * @throws IOException if the integer cannot be read + * @return the next integer + * @throws IOException if an I/O error occurs */ int readCompactInt() throws IOException; + /** + * Extracts the next short from this context. + * + * @return the next short + * @throws IOException if an I/O error occurs + */ short readShort() throws IOException; + /** + * Extracts the next long from this context. + * + * @return the next long + * @throws IOException if an I/O error occurs + */ long readLong() throws IOException; + /** + * Extracts the next float from this context. + * + * @return the next float + * @throws IOException if an I/O error occurs + */ float readFloat() throws IOException; + /** + * Extracts the next double from this context. + * + * @return the next double + * @throws IOException if an I/O error occurs + */ double readDouble() throws IOException; - String readUTF() throws IOException; + /** + * Extracts the next string from this context. This requires that + * the string was previously marshalled through {@link MarshallingContext#writeStringUnshared(String)}. + * In comparison to {@link #readStringShared()}, this representation might be smaller + * if the string is unlikely to be repeated in the same marshalled object. + * + * @return the next string + * @throws IOException if an I/O error occurs + */ + String readStringUnshared() throws IOException; + + /** + * Extracts the next string from this context. This requires that + * the string was previously marshalled through {@link MarshallingContext#writeStringShared(String)}. + * In comparison to {@link #readStringUnshared()}, this representation might + * be smaller if the same string is repeated in the same marshalled object. + * + * @return the next string + * @throws IOException if an I/O error occurs + */ + String readStringShared() throws IOException; /** - * Reads {@code length} bytes from the context. + * Extracts the next {@code length} bytes from this context. * - * @param length the number of bytes to read - * @param errorMessage the message of the exception if it was not possible to read exactly {@code length} bytes + * @param length the number of bytes to extract + * @param errorMessage the message of the exception thrown if it was not possible + * to read {@code length} bytes * @return the bytes - * @throws IOException if it was not possible to read {@code length} bytes + * @throws IOException if an I/O error occurs */ byte[] readBytes(int length, String errorMessage) throws IOException; - String readStringShared() throws IOException; - /** - * Reads a big integer, taking into account - * optimized representations used for the big integer. + * Extracts the next big integer from this context, in an optimized way, + * that tries to use smaller representations for frequent cases. * - * @return the big integer - * @throws IOException if the big integer could not be written + * @return the next big integer + * @throws IOException if an I/O error occurs */ BigInteger readBigInteger() throws IOException; diff --git a/io-hotmoka-marshalling-api/src/main/java/module-info.java b/io-hotmoka-marshalling-api/src/main/java/module-info.java index 6d4c3e36d..de373611c 100644 --- a/io-hotmoka-marshalling-api/src/main/java/module-info.java +++ b/io-hotmoka-marshalling-api/src/main/java/module-info.java @@ -14,6 +14,9 @@ limitations under the License. */ +/** + * This module defines the API for efficient serialization/deserialization of objects into bytes. + */ module io.hotmoka.marshalling.api { exports io.hotmoka.marshalling.api; } \ No newline at end of file diff --git a/io-hotmoka-marshalling/pom.xml b/io-hotmoka-marshalling/pom.xml index 272093eab..d40964ace 100644 --- a/io-hotmoka-marshalling/pom.xml +++ b/io-hotmoka-marshalling/pom.xml @@ -6,6 +6,7 @@ jar io-hotmoka-marshalling ${hotmoka.version} + This module provides classes for efficient serialization and deserialization of objects into/from bytes. io.hotmoka diff --git a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/AbstractMarshallable.java b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/AbstractMarshallable.java index ef4402403..04b931f9d 100644 --- a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/AbstractMarshallable.java +++ b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/AbstractMarshallable.java @@ -25,4 +25,10 @@ * this works because of context information about the structure of the object. */ public abstract class AbstractMarshallable extends MarshallableImpl { + + /** + * Creates the marshallable. + */ + protected AbstractMarshallable() { + } } \ 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 0c7da372c..9bf6dbe47 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 @@ -30,9 +30,10 @@ public final class UnmarshallingContexts { private UnmarshallingContexts() {} /** - * Creates an unmarshalling context. + * Yields an unmarshalling context. * * @param is the input stream of the context + * @return the unmarshalling context * @throws IOException if the context cannot be created */ public static UnmarshallingContext of(InputStream is) throws IOException { diff --git a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/internal/MarshallingContextImpl.java b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/internal/MarshallingContextImpl.java index ad77301a2..74ceef3ec 100644 --- a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/internal/MarshallingContextImpl.java +++ b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/internal/MarshallingContextImpl.java @@ -111,7 +111,7 @@ public void writeCompactInt(int i) throws IOException { } @Override - public void writeUTF(String s) throws IOException { + public void writeStringUnshared(String s) throws IOException { oos.writeUTF(s); } diff --git a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/internal/UnmarshallingContextImpl.java b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/internal/UnmarshallingContextImpl.java index f33061dd2..b0a0839ee 100644 --- a/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/internal/UnmarshallingContextImpl.java +++ b/io-hotmoka-marshalling/src/main/java/io/hotmoka/marshalling/internal/UnmarshallingContextImpl.java @@ -138,7 +138,7 @@ public double readDouble() throws IOException { } @Override - public String readUTF() throws IOException { + public String readStringUnshared() throws IOException { return ois.readUTF(); } @@ -158,7 +158,7 @@ public String readStringShared() throws IOException { selector = 256 + selector; if (selector == 255) { - String s = readUTF(); + String s = readStringUnshared(); memoryString.put(memoryString.size(), s); return s; } diff --git a/io-hotmoka-marshalling/src/main/java/module-info.java b/io-hotmoka-marshalling/src/main/java/module-info.java index 69c1c38d0..1a786774e 100644 --- a/io-hotmoka-marshalling/src/main/java/module-info.java +++ b/io-hotmoka-marshalling/src/main/java/module-info.java @@ -14,6 +14,10 @@ limitations under the License. */ +/** + * This module provides classes for efficient serialization and deserialization + * of objects into/from bytes. + */ module io.hotmoka.marshalling { exports io.hotmoka.marshalling; requires transitive io.hotmoka.marshalling.api; diff --git a/io-hotmoka-stores/src/main/java/io/hotmoka/stores/internal/TrieOfErrors.java b/io-hotmoka-stores/src/main/java/io/hotmoka/stores/internal/TrieOfErrors.java index cd9ddb1d4..a9a33a8be 100644 --- a/io-hotmoka-stores/src/main/java/io/hotmoka/stores/internal/TrieOfErrors.java +++ b/io-hotmoka-stores/src/main/java/io/hotmoka/stores/internal/TrieOfErrors.java @@ -88,7 +88,7 @@ private MarshallableString(String s) { @Override public void into(MarshallingContext context) throws IOException { - context.writeUTF(s); + context.writeStringUnshared(s); } @Override @@ -104,7 +104,7 @@ public String toString() { * @throws IOException if the string could not be unmarshalled */ private static MarshallableString from(UnmarshallingContext context) throws IOException { - return new MarshallableString(context.readUTF()); + return new MarshallableString(context.readStringUnshared()); } } diff --git a/io-hotmoka-tests/src/test/java/io/hotmoka/tests/Marshallable.java b/io-hotmoka-tests/src/test/java/io/hotmoka/tests/Marshallable.java index 80b38d840..3ef2ebe7c 100644 --- a/io-hotmoka-tests/src/test/java/io/hotmoka/tests/Marshallable.java +++ b/io-hotmoka-tests/src/test/java/io/hotmoka/tests/Marshallable.java @@ -232,7 +232,7 @@ public void testString() throws IOException { byte[] bytes; try (var baos = new ByteArrayOutputStream(); var context = MarshallingContexts.of(baos)) { - context.writeUTF("hello world"); + context.writeStringUnshared("hello world"); context.flush(); bytes = baos.toByteArray(); } @@ -246,7 +246,7 @@ public void testVeryLongString() throws IOException { byte[] bytes; try (var baos = new ByteArrayOutputStream(); var context = MarshallingContexts.of(baos)) { - context.writeUTF("rO0ABXoAAAQAAwAJY2hhaW50ZXN0///Q5JZGjCX8pZF5iF+nxf9PRA770ODJbCQmt5lzNmGYggQAE4gAD6AABf8AAA9DUEsDBBQAAAgIAC92eFMKW93AUAAAAFEAAAAUAAAATUVUQS1JTkYvTUFOSUZFU1QuTUbzTczLTEstLtENSy0qzszPs1Iw1DPg5XIuSk0sSU3Rdaq0UvBNLEvNU/BKLFIIyClNz8xTMNYzAqlxKs3MSdH1SsnWDS5ITQZqNOTl4uUCAFBLAwQKAAAIAAAvdnhTAAAAAAAAAAAAAAAACQAAAE1FVEEtSU5GL1BLAwQKAAAIAAAvdnhTAAAAAAAAAAAAAAAAAwAAAGlvL1BLAwQKAAAIAAAvdnhTAAAAAAAAAAAAAAAACwAAAGlvL2hvdG1va2EvUEsDBAoAAAgAAC92eFMAAAAAAAAAAAAAAAAUAAAAaW8vaG90bW9rYS9leGFtcGxlcy9QSwMECgAACAAALnZ4UwAAAAAAAAAAAAAAABwAAABpby9ob3Rtb2thL2V4YW1wbGVzL2xhbWJkYXMvUEsDBBQAAAgIAC52eFNK4TRKwQsAAKQgAAApAAAAaW8vaG90bW9rYS9leGFtcGxlcy9sYW1iZGFzL0xhbWJkYXMuY2xhc3O1WQd8G9UZ/z/Z1tnyOVJEBnGIMzCJLDtxnAlkEMc4iRPHTmMnwVCgZ/lsXyzdGekUSGmhLbSslu6W7l066AglyxRKd0vp3ovuvQfdpfzf3fmsyJIsRu2fT9+9977v+3/jve978oOPTtwPYKPYGMJ63FwF52dFJISFuKUGYdyq4LYQgnihfHmRfNwuHy8O8fESBS+txcvw8mq8QsEra8jzKjn+ajl4R5SC3liLN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