Re-Request for Re-Review : 7088952 : Add "BYTES" constant to primitive wrapper classes
Ulf Zibis
Ulf.Zibis at CoSoCo.de
Wed Nov 7 23:30:30 UTC 2012
I think, it would be more intuitive, to calculate the SIZE from the BYTES, e.g. SIZE = BYTES * 8.
Ulf
Am 08.11.2012 00:08, schrieb Mike Duigou:
> Hello all;
>
> A long time ago [1] this patch was put forward for review. Though the request was approved the patch was never committed because some of the followup questions were not answered.
>
> The summary motivation for this issue is that measuring the size of the primitive types in bytes is more frequently used than bits because bytes are the minimum unit of allocation in Java. The proposed BYTES constant is a convenience to avoid many repetitions of Integer.SIZE / Byte.SIZE where the size in bytes is desired. There are many of these cases already in the JDK that are currently using locally defined constants or manifest constants ("magic" numbers) [2] that could benefit from this change to improve clarity. Many other external usages could take advantage of these constants as well.
>
> Unless there are objections I will go forward with pushing this change on Nov 9th, 2012 as originally reviewed with the original reviewers.
>
> http://cr.openjdk.java.net/~mduigou/7088952/0/webrev/
>
> Mike
>
> [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2011-September/007753.html
> [2] http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/00cd9dc3c2b5/src/share/classes/java/io/DataOutputStream.java
More information about the core-libs-dev
mailing list