Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8366002

Beans.instantiate needs to describe the lookup procedure

XMLWordPrintable

      The current Beans.instantiate specification lacks an explicit description of a behavior that existed in previous versions. Historically, the specification stated:

      "In Beans 1.0 the given name can indicate either a serialized object or a class. Other mechanisms may be added in the future. In Beans 1.0 we first try to treat the beanName as a serialized object name, then as a class name..."

      This explanation was previously included in the now-deleted instantiate method (Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext, AppletInitializer initializer)
       ). Without it, it is unclear that Beans.instantiate will attempt to load a serialized bean before creating an object from the specified class.

      However, the current specification only mentions that ClassNotFoundException is thrown if the class of a serialized object cannot be found, which hints at serialized loading but does not describe the mechanism or order explicitly.

      Impact:

      other implementations may assume the method simply creates an object from the specified class, leading to potential misunderstandings.

      Request:

      Update the specification to make the serialized object loading behavior of Beans.instantiate explicit.

      "In Beans 1.0 the given name can indicate either a serialized object or a class. Other mechanisms may be added in the future. In Beans 1.0 we first try to treat the beanName as a serialized object name, then as a class name..."

            prr Philip Race
            hnassour Hamza Nassour
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: