Fix compilation errors (#384)

- ECJ worked fine with the old code, but the official compiler does not
This commit is contained in:
Trustin Lee 2012-06-06 23:02:47 +09:00
parent a4b2d70264
commit 843a94b989
6 changed files with 55 additions and 64 deletions

View File

@ -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) {

View File

@ -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();
}

View File

@ -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;

View File

@ -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) {

View File

@ -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) {