Group all checker which only check the value of one field#2437
Conversation
|
To me, the code is worse than before. Less clear, less self-contained. And just for saving a few lines of code which are very simple. Just my 2 cents. |
|
Thanks @simonharrer for your feedback. Besides "saving a few lines of code" I had the following motivation in mind:
But probably all these things can also be accomplished without the FieldChecker as abstraction layer. @JabRef/developers if you think that it over-complicates things, just close this PR. |
|
Ok, I see. Thanks for clarification. The PR makes more sense to me now. :-) In that case, I would vote for a FieldChecker interface that is implemented by each of these classes you refactored. Then, another class can bridge between a Checker and a FieldChecker like an adapter. The FieldCheckers can then be easily used within the entry editor. Working with generics could be the way to go for your second point, but I am unsure how this will look. The idea behind this change could be to use the decorator pattern. On the outside, there is a String FieldChecker, and on the inside an ISSN FieldChecker, for instance. |
…to a normal Checker
|
Thanks @simonharrer for this suggestion! I now implemented the FieldCheckers via the adapter pattern and think it is more clear than it was before. |
* upstream/master: Save deletion of current searchquery (#2469) Update dev dependencies (mockito, wiremock, assertj) Update BouncyCastle (1.55->1.56), ANTRL4 (4.5.3->4.6), jsoup (1.10.1->1.10.2) Group all checker which only check the value of one field (#2437) Follow up #2428 (#2438) Fix conversion of "'n" and "\'{n}" from LaTeX to Unicode (#2464) Fix failing tests
Most of the integrity checker only work on one field and thus I introduced a new abstract class which groups the common functionality.
(I know we don't want pure refactor PRs anymore, sorry for that)
gradle localizationUpdate?