reschke commented on code in PR #2795:
URL: https://github.com/apache/jackrabbit-oak/pull/2795#discussion_r2940700306
##########
oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentPropertyState.java:
##########
@@ -190,7 +197,33 @@ private <T> T getValue(RecordId id, Type<T> type) {
return (T) reader.readBlob(id); // load binaries lazily
}
- String value = reader.readString(id);
+ // OAK-12133: Detect when trying to read a binary property as a string
+ Type<?> actualType = getType();
+ if (actualType.isArray()) {
+ actualType = actualType.getBaseType();
+ }
+ String message = null;
+ if (actualType == BINARY && type != BINARY) {
+ message = String.format(
Review Comment:
This:
~~~
type != BINARY
~~~
indeed always evaluates to true
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]