@Override
 public TransformResult finishBundle() throws Exception {
   try {
     return underlying.finishBundle();
   } catch (Exception e) {
     threadLocal.remove();
     throw e;
   }
 }