Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/java.desktop/share/classes/java/beans/Beans.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ public Beans() {}
* <p>
* Instantiate a JavaBean.
* </p>
* The bean is created based on a name relative to a class-loader.
* This name should be a dot-separated name such as "a.b.c".
* <p>
* The given name can indicate either a serialized object or a class.
* We first try to treat the beanName as a serialized object
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* We first try to treat the beanName as a serialized object
* We first try to treat the {@code beanName} as a serialized object

Should this be marked up as it refers the parameter name? Also, in other instances.

* name then as a class name.
* <p>
* When using the beanName as a serialized object name we convert the
* given beanName to a resource pathname and add a trailing ".ser" suffix.
* We then try to load a serialized object from that resource.
* <p>
* For example, given a beanName of "x.y", Beans.instantiate would first
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* For example, given a beanName of "x.y", Beans.instantiate would first
* For example, given a beanName of "x.y", {@code Beans.instantiate} would first

Method names should be marked up.

* try to read a serialized object from the resource "x/y.ser" and if
* that failed it would try to load the class "x.y" and create an
* instance of that class.
*
* @return a JavaBean
* @param cls the class-loader from which we should create
* the bean. If this is null, then the system
Expand All @@ -84,6 +100,22 @@ public static Object instantiate(ClassLoader cls, String beanName) throws IOExce
* <p>
* Instantiate a JavaBean.
* </p>
* The bean is created based on a name relative to a class-loader.
* This name should be a dot-separated name such as "a.b.c".
* <p>
* The given name can indicate either a serialized object or a class.
* We first try to treat the beanName as a serialized object
* name then as a class name.
* <p>
* When using the beanName as a serialized object name we convert the
* given beanName to a resource pathname and add a trailing ".ser" suffix.
* We then try to load a serialized object from that resource.
* <p>
* For example, given a beanName of "x.y", Beans.instantiate would first
* try to read a serialized object from the resource "x/y.ser" and if
* that failed it would try to load the class "x.y" and create an
* instance of that class.
*
* @return a JavaBean
*
* @param cls the class-loader from which we should create
Expand Down