8230074: Improve specification for {Math, StrictMath}.negateExact

Reviewed-by: bpb
This commit is contained in:
Joe Darcy 2019-08-28 22:30:26 -07:00
parent bc1c0aec0d
commit 9b0cfaf53e
2 changed files with 12 additions and 0 deletions

View file

@ -952,6 +952,7 @@ public final class Math {
/** /**
* Returns the argument incremented by one, throwing an exception if the * Returns the argument incremented by one, throwing an exception if the
* result overflows an {@code int}. * result overflows an {@code int}.
* The overflow only occurs for {@linkplain Integer#MAX_VALUE the maximum value}.
* *
* @param a the value to increment * @param a the value to increment
* @return the result * @return the result
@ -970,6 +971,7 @@ public final class Math {
/** /**
* Returns the argument incremented by one, throwing an exception if the * Returns the argument incremented by one, throwing an exception if the
* result overflows a {@code long}. * result overflows a {@code long}.
* The overflow only occurs for {@linkplain Long#MAX_VALUE the maximum value}.
* *
* @param a the value to increment * @param a the value to increment
* @return the result * @return the result
@ -988,6 +990,7 @@ public final class Math {
/** /**
* Returns the argument decremented by one, throwing an exception if the * Returns the argument decremented by one, throwing an exception if the
* result overflows an {@code int}. * result overflows an {@code int}.
* The overflow only occurs for {@linkplain Integer#MIN_VALUE the minimum value}.
* *
* @param a the value to decrement * @param a the value to decrement
* @return the result * @return the result
@ -1006,6 +1009,7 @@ public final class Math {
/** /**
* Returns the argument decremented by one, throwing an exception if the * Returns the argument decremented by one, throwing an exception if the
* result overflows a {@code long}. * result overflows a {@code long}.
* The overflow only occurs for {@linkplain Long#MIN_VALUE the minimum value}.
* *
* @param a the value to decrement * @param a the value to decrement
* @return the result * @return the result
@ -1024,6 +1028,7 @@ public final class Math {
/** /**
* Returns the negation of the argument, throwing an exception if the * Returns the negation of the argument, throwing an exception if the
* result overflows an {@code int}. * result overflows an {@code int}.
* The overflow only occurs for {@linkplain Integer#MIN_VALUE the minimum value}.
* *
* @param a the value to negate * @param a the value to negate
* @return the result * @return the result
@ -1042,6 +1047,7 @@ public final class Math {
/** /**
* Returns the negation of the argument, throwing an exception if the * Returns the negation of the argument, throwing an exception if the
* result overflows a {@code long}. * result overflows a {@code long}.
* The overflow only occurs for {@linkplain Long#MIN_VALUE the minimum value}.
* *
* @param a the value to negate * @param a the value to negate
* @return the result * @return the result

View file

@ -837,6 +837,7 @@ public final class StrictMath {
/** /**
* Returns the argument incremented by one, * Returns the argument incremented by one,
* throwing an exception if the result overflows an {@code int}. * throwing an exception if the result overflows an {@code int}.
* The overflow only occurs for {@linkplain Integer#MAX_VALUE the maximum value}.
* *
* @param a the value to increment * @param a the value to increment
* @return the result * @return the result
@ -851,6 +852,7 @@ public final class StrictMath {
/** /**
* Returns the argument incremented by one, * Returns the argument incremented by one,
* throwing an exception if the result overflows a {@code long}. * throwing an exception if the result overflows a {@code long}.
* The overflow only occurs for {@linkplain Long#MAX_VALUE the maximum value}.
* *
* @param a the value to increment * @param a the value to increment
* @return the result * @return the result
@ -865,6 +867,7 @@ public final class StrictMath {
/** /**
* Returns the argument decremented by one, * Returns the argument decremented by one,
* throwing an exception if the result overflows an {@code int}. * throwing an exception if the result overflows an {@code int}.
* The overflow only occurs for {@linkplain Integer#MIN_VALUE the minimum value}.
* *
* @param a the value to decrement * @param a the value to decrement
* @return the result * @return the result
@ -879,6 +882,7 @@ public final class StrictMath {
/** /**
* Returns the argument decremented by one, * Returns the argument decremented by one,
* throwing an exception if the result overflows a {@code long}. * throwing an exception if the result overflows a {@code long}.
* The overflow only occurs for {@linkplain Long#MIN_VALUE the minimum value}.
* *
* @param a the value to decrement * @param a the value to decrement
* @return the result * @return the result
@ -893,6 +897,7 @@ public final class StrictMath {
/** /**
* Returns the negation of the argument, * Returns the negation of the argument,
* throwing an exception if the result overflows an {@code int}. * throwing an exception if the result overflows an {@code int}.
* The overflow only occurs for {@linkplain Integer#MIN_VALUE the minimum value}.
* *
* @param a the value to negate * @param a the value to negate
* @return the result * @return the result
@ -907,6 +912,7 @@ public final class StrictMath {
/** /**
* Returns the negation of the argument, * Returns the negation of the argument,
* throwing an exception if the result overflows a {@code long}. * throwing an exception if the result overflows a {@code long}.
* The overflow only occurs for {@linkplain Long#MIN_VALUE the minimum value}.
* *
* @param a the value to negate * @param a the value to negate
* @return the result * @return the result