diff --git a/core/src/main/java/org/infinispan/protostream/annotations/impl/MarshallerCodeGenerator.java b/core/src/main/java/org/infinispan/protostream/annotations/impl/MarshallerCodeGenerator.java index f7d1493ef..fcef63530 100644 --- a/core/src/main/java/org/infinispan/protostream/annotations/impl/MarshallerCodeGenerator.java +++ b/core/src/main/java/org/infinispan/protostream/annotations/impl/MarshallerCodeGenerator.java @@ -392,9 +392,9 @@ private String generateReadFromMethod(ProtoMessageTypeMetadata messageTypeMetada iw.inc(); String v; if (Date.class.isAssignableFrom(fieldMetadata.getJavaType())) { - v = box(defaultValue + "L", fieldMetadata.getJavaType()); + v = defaultValue + "L"; } else if (Instant.class.isAssignableFrom(fieldMetadata.getJavaType())) { - v = box(defaultValue + "L", fieldMetadata.getJavaType()); + v = defaultValue + "L"; } else if (defaultValue instanceof ProtoEnumValueMetadata) { Enum enumValue = ((ProtoEnumValueMetadata) defaultValue).getEnumValue(); v = enumValue.getDeclaringClass().getName() + "." + enumValue.name(); diff --git a/core/src/test/java/org/infinispan/protostream/annotations/impl/ProtoSchemaBuilderTest.java b/core/src/test/java/org/infinispan/protostream/annotations/impl/ProtoSchemaBuilderTest.java index 11fb94779..cfa829916 100644 --- a/core/src/test/java/org/infinispan/protostream/annotations/impl/ProtoSchemaBuilderTest.java +++ b/core/src/test/java/org/infinispan/protostream/annotations/impl/ProtoSchemaBuilderTest.java @@ -357,16 +357,16 @@ static class MessageWithAllFieldTypes { @ProtoField(number = 30, defaultValue = "xyz") String[] testField30 = {"one", "two"}; - @ProtoField(number = 31/*, defaultValue = "1"*/) + @ProtoField(number = 31, defaultValue = "1") Date testField31 = new Date(100); - @ProtoField(number = 32/*, defaultValue = "1"*/) + @ProtoField(number = 32, defaultValue = "1") Date[] testField32 = {new Date(100), new Date(200)}; - @ProtoField(number = 33/*, defaultValue = "1"*/) + @ProtoField(number = 33, defaultValue = "1") Instant testField33 = Instant.ofEpochMilli(100); - @ProtoField(number = 34/*, defaultValue = "1"*/) + @ProtoField(number = 34, defaultValue = "1") Instant[] testField34 = {Instant.ofEpochMilli(100), Instant.ofEpochMilli(200)}; @ProtoField(number = 35, defaultValue = "35") @@ -707,7 +707,7 @@ public void setTestField80(String[] testField80) { private Date testField81 = new Date(100); - @ProtoField(number = 81/*, defaultValue = "1"*/) + @ProtoField(number = 81, defaultValue = "1") public Date getTestField81() { return testField81; } @@ -718,7 +718,7 @@ public void setTestField81(Date testField81) { private Date[] testField82 = {new Date(100), new Date(200)}; - @ProtoField(number = 82/*, defaultValue = "1"*/) + @ProtoField(number = 82, defaultValue = "1") public Date[] getTestField82() { return testField82; } @@ -729,7 +729,7 @@ public void setTestField82(Date[] testField82) { private Instant testField83 = Instant.ofEpochMilli(100); - @ProtoField(number = 83/*, defaultValue = "1"*/) + @ProtoField(number = 83, defaultValue = "1") public Instant getTestField83() { return testField83; } @@ -740,7 +740,7 @@ public void setTestField83(Instant testField83) { private Instant[] testField84 = {Instant.ofEpochMilli(100), Instant.ofEpochMilli(200)}; - @ProtoField(number = 84/*, defaultValue = "1"*/) + @ProtoField(number = 84, defaultValue = "1") public Instant[] getTestField84() { return testField84; } diff --git a/core/src/test/java/org/infinispan/protostream/test/AnnotationsPerformanceTest.java b/core/src/test/java/org/infinispan/protostream/test/AnnotationsPerformanceTest.java index 850038a2e..00befa258 100644 --- a/core/src/test/java/org/infinispan/protostream/test/AnnotationsPerformanceTest.java +++ b/core/src/test/java/org/infinispan/protostream/test/AnnotationsPerformanceTest.java @@ -44,6 +44,7 @@ public void testReadWrite() throws Exception { user.setId(1); user.setName("John"); user.setSurname("Batman"); + user.setSalutation("Sir"); user.setGender(User.Gender.MALE); user.setAccountIds(new HashSet<>(Arrays.asList(1, 3))); List
addresses = new ArrayList<>();