Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-04-05 Thread Sathish Kumar Thiyagarajan
Thanks, Volkan. I agree that JSON parsers may have their own number codecs and may not necessarily rely on Integer.parseInt() or Long.parseLong(). I appreciate the clarification. Let me simplify my concern: I've tried converting a *String to a Number* and loading it into memory, and my expectati

Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-04-05 Thread Joseph D. Darcy
Another reaction: in practice there is not much numeric about java.lang.Number. Operationally the type means "convertible to a primitive type" and there is nothing else extending Number lets you do with a class. Additionally in retrospect, Number would have been better as an interface rather th

Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-04-04 Thread Volkan Yazıcı
Sathish, would you mind elaborating on your use case a bit more, please? That is, I am not able to see where and how you want to leverage `Number#parseNumber(String)` in the `testNumberMemoryUsage()` method. Example: *"I have this test method verifying this behavior of that application. Given a `Nu

Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-04-04 Thread Volkan Yazıcı
Sathish, please see my response below. On Tue, Apr 1, 2025 at 7:58 AM Sathish Kumar Thiyagarajan < sathishkumar.thiyagara...@gmail.com> wrote: > However, *Jackson (and most JSON parsers) default to Integer for whole > numbers* because they rely on Integer.parseInt(String), which is a safe > fallb

Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-04-01 Thread Sathish Kumar Thiyagarajan
Sure, Volkan. Let me explain with a sample use case (I also have the source code available on GitHub at https://github.com/sathishk/parse-number ). > When developing *REST APIs or Data Engineering applications*, we often > deal with *untyped JSON documents*, which are loaded into Java as Map Obje

Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-03-29 Thread Kevin Bourrillion
I appreciate you raising this; I think it is relevant to some internal discussions we’re having about the future of Number. Here’s some personal reactions from a team member (not a team consensus opinion): Unfortunately, we’ve found many times that `Number` is a pretty deficient return type tha

Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-03-28 Thread Sathish Kumar Thiyagarajan
Hi Kevin and Joseph, Thank you both for your detailed insights. I really appreciate the perspective you’ve shared on the limitations of Number and the challenges in evolving it. I agree that modifying core classes may not be the ri