changeset 1063:0157e92670f5

remove JBuffer.getIndex()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 09 Nov 2016 02:08:33 -0700
parents 4a50422596b6
children a0abb16cf6e7
files src/org/eclipse/jetty/http/HttpParser.java src/org/eclipse/jetty/io/JBuffer.java
diffstat 2 files changed, 7 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpParser.java	Wed Nov 09 02:04:02 2016 -0700
+++ b/src/org/eclipse/jetty/http/HttpParser.java	Wed Nov 09 02:08:33 2016 -0700
@@ -86,7 +86,7 @@
 	}
 
 	private void mark() {
-		_mark = _buffer.getIndex() - 1;
+		_mark = _buffer.position() - 1;
 	}
 
 	private String sliceFromMark() {
@@ -106,7 +106,7 @@
 		if( _mark == -1 ) {
 			_buffer.compact();
 		} else if( _mark > 0 ) {
-			int old = _buffer.getIndex();
+			int old = _buffer.position();
 			_buffer.position(_mark);
 			_buffer.compact();
 			_buffer.position( old - _mark );
@@ -335,7 +335,7 @@
 					case STATE_FIELD0:
 						if (ch == HttpTokens.SPACE)
 						{
-							_tok0 = bufferToString(_mark, _buffer.getIndex() - 1 - _mark);
+							_tok0 = bufferToString(_mark, _buffer.position() - 1 - _mark);
 							_responseStatus = !HttpVersions.CACHE.contains(_tok0)?-1:0;
 							_state=STATE_SPACE1;
 							continue;
@@ -367,8 +367,7 @@
 					case STATE_STATUS:
 						if (ch == HttpTokens.SPACE)
 						{
-//							_tok1.update(_mark, _buffer.getIndex() - 1);
-							_tok1 = bufferToString(_mark, _buffer.getIndex() - 1 - _mark);
+							_tok1 = bufferToString(_mark, _buffer.position() - 1 - _mark);
 							_state = STATE_SPACE2;
 							continue;
 						}
@@ -394,8 +393,7 @@
 					case STATE_URI:
 						if (ch == HttpTokens.SPACE)
 						{
-//							_tok1.update(_mark, _buffer.getIndex() - 1);
-							_tok1 = bufferToString(_mark, _buffer.getIndex() - 1 - _mark);
+							_tok1 = bufferToString(_mark, _buffer.position() - 1 - _mark);
 							_state=STATE_SPACE2;
 							continue;
 						}
@@ -664,7 +662,7 @@
 								_cached = null;
 								if (_length == -1)
 									mark();
-								_length=_buffer.getIndex() - _mark;
+								_length = _buffer.position() - _mark;
 								_state = STATE_HEADER_IN_NAME;
 							}
 						}
@@ -730,7 +728,7 @@
 							{
 								if (_length == -1)
 									mark();
-								_length=_buffer.getIndex() - _mark;
+								_length = _buffer.position() - _mark;
 								_state = STATE_HEADER_IN_VALUE;
 							}
 						}
--- a/src/org/eclipse/jetty/io/JBuffer.java	Wed Nov 09 02:04:02 2016 -0700
+++ b/src/org/eclipse/jetty/io/JBuffer.java	Wed Nov 09 02:08:33 2016 -0700
@@ -86,10 +86,6 @@
 		return bb;
 	}
 
-	public int getIndex() {
-		return bb.position();
-	}
-
 	public void clear() {
 		bb.position(0);
 		bb.limit(0);