This automatically-generated patch replaces explicit Closeable
handling with try-with-resources.
Change-Id: Ib707d30dd9730fed5dacefa60d7f61c9010e2909
Signed-off-by: Stephen Kitt <skitt@redhat.com>
return;
}
- ConfigSubsystemFacade configFacade = configFacadeFactory.createFacade("BlueprintContainerRestartService");
- try {
+ try (ConfigSubsystemFacade configFacade = configFacadeFactory.createFacade(
+ "BlueprintContainerRestartService")) {
restartConfigModules(configModules, configFacade);
} catch (ParserConfigurationException | DocumentedException | ValidationException
| ConflictingVersionException e) {
LOG.error("Error restarting config modules", e);
} finally {
- configFacade.close();
bundleContext.ungetService(configFacadeFactoryRef);
}
}
private boolean isTopInDataStore() throws ReadFailedException {
- ReadOnlyTransaction readTx = getDataBroker().newReadOnlyTransaction();
- try {
+ try (ReadOnlyTransaction readTx = getDataBroker().newReadOnlyTransaction()) {
return readTx.read(LogicalDatastoreType.OPERATIONAL, TOP_PATH).checkedGet().isPresent();
- } finally {
- readTx.close();
}
}