Uploaded image for project: 'BVal'
  1. BVal
  2. BVAL-111

ValidatorFactory-bound ConstraintValidatorFactory used instead of ValidatorContext-bound instance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.4
    • 0.5
    • jsr303
    • None

    Description

      I have a project use bval-0.2 and CODI-BV modules,after upgrade to bval-0.4 the bval CODI BV modules integration broke.

      After some debug I found this line in AnnotationProcessor#getConstraintValidator method.

      (ConstraintValidator<A, ? super T>) factoryContext.getFactory().getConstraintValidatorFactory().getInstance(validatorTypes.get(assignableTypes.get(0)));

      It use factoryContext.getFactory().getConstraintValidatorFactory()
      This line was commit by revision https://svn.apache.org/repos/asf/incubator/bval/sandbox/lang3-work@993590

      According to commit log it was extracted from Jsr303MetaBeanFactory.java
      But the original version was factoryContext.getConstraintValidatorFactory()

      CODI replace factoryContext.constraintValidatorFactory with a CdiAwareConstraintValidatorFactory but the factoryContext.getFactory().getConstraintValidatorFactory() keep the default one.

      So, which method is the correct one to get ConstraintValidatorFactory?
      Is this a BVal bug or CODI bug?

      Attachments

        Activity

          People

            Unassigned Unassigned
            chunlinyao chunlinyao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: