mirror of https://github.com/apache/lucene.git
SOLR-7014: Collapse identical catch branches in try-catch statements in morphlines-core
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1653697 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0961e4179d
commit
ad298b70cf
|
@ -85,35 +85,27 @@ public final class LoadSolrBuilder implements CommandBuilder {
|
|||
if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) {
|
||||
try {
|
||||
loader.beginTransaction();
|
||||
} catch (SolrServerException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
} catch (SolrServerException | IOException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
}
|
||||
} else if (event == Notifications.LifecycleEvent.COMMIT_TRANSACTION) {
|
||||
try {
|
||||
loader.commitTransaction();
|
||||
} catch (SolrServerException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
} catch (SolrServerException | IOException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
}
|
||||
}
|
||||
else if (event == Notifications.LifecycleEvent.ROLLBACK_TRANSACTION) {
|
||||
try {
|
||||
loader.rollbackTransaction();
|
||||
} catch (SolrServerException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
} catch (SolrServerException | IOException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
}
|
||||
}
|
||||
else if (event == Notifications.LifecycleEvent.SHUTDOWN) {
|
||||
try {
|
||||
loader.shutdown();
|
||||
} catch (SolrServerException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
} catch (SolrServerException | IOException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
@ -127,9 +119,7 @@ public final class LoadSolrBuilder implements CommandBuilder {
|
|||
SolrInputDocument doc = convert(record);
|
||||
try {
|
||||
loader.load(doc);
|
||||
} catch (IOException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
} catch (SolrServerException e) {
|
||||
} catch (IOException | SolrServerException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
} finally {
|
||||
timerContext.stop();
|
||||
|
|
|
@ -140,11 +140,7 @@ public class SolrLocator {
|
|||
downloadedSolrHomeDir = Files.createTempDir();
|
||||
downloadedSolrHomeDir = zki.downloadConfigDir(zkClient, configName, downloadedSolrHomeDir);
|
||||
mySolrHomeDir = downloadedSolrHomeDir.getAbsolutePath();
|
||||
} catch (KeeperException e) {
|
||||
throw new MorphlineCompilationException("Cannot download schema.xml from ZooKeeper", config, e);
|
||||
} catch (InterruptedException e) {
|
||||
throw new MorphlineCompilationException("Cannot download schema.xml from ZooKeeper", config, e);
|
||||
} catch (IOException e) {
|
||||
} catch (KeeperException | InterruptedException | IOException e) {
|
||||
throw new MorphlineCompilationException("Cannot download schema.xml from ZooKeeper", config, e);
|
||||
} finally {
|
||||
zkClient.close();
|
||||
|
@ -161,11 +157,7 @@ public class SolrLocator {
|
|||
IndexSchema schema = new IndexSchema(solrConfig, "schema.xml", is);
|
||||
validateSchema(schema);
|
||||
return schema;
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
} catch (SAXException e) {
|
||||
} catch (ParserConfigurationException | IOException | SAXException e) {
|
||||
throw new MorphlineRuntimeException(e);
|
||||
}
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue