Spring Batch
  1. Spring Batch
  2. BATCH-1343

Change JobLauncher.run() to "throws JobExecutionException"

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.0.M2
    • Fix Version/s: 3.0.0
    • Component/s: Core
    • Labels:
      None

      Description

      Since all 3 exceptions in the throws clause of JobLauncher.run() extend JobExecutionException, it might be easier to change the declaration to "throws JobExecutionException". This would allow users to create their own JobLauncher implementations and that throw other JobExecutionExceptions.

        Activity

        Hide
        Lucas Ward added a comment -

        Unfortunately, there is no way to make this change without breaking backwards compatibility. If someone is using the JobLauncher API, and is catching the more specific exception, changing the signature to the more general exception will cause compilation failures, since the more broad exception is not being caught. I don't think there's anyway that we could do this until a major release.

        Show
        Lucas Ward added a comment - Unfortunately, there is no way to make this change without breaking backwards compatibility. If someone is using the JobLauncher API, and is catching the more specific exception, changing the signature to the more general exception will cause compilation failures, since the more broad exception is not being caught. I don't think there's anyway that we could do this until a major release.
        Hide
        Dave Syer added a comment -

        I'm not really sure I want to do it anyway since the current signature says very precisely what can happen in the launcher. Maybe we could declare the existing set explicitly and the base class as well?

        Show
        Dave Syer added a comment - I'm not really sure I want to do it anyway since the current signature says very precisely what can happen in the launcher. Maybe we could declare the existing set explicitly and the base class as well?

          People

          • Assignee:
            Dan Garrette
            Reporter:
            Dan Garrette
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: