-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValidationStatus#getMessages return value has changed #415
Comments
Due to a change in 1.5.1 it wasn't possible to use subclasses of ValidationMessage together with CompositeValidator anymore. The reason was an internal refactoring of the CompositeValidationResult class. In this commit the class was refactored again and now uses another logic to both fix the original bug and still make usage of custom ValidationMessage types possible. Fix for #415
Hi, I hope this solves your problem. However the actual code you provided doesn't compile and I think it wasn't compiling in previous versions neither because the return type of List<MyValidationType> validationMessages =
compositeValidator.getValidationStatus().getMessage()
.stream()
.map(m -> (MyValidationType) m) // this wasn't possible
.collect(Collectors.toList()); @sideisra Can you review the code and test it in your project? All tests are green but maybe there are still corner cases for which we don't have test cases yet. |
I have tested it, and it is working correctly on my side. Thanks for the quick response :) Sorry, I had sanitized my code for the purposes of explaining the problem - the actual code is:
which is consistent with your example. |
@lestard looks good 👍 |
Ok cool. So I will merge this with develop so it can be tested with version |
I have subclassed ValidationMessage and am using them in a CompositeValidator, This previously worked. As of 1.5.2, the following code fails:
List<MyValidationType> validationMessages = compositeValidator.getValidationStatus().getMessages();
with the following error:
de.saxsys.mvvmfx.utils.validation.CompositeValidationStatus$CompositeValidationMessageWrapper cannot be cast to mypackage.MyValidationMessage
Is there any way to get access to the actual validation messages?
The text was updated successfully, but these errors were encountered: