Пример #1
0
 public static Doclean assertDoclean() {
   Doclean doclean = context.value();
   if (doclean == null) {
     throw new RuntimeException("Doclean is absent!!!");
   }
   return doclean;
 }
Пример #2
0
 /**
  * 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);
   }
 }