MCPcopy Create free account
hub / github.com/apache/tomcat / createHeader

Method createHeader

java/org/apache/tomcat/util/http/MimeHeaders.java:280–301  ·  view source on GitHub ↗

Adds a partially constructed field to the header. This field has not had its name or value initialized.

()

Source from the content-addressed store, hash-verified

278 * Adds a partially constructed field to the header. This field has not had its name or value initialized.
279 */
280 private MimeHeaderField createHeader() {
281 if (limit > -1 && count >= limit) {
282 throw new IllegalStateException(sm.getString("headers.maxCountFail", Integer.valueOf(limit)));
283 }
284 MimeHeaderField mh;
285 int len = headers.length;
286 if (count >= len) {
287 // expand header list array
288 int newLength = count * 2;
289 if (limit > 0 && newLength > limit) {
290 newLength = limit;
291 }
292 MimeHeaderField[] tmp = new MimeHeaderField[newLength];
293 System.arraycopy(headers, 0, tmp, 0, len);
294 headers = tmp;
295 }
296 if ((mh = headers[count]) == null) {
297 headers[count] = mh = new MimeHeaderField();
298 }
299 count++;
300 return mh;
301 }
302
303 /**
304 * Create a new named header , return the MessageBytes container for the new value

Callers 3

duplicateMethod · 0.95
addValueMethod · 0.95
setValueMethod · 0.95

Calls 2

getStringMethod · 0.65
valueOfMethod · 0.45

Tested by

no test coverage detected