Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3743

XWorkMapPropertyAccessor calls getProperty twice if the value is null

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.1.1
    • 2.3.3
    • Value Stack
    • Patch

    Description

      If you evaluate an OGNL expression which has null value, XWorkMapPropertyAccessor does the evaluation twice.
      First in line 81: result = super.getProperty(context, target, name);
      Second in line 91: return super.getProperty(context, target, name);

      Performance can be improved by removing the second evaluation.
      Line 91: return null;
      This saves an extra evaluation, and at this point we can be sure that the result can only be null.

      Patch is attached.
      Please review it.

      Attachments

        1. WW-3743.diff
          0.8 kB
          Pelladi Gabor

        Activity

          People

            lukaszlenart Lukasz Lenart
            pelladi Pelladi Gabor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: