From c2fe1ca4702f90cdb5f046acf28bfd7e4e9382e9 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 30 Jan 2015 10:23:45 -0800 Subject: [PATCH] 8067669: Documentation for methods in Number incomplete regarding too large values Remove statments about rounding and truncation from the *Valud() methods Reviewed-by: rriggs, darcy, alundblad --- .../share/classes/java/lang/Number.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/Number.java b/jdk/src/java.base/share/classes/java/lang/Number.java index b89ed7190f0..019ed9c56c3 100644 --- a/jdk/src/java.base/share/classes/java/lang/Number.java +++ b/jdk/src/java.base/share/classes/java/lang/Number.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2015, 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 @@ -37,7 +37,7 @@ package java.lang; * * For platform classes, the conversion is often analogous to a * narrowing primitive conversion or a widening primitive conversion - * as defining in The Java™ Language Specification + * as defined in The Java™ Language Specification * for converting between primitive types. Therefore, conversions may * lose information about the overall magnitude of a numeric value, may * lose precision, and may even return a result of a different sign @@ -54,8 +54,7 @@ package java.lang; */ public abstract class Number implements java.io.Serializable { /** - * Returns the value of the specified number as an {@code int}, - * which may involve rounding or truncation. + * Returns the value of the specified number as an {@code int}. * * @return the numeric value represented by this object after conversion * to type {@code int}. @@ -63,8 +62,7 @@ public abstract class Number implements java.io.Serializable { public abstract int intValue(); /** - * Returns the value of the specified number as a {@code long}, - * which may involve rounding or truncation. + * Returns the value of the specified number as a {@code long}. * * @return the numeric value represented by this object after conversion * to type {@code long}. @@ -72,8 +70,7 @@ public abstract class Number implements java.io.Serializable { public abstract long longValue(); /** - * Returns the value of the specified number as a {@code float}, - * which may involve rounding. + * Returns the value of the specified number as a {@code float}. * * @return the numeric value represented by this object after conversion * to type {@code float}. @@ -81,8 +78,7 @@ public abstract class Number implements java.io.Serializable { public abstract float floatValue(); /** - * Returns the value of the specified number as a {@code double}, - * which may involve rounding. + * Returns the value of the specified number as a {@code double}. * * @return the numeric value represented by this object after conversion * to type {@code double}. @@ -90,8 +86,7 @@ public abstract class Number implements java.io.Serializable { public abstract double doubleValue(); /** - * Returns the value of the specified number as a {@code byte}, - * which may involve rounding or truncation. + * Returns the value of the specified number as a {@code byte}. * *

This implementation returns the result of {@link #intValue} cast * to a {@code byte}. @@ -105,8 +100,7 @@ public abstract class Number implements java.io.Serializable { } /** - * Returns the value of the specified number as a {@code short}, - * which may involve rounding or truncation. + * Returns the value of the specified number as a {@code short}. * *

This implementation returns the result of {@link #intValue} cast * to a {@code short}.