changeset 1049:4afdf0f0c5bc

remove unused JBuffer methods
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 07 Nov 2016 23:34:48 -0700
parents 2b769da7f67d
children 5ef954fad97b
files src/org/eclipse/jetty/io/JBuffer.java src/org/eclipse/jetty/io/nio/ChannelEndPoint.java src/org/eclipse/jetty/io/nio/SslConnection.java
diffstat 3 files changed, 5 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/JBuffer.java	Mon Nov 07 23:15:42 2016 -0700
+++ b/src/org/eclipse/jetty/io/JBuffer.java	Mon Nov 07 23:34:48 2016 -0700
@@ -56,10 +56,6 @@
 		return bb.capacity();
 	}
 
-	public boolean isDirect() {
-		return bb.isDirect();
-	}
-
 
 
 	public ByteBuffer getByteBuffer() {
@@ -81,10 +77,6 @@
 		return bb.capacity() - bb.limit();
 	}
 
-	public JBuffer buffer() {
-		return this;
-	}
-
 
 	public JBuffer get(int length) {
 		ByteBuffer dup = bb.duplicate();
@@ -118,7 +110,7 @@
 		bb.limit(bb.limit()+1);
 	}
 
-	public int put(byte[] b, int offset, int length) {
+	private int put(byte[] b, int offset, int length) {
 		ByteBuffer dup = bb.duplicate();
 		int put = bb.limit();
 		int capacity = bb.capacity();
@@ -153,10 +145,6 @@
 		return n;
 	}
 
-	public JBuffer slice() {
-		return duplicate();
-	}
-
 	public final JBuffer sliceFrom(int index) {
 		ByteBuffer dup = bb.duplicate();
 		dup.position(index);
@@ -197,7 +185,7 @@
 		return new JBuffer(dup).toString();
 	}
 
-	public final String toString(String charset)
+	private final String toString(String charset)
 	{
 		byte[] bytes = asArray();
 		try
@@ -211,39 +199,6 @@
 		}
 	}
 
-	public String toDetailString()
-	{
-		StringBuilder buf = new StringBuilder();
-		buf.append("[");
-		buf.append(super.hashCode());
-		buf.append(",");
-		buf.append(this.buffer().hashCode());
-		buf.append(",g=");
-		buf.append(getIndex());
-		buf.append(",p=");
-		buf.append(putIndex());
-		buf.append(",c=");
-		buf.append(capacity());
-		buf.append("]={");
-		int count = 0;
-		for (int i = getIndex(); i < putIndex(); i++)
-		{
-			byte b =  peek(i);
-			TypeUtil.toHex(b,buf);
-			if (count++ == 50)
-			{
-				if (putIndex() - i > 20)
-				{
-					buf.append(" ... ");
-					i = putIndex() - 20;
-				}
-			}
-		}
-		buf.append('}');
-		return buf.toString();
-	}
-
-
 
 	private JBuffer pokeBuffer(int index) {
 		JBuffer dup = duplicate();
@@ -259,10 +214,6 @@
 		pokeBuffer(index).put(b);
 	}
 
-	public int poke(int index, JBuffer src) {
-		return pokeBuffer(index).put(src);
-	}
-
 	private JBuffer peekBuffer(int index) {
 		JBuffer dup = duplicate();
 		dup.setGetIndex(index);
@@ -270,10 +221,6 @@
 		return dup;
 	}
 
-	public int peek(int index, byte[] b, int offset, int length) {
-		return peekBuffer(index).get(b,offset,length);
-	}
-
 	public byte peek(int index) {
 		return bb.get(index);
 	}
--- a/src/org/eclipse/jetty/io/nio/ChannelEndPoint.java	Mon Nov 07 23:15:42 2016 -0700
+++ b/src/org/eclipse/jetty/io/nio/ChannelEndPoint.java	Mon Nov 07 23:34:48 2016 -0700
@@ -168,9 +168,8 @@
 	{
 		if (_ishut)
 			return -1;
-		JBuffer nbuf = buffer.buffer();
 		int len = 0;
-		final ByteBuffer bbuf = nbuf.getByteBuffer();
+		final ByteBuffer bbuf = buffer.getByteBuffer();
 
 		//noinspection SynchronizationOnLocalVariableOrMethodParameter
 		try
@@ -221,9 +220,8 @@
 	@Override
 	public int flush(JBuffer buffer) throws IOException
 	{
-		JBuffer nbuf = buffer.buffer();
 		int len=0;
-		final ByteBuffer bbuf = nbuf.getByteBuffer().asReadOnlyBuffer();
+		final ByteBuffer bbuf = buffer.getByteBuffer().asReadOnlyBuffer();
 		try
 		{
 			bbuf.position(buffer.getIndex());
@@ -243,14 +241,11 @@
 	{
 		int length=0;
 
-		JBuffer buf0 = header==null?null:header.buffer();
-		JBuffer buf1 = buffer==null?null:buffer.buffer();
-
 		if (_channel instanceof GatheringByteChannel &&
 			header!=null && header.remaining()!=0 &&
 			buffer!=null && buffer.remaining()!=0)
 		{
-			length = gatheringFlush(header,buf0.getByteBuffer(),buffer,buf1.getByteBuffer());
+			length = gatheringFlush(header,header.getByteBuffer(),buffer,buffer.getByteBuffer());
 		}
 		else
 		{
--- a/src/org/eclipse/jetty/io/nio/SslConnection.java	Mon Nov 07 23:15:42 2016 -0700
+++ b/src/org/eclipse/jetty/io/nio/SslConnection.java	Mon Nov 07 23:34:48 2016 -0700
@@ -506,7 +506,6 @@
 				break;
 
 			case BUFFER_OVERFLOW:
-				if (_logger.isDebugEnabled()) _logger.debug("{} unwrap {} {}->{}",_session,result.getStatus(),_inbound.toDetailString(),buffer.toDetailString());
 				break;
 
 			case OK: