public static Doclean assertDoclean() { Doclean doclean = context.value(); if (doclean == null) { throw new RuntimeException("Doclean is absent!!!"); } return doclean; }
/** * Runs the body of code within a cleanup context. If the context is null, establishes a new one. * * @param body */ public static void run(Runnable body) { Doclean doclean = context.value(); if (doclean != null) { body.run(); } else { runNew(body); } }