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

TranslationCheck: should fire file started/finished when invoking errors #5057

rnveach opened this Issue Sep 2, 2017 · 1 comment


None yet
2 participants

rnveach commented Sep 2, 2017

Identified at #5043 (comment) this issue is slightly related to multi-file validation,

PR wishes to remove file started/finished calls in TranslationCheck.

As pitest has proven these calls aren't needed because:
After the check destroy executes from the violation, we run fireAuditFinished

// It may also log!!!
final int errorCount = counter.getCount();

and the XML logger clears out it's file cache if it hadn't before.
public void auditFinished(AuditEvent event) {

So correct output is still here only because XML logger was extra careful in clearing out it's cache.

DefaultLogger doesn't care about files starting or finishing really.

public void fileStarted(AuditEvent event) {
// No need to implement this method in this class
public void fileFinished(AuditEvent event) {

To me, it is weird we fire errors without a start/end file, but this check is already 'special' as it is related to multi-file mode. We can't assume any new listener made will know this weird behavior.

I suggest we undo the changes to TranslationCheck in that PR and in #5397 , and modify XMLLogger to not clear out it's cache as fileFinished should be the only one doing this.
I assume removing the fileMessages.forEach(this::writeFileMessages); in XMLLogger's auditFinished would solve the pitest issue in this check and require the removed code to stay.


This comment has been minimized.

Show comment
Hide comment

romani Dec 30, 2017


fix is merged


romani commented Dec 30, 2017

fix is merged

@romani romani closed this Dec 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment