Skip to content

Processing java.math.BigDecimal via Spring's ExtendedBeanInfo fails sporadically [SPR-10111] #14744

Closed

Description

@spring-projects-issues

Chris Beams opened SPR-10111 and commented

This issue was spawned from #14336. See comments there for background.


Issue Links:

Referenced from: commits 1c306df, 26d5ef9, aa3e0be

Backported to: 3.1.4

Activity

  1. spring-projects-issues commented on Dec 19, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Chris Beams commented

    commit 3e19b484efb1e5e490b649e2fd6c4a0ced55b34d
    Author: Chris Beams <[email protected]>
    Commit: Chris Beams <[email protected]>
    
        Handle non-void write methods deterministically
        
        This change resolves a specific issue with processing
        java.math.BigDecimal via ExtendedBeanInfo. BigDecimal has a particular
        constellation of #setScale methods that, prior to this change, had the
        potential to cause ExtendedBeanInfo to throw an IntrospectionException
        depending on the order in which the methods were processed.
        
        Because JDK 7 no longer returns deterministic results from
        Class#getDeclaredMethods, it became a genuine possibility - indeed a
        statistical certainty that the 'wrong' setScale method handling order
        happens sooner or later. Typically one could observe this failure once
        out of every four test runs.
        
        This commit introduces deterministic method ordering of all discovered
        non-void returning write methods in such a way that solves the problem
        for BigDecimal as well as for any other class having a similar method
        arrangement.
        
        Also:
        
         - Remove unnecessary cast
        
         - Pass no method information to PropertyDescriptor superclasses when
           invoking super(...). This ensures that any 'type mismatch'
           IntrospectionExceptions are handled locally in ExtendedBeanInfo and
           its Simple* PropertyDescriptor variants where we have full control.
        
        Issue: SPR-10111, SPR-9702
    
  2. added
    type: bug
    status: backported
    in: core
    on Jan 11, 2019
  3. added this to the 3.2.1 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: corestatus: backportedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions