bval-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BVAL-167) ConstraintDeclarationException: Illegal strengthening: overridden [constraints] in inheritance hierarchy
Date Mon, 05 Nov 2018 08:45:02 GMT

    [ https://issues.apache.org/jira/browse/BVAL-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16674817#comment-16674817
] 

Romain Manni-Bucau commented on BVAL-167:
-----------------------------------------

@ilgrosso: the issue is not the leaves but the abstractserviceimpl which implements part of
the API without actually implementing it in terms of java rules so it creates two heads.

For reference the spec says:

{code}
If a sub type overrides/implements a method originally defined in several parallel types of
the hierarchy (e.g. two interfaces not extending each other, or a class and an interface not
implemented by said class), no parameter constraints may be declared for that method at all
nor parameters be marked for cascaded validation. This again is to avoid an unexpected strengthening
of preconditions to be fulfilled by the caller.
{code}

BVal is stricter than that (the cascading point), this is why i think we can revisit it safely
but syncope will keep concurrent heads for the Liskov principle so it assumes the implementation
will pass through the java rules to check the implementation by reflection which is not required
by bean validation spec anywhere - was my point.

> ConstraintDeclarationException: Illegal strengthening: overridden [constraints] in inheritance
hierarchy
> --------------------------------------------------------------------------------------------------------
>
>                 Key: BVAL-167
>                 URL: https://issues.apache.org/jira/browse/BVAL-167
>             Project: BVal
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Francesco Chicchiriccò
>            Priority: Major
>             Fix For: 2.0.1
>
>
> I am trying to upgrade BVal to 2.0.0 in Syncope.
> I have changed my POMs as follows:
> * javax.validation:validation-api from 1.1.0.Final to 2.0.1.Final
> * org.apache.bval:bval-jsr from 1.1.2 to 2.0.0
> When I try to reach up some of the REST services (based on CXF 3.2), an [exception|https://paste.apache.org/hxvY]
is thrown; I have read about such exception, but it seems to me that the mentioned methods
in [interface|https://github.com/apache/syncope/blob/2_1_X/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java#L70]
and [implementation|https://github.com/apache/syncope/blob/2_1_X/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AbstractAnyService.java#L68]
should comply with hierarchy rules.
> Nevertheless, if I swap
> org.apache.bval:bval-jsr:2.0.0
> with
> org.hibernate.validator:hibernate-validator:6.0.13.Final
> all is working fine.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message