Hi,

The class level @apiNote in java.util.Objects refers to variation of static
methods checkIndex(int, int), checkFromToIndex(int, int, int), and
checkFromIndexSize(int, int, int), which support customization of the
runtime exception, and corresponding exception detail message.

But these static methods were removed from java.util.Objects as part of
JDK-8155794 [1].
So the @apiNote in java.util.Objects is outdated.

I have created JBS issue to remove the @apiNote [2].
Patch is attached.

Can someone review and sponsor it?

[1] : https://bugs.openjdk.java.net/browse/JDK-8155794
[2] : https://bugs.openjdk.java.net/browse/JDK-8244293

-- 
Anirvan
diff a/src/java.base/share/classes/java/util/Objects.java b/src/java.base/share/classes/java/util/Objects.java
--- a/src/java.base/share/classes/java/util/Objects.java
+++ b/src/java.base/share/classes/java/util/Objects.java
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this
@@ -35,24 +35,10 @@
  * on objects, or checking certain conditions before operation.  These utilities
  * include {@code null}-safe or {@code null}-tolerant methods for computing the
  * hash code of an object, returning a string for an object, comparing two
  * objects, and checking if indexes or sub-range values are out of bounds.
  *
- * @apiNote
- * Static methods such as {@link Objects#checkIndex},
- * {@link Objects#checkFromToIndex}, and {@link Objects#checkFromIndexSize} are
- * provided for the convenience of checking if values corresponding to indexes
- * and sub-ranges are out of bounds.
- * Variations of these static methods support customization of the runtime
- * exception, and corresponding exception detail message, that is thrown when
- * values are out of bounds.  Such methods accept a functional interface
- * argument, instances of {@code BiFunction}, that maps out-of-bound values to a
- * runtime exception.  Care should be taken when using such methods in
- * combination with an argument that is a lambda expression, method reference or
- * class that capture values.  In such cases the cost of capture, related to
- * functional interface allocation, may exceed the cost of checking bounds.
- *
  * @since 1.7
  */
 public final class Objects {
     private Objects() {
         throw new AssertionError("No java.util.Objects instances for you!");

Reply via email to