Fix validation of input parameter.
[arachne.git] / src / net / pterodactylus / arachne / core / Core.java
index ad438b1..1061325 100644 (file)
@@ -47,6 +47,20 @@ public class Core extends AbstractService {
        private final List<Page> pages = new ArrayList<Page>();
 
        //
+       // ACCESSORS
+       //
+
+       /**
+        * Sets the host name of the node.
+        *
+        * @param nodeHost
+        *            The node’s host name
+        */
+       public void setNodeHost(String nodeHost) {
+               this.nodeHost = nodeHost;
+       }
+
+       //
        // ACTIONS
        //
 
@@ -171,7 +185,7 @@ public class Core extends AbstractService {
         * @return The joined path
         */
        private String createPath(String[] pathComponents, int index) {
-               Validation.begin().isNotNull("pathComponents", pathComponents).check().isLess("index", index, pathComponents.length).check();
+               Validation.begin().isNotNull("pathComponents", pathComponents).check().isLessOrEqual("index", index, pathComponents.length).check();
                StringBuilder path = new StringBuilder();
                for (int pathComponentIndex = index; pathComponentIndex < pathComponents.length; pathComponentIndex++) {
                        if (path.length() > 0) {