Trying to make the code compatible with both 1.6 and 1.7 java, while
keeping the huge performance benefit of early clearing of cancelled
jobs.