Spring Framework
  1. Spring Framework
  2. SPR-9542

ExtendedBeanInfo is extremely slow processing beans derived from java.awt.Component

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.1.1, 3.2 M1
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
    • Last commented by a User:
      false

      Description

      I've got a spring bean derived from java.awt.Component in my context. The log file (spring on debug) is like:

      2012-06-23 16:10:46,834 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Processing injected method of bean 'org.nuclos.client.task.PersonalTaskController': AutowiredMethodElement for void org.nuclos.client.ui.Controller.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:10:46,837 DEBUG AWT-EventQueue-0 [factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'springLocaleDelegate'
      2012-06-23 16:10:47,316 DEBUG AWT-EventQueue-0 [springframework.beans.ExtendedBeanInfo] - Could not add indexed write method [public void java.awt.Component.setSize(int,int)] for property [component]. Reason: type mismatch between indexed read and indexed write methods: component
      2012-06-23 16:10:47,545 DEBUG AWT-EventQueue-0 [springframework.beans.ExtendedBeanInfo] - Could not add indexed write method [public void java.awt.Component.setLocation(int,int)] for property [component]. Reason: type mismatch between indexed read and indexed write methods: component
      2012-06-23 16:10:52,387 DEBUG AWT-EventQueue-0 [springframework.beans.ExtendedBeanInfo] - Could not add indexed write method [public final void javax.swing.JComponent.setInputMap(int,javax.swing.InputMap)] for property [component]. Reason: type mismatch between indexed read and indexed write methods: component
      2012-06-23 16:10:52,653 DEBUG AWT-EventQueue-0 [springframework.beans.ExtendedBeanInfo] - Could not add indexed write method [public void javax.swing.JComponent.setFocusTraversalKeys(int,java.util.Set)] for property [component]. Reason: type mismatch between indexed read and indexed write methods: component
      2012-06-23 16:10:57,018 DEBUG AWT-EventQueue-0 [springframework.beans.ExtendedBeanInfo] - Could not add indexed write method [public void java.awt.Component.setLocation(int,int)] for property [component]. Reason: type mismatch between indexed read and indexed write methods: component
      2012-06-23 16:11:02,023 DEBUG AWT-EventQueue-0 [springframework.beans.ExtendedBeanInfo] - Could not add indexed write method [public final void javax.swing.JComponent.setInputMap(int,javax.swing.InputMap)] for property [component]. Reason: type mismatch between indexed read and indexed write methods: component
      2012-06-23 16:11:02,227 DEBUG AWT-EventQueue-0 [springframework.beans.ExtendedBeanInfo] - Could not add indexed write method [public void javax.swing.JComponent.setFocusTraversalKeys(int,java.util.Set)] for property [component]. Reason: type mismatch between indexed read and indexed write methods: component
      2012-06-23 16:11:04,968 DEBUG AWT-EventQueue-0 [springframework.beans.ExtendedBeanInfo] - Could not add indexed write method [public void java.awt.Component.setSize(int,int)] for property [component]. Reason: type mismatch between indexed read and indexed write methods: component
      2012-06-23 16:11:05,467 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Found injected element on class [org.nuclos.client.task.PersonalTaskView]: AutowiredMethodElement for void org.nuclos.client.task.TaskView.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:05,472 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Processing injected method of bean 'org.nuclos.client.task.PersonalTaskView': AutowiredMethodElement for void org.nuclos.client.task.TaskView.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:05,476 DEBUG AWT-EventQueue-0 [factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'springLocaleDelegate'
      2012-06-23 16:11:05,477 DEBUG AWT-EventQueue-0 [factory.annotation.AutowiredAnnotationBeanPostProcessor] - Autowiring by type from bean name 'org.nuclos.client.task.PersonalTaskView' to bean named 'springLocaleDelegate'
      2012-06-23 16:11:06,975 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Found injected element on class [org.nuclos.client.task.PersonalTaskTableModel]: AutowiredMethodElement for void org.nuclos.client.ui.model.AbstractListTableModel.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:06,985 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Processing injected method of bean 'org.nuclos.client.task.PersonalTaskTableModel': AutowiredMethodElement for void org.nuclos.client.ui.model.AbstractListTableModel.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:06,987 DEBUG AWT-EventQueue-0 [factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'springLocaleDelegate'
      2012-06-23 16:11:06,987 DEBUG AWT-EventQueue-0 [factory.annotation.AutowiredAnnotationBeanPostProcessor] - Autowiring by type from bean name 'org.nuclos.client.task.PersonalTaskTableModel' to bean named 'springLocaleDelegate'
      2012-06-23 16:11:08,339 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Found injected element on class [org.nuclos.client.ui.collect.component.CollectableTextField]: AutowiredMethodElement for void org.nuclos.client.ui.collect.component.AbstractCollectableComponent.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:08,351 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Processing injected method of bean 'org.nuclos.client.ui.collect.component.CollectableTextField': AutowiredMethodElement for void org.nuclos.client.ui.collect.component.AbstractCollectableComponent.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:08,353 DEBUG AWT-EventQueue-0 [factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'springLocaleDelegate'
      2012-06-23 16:11:08,354 DEBUG AWT-EventQueue-0 [factory.annotation.AutowiredAnnotationBeanPostProcessor] - Autowiring by type from bean name 'org.nuclos.client.ui.collect.component.CollectableTextField' to bean named 'springLocaleDelegate'
      2012-06-23 16:11:08,539 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Processing injected method of bean 'org.nuclos.client.ui.collect.component.CollectableTextField': AutowiredMethodElement for void org.nuclos.client.ui.collect.component.AbstractCollectableComponent.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:08,543 DEBUG AWT-EventQueue-0 [factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'springLocaleDelegate'
      2012-06-23 16:11:09,090 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Processing injected method of bean 'org.nuclos.client.ui.collect.component.CollectableTextField': AutowiredMethodElement for void org.nuclos.client.ui.collect.component.AbstractCollectableComponent.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:09,097 DEBUG AWT-EventQueue-0 [factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'springLocaleDelegate'
      2012-06-23 16:11:10,010 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Found injected element on class [org.nuclos.client.ui.collect.component.CollectableDateChooser]: AutowiredMethodElement for void org.nuclos.client.ui.collect.component.AbstractCollectableComponent.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:10,012 DEBUG AWT-EventQueue-0 [factory.annotation.InjectionMetadata] - Processing injected method of bean 'org.nuclos.client.ui.collect.component.CollectableDateChooser': AutowiredMethodElement for void org.nuclos.client.ui.collect.component.AbstractCollectableComponent.setSpringLocaleDelegate(org.nuclos.common2.SpringLocaleDelegate)
      2012-06-23 16:11:10,013 DEBUG AWT-EventQueue-0 [factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'springLocaleDelegate'
      

      In other words:

      • Whenever I've got 'Could not add indexed write method...' my application stalls for over one second.
      • As 'Could not add indexed write method...' is there over and over and over in the log, this seems to be a performance hit.
      • Perhaps it would be better to cache if 'adding an indexed write method' is not possible.

        Issue Links

          Activity

          Hide
          Chris Beams added a comment -

          Hi Thomas,

          To help expedite this, please consider adding a reproduction project, or contributing a pull request per the contributor guidelines. In any case, thanks for the report.

          Show
          Chris Beams added a comment - Hi Thomas, To help expedite this, please consider adding a reproduction project , or contributing a pull request per the contributor guidelines . In any case, thanks for the report.
          Hide
          Thomas Pasch added a comment -

          Looking around I wonder if SPR-6252 describes the same problem. It has a small test case, anyway.

          Show
          Thomas Pasch added a comment - Looking around I wonder if SPR-6252 describes the same problem. It has a small test case, anyway.
          Hide
          Chris Beams added a comment -

          Hi Thomas,

          As of SPR-9723, ExtendedBeanInfo is no longer part of the default code path; it is only used for bean classes that actually declare "non-standard" java beans setter methods, i.e. those with non-void return types.

          This means that ExtendedBeanInfo won't have anything to do with java.awt.Component and subclasses (unless your subclass happens to declare non-void returning setter methods, which is highly unlikely).

          Thefore, I'm resolving this as Won't Fix. This isn't to say that there isn't a potential problem here, but rather that the problem is now very likely moot with regard to your situation.

          Show
          Chris Beams added a comment - Hi Thomas, As of SPR-9723 , ExtendedBeanInfo is no longer part of the default code path; it is only used for bean classes that actually declare "non-standard" java beans setter methods, i.e. those with non-void return types. This means that ExtendedBeanInfo won't have anything to do with java.awt.Component and subclasses (unless your subclass happens to declare non-void returning setter methods, which is highly unlikely). Thefore, I'm resolving this as Won't Fix. This isn't to say that there isn't a potential problem here, but rather that the problem is now very likely moot with regard to your situation.
          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:
              Thomas Pasch
              Last updater:
              Chris Beams
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

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