Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2549

Usage of HibernateValidator Impl classes in SimpleViolationsContainer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.13.1.Final, 4.5.8.Final
    • 4.5.3.Final
    • None
    • None

    Description

      The resteasy-validator-provider class org.jboss.resteasy.plugins.validation.SimpleViolationsContainer is using HibernateValidator impl classes as given below.

      import org.hibernate.validator.internal.engine.path.NodeImpl;
      import org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl;
      
      // method
      
      private static boolean compareNode(Node n1, Node n2)
            if (!(n1 instanceof NodeImpl))
            {
               return false;
            }
            NodeImpl ni1 = (NodeImpl) n1;
            NodeImpl ni2 = (NodeImpl) n2;
            if (ni1.getIndex() == null)
            {
               if (ni2.getIndex() != null)
               {
                  return false;
               }
            }
      
      // method
      
      static boolean compareConstraintViolation(ConstraintViolation<?> cv1, ConstraintViolation<?> cv2)
      
      if (cv1.getConstraintDescriptor() instanceof ConstraintDescriptorImpl && cv2.getConstraintDescriptor() instanceof ConstraintDescriptorImpl)
            {
               ConstraintDescriptorImpl<?> cdi1 = (ConstraintDescriptorImpl<?>) cv1.getConstraintDescriptor();
               ConstraintDescriptorImpl<?> cdi2 = (ConstraintDescriptorImpl<?>) cv2.getConstraintDescriptor();
               if (cdi1.getElementType() != null ? !cdi1.getElementType().equals(cdi2.getElementType()) : cdi2.getElementType() != null) {
                  return false;
               }
            }
      
      

      I am using HibernateValidator bundle in OSGi and the impl packages are not being exported which results in my RESTEasy based REST service bundle not being resolved.

      Can we somehow stick to interfaces so that any reference to impl packages to be avoided?

      Thanks,
      Rakesh

      Attachments

        Activity

          People

            rsigal@redhat.com Ronald Sigal
            rakeshk15 Rakesh Kumar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: