-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: AssertTrue property method called twice
PostPosted: Tue Mar 18, 2014 2:39 pm 
Newbie

Joined: Tue Mar 18, 2014 2:25 pm
Posts: 1
I have the following class:

Code:
public class Foo {

    ...
    @AssertTrue(message="Foo is not valid")
    public boolean isValid() {
        // perform some validation logic and return either true or false
    }
    ....
}


When I create an instance of Foo and validate this instance, the method isValid is called twice. Why is this method called twice?

This is how I validate the instance

Code:
    ...
    Foo foo = new Foo();
    ...
    ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
    Validator validator = factory.getValidator();
    Set<ConstraintViolation<Foo>> violations = validator.validate(foo);


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.