Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2928

FacesConfigurator cast for ApplicationImpl directly to load converter configuration, instead use RuntimeConfig object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.9-SNAPSHOT, 1.2.10-SNAPSHOT, 2.0.3-SNAPSHOT
    • 1.1.9, 1.2.10, 2.0.3
    • JSR-314
    • None

    Description

      Checking some code on myfaces I notice this lines on FacesConfigurator:

      if(application instanceof ApplicationImpl)
      {
      for (Iterator it = _dispenser.getConverterConfigurationByClassName(); it.hasNext()

      { String converterClassName = (String) it.next(); ((ApplicationImpl) application).addConverterConfiguration(converterClassName, _dispenser.getConverterConfiguration(converterClassName)); }

      }

      We should avoid that, and instead use RuntimeConfig object, because that is the right place to do that.

      The problem with this hack is what happen when Application object is wrapped. It is very rare that someone overrides this class, but on JSF 2.0 this problem become important, because it is valid to wrap Application object.

      The solution is just move the related code to RuntimeConfig object and call from ApplicationImpl doing a lookup to that location.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: