changes after second review from gregw
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
020ebde77c
commit
31347db71b
|
@ -82,15 +82,14 @@ public class HttpContent implements Callback, Closeable
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param buffer
|
||||
* @return whether the input buffer has been closed
|
||||
* @return true if the buffer is the sentinel instance {@link CLOSE}
|
||||
*/
|
||||
private static boolean isBufferClosed(ByteBuffer buffer)
|
||||
private static boolean isTheCloseBuffer(ByteBuffer buffer)
|
||||
{
|
||||
@SuppressWarnings("ReferenceEquality")
|
||||
boolean bufferClosed = (buffer == CLOSE);
|
||||
return bufferClosed;
|
||||
boolean isTheCloseBuffer = (buffer == CLOSE);
|
||||
return isTheCloseBuffer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -200,7 +199,7 @@ public class HttpContent implements Callback, Closeable
|
|||
{
|
||||
if (isConsumed())
|
||||
return;
|
||||
if (isBufferClosed(buffer))
|
||||
if (isTheCloseBuffer(buffer))
|
||||
return;
|
||||
if (iterator instanceof Callback)
|
||||
((Callback)iterator).succeeded();
|
||||
|
@ -211,7 +210,7 @@ public class HttpContent implements Callback, Closeable
|
|||
{
|
||||
if (isConsumed())
|
||||
return;
|
||||
if (isBufferClosed(buffer))
|
||||
if (isTheCloseBuffer(buffer))
|
||||
return;
|
||||
if (iterator instanceof Callback)
|
||||
((Callback)iterator).failed(x);
|
||||
|
|
|
@ -74,25 +74,11 @@ public final class Edge
|
|||
return _from;
|
||||
}
|
||||
|
||||
public boolean isFromNode(Node node)
|
||||
{
|
||||
@SuppressWarnings("ReferenceEquality")
|
||||
boolean isFromNode_ = (_from == node);
|
||||
return isFromNode_;
|
||||
}
|
||||
|
||||
public Node getTo()
|
||||
{
|
||||
return _to;
|
||||
}
|
||||
|
||||
public boolean isToNode(Node node)
|
||||
{
|
||||
@SuppressWarnings("ReferenceEquality")
|
||||
boolean isToNode_ = (_to == node);
|
||||
return isToNode_;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ public class Graph
|
|||
addNode(toNode=edge.getTo());
|
||||
|
||||
// replace edge with normalized edge
|
||||
if (!edge.isFromNode(fromNode) || !edge.isToNode(toNode))
|
||||
if (!edge.getFrom().equals(fromNode) || !edge.getTo().equals(toNode))
|
||||
edge=new Edge(fromNode,toNode);
|
||||
|
||||
this._edges.add(edge);
|
||||
|
@ -129,7 +129,7 @@ public class Graph
|
|||
|
||||
for (Edge edge : this._edges)
|
||||
{
|
||||
if (edge.isFromNode(node) || edge.isToNode(node))
|
||||
if (edge.getFrom().equals(node) || edge.getTo().equals(node))
|
||||
{
|
||||
fromedges.add(edge);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ public class Graph
|
|||
|
||||
for (Edge edge : this._edges)
|
||||
{
|
||||
if (edge.isFromNode(from))
|
||||
if (edge.getFrom().equals(from))
|
||||
{
|
||||
fromedges.add(edge);
|
||||
}
|
||||
|
|
|
@ -381,7 +381,7 @@ public class DoSFilter implements Filter
|
|||
// or if we were woken up we insist or we fail.
|
||||
Boolean throttled = (Boolean)request.getAttribute(__THROTTLED);
|
||||
long throttleMs = getThrottleMs();
|
||||
if (Boolean.FALSE.equals(throttled) && throttleMs > 0)
|
||||
if (!Boolean.TRUE.equals(throttled) && throttleMs > 0)
|
||||
{
|
||||
int priority = getPriority(request, tracker);
|
||||
request.setAttribute(__THROTTLED, Boolean.TRUE);
|
||||
|
|
|
@ -45,11 +45,11 @@ public class MessageInputStream extends InputStream implements MessageAppender
|
|||
private final long timeoutMs;
|
||||
private ByteBuffer activeBuffer = null;
|
||||
|
||||
private static boolean isBufferEOF(ByteBuffer buf)
|
||||
private static boolean isTheEofBuffer(ByteBuffer buf)
|
||||
{
|
||||
@SuppressWarnings("ReferenceEquality")
|
||||
boolean isBufferEOF_ = (buf==EOF);
|
||||
return isBufferEOF_;
|
||||
boolean isTheEofBuffer = (buf==EOF);
|
||||
return isTheEofBuffer;
|
||||
}
|
||||
|
||||
public MessageInputStream()
|
||||
|
@ -173,7 +173,7 @@ public class MessageInputStream extends InputStream implements MessageAppender
|
|||
}
|
||||
}
|
||||
|
||||
if (isBufferEOF(activeBuffer))
|
||||
if (isTheEofBuffer(activeBuffer))
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Reached EOF");
|
||||
|
|
Loading…
Reference in New Issue