Skip to content

Conversation

@surli
Copy link
Member

@surli surli commented Jul 25, 2023

No description provided.

-->

<org.xwiki.job.internal.DefaultJobStatus>
<org.xwiki.job.DefaultJobStatus>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to modify the serialization in the XML files of the test, since the class is not present anymore in this module. I don't think it would have an impact for real world status serialization if the old class is available through the legacy module.

boolean ignore = false;
if (event instanceof JobStartedEvent) {
Job job = (Job) source;
if (job.getStatus() instanceof org.xwiki.job.AbstractJobStatus
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have used an aspect for injecting this condition check, but it felt easier to do it like that.

import org.xwiki.job.event.status.JobStatus;
import org.xwiki.job.event.status.QuestionAnsweredEvent;
import org.xwiki.job.internal.AbstractJobStatus;
import org.xwiki.job.AbstractJobStatus;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This impacts a condition in #onJobStarted which is called from #onEvent hence the legacy class I added to support the condition with the old class.

Copy link
Member

@tmortagne tmortagne Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those should have moved to org.xwiki.job.AbstractJobStatus back when it was introduced. There is no need to introduce any legacy for this change, as org.xwiki.job.internal.AbstractJobStatus is a org.xwiki.job.AbstractJobStatus too.

@surli surli requested a review from tmortagne July 25, 2023 08:24
@Named(ExtensionJobHistoryRecorder.NAME)
@Singleton
@Deprecated
public class LegacyExtensionJobHistoryRecorder extends ExtensionJobHistoryRecorder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to me this class is actually useless.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants