OFBiz
  1. OFBiz
  2. OFBIZ-4290

UtilCache#getPropertyParam should test property existence instead of rely on MissingResourceException

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: SVN trunk
    • Fix Version/s: SVN trunk
    • Component/s: framework
    • Labels:

      Description

      Hello,
      UtilCache#getPropertyParam should call res.containsKey instead of relying on catching MissingResourceException, which will reduce number of Exceptions created so CPU.

      Regards
      Philippe
      http://www.ubik-ingenierie.com

      1. patch-OFBIZ-4290.patch
        1.0 kB
        Philippe Mouawad

        Activity

        Hide
        Jacques Le Roux added a comment -

        Ah Philippe,

        Something I forgot: please be careful with your indentations, (re-)read https://cwiki.apache.org/confluence/display/OFBADMIN/Coding+Conventions and by and large https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices

        See r1126399 for this case

        Show
        Jacques Le Roux added a comment - Ah Philippe, Something I forgot: please be careful with your indentations, (re-)read https://cwiki.apache.org/confluence/display/OFBADMIN/Coding+Conventions and by and large https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices See r1126399 for this case
        Hide
        Jacques Le Roux added a comment -

        Thanks Philippe,

        Based on http://stackoverflow.com/questions/299068/how-slow-are-java-exceptions I agree

        Your patch is in trunk at r1126379

        Show
        Jacques Le Roux added a comment - Thanks Philippe, Based on http://stackoverflow.com/questions/299068/how-slow-are-java-exceptions I agree Your patch is in trunk at r1126379
        Hide
        Philippe Mouawad added a comment -

        The fix

        Show
        Philippe Mouawad added a comment - The fix

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Philippe Mouawad
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development