You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2018/07/23 08:35:37 UTC

lucene-solr:jira/solr-11990: SOLR-11990: NPE removing unnecessary System.out.println

Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-11990 501bc6c1d -> 582f1fd98


SOLR-11990: NPE removing unnecessary System.out.println


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/582f1fd9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/582f1fd9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/582f1fd9

Branch: refs/heads/jira/solr-11990
Commit: 582f1fd98de93ab73c74a1f623749dd031beb381
Parents: 501bc6c
Author: Noble Paul <no...@apache.org>
Authored: Mon Jul 23 18:35:22 2018 +1000
Committer: Noble Paul <no...@apache.org>
Committed: Mon Jul 23 18:35:22 2018 +1000

----------------------------------------------------------------------
 .../solrj/cloud/autoscaling/Suggestion.java     | 51 +++++++++-----------
 1 file changed, 23 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/582f1fd9/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Suggestion.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Suggestion.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Suggestion.java
index 66efc43..18b3296 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Suggestion.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Suggestion.java
@@ -624,35 +624,30 @@ public class Suggestion {
 
     ConditionType() {
       try {
-        try {
-          meta = ConditionType.class.getField(name()).getAnnotation(Meta.class);
-          if (meta == null) {
-            throw new RuntimeException("Invalid type, should have a @Meta annotation " + name());
-          }
-        } catch (NoSuchFieldException e) {
-          //cannot happen
+        meta = ConditionType.class.getField(name()).getAnnotation(Meta.class);
+        if (meta == null) {
+          throw new RuntimeException("Invalid type, should have a @Meta annotation " + name());
         }
-        this.tagName = meta.name();
-        this.type = meta.type();
-
-        this.vals = readSet(meta.enumVals());
-        this.max = readNum(meta.max());
-        this.min = readNum(meta.min());
-        this.perReplicaValue = readStr(meta.associatedPerReplicaValue());
-        this.associatedPerNodeValues = readSet(meta.associatedPerNodeValue());
-        this.additive = meta.isAdditive();
-        this.metricsAttribute = readStr(meta.metricsKey());
-        this.isPerNodeValue = meta.isNodeSpecificVal();
-        this.supportedComputedTypes = meta.computedValues()[0] == ComputedType.NULL ?
-            emptySet() :
-            unmodifiableSet(new HashSet(Arrays.asList(meta.computedValues())));
-        this.isHidden = meta.isHidden();
-        this.wildCards = readSet(meta.wildCards());
-      } catch (RuntimeException e) {
-        System.out.println("%%%%%%%%ERROR");
-        e.printStackTrace();
-        throw e;
-      }
+      } catch (NoSuchFieldException e) {
+        //cannot happen
+      }
+      this.tagName = meta.name();
+      this.type = meta.type();
+
+      this.vals = readSet(meta.enumVals());
+      this.max = readNum(meta.max());
+      this.min = readNum(meta.min());
+      this.perReplicaValue = readStr(meta.associatedPerReplicaValue());
+      this.associatedPerNodeValues = readSet(meta.associatedPerNodeValue());
+      this.additive = meta.isAdditive();
+      this.metricsAttribute = readStr(meta.metricsKey());
+      this.isPerNodeValue = meta.isNodeSpecificVal();
+      this.supportedComputedTypes = meta.computedValues()[0] == ComputedType.NULL ?
+          emptySet() :
+          unmodifiableSet(new HashSet(Arrays.asList(meta.computedValues())));
+      this.isHidden = meta.isHidden();
+      this.wildCards = readSet(meta.wildCards());
+
     }
 
     private String readStr(String s) {