FloydDsilva commented on PR #1623:
URL: https://github.com/apache/commons-lang/pull/1623#issuecomment-4262562317

   > Closing in favor of #1626
   Hi @garydgregory, thanks for the suggestion — it’s a neat and simple 
approach.
   
   However, I don’t think using createNumber directly inside isCreatable is a 
good fit here, mainly for two reasons:
   
   
   **1)Performance considerations:** isCreatable is commonly used in loops and 
validation paths. Calling createNumber would introduce object creation and 
additional overhead, which would be a noticeable regression for a method 
intended to be lightweight.
   
   **2)Separation of concerns:** isCreatable is designed as a validation method 
that checks whether number creation is viable, not to actually construct the 
number. If callers already need to invoke createNumber, validating by 
constructing the number twice defeats the purpose of having a separate, 
inexpensive check.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to