You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bval.apache.org by "Karsten Tinnefeld (JIRA)" <ji...@apache.org> on 2012/05/03 14:34:50 UTC

[jira] [Created] (BVAL-105) Multiple use of @ReportAsSingleViolation composing constraints on one bean leads to internal RuntimeError

Karsten Tinnefeld created BVAL-105:
--------------------------------------

             Summary: Multiple use of @ReportAsSingleViolation composing constraints on one bean leads to internal RuntimeError
                 Key: BVAL-105
                 URL: https://issues.apache.org/jira/browse/BVAL-105
             Project: BVal
          Issue Type: Bug
          Components: jsr303
    Affects Versions: 0.4
         Environment: Win 7 64-Bit Java 1.6.0_30 
            Reporter: Karsten Tinnefeld


Given a composing validation annotation


@Pattern(regexp = ".*\\$1.*")
@ReportAsSingleViolation
@Constraint(validatedBy = {})
@Documented
@Retention(RUNTIME)
@Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
public @interface ValidURLPattern {

    String message() default "{path.to.ValidURLPattern.message}";

    Class < ? >[] groups() default {};

    Class < ? extends Payload >[] payload() default {};
}


attached to a bean several times 


@lombok.Data
public class Bean {

    @ValidURLPattern
    private String oneURL;

    @ValidURLPattern
    private String secondURL;

[...]
}


validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.

I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.

On removal of @ReportAsSingleViolation, the error disappeared.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BVAL-105) Multiple use of @ReportAsSingleViolation composing constraints on one bean leads to internal RuntimeError

Posted by "Karsten Tinnefeld (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karsten Tinnefeld updated BVAL-105:
-----------------------------------

    Description: 
Given a composing validation annotation

{quote}
@Pattern(regexp = ".*\\$1.*")
@ReportAsSingleViolation
@Constraint(validatedBy = {})
@Documented
@Retention(RUNTIME)
@Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
public @interface ValidURLPattern {

    String message() default "{path.to.ValidURLPattern.message}";

    Class < ? >[] groups() default {};

    Class < ? extends Payload >[] payload() default {};
}
{quote}

attached to a bean several times 

{quote}
@lombok.Data
public class Bean {

    @ValidURLPattern
    private String oneURL;

    @ValidURLPattern
    private String secondURL;

[...]
}
{quote}

validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.

I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.

On removal of @ReportAsSingleViolation, the error disappeared.

  was:
Given a composing validation annotation


@Pattern(regexp = ".*\\$1.*")
@ReportAsSingleViolation
@Constraint(validatedBy = {})
@Documented
@Retention(RUNTIME)
@Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
public @interface ValidURLPattern {

    String message() default "{path.to.ValidURLPattern.message}";

    Class < ? >[] groups() default {};

    Class < ? extends Payload >[] payload() default {};
}


attached to a bean several times 


@lombok.Data
public class Bean {

    @ValidURLPattern
    private String oneURL;

    @ValidURLPattern
    private String secondURL;

[...]
}


validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.

I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.

On removal of @ReportAsSingleViolation, the error disappeared.

    
> Multiple use of @ReportAsSingleViolation composing constraints on one bean leads to internal RuntimeError
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: BVAL-105
>                 URL: https://issues.apache.org/jira/browse/BVAL-105
>             Project: BVal
>          Issue Type: Bug
>          Components: jsr303
>    Affects Versions: 0.4
>         Environment: Win 7 64-Bit Java 1.6.0_30 
>            Reporter: Karsten Tinnefeld
>
> Given a composing validation annotation
> {quote}
> @Pattern(regexp = ".*\\$1.*")
> @ReportAsSingleViolation
> @Constraint(validatedBy = {})
> @Documented
> @Retention(RUNTIME)
> @Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
> public @interface ValidURLPattern {
>     String message() default "{path.to.ValidURLPattern.message}";
>     Class < ? >[] groups() default {};
>     Class < ? extends Payload >[] payload() default {};
> }
> {quote}
> attached to a bean several times 
> {quote}
> @lombok.Data
> public class Bean {
>     @ValidURLPattern
>     private String oneURL;
>     @ValidURLPattern
>     private String secondURL;
> [...]
> }
> {quote}
> validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.
> I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.
> On removal of @ReportAsSingleViolation, the error disappeared.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BVAL-105) Multiple use of @ReportAsSingleViolation composing constraints on one bean leads to internal RuntimeError

Posted by "Karsten Tinnefeld (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karsten Tinnefeld updated BVAL-105:
-----------------------------------

    Description: 
Given a composing validation annotation

{noformat} 
@Pattern(regexp = ".*\\$1.*")
@ReportAsSingleViolation
@Constraint(validatedBy = {})
@Documented
@Retention(RUNTIME)
@Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
public @interface ValidURLPattern {

    String message() default "{path.to.ValidURLPattern.message}";

    Class < ? >[] groups() default {};

    Class < ? extends Payload >[] payload() default {};
}
{noformat} 

attached to a bean several times 

{noformat} 
@lombok.Data
public class Bean {

    @ValidURLPattern
    private String oneURL;

    @ValidURLPattern
    private String secondURL;

[...]
}
{noformat} 

validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.

I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.

On removal of @ReportAsSingleViolation, the error disappeared.

  was:
