SLING-7845 cosmetic code cleanup
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockNode.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockNode.java
index b420774..db7bdc0 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockNode.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockNode.java
@@ -356,7 +356,14 @@
// we have no real mixin support - just assume no mixin nodetypes are set
return new NodeType[0];
}
-
+
+ @Override
+ public void orderBefore(final String srcChildRelPath, final String destChildRelPath) throws RepositoryException {
+ Item srcChild = srcChildRelPath == null ? null : getMockedSession().getItem(getPath() + "/" + srcChildRelPath);
+ Item destChild = destChildRelPath == null ? null : getMockedSession().getItem(getPath() + "/" + destChildRelPath);
+ getMockedSession().orderBefore(srcChild, destChild);
+ }
+
// --- unsupported operations ---
@Override
public Property setProperty(final String name, final Value value, final int type) throws RepositoryException {
@@ -469,13 +476,6 @@
}
@Override
- public void orderBefore(final String srcChildRelPath, final String destChildRelPath) throws RepositoryException {
- Item srcChild = srcChildRelPath == null ? null : getMockedSession().getItem(getPath() + "/" + srcChildRelPath);
- Item destChild = destChildRelPath == null ? null : getMockedSession().getItem(getPath() + "/" + destChildRelPath);
- getMockedSession().orderBefore(srcChild, destChild);
- }
-
- @Override
public void removeMixin(final String mixinName) throws RepositoryException {
throw new UnsupportedOperationException();
}
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTest.java
index 4ff2525..b1b0aa0 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTest.java
@@ -218,6 +218,7 @@
getNodeNames(foo.getNodes()));
}
+ @SuppressWarnings("unchecked")
private String[] getNodeNames(NodeIterator nodeIterator) {
List<String> names = new LinkedList<>();
nodeIterator.forEachRemaining(node -> {