You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/01/10 10:56:11 UTC

[GitHub] [commons-beanutils] seregamorph opened a new pull request #68: BEANUTILS-541 - FluentPropertyBeanIntrospector caches corrupted write…

seregamorph opened a new pull request #68:
URL: https://github.com/apache/commons-beanutils/pull/68


   https://issues.apache.org/jira/browse/BEANUTILS-541
   
   There is an issue in FluentPropertyBeanIntrospector (at line 144 for 1.9.3), it caches wrong writeMethod in the static cache of java.beans.Introspector when base class has at least two subclasses. Simple snippet to reproduce can be found in covering `Jira541TestCase` (revert `FluentPropertyBeanIntrospector.java` changes locally and you'll see the failure).
   
   It is critical, because wrong information is stored globally unless explicit `Introspector.flushCaches (or Introspector.flushFromCaches)` is called.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-beanutils] seregamorph commented on pull request #68: BEANUTILS-541 - FluentPropertyBeanIntrospector caches corrupted writeMethod

Posted by GitBox <gi...@apache.org>.
seregamorph commented on pull request #68:
URL: https://github.com/apache/commons-beanutils/pull/68#issuecomment-757477286


   Backported for 1.x in #69


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-beanutils] seregamorph commented on a change in pull request #68: BEANUTILS-541 - FluentPropertyBeanIntrospector caches corrupted writeMethod

Posted by GitBox <gi...@apache.org>.
seregamorph commented on a change in pull request #68:
URL: https://github.com/apache/commons-beanutils/pull/68#discussion_r554549518



##########
File path: src/main/java/org/apache/commons/beanutils2/FluentPropertyBeanIntrospector.java
##########
@@ -138,9 +138,13 @@ public void introspect(final IntrospectionContext icontext)
                         .getPropertyDescriptor(propertyName);
                 try {
                     if (pd == null) {
-                        icontext.addPropertyDescriptor(createFluentPropertyDescritor(
-                                m, propertyName));
+                        icontext.addPropertyDescriptor(createFluentPropertyDescriptor(

Review comment:
       trivia: in the `private createFluentPropertyDescriptor` second argument was not used




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-beanutils] seregamorph commented on a change in pull request #68: BEANUTILS-541 - FluentPropertyBeanIntrospector caches corrupted writeMethod

Posted by GitBox <gi...@apache.org>.
seregamorph commented on a change in pull request #68:
URL: https://github.com/apache/commons-beanutils/pull/68#discussion_r554549518



##########
File path: src/main/java/org/apache/commons/beanutils2/FluentPropertyBeanIntrospector.java
##########
@@ -138,9 +138,13 @@ public void introspect(final IntrospectionContext icontext)
                         .getPropertyDescriptor(propertyName);
                 try {
                     if (pd == null) {
-                        icontext.addPropertyDescriptor(createFluentPropertyDescritor(
-                                m, propertyName));
+                        icontext.addPropertyDescriptor(createFluentPropertyDescriptor(

Review comment:
       trivia: in the `private createFluentPropertyDescriptor` second argument was not used




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-beanutils] seregamorph commented on a change in pull request #68: BEANUTILS-541 - FluentPropertyBeanIntrospector caches corrupted writeMethod

Posted by GitBox <gi...@apache.org>.
seregamorph commented on a change in pull request #68:
URL: https://github.com/apache/commons-beanutils/pull/68#discussion_r554550669



##########
File path: src/main/java/org/apache/commons/beanutils2/FluentPropertyBeanIntrospector.java
##########
@@ -169,12 +179,10 @@ private String propertyName(final Method m) {
      * Creates a property descriptor for a fluent API property.
      *
      * @param m the set method for the fluent API property
-     * @param propertyName the name of the corresponding property
      * @return the descriptor
      * @throws IntrospectionException if an error occurs
      */
-    private PropertyDescriptor createFluentPropertyDescritor(final Method m,
-            final String propertyName) throws IntrospectionException {

Review comment:
       `propertyName` argument is redundant in private method




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org