This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* As seen on https://javaspecialists.slack.com/messages/general | |
* | |
* This class fails to compile with JDK 1.6, 1.7 and 1.8: | |
* | |
* class Two extends Observable { // Nothing special about the choice of Observable here | |
* ^ | |
* symbol: class Observable | |
* 1 error | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Collection; | |
import java.util.Iterator; | |
import java.util.concurrent.LinkedTransferQueue; | |
import java.util.concurrent.RejectedExecutionException; | |
import java.util.concurrent.RejectedExecutionHandler; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.TransferQueue; | |
public final class ScalingThreadPoolExecutor extends ThreadPoolExecutor { |