comparison src/org/eclipse/jetty/io/AbstractBuffer.java @ 1026:6647dbc8be71

remove Buffer.CaseInsensitve
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 02 Nov 2016 23:52:33 -0600
parents 6be43ef1eb96
children 6d17a257b03f
comparison
equal deleted inserted replaced
1025:cf0367978d8b 1026:6647dbc8be71
83 return bytes; 83 return bytes;
84 } 84 }
85 85
86 private ByteArrayBuffer duplicate(int access) 86 private ByteArrayBuffer duplicate(int access)
87 { 87 {
88 Buffer b=this.buffer(); 88 return new ByteArrayBuffer(asArray(), 0, length(), access);
89 if (this instanceof Buffer.CaseInsensitve || b instanceof Buffer.CaseInsensitve)
90 return new ByteArrayBuffer.CaseInsensitive(asArray(), 0, length(),access);
91 else
92 return new ByteArrayBuffer(asArray(), 0, length(), access);
93 } 89 }
94 90
95 public Buffer asImmutableBuffer() 91 public Buffer asImmutableBuffer()
96 { 92 {
97 if (isImmutable()) return this; 93 if (isImmutable()) return this;
148 144
149 // reject non buffers; 145 // reject non buffers;
150 if (obj == null || !(obj instanceof Buffer)) return false; 146 if (obj == null || !(obj instanceof Buffer)) return false;
151 Buffer b = (Buffer) obj; 147 Buffer b = (Buffer) obj;
152 148
153 if (this instanceof Buffer.CaseInsensitve || b instanceof Buffer.CaseInsensitve)
154 return equalsIgnoreCase(b);
155
156 // reject different lengths 149 // reject different lengths
157 if (b.length() != length()) return false; 150 if (b.length() != length()) return false;
158 151
159 // reject AbstractBuffer with different hash value 152 // reject AbstractBuffer with different hash value
160 if (_hash != 0 && obj instanceof AbstractBuffer) 153 if (_hash != 0 && obj instanceof AbstractBuffer)