Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13680

ScheduledTaskRegistrar's task list getters fail with NPE when no tasks set

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.2.2
    • Fix Version/s: 4.2.3
    • Component/s: Core
    • Labels:
    • Last commented by a User:
      false

      Description

      The ScheduledTaskRegistrar must be improved by adding few more helper methods.

      1. hasTriggerTasks()
      2. hasCronTasks()
      3. hasFixedRateTasks()
      4. hasFixedDelayTasks()

      The reason I am adding these helper methods as I tried accessing one of the getTriggerTaskList(), getCronTaskList(), getFixedRateTaskList(), getFixedDelayTaskList() which try to return a Collections.unmodifiableList list which does not accept a list object that is not instantiated (null) and throws a null pointer exception in case of null. This left me no other way to do null checks. Adding the helper methods would provide me if I should/shouldn't access it. There is already a helper method hasTasks but does not fit the solution to know if a specific TaskList is empty or null.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                mrtinkz Vikram Palakurthi
                Last updater:
                St├ęphane Nicoll
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 27 weeks, 4 days ago