Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-89

[validator] ValidatorAction needs thread-safe

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.1 Release
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      39393

      Description

      ValidatorAction needs thread-safe because it is cached by other programs, like
      Struts.
      But ValidatorAction has an unthread-safe block.

      Here is a patch below.

          • ValidatorAction.java Mon Apr 24 22:41:55 2006
          • ValidatorAction.java.new Mon Apr 24 22:44:54 2006
            ***************
          • 527,536 ****
            params.put(Validator.VALIDATOR_ACTION_PARAM, this);

      try {
      ! ClassLoader loader = this.getClassLoader(params);
      ! this.loadValidationClass(loader);
      ! this.loadParameterClasses(loader);
      ! this.loadValidationMethod();

      Object[] paramValues = this.getParameterValues(params);

      — 527,540 ----
      params.put(Validator.VALIDATOR_ACTION_PARAM, this);

      try {
      ! if (this.validationMethod == null) {
      ! synchronized(this)

      { ! ClassLoader loader = this.getClassLoader(params); ! this.loadValidationClass(loader); ! this.loadParameterClasses(loader); ! this.loadValidationMethod(); ! }

      ! }

      Object[] paramValues = this.getParameterValues(params);

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kanekotky@yahoo.co.jp Takayuki Kaneko
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: