MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / wrappedCall

Method wrappedCall

src/main/java/field/graphics/Scene.java:286–307  ·  view source on GitHub ↗
(Consumer<Integer> c, Integer i)

Source from the content-addressed store, hash-verified

284 }
285
286 private boolean wrappedCall(Consumer<Integer> c, Integer i) {
287 if (c == null) return false;
288 try {
289 if (c instanceof Perform)
290 return ((Perform) c).perform(i);
291 else
292 c.accept(i);
293
294 return true;
295 } catch (Throwable t) {
296 if (!(t instanceof Cancel)) exceptions.add(t);
297 else return false;
298 return true;
299 } finally {
300 try {
301 GraphicsContext.checkError(() -> "error on " + c);
302 } catch (IllegalStateException e) {
303 Errors.tryToReportTo(e, "pass " + i, c);
304 }
305
306 }
307 }
308
309 private boolean wrappedCall(Callable<Boolean> middle) {
310 if (middle == null) return false;

Callers 1

updateMethod · 0.95

Calls 6

checkErrorMethod · 0.95
tryToReportToMethod · 0.95
performMethod · 0.65
acceptMethod · 0.65
addMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected