File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
src/main/java/org/seasar/doma/internal Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ public class ExpressionTokenizer {
1010
1111 protected final String expression ;
1212
13- protected CharBuffer buf ;
13+ protected final CharBuffer buf ;
1414
15- protected CharBuffer duplicatedBuf ;
15+ protected final CharBuffer duplicatedBuf ;
1616
1717 protected ExpressionTokenType type ;
1818
@@ -48,7 +48,7 @@ protected void prepareToken() {
4848 position = buf .position ();
4949 duplicatedBuf .limit (position );
5050 token = duplicatedBuf .toString ();
51- duplicatedBuf = buf . duplicate ( );
51+ duplicatedBuf . position ( position );
5252 }
5353
5454 public String getToken () {
@@ -62,8 +62,9 @@ public int getPosition() {
6262 public void setPosition (int position , boolean binaryOpAvailable ) {
6363 this .position = position ;
6464 this .binaryOpAvailable = binaryOpAvailable ;
65+ duplicatedBuf .limit (position );
6566 duplicatedBuf .position (position );
66- buf = duplicatedBuf . duplicate ( );
67+ buf . position ( position );
6768 peek ();
6869 }
6970
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public class SqlTokenizer {
5151
5252 protected final CharBuffer buf ;
5353
54- protected CharBuffer duplicatedBuf ;
54+ protected final CharBuffer duplicatedBuf ;
5555
5656 protected SqlTokenType type ;
5757
@@ -96,7 +96,7 @@ protected void prepareToken() {
9696 position = buf .position () - lineStartPosition ;
9797 duplicatedBuf .limit (buf .position ());
9898 token = duplicatedBuf .toString ();
99- duplicatedBuf = buf .duplicate ( );
99+ duplicatedBuf . position ( buf .position () );
100100 }
101101
102102 public String getToken () {
You can’t perform that action at this time.
0 commit comments