MCPcopy Create free account
hub / github.com/ReadyTalk/avian / resize

Method resize

classpath/java/util/ArrayList.java:49–62  ·  view source on GitHub ↗
(int capacity)

Source from the content-addressed store, hash-verified

47 }
48
49 private void resize(int capacity) {
50 Object[] newArray = null;
51 if (capacity != 0) {
52 if (array != null && array.length == capacity) {
53 return;
54 }
55
56 newArray = new Object[capacity];
57 if (array != null) {
58 System.arraycopy(array, 0, newArray, 0, size);
59 }
60 }
61 array = newArray;
62 }
63
64 private static boolean equal(Object a, Object b) {
65 return (a == null && b == null) || (a != null && a.equals(b));

Callers 3

ArrayListMethod · 0.95
growMethod · 0.95
shrinkMethod · 0.95

Calls 1

arraycopyMethod · 0.95

Tested by

no test coverage detected