Return-Path: X-Original-To: apmail-lucene-commits-archive@www.apache.org Delivered-To: apmail-lucene-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2122510FCF for ; Wed, 21 Jan 2015 22:58:28 +0000 (UTC) Received: (qmail 13985 invoked by uid 500); 21 Jan 2015 22:58:28 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 13975 invoked by uid 99); 21 Jan 2015 22:58:28 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jan 2015 22:58:28 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 92F79AC0059; Wed, 21 Jan 2015 22:58:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1653688 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/contrib/ solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ solr/contrib/morphlines-cell/src/java/org/apache/solr/morphlines/cell/ solr/core/ solr/core/src/java/o... Date: Wed, 21 Jan 2015 22:58:26 -0000 To: commits@lucene.apache.org From: shalin@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150121225827.92F79AC0059@hades.apache.org> Author: shalin Date: Wed Jan 21 22:58:25 2015 New Revision: 1653688 URL: http://svn.apache.org/r1653688 Log: SOLR-7014: Collapse identical catch branches in try-catch statements Modified: lucene/dev/branches/branch_5x/ (props changed) lucene/dev/branches/branch_5x/solr/ (props changed) lucene/dev/branches/branch_5x/solr/CHANGES.txt (contents, props changed) lucene/dev/branches/branch_5x/solr/contrib/ (props changed) lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java lucene/dev/branches/branch_5x/solr/contrib/morphlines-cell/src/java/org/apache/solr/morphlines/cell/SolrCellBuilder.java lucene/dev/branches/branch_5x/solr/core/ (props changed) lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/ZkController.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/Config.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/ZkContainer.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CollationField.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CurrencyField.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/EnumField.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/Grouping.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/TestRecoveryHdfs.java lucene/dev/branches/branch_5x/solr/solrj/ (props changed) lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original) +++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Wed Jan 21 22:58:25 2015 @@ -39,6 +39,10 @@ New Features * SOLR-6909: Extract atomic update handling logic into AtomicUpdateDocumentMerger class and enable subclassing. (Steve Davids, yonik) +Other Changes +---------------------- +* SOLR-7014: Collapse identical catch branches in try-catch statements. (shalin) + ================== 5.0.0 ================== Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release Modified: lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java (original) +++ lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java Wed Jan 21 22:58:25 2015 @@ -94,9 +94,7 @@ public class ExtractingRequestHandler ex if (config == null) { try { config = getDefaultConfig(core.getResourceLoader().getClassLoader()); - } catch (MimeTypeException e) { - throw new SolrException(ErrorCode.SERVER_ERROR, e); - } catch (IOException e) { + } catch (MimeTypeException | IOException e) { throw new SolrException(ErrorCode.SERVER_ERROR, e); } } Modified: lucene/dev/branches/branch_5x/solr/contrib/morphlines-cell/src/java/org/apache/solr/morphlines/cell/SolrCellBuilder.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/contrib/morphlines-cell/src/java/org/apache/solr/morphlines/cell/SolrCellBuilder.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/contrib/morphlines-cell/src/java/org/apache/solr/morphlines/cell/SolrCellBuilder.java (original) +++ lucene/dev/branches/branch_5x/solr/contrib/morphlines-cell/src/java/org/apache/solr/morphlines/cell/SolrCellBuilder.java Wed Jan 21 22:58:25 2015 @@ -245,11 +245,7 @@ public final class SolrCellBuilder imple try { parser.parse(inputStream, parsingHandler, metadata, parseContext); - } catch (IOException e) { - throw new MorphlineRuntimeException("Cannot parse", e); - } catch (SAXException e) { - throw new MorphlineRuntimeException("Cannot parse", e); - } catch (TikaException e) { + } catch (IOException | TikaException | SAXException e) { throw new MorphlineRuntimeException("Cannot parse", e); } } finally { Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java Wed Jan 21 22:58:25 2015 @@ -197,14 +197,9 @@ public class EmbeddedSolrServer extends // Now write it out NamedList normalized = BinaryResponseWriter.getParsedResponse(req, rsp); return normalized; - } - catch( IOException iox ) { + } catch( IOException | SolrException iox ) { throw iox; - } - catch( SolrException sx ) { - throw sx; - } - catch( Exception ex ) { + } catch( Exception ex ) { throw new SolrServerException( ex ); } finally { Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java Wed Jan 21 22:58:25 2015 @@ -91,12 +91,9 @@ public class SolrZkServer { if (zkProps.getClientPortAddress() == null) { zkProps.setClientPort(Integer.parseInt(solrPort)+1000); } - } catch (QuorumPeerConfig.ConfigException e) { + } catch (QuorumPeerConfig.ConfigException | IOException e) { if (zkRun != null) throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e); - } catch (IOException e) { - if (zkRun != null) - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e); } } @@ -186,9 +183,7 @@ class SolrZkServerProps extends QuorumPe return cfg; - } catch (IOException e) { - throw new ConfigException("Error processing " + path, e); - } catch (IllegalArgumentException e) { + } catch (IOException | IllegalArgumentException e) { throw new ConfigException("Error processing " + path, e); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/ZkController.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/ZkController.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/ZkController.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/ZkController.java Wed Jan 21 22:58:25 2015 @@ -855,12 +855,10 @@ public final class ZkController { // Restore the interrupted status Thread.currentThread().interrupt(); throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e); - } catch (KeeperException e) { - throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e); - } catch (IOException e) { + } catch (KeeperException | IOException e) { throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e); } - + // in this case, we want to wait for the leader as long as the leader might // wait for a vote, at least - but also long enough that a large cluster has @@ -2023,14 +2021,10 @@ public final class ZkController { stateData = zkClient.getData(znodePath, null, new Stat(), false); } catch (NoNodeException ignoreMe) { // safe to ignore as this znode will only exist if the leader initiated recovery - } catch (ConnectionLossException cle) { + } catch (ConnectionLossException | SessionExpiredException cle) { // sort of safe to ignore ??? Usually these are seen when the core is going down // or there are bigger issues to deal with than reading this znode log.warn("Unable to read "+znodePath+" due to: "+cle); - } catch (SessionExpiredException see) { - // sort of safe to ignore ??? Usually these are seen when the core is going down - // or there are bigger issues to deal with than reading this znode - log.warn("Unable to read "+znodePath+" due to: "+see); } catch (Exception exc) { log.error("Failed to read data from znode "+znodePath+" due to: "+exc); if (exc instanceof SolrException) { Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/Config.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/Config.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/Config.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/Config.java Wed Jan 21 22:58:25 2015 @@ -151,13 +151,7 @@ public class Config { if (substituteProps) { DOMUtil.substituteProperties(doc, getSubstituteProperties()); } - } catch (ParserConfigurationException e) { - SolrException.log(log, "Exception during parsing file: " + name, e); - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e); - } catch (SAXException e) { - SolrException.log(log, "Exception during parsing file: " + name, e); - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e); - } catch (TransformerException e) { + } catch (ParserConfigurationException | SAXException | TransformerException e) { SolrException.log(log, "Exception during parsing file: " + name, e); throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e); } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/ZkContainer.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/ZkContainer.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/ZkContainer.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/ZkContainer.java Wed Jan 21 22:58:25 2015 @@ -180,16 +180,12 @@ public class ZkContainer { log.error("Could not connect to ZooKeeper", e); throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e); - } catch (IOException e) { - log.error("", e); - throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, - "", e); - } catch (KeeperException e) { + } catch (IOException | KeeperException e) { log.error("", e); throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e); } - + } this.zkController = zkController; Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java Wed Jan 21 22:58:25 2015 @@ -676,9 +676,7 @@ public class SnapPuller { if (waitSearcher[0] != null) { try { waitSearcher[0].get(); - } catch (InterruptedException e) { - SolrException.log(LOG, e); - } catch (ExecutionException e) { + } catch (InterruptedException | ExecutionException e) { SolrException.log(LOG, e); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java Wed Jan 21 22:58:25 2015 @@ -596,9 +596,7 @@ public class RealTimeGetComponent extend // TODO: do any kind of validation here? updates.add(o); - } catch (SolrException e) { - log.warn("Exception reading log for updates", e); - } catch (ClassCastException e) { + } catch (SolrException | ClassCastException e) { log.warn("Exception reading log for updates", e); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java Wed Jan 21 22:58:25 2015 @@ -150,13 +150,9 @@ public abstract class SolrQueryParserBas Query res = TopLevelQuery(null); // pass null so we can tell later if an explicit field was provided or not return res!=null ? res : newBooleanQuery(false); } - catch (ParseException tme) { + catch (ParseException | TokenMgrError tme) { throw new SyntaxError("Cannot parse '" +query+ "': " + tme.getMessage(), tme); - } - catch (TokenMgrError tme) { - throw new SyntaxError("Cannot parse '" +query+ "': " + tme.getMessage(), tme); - } - catch (BooleanQuery.TooManyClauses tmc) { + } catch (BooleanQuery.TooManyClauses tmc) { throw new SyntaxError("Cannot parse '" +query+ "': too many boolean clauses", tmc); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CollationField.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CollationField.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CollationField.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CollationField.java Wed Jan 21 22:58:25 2015 @@ -180,11 +180,8 @@ public class CollationField extends Fiel input = loader.openResource(fileName); String rules = IOUtils.toString(input, "UTF-8"); return new RuleBasedCollator(rules); - } catch (IOException e) { - // io error - throw new RuntimeException(e); - } catch (ParseException e) { - // invalid rules + } catch (IOException | ParseException e) { + // io error or invalid rules throw new RuntimeException(e); } finally { IOUtils.closeQuietly(input); Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CurrencyField.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CurrencyField.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CurrencyField.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/CurrencyField.java Wed Jan 21 22:58:25 2015 @@ -836,13 +836,7 @@ class FileExchangeRateProvider implement addRate(tmpRates, fromCurrency, toCurrency, exchangeRate); } - } catch (SAXException e) { - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Error parsing currency config.", e); - } catch (IOException e) { - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Error parsing currency config.", e); - } catch (ParserConfigurationException e) { - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Error parsing currency config.", e); - } catch (XPathExpressionException e) { + } catch (SAXException | XPathExpressionException | ParserConfigurationException | IOException e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Error parsing currency config.", e); } } catch (IOException e) { Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/EnumField.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/EnumField.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/EnumField.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/schema/EnumField.java Wed Jan 21 22:58:25 2015 @@ -126,13 +126,7 @@ public class EnumField extends Primitive enumStringToIntMap.put(valueStr, i); } } - catch (ParserConfigurationException e) { - throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Error parsing enums config.", e); - } - catch (SAXException e) { - throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Error parsing enums config.", e); - } - catch (XPathExpressionException e) { + catch (ParserConfigurationException | XPathExpressionException | SAXException e) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Error parsing enums config.", e); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/Grouping.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/Grouping.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/Grouping.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/Grouping.java Wed Jan 21 22:58:25 2015 @@ -450,12 +450,9 @@ public class Grouping { } try { searcher.search(query, luceneFilter, collector); - } catch (TimeLimitingCollector.TimeExceededException x) { + } catch (TimeLimitingCollector.TimeExceededException | ExitableDirectoryReader.ExitingReaderException x) { logger.warn( "Query: " + query + "; " + x.getMessage() ); qr.setPartialResults(true); - } catch (ExitableDirectoryReader.ExitingReaderException e) { - logger.warn( "Query: " + query + "; " + e.getMessage() ); - qr.setPartialResults(true); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java Wed Jan 21 22:58:25 2015 @@ -233,12 +233,9 @@ public class SolrIndexSearcher extends I ((DelegatingCollector)collector).finish(); } } - catch( TimeLimitingCollector.TimeExceededException x ) { + catch( TimeLimitingCollector.TimeExceededException | ExitableDirectoryReader.ExitingReaderException x ) { log.warn( "Query: " + query + "; " + x.getMessage() ); qr.setPartialResults(true); - } catch ( ExitableDirectoryReader.ExitingReaderException e) { - log.warn("Query: " + query + "; " + e.getMessage()); - qr.setPartialResults(true); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java Wed Jan 21 22:58:25 2015 @@ -228,12 +228,9 @@ public class CommandHandler { try { searcher.search(query, luceneFilter, collector); - } catch (TimeLimitingCollector.TimeExceededException x) { + } catch (TimeLimitingCollector.TimeExceededException | ExitableDirectoryReader.ExitingReaderException x) { partialResults = true; logger.warn( "Query: " + query + "; " + x.getMessage() ); - } catch (ExitableDirectoryReader.ExitingReaderException e) { - partialResults = true; - logger.warn( "Query: " + query + "; " + e.getMessage() ); } if (includeHitCount) { Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java Wed Jan 21 22:58:25 2015 @@ -658,9 +658,7 @@ public class DirectUpdateHandler2 extend if (waitSearcher!=null && waitSearcher[0] != null) { try { waitSearcher[0].get(); - } catch (InterruptedException e) { - SolrException.log(log,e); - } catch (ExecutionException e) { + } catch (InterruptedException | ExecutionException e) { SolrException.log(log,e); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java Wed Jan 21 22:58:25 2015 @@ -66,9 +66,7 @@ public class HdfsUpdateLog extends Updat if (future != null) { try { future.get(); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } catch (ExecutionException e) { + } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } } @@ -264,8 +262,6 @@ public class HdfsUpdateLog extends Updat return path.getName().startsWith(prefix); } }); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java Wed Jan 21 22:58:25 2015 @@ -1302,10 +1302,6 @@ public class UpdateLog implements Plugin // versionInfo.unblockUpdates(); } } - } catch (InterruptedException e) { - SolrException.log(log,e); - } catch (IOException e) { - SolrException.log(log,e); } catch (Exception e) { SolrException.log(log,e); } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.java Wed Jan 21 22:58:25 2015 @@ -429,13 +429,7 @@ public class StatelessScriptUpdateProces } } - } catch (ScriptException e) { - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, - "Unable to invoke function " + name + - " in script: " + - engine.getScriptFile().getFileName() + - ": " + e.getMessage(), e); - } catch (NoSuchMethodException e) { + } catch (ScriptException | NoSuchMethodException e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unable to invoke function " + name + " in script: " + Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java Wed Jan 21 22:58:25 2015 @@ -125,9 +125,7 @@ public class URLClassifyProcessor extend document.setField(canonicalUrlFieldname, getCanonicalUrl(normalizedURL)); } log.debug(document.toString()); - } catch (MalformedURLException e) { - log.warn("cannot get the normalized url for \"" + url + "\" due to " + e.getMessage()); - } catch (URISyntaxException e) { + } catch (MalformedURLException | URISyntaxException e) { log.warn("cannot get the normalized url for \"" + url + "\" due to " + e.getMessage()); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java Wed Jan 21 22:58:25 2015 @@ -993,9 +993,7 @@ public class SolrPluginUtils { Class pClazz = method.getParameterTypes()[0]; Object val = entry.getValue(); method.invoke(bean, val); - } catch (InvocationTargetException e1) { - throw new RuntimeException("Error invoking setter " + setterName + " on class : " + clazz.getName(), e1); - } catch (IllegalAccessException e1) { + } catch (InvocationTargetException | IllegalAccessException e1) { throw new RuntimeException("Error invoking setter " + setterName + " on class : " + clazz.getName(), e1); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java Wed Jan 21 22:58:25 2015 @@ -559,9 +559,7 @@ public class BasicDistributedZkTest exte createCmd.setDataDir(getDataDir(core3dataDir)); client.request(createCmd); - } catch (SolrServerException e) { - throw new RuntimeException(e); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { throw new RuntimeException(e); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java Wed Jan 21 22:58:25 2015 @@ -919,10 +919,7 @@ public class CollectionsAPIDistributedZk CollectionAdminRequest.Delete delete = new CollectionAdminRequest.Delete(); delete.setCollectionName(collectionName); client.request(delete); - } catch (SolrServerException e) { - e.printStackTrace(); - throw new RuntimeException(e); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { e.printStackTrace(); throw new RuntimeException(e); } finally { Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java Wed Jan 21 22:58:25 2015 @@ -375,13 +375,11 @@ public class FullSolrCloudDistribCmdsTes try { uReq.process(cloudClient); uReq.process(controlClient); - } catch (SolrServerException e) { - throw new RuntimeException(e); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { throw new RuntimeException(e); } - + } } }; Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java Wed Jan 21 22:58:25 2015 @@ -170,10 +170,6 @@ public class LeaderElectionTest extends public void run() { try { setupOnConnect(); - } catch (InterruptedException e) { - log.error("setup failed", e); - es.close(); - return; } catch (Throwable e) { log.error("setup failed", e); es.close(); @@ -251,9 +247,7 @@ public class LeaderElectionTest extends ZkCoreNodeProps leaderProps = new ZkCoreNodeProps( ZkNodeProps.load(data)); return leaderProps.getCoreUrl(); - } catch (NoNodeException e) { - Thread.sleep(500); - } catch (SessionExpiredException e) { + } catch (NoNodeException | SessionExpiredException e) { Thread.sleep(500); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java Wed Jan 21 22:58:25 2015 @@ -55,9 +55,7 @@ public class TestRequestStatusCollection params.set("async", "1000"); try { sendRequest(params); - } catch (SolrServerException e) { - e.printStackTrace(); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { e.printStackTrace(); } @@ -74,9 +72,7 @@ public class TestRequestStatusCollection try { message = sendStatusRequestWithRetry(params, MAX_WAIT_TIMEOUT_SECONDS); - } catch (SolrServerException e) { - e.printStackTrace(); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { e.printStackTrace(); } @@ -90,9 +86,7 @@ public class TestRequestStatusCollection r = sendRequest(params); status = (NamedList) r.get("status"); message = (String) status.get("msg"); - } catch (SolrServerException e) { - e.printStackTrace(); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { e.printStackTrace(); } @@ -105,9 +99,7 @@ public class TestRequestStatusCollection params.set("async", "1001"); try { sendRequest(params); - } catch (SolrServerException e) { - e.printStackTrace(); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { e.printStackTrace(); } @@ -117,9 +109,7 @@ public class TestRequestStatusCollection params.set(OverseerCollectionProcessor.REQUESTID, "1001"); try { message = sendStatusRequestWithRetry(params, MAX_WAIT_TIMEOUT_SECONDS); - } catch (SolrServerException e) { - e.printStackTrace(); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { e.printStackTrace(); } @@ -135,9 +125,7 @@ public class TestRequestStatusCollection params.set("async", "1002"); try { sendRequest(params); - } catch (SolrServerException e) { - e.printStackTrace(); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { e.printStackTrace(); } @@ -149,9 +137,7 @@ public class TestRequestStatusCollection try { message = sendStatusRequestWithRetry(params, MAX_WAIT_TIMEOUT_SECONDS); - } catch (SolrServerException e) { - e.printStackTrace(); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { e.printStackTrace(); } @@ -168,9 +154,7 @@ public class TestRequestStatusCollection params.set("async", "1002"); try { r = sendRequest(params); - } catch (SolrServerException e) { - e.printStackTrace(); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { e.printStackTrace(); } Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java Wed Jan 21 22:58:25 2015 @@ -416,9 +416,7 @@ public class UnloadDistributedZkTest ext unloadCmd.setCoreName("multiunload" + freezeJ); try { adminClient.request(unloadCmd); - } catch (SolrServerException e) { - throw new RuntimeException(e); - } catch (IOException e) { + } catch (SolrServerException | IOException e) { throw new RuntimeException(e); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java Wed Jan 21 22:58:25 2015 @@ -176,9 +176,7 @@ public class ZkSolrClientTest extends Ab try { zkClient.makePath("collections/collection4", true); break; - } catch (KeeperException.SessionExpiredException e) { - - } catch (KeeperException.ConnectionLossException e) { + } catch (KeeperException.SessionExpiredException | KeeperException.ConnectionLossException e) { } Thread.sleep(1000 * i); @@ -289,9 +287,7 @@ public class ZkSolrClientTest extends Ab try { zkClient.getChildren("/collections", this, true); latch.countDown(); - } catch (KeeperException e) { - throw new RuntimeException(e); - } catch (InterruptedException e) { + } catch (KeeperException | InterruptedException e) { throw new RuntimeException(e); } } Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java Wed Jan 21 22:58:25 2015 @@ -21,7 +21,6 @@ import static java.util.Arrays.asList; import static org.apache.solr.core.ConfigOverlay.getObjectByPath; import static org.noggit.ObjectBuilder.getVal; -import java.io.IOException; import java.io.StringReader; import java.nio.charset.StandardCharsets; import java.text.MessageFormat; @@ -100,8 +99,6 @@ public class TestSolrConfigHandlerConcur ArrayList errs = new ArrayList(); collectErrors.add(errs); invokeBulkCall((String)e.getKey() , errs, (Map) e.getValue()); - } catch (IOException e) { - e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java Wed Jan 21 22:58:25 2015 @@ -22,7 +22,6 @@ import static java.text.MessageFormat.fo import static org.apache.solr.rest.schema.TestBulkSchemaAPI.getCopyFields; import static org.apache.solr.rest.schema.TestBulkSchemaAPI.getObj; -import java.io.IOException; import java.io.StringReader; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -98,8 +97,6 @@ public class TestBulkSchemaConcurrent e ArrayList errs = new ArrayList(); collectErrors.add(errs); invokeBulkCall(finalI,errs); - } catch (IOException e) { - e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/TestRecoveryHdfs.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/TestRecoveryHdfs.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/TestRecoveryHdfs.java (original) +++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/TestRecoveryHdfs.java Wed Jan 21 22:58:25 2015 @@ -82,12 +82,10 @@ public class TestRecoveryHdfs extends So try { URI uri = new URI(hdfsUri); fs = FileSystem.newInstance(uri, new Configuration()); - } catch (IOException e) { - throw new RuntimeException(e); - } catch (URISyntaxException e) { + } catch (IOException | URISyntaxException e) { throw new RuntimeException(e); } - + System.setProperty("solr.ulog.dir", hdfsUri + "/solr/shard1"); initCore("solrconfig-tlog.xml","schema15.xml"); Modified: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java (original) +++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java Wed Jan 21 22:58:25 2015 @@ -458,15 +458,7 @@ public class CloudSolrClient extends Sol Thread.currentThread().interrupt(); throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e); - } catch (KeeperException e) { - if (zk != null) zk.close(); - throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, - "", e); - } catch (IOException e) { - if (zk != null) zk.close(); - throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, - "", e); - } catch (TimeoutException e) { + } catch (KeeperException | TimeoutException | IOException e) { if (zk != null) zk.close(); throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "", e); Modified: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java?rev=1653688&r1=1653687&r2=1653688&view=diff ============================================================================== --- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java (original) +++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java Wed Jan 21 22:58:25 2015 @@ -92,10 +92,8 @@ public class QueryRequest extends SolrRe long endTime = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS); res.setElapsedTime(endTime - startTime); return res; - } catch (SolrServerException e){ + } catch (SolrServerException | SolrException e){ throw e; - } catch (SolrException s){ - throw s; } catch (Exception e) { throw new SolrServerException("Error executing query", e); }