reschke commented on code in PR #3050:
URL: https://github.com/apache/jackrabbit-oak/pull/3050#discussion_r3685727227
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionEditor.java:
##########
@@ -303,16 +303,29 @@ private StringBuilder buildAfterIdentifier(StringBuilder
identifier) {
return identifier;
}
- private static void throwCheckedIn(String msg)
+ private void throwCheckedIn(String msg)
throws CommitFailedException {
throw new CommitFailedException(CommitFailedException.VERSION,
- VersionExceptionCode.NODE_CHECKED_IN.ordinal(), msg);
+ VersionExceptionCode.NODE_CHECKED_IN.ordinal(),
+ msg + " at " + getPath());
}
- private static void throwProtected(String name)
+ /**
+ * @return the absolute path of the node this editor is processing,
+ * reconstructed from the parent chain.
+ */
+ private String getPath() {
+ if (parent == null) {
+ return "/";
+ }
+ String parentPath = parent.getPath();
+ return parentPath.equals("/") ? "/" + name : parentPath + "/" + name;
+ }
+
+ private void throwProtected(String name)
throws CommitFailedException {
throw new CommitFailedException(CommitFailedException.CONSTRAINT, 100,
- "Property is protected: " + name);
+ "Property is protected: " + name + " at " + getPath());
Review Comment:
```suggestion
"Property is protected: " + name + " at '" + getPath() +
"'");
```
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionEditor.java:
##########
@@ -303,16 +303,29 @@ private StringBuilder buildAfterIdentifier(StringBuilder
identifier) {
return identifier;
}
- private static void throwCheckedIn(String msg)
+ private void throwCheckedIn(String msg)
throws CommitFailedException {
throw new CommitFailedException(CommitFailedException.VERSION,
- VersionExceptionCode.NODE_CHECKED_IN.ordinal(), msg);
+ VersionExceptionCode.NODE_CHECKED_IN.ordinal(),
+ msg + " at " + getPath());
Review Comment:
```suggestion
msg + " at '" + getPath() + "'");
```
--
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]