Uploaded image for project: 'Hibernate Validator'
  1. Hibernate Validator
  2. HV-1359

Loading ConstraintValidators with service loader does not take into account externalClassLoader

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0.0.CR2
    • Component/s: engine
    • Labels:
      None

      Description

      We should get rid of GetConstraintValidatorsFromServiceLoader and use GetInstancesFromServiceLoader instead.

      Moreover, I think we can safely remove serviceLoaderBasedConstraintMappingContributor from ConfigurationImpl.

      We can instantiate it in ValidatorFactoryImpl: it will be safer (we will need to pass the externalClassLoader to it and thus it will be possible to call getServiceLoaderBasedConstraintMappingContributor() before the call to externalClassLoader(...) which would be wrong) and we don't need to keep it around, once the initialization is done.

        Attachments

          Activity

            People

            • Assignee:
              gsmet Guillaume Smet
              Reporter:
              gsmet Guillaume Smet
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: