MCPcopy Create free account
hub / github.com/e2wugui/zeze / run

Method run

ZezeJava/ZezeJavaTest/src/Infinite/CoverHistory.java:176–205  ·  view source on GitHub ↗
(BValue value)

Source from the content-addressed store, hash-verified

174
175 public static class List9 implements Job {
176 @Override
177 public void run(BValue value) {
178/// logger.info("List9: {}", value.objectId());
179 var list = value.getList9();
180 var forceRemove = list.size() >= 3;
181 if (forceRemove) {
182 list.remove(getRandom().nextInt(list.size()));
183 } else {
184 switch (getRandom().nextInt(3)) {
185 case 0: // insert
186 if (list.isEmpty())
187 list.add(new Bean1());
188 else
189 list.add(getRandom().nextInt(list.size()), new Bean1());
190 break;
191
192 case 1: // remove
193 if (!list.isEmpty())
194 list.remove(getRandom().nextInt(list.size()));
195 break;
196
197 case 2: // modify.
198 if (list.isEmpty())
199 list.add(new Bean1()); // ensure modify
200 var randItem = list.get(getRandom().nextInt(list.size()));
201 randItem.setV1(getRandom().nextInt());
202 break;
203 }
204 }
205 }
206 }
207
208 public static class Set10 implements Job {

Callers

nothing calls this directly

Calls 7

getRandomMethod · 0.80
sizeMethod · 0.65
removeMethod · 0.65
isEmptyMethod · 0.65
addMethod · 0.65
getMethod · 0.65
nextIntMethod · 0.45

Tested by

no test coverage detected