Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7119

The ComponentDefinition's equals/hashCode implementations aren't null-safe enough

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 5.5.6, 5.6
    • None
    • None
    • None
    • Basel 110
    • 3

    Description

      Logically, at least the type property in ComponentDefinition class is supposed to be non-null and so can be used in equals/hashCode implementations without a safe-guard. However, it appears that on some installations betwixt library which converts XML module descriptors to the beans may experience non-fatal failures, which it could overcome.

      However, betwixt tries to populate a warning message for such problems which includes a call of the non-completely converted bean's toString() which in turn triggers the hashCode() call. Since the object might not be fully assembled at that phase any property can be null (the definition is based on setters and getters). This leads to betwixt crashing completely and Magnolia fails to start.

      It appears that merely making sure that hasCode() method is null-safe cures the problem.

      An unfortunate thing is that so far it was not possible to reproduce the sporadical betwixt failures on our side, so we can only hope that the fix is actually enough.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              apchelintcev Aleksandr Pchelintcev
              apchelintcev Aleksandr Pchelintcev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD