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

Method insertMap

java/org/apache/catalina/mapper/Mapper.java:1480–1489  ·  view source on GitHub ↗

Insert into the right place in a sorted MapElement array, and prevent duplicates.

(MapElement<T>[] oldMap, MapElement<T>[] newMap, MapElement<T> newElement)

Source from the content-addressed store, hash-verified

1478 * Insert into the right place in a sorted MapElement array, and prevent duplicates.
1479 */
1480 private static <T> boolean insertMap(MapElement<T>[] oldMap, MapElement<T>[] newMap, MapElement<T> newElement) {
1481 int pos = find(oldMap, newElement.name);
1482 if ((pos != -1) && (newElement.name.equals(oldMap[pos].name))) {
1483 return false;
1484 }
1485 System.arraycopy(oldMap, 0, newMap, 0, pos + 1);
1486 newMap[pos + 1] = newElement;
1487 System.arraycopy(oldMap, pos + 1, newMap, pos + 2, oldMap.length - pos - 1);
1488 return true;
1489 }
1490
1491
1492 /**

Callers 5

addHostMethod · 0.95
addHostAliasImplMethod · 0.95
addContextVersionMethod · 0.95
addWrapperMethod · 0.95
addContextMethod · 0.80

Calls 2

findMethod · 0.95
equalsMethod · 0.65

Tested by

no test coverage detected