Fix compilation errors (#384)
- ECJ worked fine with the old code, but the official compiler does not
This commit is contained in:
parent
a4b2d70264
commit
843a94b989
|
@ -20,7 +20,7 @@ import java.util.concurrent.ThreadFactory;
|
|||
public class DefaultEventExecutor extends MultithreadEventExecutor {
|
||||
|
||||
public DefaultEventExecutor(int nThreads) {
|
||||
super(nThreads);
|
||||
this(nThreads, null);
|
||||
}
|
||||
|
||||
public DefaultEventExecutor(int nThreads, ThreadFactory threadFactory) {
|
||||
|
|
|
@ -41,20 +41,15 @@ public abstract class MultithreadEventExecutor implements EventExecutor {
|
|||
}
|
||||
};
|
||||
|
||||
protected MultithreadEventExecutor(Object... args) {
|
||||
this(DEFAULT_POOL_SIZE, args);
|
||||
}
|
||||
|
||||
protected MultithreadEventExecutor(int nThreads, Object... args) {
|
||||
this(nThreads, null, args);
|
||||
}
|
||||
|
||||
protected MultithreadEventExecutor(int nThreads, ThreadFactory threadFactory, Object... args) {
|
||||
if (nThreads <= 0) {
|
||||
if (nThreads < 0) {
|
||||
throw new IllegalArgumentException(String.format(
|
||||
"nThreads: %d (expected: > 0)", nThreads));
|
||||
"nThreads: %d (expected: >= 0)", nThreads));
|
||||
}
|
||||
|
||||
if (nThreads == 0) {
|
||||
nThreads = DEFAULT_POOL_SIZE;
|
||||
}
|
||||
if (threadFactory == null) {
|
||||
threadFactory = new DefaultThreadFactory();
|
||||
}
|
||||
|
|
|
@ -20,19 +20,11 @@ import java.util.concurrent.ThreadFactory;
|
|||
public abstract class MultithreadEventLoop extends MultithreadEventExecutor implements EventLoop {
|
||||
|
||||
|
||||
protected MultithreadEventLoop(int nThreads, Object... args) {
|
||||
super(nThreads, args);
|
||||
}
|
||||
|
||||
protected MultithreadEventLoop(int nThreads, ThreadFactory threadFactory,
|
||||
Object... args) {
|
||||
super(nThreads, threadFactory, args);
|
||||
}
|
||||
|
||||
protected MultithreadEventLoop(Object... args) {
|
||||
super(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected abstract EventExecutor newChild(ThreadFactory threadFactory, Object... args) throws Exception;
|
||||
|
||||
|
|
|
@ -22,10 +22,12 @@ import java.util.concurrent.ThreadFactory;
|
|||
|
||||
public class LocalEventLoop extends MultithreadEventLoop {
|
||||
|
||||
public LocalEventLoop() { }
|
||||
public LocalEventLoop() {
|
||||
this(0);
|
||||
}
|
||||
|
||||
public LocalEventLoop(int nThreads) {
|
||||
super(nThreads);
|
||||
this(nThreads, null);
|
||||
}
|
||||
|
||||
public LocalEventLoop(int nThreads, ThreadFactory threadFactory) {
|
||||
|
|
|
@ -23,10 +23,12 @@ import java.util.concurrent.ThreadFactory;
|
|||
|
||||
public class NioEventLoop extends MultithreadEventLoop {
|
||||
|
||||
public NioEventLoop() { }
|
||||
public NioEventLoop() {
|
||||
this(0);
|
||||
}
|
||||
|
||||
public NioEventLoop(int nThreads) {
|
||||
super(nThreads);
|
||||
this(nThreads, null);
|
||||
}
|
||||
|
||||
public NioEventLoop(int nThreads, ThreadFactory threadFactory) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user