Skip to content
Snippets Groups Projects
Unverified Commit 6d52c15c authored by Daniel's avatar Daniel
Browse files

FIX: Reference correct version.

If not-to-be-changed entities are in container.
parent d5d9a714
Branches
Tags
No related merge requests found
...@@ -188,17 +188,19 @@ public abstract class Job extends AbstractObservable implements Observer { ...@@ -188,17 +188,19 @@ public abstract class Job extends AbstractObservable implements Observer {
if (ret != null) { if (ret != null) {
return ret; return ret;
} }
} else if (version.startsWith("HEAD~") && getEntityById(id) != null) { } else if (version.startsWith("HEAD~")) {
// if version is HEAD~{OFFSET} with {OFFSET} > 0 and the targeted entity is EntityInterface entById = getEntityById(id);
// part of this request (i.e. is to be updated), the actual offset has to be if (entById != null && entById.getEntityStatus() != EntityStatus.VALID) {
// reduced by 1. HEAD always denotes the entity@HEAD *after* the successful // if version is HEAD~{OFFSET} with {OFFSET} > 0 and the targeted entity is is to be
// transaction. // updated, the actual offset has to be reduced by 1. HEAD always denotes the entity@HEAD
int offset = Integer.parseInt(version.substring(5)) - 1; // *after* the successful transaction, so that it is consistent with subsequent retrieves.
if (offset == 0) { int offset = Integer.parseInt(version.substring(5)) - 1;
// special case HEAD~1 if (offset == 0) {
resulting_version = "HEAD"; // special case HEAD~1
} else { resulting_version = "HEAD";
resulting_version = new StringBuilder().append("HEAD~").append(offset).toString(); } else {
resulting_version = new StringBuilder().append("HEAD~").append(offset).toString();
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment