Deprecate Double.MIN_VALUE?
Olexandr Rotan
rotanolexandr842 at gmail.com
Wed Dec 4 08:04:12 UTC 2024
To add one more voice, not particularly with Java, but I have made the same
issue with js Number.MIN_VALUE a bunch of times (assuming it should work as
java`s) Integer.MIN_VALUE.
And also, would like to note that half-measures may not work as expected or
to expected extent, for example you can very often see misused
Number.MAX_VALUE, where in fact Number.MAX_SAFE_INTEGER should be used in
previously mentioned js. The thing that will be most intuitive for dev
(which is MIN_VALUE will most likely sneak into codebase from time to time
at least, unless there some warning for it's use. Since java doesn't have
concept of "note", which is kind of like weaker warning, deprecation seems
really harsh but to some extent reasonable step, SPECIFICALLY because it
will break -Weeror builds, so people will return to places where they use
Double.MIN_VALUE and I am sure that they will find out that at least half
of the times this constant has been missused
On Wed, Dec 4, 2024, 09:56 Stephen Colebourne <scolebourne at joda.org> wrote:
> On Tue, 3 Dec 2024 at 18:37, Louis Wasserman <lowasser at google.com> wrote:
> > To add some more data, from taking a sample, at least a third of usages
> in Google's codebase were using it incorrectly in the way we've described.
>
> I just checked, and only a few days ago I made this error (in a test
> case, where it is less noticeable).
>
> I do think deprecation of Double.MIN_VALUE is long overdue (whether
> there are new constants or not is a separate issue).
>
> Stephen
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20241204/f1626899/attachment-0001.htm>
More information about the core-libs-dev
mailing list