Closed zonkeydonkey closed 4 years ago
Hi,
Thank you for the contribution. I will look into it. We definitely need a test for this.
Thanks, Daniil
@daivanov in the test for this issue you are assuming that when strategy for generic Annotation class is defined, the number of calls of that strategy is equal to 0. Is it only for the test to pass before this PR gets merged or is it some internal requirement for Podam you wish to preserve?
This is just a placeholder test, which I made to succeed otherwise Travis will be failing and everybody will be unhappy.
The idea was that @Version
and @Basic
will be triggering generic AnnotationStrategy, which doesn't happen at the moment.
Thanks, Daniil
And it looks like the whole enterprise has failed because each field has multiple annotations and at least one of them is supported by Podam :)
Thanks, Daniil
I think I need to investigate your branch more thoroughly.
Thanks, Daniil
What do you think about the latest changes?
Thanks, Daniil
Hi, I agree with all your changes. Thanks for applying them, could you release a new version of Podam? Thanks, Sylwia
Ok, thank you. Fixed in Podam 7.2.4
Thanks, Daniil
It's already there, but will be visible in Maven UI, when they will synchronize everything https://repo1.maven.org/maven2/uk/co/jemos/podam/podam/7.2.4.RELEASE/
Thanks, Daniil
https://mvnrepository.com/artifact/uk.co.jemos.podam/podam :man_shrugging:
@daivanov could you reopen the issue? I have noticed that the logging still needs to be conformed to the changes that have been done for this issue, example:
supposing you have your custom validation annotation and you did not registered an attribute strategy for this annotation itself, but you registered a fallback strategy for Annotation class (the interface for all annotation classes), Podam still logs:
Please, register AttributeStratergy for custom constraint (...)
Better would be to log the above message when no strategy for certain annotation can be applied (neither strategy for the annotation nor for Annotation class) and when fallback strategy can be applied, then log some message in this manner: "A strategy for $annotation was not found, $baseClassOfAnnotation strategy was used."
True, the warning is logged too early.
Thanks, Daniil
Sorry for a delay. Not it's merged.
Thanks, Daniil
Podam allows to set custom AttributeStrategies for specific, explicitly mentioned annotation types:
but it is not possible to define "fallback" strategy that will be used for all annotations that implement the same base interface (for example in Kotlin every annotation class implements kotlin.Annotation):
All above examples are written in Kotlin.