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

Method hasEmptyBody

java/org/apache/jasper/compiler/Node.java:2141–2160  ·  view source on GitHub ↗

A custom action is considered to have an empty body if any of the following hold true: getBody() returns null all immediate children are jsp:attribute actions the action's jsp:body is empty @return true if this custom action has an empty body, and {@cod

()

Source from the content-addressed store, hash-verified

2139 * @return {@code true} if this custom action has an empty body, and {@code false} otherwise.
2140 */
2141 public boolean hasEmptyBody() {
2142 boolean hasEmptyBody = true;
2143 Nodes nodes = getBody();
2144 if (nodes != null) {
2145 int numChildNodes = nodes.size();
2146 for (int i = 0; i < numChildNodes; i++) {
2147 Node n = nodes.getNode(i);
2148 if (!(n instanceof NamedAttribute)) {
2149 if (n instanceof JspBody) {
2150 hasEmptyBody = (n.getBody() == null);
2151 } else {
2152 hasEmptyBody = false;
2153 }
2154 break;
2155 }
2156 }
2157 }
2158
2159 return hasEmptyBody;
2160 }
2161 }
2162
2163 /**

Callers 6

visitMethod · 0.80
visitMethod · 0.80
generateCustomStartMethod · 0.80
generateCustomEndMethod · 0.80
generateCustomDoTagMethod · 0.80

Calls 3

getBodyMethod · 0.95
sizeMethod · 0.95
getNodeMethod · 0.95

Tested by

no test coverage detected