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

Method toVariableName

java/org/apache/tomcat/util/digester/Digester.java:495–512  ·  view source on GitHub ↗

Generate a variable name for the given object for use in generated code. @param object Object to generate a variable name for @return Generated variable name

(Object object)

Source from the content-addressed store, hash-verified

493 * @return Generated variable name
494 */
495 public String toVariableName(Object object) {
496 boolean found = false;
497 int pos = 0;
498 if (!known.isEmpty()) {
499 for (int i = known.size() - 1; i >= 0; i--) {
500 if (known.get(i) == object) {
501 pos = i;
502 found = true;
503 break;
504 }
505 }
506 }
507 if (!found) {
508 pos = known.size();
509 known.add(object);
510 }
511 return "tc_" + object.getClass().getSimpleName() + "_" + String.valueOf(pos);
512 }
513
514 // ------------------------------------------------------------- Properties
515

Callers 15

beginMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
bodyMethod · 0.80
beginMethod · 0.80
beginMethod · 0.80
beginMethod · 0.80
beginMethod · 0.80
beginMethod · 0.80
beginMethod · 0.80

Calls 5

getMethod · 0.65
addMethod · 0.65
isEmptyMethod · 0.45
sizeMethod · 0.45
valueOfMethod · 0.45

Tested by

no test coverage detected