/** * Wraps the provided task in our statistic wrapper. If the task is {@code null}, this will * return {@code null} so that the parent class can do error checking. * * @param task Runnable to wrap * @param priority Priority for runnable to execute * @return Runnable which is our wrapped implementation */ private Runnable wrap(Runnable task, TaskPriority priority) { if (priority == null) { priority = getDefaultPriority(); } if (task == null) { return null; } else { return new TaskStatWrapper(statsManager, priority, task); } }
/** * Wraps the provided task in our statistic wrapper. If the task is {@code null}, this will * return {@code null} so that the parent class can do error checking. * * @param task Runnable to wrap * @param priority Priority for runnable to execute * @return Runnable which is our wrapped implementation */ private Runnable wrap(Runnable task, TaskPriority priority) { if (priority == null) { priority = getDefaultPriority(); } if (task == null) { return null; } else { return new TaskStatWrapper(statsManager, priority, task); } }