jetty-9 some findbug cleanups
This commit is contained in:
parent
7e8a627b92
commit
dc02390449
|
@ -165,10 +165,11 @@ public class AsyncByteArrayEndPoint extends ByteArrayEndPoint implements AsyncEn
|
||||||
_readFuture.fail(new TimeoutException());
|
_readFuture.fail(new TimeoutException());
|
||||||
if (!_writeFuture.isComplete())
|
if (!_writeFuture.isComplete())
|
||||||
_writeFuture.fail(new TimeoutException());
|
_writeFuture.fail(new TimeoutException());
|
||||||
|
|
||||||
|
notIdle();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
notIdle();
|
|
||||||
_lock.unlock();
|
_lock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.nio.ByteBuffer;
|
||||||
*/
|
*/
|
||||||
public interface Buffers
|
public interface Buffers
|
||||||
{
|
{
|
||||||
enum Type { DIRECT, INDIRECT } ;
|
enum Type { DIRECT, INDIRECT }
|
||||||
|
|
||||||
ByteBuffer getHeader();
|
ByteBuffer getHeader();
|
||||||
ByteBuffer getBuffer();
|
ByteBuffer getBuffer();
|
||||||
|
|
|
@ -28,16 +28,12 @@ public class DispatchedIOFuture implements IOFuture
|
||||||
|
|
||||||
public DispatchedIOFuture()
|
public DispatchedIOFuture()
|
||||||
{
|
{
|
||||||
// System.err.println(this);new Throwable().printStackTrace();
|
this(false,new ReentrantLock());
|
||||||
_lock = new ReentrantLock();
|
|
||||||
_block = _lock.newCondition();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DispatchedIOFuture(Lock lock)
|
public DispatchedIOFuture(Lock lock)
|
||||||
{
|
{
|
||||||
// System.err.println(this);new Throwable().printStackTrace();
|
this(false,lock);
|
||||||
_lock = lock;
|
|
||||||
_block = _lock.newCondition();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DispatchedIOFuture(boolean ready,Lock lock)
|
public DispatchedIOFuture(boolean ready,Lock lock)
|
||||||
|
@ -209,7 +205,7 @@ public class DispatchedIOFuture implements IOFuture
|
||||||
|
|
||||||
protected void dispatch(Runnable callback)
|
protected void dispatch(Runnable callback)
|
||||||
{
|
{
|
||||||
new Thread(callback).run();
|
new Thread(callback).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dispatchReady()
|
private void dispatchReady()
|
||||||
|
|
|
@ -195,10 +195,10 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
|
||||||
_readFuture.fail(new TimeoutException());
|
_readFuture.fail(new TimeoutException());
|
||||||
if (!_writeFuture.isComplete())
|
if (!_writeFuture.isComplete())
|
||||||
_writeFuture.fail(new TimeoutException());
|
_writeFuture.fail(new TimeoutException());
|
||||||
|
notIdle();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
notIdle();
|
|
||||||
_lock.unlock();
|
_lock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -441,6 +441,8 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
|
||||||
public void close() throws IOException
|
public void close() throws IOException
|
||||||
{
|
{
|
||||||
_lock.lock();
|
_lock.lock();
|
||||||
|
try
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
super.close();
|
super.close();
|
||||||
|
@ -449,9 +451,10 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
|
||||||
{
|
{
|
||||||
LOG.ignore(e);
|
LOG.ignore(e);
|
||||||
}
|
}
|
||||||
|
updateKey();
|
||||||
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
updateKey();
|
|
||||||
_lock.unlock();
|
_lock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ public class IOFutureTest
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
try{TimeUnit.MILLISECONDS.sleep(50);}catch(Exception e){}
|
try{TimeUnit.MILLISECONDS.sleep(50);}catch(Exception e){e.printStackTrace();}
|
||||||
f0.ready();
|
f0.ready();
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
|
@ -229,7 +229,7 @@ public class IOFutureTest
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
try{TimeUnit.MILLISECONDS.sleep(50);}catch(Exception e){}
|
try{TimeUnit.MILLISECONDS.sleep(50);}catch(Exception e){e.printStackTrace();}
|
||||||
f1.ready();
|
f1.ready();
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
|
@ -285,7 +285,7 @@ public class IOFutureTest
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
try{TimeUnit.MILLISECONDS.sleep(50);}catch(Exception e){}
|
try{TimeUnit.MILLISECONDS.sleep(50);}catch(Exception e){e.printStackTrace();}
|
||||||
f0.fail(ex);
|
f0.fail(ex);
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
|
@ -328,7 +328,7 @@ public class IOFutureTest
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
try{TimeUnit.MILLISECONDS.sleep(50);}catch(Exception e){}
|
try{TimeUnit.MILLISECONDS.sleep(50);}catch(Exception e){e.printStackTrace();}
|
||||||
f1.fail(ex);
|
f1.fail(ex);
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
|
|
|
@ -360,7 +360,8 @@ public class SelectChannelEndPointTest
|
||||||
clientOutputStream.write("12345678".getBytes("UTF-8"));
|
clientOutputStream.write("12345678".getBytes("UTF-8"));
|
||||||
clientOutputStream.flush();
|
clientOutputStream.flush();
|
||||||
|
|
||||||
while(_lastEndp==null);
|
while(_lastEndp==null)
|
||||||
|
Thread.sleep(10);
|
||||||
|
|
||||||
_lastEndp.setMaxIdleTime(10*specifiedTimeout);
|
_lastEndp.setMaxIdleTime(10*specifiedTimeout);
|
||||||
Thread.sleep(2 * specifiedTimeout);
|
Thread.sleep(2 * specifiedTimeout);
|
||||||
|
|
Loading…
Reference in New Issue