Skip to content

Commit e1f8e49

Browse files
committed
fix Group.writeMetadata
1 parent bd3bd7c commit e1f8e49

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/dev/zarr/zarrjava/v2/Group.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ private Group writeMetadata(GroupMetadata newGroupMetadata) throws IOException {
117117
objectWriter.writeValueAsBytes(newGroupMetadata.attributes));
118118
attrsHandle.set(attrsBytes);
119119
}
120-
return new Group(storeHandle, newGroupMetadata);
120+
this.metadata = newGroupMetadata;
121+
return this;
121122
}
122123

123124
public Group setAttributes(Attributes newAttributes) throws ZarrException, IOException {

src/main/java/dev/zarr/zarrjava/v3/Group.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ private Group writeMetadata(GroupMetadata newGroupMetadata) throws IOException {
120120
ByteBuffer metadataBytes = ByteBuffer.wrap(objectWriter.writeValueAsBytes(newGroupMetadata));
121121
storeHandle.resolve(ZARR_JSON)
122122
.set(metadataBytes);
123-
return new Group(storeHandle, newGroupMetadata);
123+
this.metadata = newGroupMetadata;
124+
return this;
124125
}
125126

126127
public Group setAttributes(Attributes newAttributes) throws ZarrException, IOException {

0 commit comments

Comments
 (0)