Permalink
Browse files

Fixes #154 - remove JavaDoc copied from Java API.

  • Loading branch information...
1 parent f98f4ae commit 2c4bf202c21bd25606b6c9ad6e13795a1e8166d1 @rolfl rolfl committed May 23, 2016
Showing with 6 additions and 10 deletions.
  1. +6 −10 core/src/java/org/jdom2/util/NamespaceStack.java
@@ -264,16 +264,12 @@ public int compare(Namespace ns1, Namespace ns2) {
* @param left The left side of the range to search <b>INCLUSIVE</b>
* @param right The right side of the range to search <b>EXCLUSIVE</b>
* @param key The Namespace to search for.
- * @return the 'insertion point' - the following is copied from the Java
- * Javadoc for Arrays.binarySearch()
- * <br><i>
- * index of the search key, if it is contained in the array; otherwise,
- * <code> (-(insertion point) - 1) </code>. The insertion point is
- * defined as the point at which the key would be inserted into the
- * array: the index of the first element greater than the key, or
- * a.length if all elements in the array are less than the specified
- * key. Note that this guarantees that the return value will be >= 0
- * if and only if the key is found.
+ * @return the 'insertion point' - This return value follows the same convention
+ * as the standard Java BinarySearch methods (see the JavaDoc for Arrays.binarySearch().
+ * In summary, if the value exists then the return value is the index of the existing value.
+ * If the value was not found, then the return value will be negative, and the
+ * place where the missing value should be inserted, can be determined by
+ * adding 1, and converting back to positive (or converting to positive, and subtracting 1).
* </i>
*/
private static final int binarySearch(final Namespace[] data,

0 comments on commit 2c4bf20

Please sign in to comment.