--- old/src/java.base/share/classes/java/util/OptionalInt.java	2016-04-25 14:50:38.000000000 -0700
+++ new/src/java.base/share/classes/java/util/OptionalInt.java	2016-04-25 14:50:38.000000000 -0700
@@ -107,14 +107,44 @@
     }
 
     /**
+     * Equivalent to {@link #getWhenPresent()}.
      * If a value is present, returns the value, otherwise throws
      * {@code NoSuchElementException}.
      *
+     * @deprecated
+     * This method's name {@code getAsInt} makes it the obvious method to
+     * call to retrieve the value from this {@code OptionalInt}. However, it has
+     * no mechanism to avoid an exception if this {@code OptionalInt} is empty.
+     * This tends to lead to code that mishandles empty {@code OptionalInt}
+     * values. Consider using other methods that handle the case where
+     * the {@code OptionalInt} might be empty, such as
+     * {@link #ifPresent(java.util.function.IntConsumer) ifPresent()}
+     * and related methods, and
+     * {@link #orElse(int) orElse()} and related methods.
+     * Use {@link getWhenPresent()} when it is known that a value is
+     * always present.
+     *
      * @return the value described by this {@code OptionalInt}
      * @throws NoSuchElementException if no value is present
      * @see OptionalInt#isPresent()
      */
+    @Deprecated(since="9")
     public int getAsInt() {
+        return getWhenPresent();
+    }
+
+    /**
+     * If a value is present, returns the value, otherwise throws
+     * {@code NoSuchElementException}.
+     *
+     * @apiNote
+     * Use this method only when it is known that a value is always present.
+     *
+     * @return the value described by this {@code OptionalInt}
+     * @throws NoSuchElementException if no value is present
+     * @see OptionalInt#isPresent()
+     */
+    public int getWhenPresent() {
         if (!isPresent) {
             throw new NoSuchElementException("No value present");
         }