reschke commented on code in PR #1526:
URL: https://github.com/apache/jackrabbit-oak/pull/1526#discussion_r1644328794


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java:
##########
@@ -116,7 +163,20 @@ public int count() {
      */
     @NotNull
     String getValue() {
-        return value;
+        return value != null ? value : decompress(this.compressedValue);
+    }
+
+    private String decompress(byte[] value) {
+        try {
+            return new String(compression.getInputStream(new 
ByteArrayInputStream(value)).readAllBytes(), StandardCharsets.UTF_8);
+        } catch (IOException e) {
+            LOG.error("Failed to decompress property {} value: ", getName(), 
e);
+            return "\"{}\"";
+        }
+    }
+
+    private byte[] getCompressedValue() {

Review Comment:
   It actually was my proposal not to expose it. Maybe we can just *copy* or 
*move* it to the test class?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to