From 74633594d891d3f6eff61ad39310f6410dbfc313 Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Sat, 16 Jul 2016 19:54:43 +0530 Subject: [PATCH] SOLR-7280: precommit errors --- .../org/apache/solr/core/CoreContainer.java | 1 - .../java/org/apache/solr/core/CoreSorter.java | 33 +++++++++-------- .../org/apache/solr/core/CoreSorterTest.java | 36 +++++++++---------- 3 files changed, 33 insertions(+), 37 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java index 21f495ccb05..aa65f549a5c 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java +++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java @@ -36,7 +36,6 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.List; import java.util.Locale; import java.util.Map; diff --git a/solr/core/src/java/org/apache/solr/core/CoreSorter.java b/solr/core/src/java/org/apache/solr/core/CoreSorter.java index 807400975d2..4c37b8f2df3 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreSorter.java +++ b/solr/core/src/java/org/apache/solr/core/CoreSorter.java @@ -1,20 +1,3 @@ -package org.apache.solr.core; - -import java.util.Collection; -import java.util.Comparator; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - -import org.apache.solr.cloud.CloudDescriptor; -import org.apache.solr.common.cloud.ClusterState; -import org.apache.solr.common.cloud.DocCollection; -import org.apache.solr.common.cloud.Replica; -import org.apache.solr.common.cloud.Slice; - -import static java.util.Collections.emptyList; -import static java.util.stream.Collectors.toList; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -38,6 +21,22 @@ import static java.util.stream.Collectors.toList; * happening in other nodes of the cluster * */ +package org.apache.solr.core; + +import java.util.Collection; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + +import org.apache.solr.cloud.CloudDescriptor; +import org.apache.solr.common.cloud.ClusterState; +import org.apache.solr.common.cloud.DocCollection; +import org.apache.solr.common.cloud.Replica; +import org.apache.solr.common.cloud.Slice; + +import static java.util.Collections.emptyList; +import static java.util.stream.Collectors.toList; public class CoreSorter { Map shardsVsReplicaCounts = new LinkedHashMap<>(); CoreContainer cc; diff --git a/solr/core/src/test/org/apache/solr/core/CoreSorterTest.java b/solr/core/src/test/org/apache/solr/core/CoreSorterTest.java index 5b550bf9f00..3e5af201575 100644 --- a/solr/core/src/test/org/apache/solr/core/CoreSorterTest.java +++ b/solr/core/src/test/org/apache/solr/core/CoreSorterTest.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.solr.core; import java.util.ArrayList; @@ -27,24 +43,6 @@ import static org.easymock.EasyMock.expectLastCall; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.reset; - -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - public class CoreSorterTest extends SolrTestCaseJ4 { Map nodes = new LinkedHashMap<>(); Set liveNodes = new HashSet<>(); @@ -77,7 +75,7 @@ public class CoreSorterTest extends SolrTestCaseJ4 { for (int i = 0; i < 10; i++) { List copy = new ArrayList<>(l); - Collections.shuffle(copy); + Collections.shuffle(copy, random()); Collections.sort(copy, CoreSorter.countsComparator); for (int j = 0; j < copy.size(); j++) { assertEquals(expected.get(j), copy.get(j));