提交 006de46f 编写于 作者: F Fritz Elfert

Return boolean as suggested.

上级 a69542a5
......@@ -160,13 +160,14 @@ public class Nodes implements Saveable {
}
/**
* Updates an existing node on disk. If the node instance is not in the list of nodes, then this will be a no-op, even if
* there is another instance with the same {@link Node#getNodeName()}.
* Updates an existing node on disk. If the node instance is not in the list of nodes, then this
* will be a no-op, even if there is another instance with the same {@link Node#getNodeName()}.
*
* @param node the node to be updated.
* @return {@code true}, if the node was updated. {@code false}, if the node was not in the list of nodes.
* @throws IOException if the node could not be persisted.
*/
public void updateNode(final @Nonnull Node node) throws IOException {
public boolean updateNode(final @Nonnull Node node) throws IOException {
if (node == nodes.get(node.getNodeName())) {
Queue.withLock(new Runnable() {
@Override
......@@ -175,7 +176,9 @@ public class Nodes implements Saveable {
}
});
persistNode(node);
return true;
}
return false;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册