Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-13243

CDK: the attribute definition inheritance doesn't work correctly

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: cdk-4.5.0.Alpha1
    • Fix Version/s: 4.5-Tracking
    • Component/s: cdk
    • Labels:
      None

      Description

      The inheritance isn't inspected correctly in other cases than basic ones:

      public abstract class C extends A {
      }
      
      public abstract class A extends UIComponentBase implements I {
      }
      
      public interface I {
          @Attribute
          String getAttr1();
      }
      

      In this case CDK event doesn't notice there is attribute defined in I.

      It can be fixed either by:

      • C implements I.
      • moving attribute to A or directly to C

      CDK also takes into account whether we have abstract or concrete implementation:

      public abstract class C extends A {
          
          @Override
          public String getAttr() {
               return ...;
          }
      }
      

      In this case the attribute won't be generated, because it is already implemented.

      The inheritance issue get then worse by inappropriate application of attribute's properties in either of those cases:

      • C has concrete implementation of #getAttr(), C implements I
        • then generated component contains generated #getAttr() even though it's already implemented
      • implementation of #getAttr() is moved to A
        • then #getAttr() is again generated even though it's implemented in A

      I guess Those issues are caused by incomplete implementation of CDK's reflection scanning mechanisms.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  lfryc Lukáš Fryč
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated: