Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-1337

When extending JobStatus, AbstractJobs created through the JobExecutor are not initialized with the extended JobStatus

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.0
    • Fix Version/s: None
    • Component/s: Job
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      When defining an AbstractJob implementation like so:

      MyCustomJob.java
      public class MyCustomJob extends AbstractJob<CustomJobRequest, CustomJobStatus>
      

      … with the following classes :

      CustomJobRequest.java
      public class CustomJobRequest extends DefaultRequest
      
      CustomJobStatus.java
      public class CustomJobStatus extends DefaultJobStatus<CustomJobRequest>
      

      When instantiated with the JobExecutor#execute(), the job MyCustomJob is not initialized with an instance of CustomJobStatus but with an instance of DefaultJobStatus.

      It seems that the problem comes from https://github.com/xwiki/xwiki-commons/blob/44c1adfacdcbec59d41496587289b70d0deb1986/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/AbstractJob.java#L323

        Attachments

          Activity

            People

            Assignee:
            caubin Clément Aubin
            Reporter:
            caubin Clément Aubin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: