Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • Application Requirement:
      KC
    • Sprint:
      UXI 2.5.0-m6 Sprint 2
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes
    • Story Points:
      0

      Description

      While difficult to reproduce we frequently see some of the labels and controls defined in the DD missing in our KRAD screens. Luckily this issue happened locally for me today and I was able to debug into it and it appears similar or identical to the issue identified in KULRICE-12334. While debugging the resolution of the DD properties I dug down to ObjectPropertyUtils.ObjectPropertyMetadata():1161.

      The issue occurs when trying to resolve the developmentProposal property off of ProposalDevelopmentDocument. ProposalDevelopmentDocument implements an interface with the following method

      DevelopmentProposalContract getDevelopmentProposal();
      

      but implements the method as follows

          @Override
          public DevelopmentProposal getDevelopmentProposal() {
              return developmentProposal;
          }
      

      When running the following code when the labels are missing, the readMethod in the below code shows a return value of DevelopmentProposalContract which isn't defined in the DD at all, and thereby future DD resolution fails. When debugging I was able to set the readMethod as returned from the Introspector = null and getReadMethodByName returns the correct method definition returning DevelopmentProposal.

      It appears that the issue in KULRICE-12334 needs to be revisited and either the check expanded to include JDK7(and maybe JDK8?) or the fix revisited to always apply since it doesn't look to be JDK specific.

                      for (PropertyDescriptor propertyDescriptor : beanInfo
                              .getPropertyDescriptors()) {
                          String propertyName = propertyDescriptor.getName();
      
                          mutablePropertyDescriptorMap.put(propertyName, propertyDescriptor);
                          Method readMethod = propertyDescriptor.getReadMethod();
                          if (readMethod == null) {
                              readMethod = getReadMethodByName(beanClass, propertyName);
                          }
      
                          // working around a JDK6 Introspector bug WRT covariance, see KULRICE-12334
                          if (isJdk6) {
                              readMethod = getCorrectedReadMethod(beanClass, readMethod);
                          }
      
      

        Attachments

          Issue Links

            Activity

            Hide
            jheckel Jeff Heckel (Inactive) added a comment -

            I can try to piece something together. Is it possible to somehow just have you test this before being committing it?

            Show
            jheckel Jeff Heckel (Inactive) added a comment - I can try to piece something together. Is it possible to somehow just have you test this before being committing it?
            Hide
            dpace Douglas Pace added a comment -

            I could try. But in my local environment, despite over 6 months of development on Rice 2.4-2.5 I've only seen it occur to me twice so I don't know how long I would have to try to test it before I considered the issue fixed? We see it more frequently in our deployed environments though so if you commit it and we upgrade to it we should know if it fixed the issue within a week. I'd also be happy to review the change you are planning to see if I notice anything.

            Show
            dpace Douglas Pace added a comment - I could try. But in my local environment, despite over 6 months of development on Rice 2.4-2.5 I've only seen it occur to me twice so I don't know how long I would have to try to test it before I considered the issue fixed? We see it more frequently in our deployed environments though so if you commit it and we upgrade to it we should know if it fixed the issue within a week. I'd also be happy to review the change you are planning to see if I notice anything.
            Hide
            jheckel Jeff Heckel (Inactive) added a comment -

            You think this?? Wasn't sure if should leave JDK6 check or just remove it.

            for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) {
            String propertyName = propertyDescriptor.getName();

            mutablePropertyDescriptorMap.put(propertyName, propertyDescriptor);
            Method readMethod = propertyDescriptor.getReadMethod();
            if (readMethod == null)

            { readMethod = getReadMethodByName(beanClass, propertyName); }

            else if (readMethod.isBridge())

            { readMethod = getCorrectedReadMethod(beanClass, readMethod); }

            // working around a JDK6 Introspector bug WRT covariance, see KULRICE-12334
            if (isJdk6) { readMethod = getCorrectedReadMethod(beanClass, readMethod); }

            mutableReadMethodMap.put(propertyName, readMethod);

            Method writeMethod = propertyDescriptor.getWriteMethod();
            assert writeMethod == null

            (writeMethod.getParameterTypes().length == 1 && writeMethod.getParameterTypes()[0] != null) : writeMethod;
            mutableWriteMethodMap.put(propertyName, writeMethod);
            }
            Show
            jheckel Jeff Heckel (Inactive) added a comment - You think this?? Wasn't sure if should leave JDK6 check or just remove it. for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) { String propertyName = propertyDescriptor.getName(); mutablePropertyDescriptorMap.put(propertyName, propertyDescriptor); Method readMethod = propertyDescriptor.getReadMethod(); if (readMethod == null) { readMethod = getReadMethodByName(beanClass, propertyName); } else if (readMethod.isBridge()) { readMethod = getCorrectedReadMethod(beanClass, readMethod); } // working around a JDK6 Introspector bug WRT covariance, see KULRICE-12334 if (isJdk6) { readMethod = getCorrectedReadMethod(beanClass, readMethod); } mutableReadMethodMap.put(propertyName, readMethod); Method writeMethod = propertyDescriptor.getWriteMethod(); assert writeMethod == null (writeMethod.getParameterTypes().length == 1 && writeMethod.getParameterTypes() [0] != null) : writeMethod; mutableWriteMethodMap.put(propertyName, writeMethod); }
            Hide
            dpace Douglas Pace added a comment -

            I'm not sure if isBridge covers the jdk6 case. I think so, but not 100%, but I thought Rice was dropping support for JDK6 in any case? Also, I think getReadMethodByName(beanClass, propertyName); will always get the correct method anyway, but what might be more correct is?

            if (readMethod == null)
            { readMethod = getReadMethodByName(beanClass, propertyName); }
            if (readMethod != null && (readMethod.isBridge() || isJdk6)
            { readMethod = getCorrectedReadMethod(beanClass, readMethod); }
            
            Show
            dpace Douglas Pace added a comment - I'm not sure if isBridge covers the jdk6 case. I think so, but not 100%, but I thought Rice was dropping support for JDK6 in any case? Also, I think getReadMethodByName(beanClass, propertyName); will always get the correct method anyway, but what might be more correct is? if (readMethod == null ) { readMethod = getReadMethodByName(beanClass, propertyName); } if (readMethod != null && (readMethod.isBridge() || isJdk6) { readMethod = getCorrectedReadMethod(beanClass, readMethod); }
            Hide
            jheckel Jeff Heckel (Inactive) added a comment -

            I modified the method to be like this after discussing with Peter. Doug, hopefully it will be tested soon and works better.

            for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) {
            String propertyName = propertyDescriptor.getName();

            mutablePropertyDescriptorMap.put(propertyName, propertyDescriptor);
            Method readMethod = propertyDescriptor.getReadMethod();
            if (readMethod == null)

            { readMethod = getReadMethodByName(beanClass, propertyName); }

            // checking for bridge methods http://www.znetdevelopment.com/blogs/2012/04/11/java-bean-introspector-and-covariantgeneric-returns/
            if (readMethod != null && readMethod.isBridge())

            { readMethod = getCorrectedReadMethod(beanClass, readMethod); }

            mutableReadMethodMap.put(propertyName, readMethod);

            Method writeMethod = propertyDescriptor.getWriteMethod();
            assert writeMethod == null

            (writeMethod.getParameterTypes().length == 1 && writeMethod.getParameterTypes()[0] != null) : writeMethod;
            mutableWriteMethodMap.put(propertyName, writeMethod);
            }
            Show
            jheckel Jeff Heckel (Inactive) added a comment - I modified the method to be like this after discussing with Peter. Doug, hopefully it will be tested soon and works better. for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) { String propertyName = propertyDescriptor.getName(); mutablePropertyDescriptorMap.put(propertyName, propertyDescriptor); Method readMethod = propertyDescriptor.getReadMethod(); if (readMethod == null) { readMethod = getReadMethodByName(beanClass, propertyName); } // checking for bridge methods http://www.znetdevelopment.com/blogs/2012/04/11/java-bean-introspector-and-covariantgeneric-returns/ if (readMethod != null && readMethod.isBridge()) { readMethod = getCorrectedReadMethod(beanClass, readMethod); } mutableReadMethodMap.put(propertyName, readMethod); Method writeMethod = propertyDescriptor.getWriteMethod(); assert writeMethod == null (writeMethod.getParameterTypes().length == 1 && writeMethod.getParameterTypes() [0] != null) : writeMethod; mutableWriteMethodMap.put(propertyName, writeMethod); }

              People

              • Assignee:
                jheckel Jeff Heckel (Inactive)
                Reporter:
                dpace Douglas Pace
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h