mirror of
https://github.com/apache/struts.git
synced 2026-09-13 01:25:07 +00:00
016c2ec9c3
StringConverter formatted BigDecimal, Double and Float with maximumFractionDigits set to Integer.MAX_VALUE. That constant arrived with WW-4871, which fixed round-trip precision loss for double and float; both of those types are naturally bounded, the widest being Double.MIN_VALUE at 325 fraction digits. BigDecimal has no such bound. DecimalFormat honours maximumFractionDigits literally and pads the fraction out to the value's full scale, so the length of the formatted output followed the scale of the value rather than its precision. Bound the setting to 340. Every double and float value still formats in full, as does every BigDecimal within that range; beyond it the value is rounded to the bound. The existing round-trip assertions for Double.MIN_VALUE (325 fraction digits) and for a BigDecimal slightly wider than double (326) are untouched and still pass. Backport of the same change on main, adjusted for the com.opensymphony.xwork2 package layout of this line. Fixes: https://issues.apache.org/jira/browse/WW-5711 Claude-Session: https://claude.ai/code/session_01LwgeV4TN78ke2hHKTVWAUP Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Struts 2 Core
This is a core of the Apache Struts framework and all other modules depend on it. It requires Java 8 at minimum and a Servlet container supporting Java Servlet API 3.1 at least.
Installation
Just drop this plugin into WEB-INF/lib folder or add it as Maven dependency