refs #7634
Change-Id: Icf20bfb365c8965fd1d8af960a0c82e14c45043f
SCLContext sclContext = SCLContext.getCurrent();
Object oldPrinter = sclContext.put(SCLReportingHandler.REPORTING_HANDLER, printer);
Object oldGraph = sclContext.put("graph", graph);
SCLContext sclContext = SCLContext.getCurrent();
Object oldPrinter = sclContext.put(SCLReportingHandler.REPORTING_HANDLER, printer);
Object oldGraph = sclContext.put("graph", graph);
- fn.apply(Tuple0.INSTANCE);
- sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
- sclContext.put("graph", oldGraph);
+ try {
+ fn.apply(Tuple0.INSTANCE);
+ } finally {
+ sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter);
+ sclContext.put("graph", oldGraph);
+ }