Given a composing validation annotation

{quote}
@Pattern(regexp = ".*\\$1.*")
@ReportAsSingleViolation
@Constraint(validatedBy = {})
@Documented
@Retention(RUNTIME)
@Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
public @interface ValidURLPattern {

    String message() default "{path.to.ValidURLPattern.message}";

    Class < ? >[] groups() default {};

    Class < ? extends Payload >[] payload() default {};
}
{quote}

attached to a bean several times 

{quote}
@lombok.Data
public class Bean {

    @ValidURLPattern
    private String oneURL;

    @ValidURLPattern
    private String secondURL;

[...]
}
{quote}

validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.

I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.

On removal of @ReportAsSingleViolation, the error disappeared.

    
> Multiple use of @ReportAsSingleViolation composing constraints on one bean leads to internal RuntimeError
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: BVAL-105
>                 URL: https://issues.apache.org/jira/browse/BVAL-105
>             Project: BVal
>          Issue Type: Bug
>          Components: jsr303
>    Affects Versions: 0.4
>         Environment: Win 7 64-Bit Java 1.6.0_30 
>            Reporter: Karsten Tinnefeld
>
> Given a composing validation annotation
> {noformat} 
> @Pattern(regexp = ".*\\$1.*")
> @ReportAsSingleViolation
> @Constraint(validatedBy = {})
> @Documented
> @Retention(RUNTIME)
> @Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
> public @interface ValidURLPattern {
>     String message() default "{path.to.ValidURLPattern.message}";
>     Class < ? >[] groups() default {};
>     Class < ? extends Payload >[] payload() default {};
> }
> {noformat} 
> attached to a bean several times 
> {noformat} 
> @lombok.Data
> public class Bean {
>     @ValidURLPattern
>     private String oneURL;
>     @ValidURLPattern
>     private String secondURL;
> [...]
> }
> {noformat} 
> validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.
> I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.
> On removal of @ReportAsSingleViolation, the error disappeared.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BVAL-105) Multiple use of @ReportAsSingleViolation composing constraints on one bean leads to internal RuntimeError

Posted by "Karsten Tinnefeld (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karsten Tinnefeld updated BVAL-105:
-----------------------------------

    Description: 
Given a composing validation annotation

{code:title=ValidURLPattern.java}
@Pattern(regexp = ".*\\$1.*")
@ReportAsSingleViolation
@Constraint(validatedBy = {})
@Documented
@Retention(RUNTIME)
@Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
public @interface ValidURLPattern {

    String message() default "{path.to.ValidURLPattern.message}";

    Class < ? >[] groups() default {};

    Class < ? extends Payload >[] payload() default {};
}
{code}

attached to a bean several times 

{code:title=Bean.java}
@lombok.Data
public class Bean {

    @ValidURLPattern
    private String oneURL;

    @ValidURLPattern
    private String secondURL;

[...]
}
{code}

validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.

I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.

On removal of @ReportAsSingleViolation, the error disappeared.

  was:
Given a composing validation annotation

{noformat} 
@Pattern(regexp = ".*\\$1.*")
@ReportAsSingleViolation
@Constraint(validatedBy = {})
@Documented
@Retention(RUNTIME)
@Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
public @interface ValidURLPattern {

    String message() default "{path.to.ValidURLPattern.message}";

    Class < ? >[] groups() default {};

    Class < ? extends Payload >[] payload() default {};
}
{noformat} 

attached to a bean several times 

{noformat} 
@lombok.Data
public class Bean {

    @ValidURLPattern
    private String oneURL;

    @ValidURLPattern
    private String secondURL;

[...]
}
{noformat} 

validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.

I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.

On removal of @ReportAsSingleViolation, the error disappeared.

    
> Multiple use of @ReportAsSingleViolation composing constraints on one bean leads to internal RuntimeError
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: BVAL-105
>                 URL: https://issues.apache.org/jira/browse/BVAL-105
>             Project: BVal
>          Issue Type: Bug
>          Components: jsr303
>    Affects Versions: 0.4
>         Environment: Win 7 64-Bit Java 1.6.0_30 
>            Reporter: Karsten Tinnefeld
>
> Given a composing validation annotation
> {code:title=ValidURLPattern.java}
> @Pattern(regexp = ".*\\$1.*")
> @ReportAsSingleViolation
> @Constraint(validatedBy = {})
> @Documented
> @Retention(RUNTIME)
> @Target({ ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER })
> public @interface ValidURLPattern {
>     String message() default "{path.to.ValidURLPattern.message}";
>     Class < ? >[] groups() default {};
>     Class < ? extends Payload >[] payload() default {};
> }
> {code}
> attached to a bean several times 
> {code:title=Bean.java}
> @lombok.Data
> public class Bean {
>     @ValidURLPattern
>     private String oneURL;
>     @ValidURLPattern
>     private String secondURL;
> [...]
> }
> {code}
> validating a bean containing null in both URLs yields a spurious validation error on one field, by adding up to _n_ fields, _n - 1_ errors are displayed.
> I tracked down to ConstraintValidation.validate(GroupValidationContext<?>), where a runtime error is thrown somewhere in the iteration over getComposingValidations(), and then gave up.
> On removal of @ReportAsSingleViolation, the error disappeared.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira