Spring Framework
  1. Spring Framework
  2. SPR-9059

Concurrent problem with BeanWrapperImpl.getPropertyValue

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      Since 3.1 BeanWrapperImpl has a concurrent problem with properties which have only a getter method.
      Please see my very simple maven project in the attached zip-file.
      The main method of the Starter class produces 3 to 8 exceptions per run with the 3.1.0 and the latest SNAPSHOT of 3.1.1. But if you either uncomment the setter or got back to 3.0.7 it is absolute stable.

      I suppose it has something to do with the new introduced ExtendedBeanInfo in CachedIntrospectionResults(L224) but I didn't get it right now.

      1. fix_for_spr_9059.patch
        0.8 kB
        Björn Voß
      2. test_for_spr_9059.patch
        2 kB
        Björn Voß

        Issue Links

          Activity

          Hide
          Björn Voß added a comment -

          It wasn't a problem of concurrency. The cause was == comparison for tow Method-Objects. But as MethodDescriptors and PropertyDescriptors uses SoftReferences internally its not guaranteed that the Method-Object of a MethodDescriptor is the same Object as the corresponding Method-Object of a PropertyDescriptor. So the check for getter methods in ExtendedBeanInfo must use equals.

          Show
          Björn Voß added a comment - It wasn't a problem of concurrency. The cause was == comparison for tow Method-Objects. But as MethodDescriptors and PropertyDescriptors uses SoftReferences internally its not guaranteed that the Method-Object of a MethodDescriptor is the same Object as the corresponding Method-Object of a PropertyDescriptor. So the check for getter methods in ExtendedBeanInfo must use equals.
          Hide
          André Neubauer added a comment -

          Hi Björn,

          The bug you mentioned is already addressed with SPR-8347 (https://jira.springsource.org/browse/SPR-8347). There is also a pull request waiting for acceptance (https://github.com/SpringSource/spring-framework/pull/20/commits).

          Cheers!

          PS: Unfortunately I can't mark this issue as duplicate.

          Show
          André Neubauer added a comment - Hi Björn, The bug you mentioned is already addressed with SPR-8347 ( https://jira.springsource.org/browse/SPR-8347 ). There is also a pull request waiting for acceptance ( https://github.com/SpringSource/spring-framework/pull/20/commits ). Cheers! PS: Unfortunately I can't mark this issue as duplicate.
          Hide
          Chris Beams added a comment -

          Thanks Björn, André.

          Show
          Chris Beams added a comment - Thanks Björn, André.
          Hide
          Chris Beams added a comment -

          A general note to watchers of ExtendedBeanInfo-related issues: SPR-10029 is a major refactoring of ExtendedBeanInfo and overall support for non-void returning setter methods.

          If you have submitted a reproduction project with this issue, we have run it through its paces against these new changes, but we would like to ask you to do the same against your actual applications.

          Please consider updating your dev or test builds to work against 3.1.4.BUILD-SNAPSHOT and/or 3.2.0.BUILD-SNAPSHOT to verify, and we would appreciate any feedback, even if it's to let us know that all is well. So that we can consolidate feedback, please add your comments to SPR-10029, and mention the original issue(s) that you were watching.

          Thanks!

          Note also that testing against 3.1.4 is preferable to 3.2.0 because ExtendedBeanInfo is always in the code path in the latter, while in 3.2.0 we've optimized things such that ExtendedBeanInfo is only in play for bean classes that have one or more non-void returning setter methods.

          Show
          Chris Beams added a comment - A general note to watchers of ExtendedBeanInfo -related issues: SPR-10029 is a major refactoring of ExtendedBeanInfo and overall support for non-void returning setter methods. If you have submitted a reproduction project with this issue, we have run it through its paces against these new changes, but we would like to ask you to do the same against your actual applications. Please consider updating your dev or test builds to work against 3.1.4.BUILD-SNAPSHOT and/or 3.2.0.BUILD-SNAPSHOT to verify, and we would appreciate any feedback, even if it's to let us know that all is well. So that we can consolidate feedback, please add your comments to SPR-10029 , and mention the original issue(s) that you were watching. Thanks! Note also that testing against 3.1.4 is preferable to 3.2.0 because ExtendedBeanInfo is always in the code path in the latter, while in 3.2.0 we've optimized things such that ExtendedBeanInfo is only in play for bean classes that have one or more non-void returning setter methods.

            People

            • Assignee:
              Chris Beams
              Reporter:
              Björn Voß
              Last updater:
              Chris Beams
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 21 weeks, 4 days ago