MCPcopy Index your code
hub / github.com/apache/tomcat / setBufferValue

Method setBufferValue

java/org/apache/jasper/compiler/PageInfo.java:609–635  ·  view source on GitHub ↗

Sets the buffer value. @param value The buffer value @param n The node @param err The error dispatcher @throws JasperException if the buffer value is invalid

(String value, Node n, ErrorDispatcher err)

Source from the content-addressed store, hash-verified

607 * @throws JasperException if the buffer value is invalid
608 */
609 public void setBufferValue(String value, Node n, ErrorDispatcher err) throws JasperException {
610
611 if ("none".equalsIgnoreCase(value)) {
612 buffer = 0;
613 } else {
614 if (value == null || !value.endsWith("kb")) {
615 if (n == null) {
616 err.jspError("jsp.error.page.invalid.buffer");
617 } else {
618 err.jspError(n, "jsp.error.page.invalid.buffer");
619 }
620 }
621 try {
622 @SuppressWarnings("null") // value can't be null here
623 int k = Integer.parseInt(value.substring(0, value.length() - 2));
624 buffer = k * 1024;
625 } catch (NumberFormatException e) {
626 if (n == null) {
627 err.jspError("jsp.error.page.invalid.buffer");
628 } else {
629 err.jspError(n, "jsp.error.page.invalid.buffer");
630 }
631 }
632 }
633
634 bufferValue = value;
635 }
636
637 /**
638 * Returns the buffer value.

Callers 2

generateJavaMethod · 0.80
visitMethod · 0.80

Calls 5

endsWithMethod · 0.80
lengthMethod · 0.80
jspErrorMethod · 0.65
equalsIgnoreCaseMethod · 0.45
parseIntMethod · 0.45

Tested by

no test coverage detected