You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2018/08/28 16:43:52 UTC
[1/2] lucene-solr:master: SOLR-12662: Reproducing TestPolicy
failures: NPE and NoClassDefFoundError
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x 86efdaa6b -> f6c06ae5e
refs/heads/master ca54137c8 -> 6430749d4
SOLR-12662: Reproducing TestPolicy failures: NPE and NoClassDefFoundError
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/6430749d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6430749d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6430749d
Branch: refs/heads/master
Commit: 6430749d46cda00bb591268ef3ade3386b927c73
Parents: ca54137
Author: Steve Rowe <sa...@apache.org>
Authored: Tue Aug 28 12:42:59 2018 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Tue Aug 28 12:42:59 2018 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +++
.../solrj/cloud/autoscaling/VariableBase.java | 16 ++++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6430749d/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 5733ce5..520e915 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -8146,6 +8146,9 @@ Bug Fixes
* SOLR-6693: bin\solr.cmd doesn't support 32-bit JRE/JDK running on Windows due to
parenthesis in JAVA_HOME. (Timothy Potter, Christopher Hewitt, Jan Høydahl)
+
+* SOLR-12662: Reproducing TestPolicy failures: NPE and NoClassDefFoundError.
+ (Steve Rowe)
Optimizations
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6430749d/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java
index 4387eb1..8b0c1cf 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java
@@ -77,7 +77,7 @@ public class VariableBase implements Variable {
}
public static Type getTagType(String name) {
- Type info = validatetypes.get(name);
+ Type info = getValidatetypes().get(name);
if (info == null && name.startsWith(ImplicitSnitch.SYSPROP)) info = Type.STRING;
if (info == null && name.startsWith(Clause.METRICS_PREFIX)) info = Type.LAZY;
return info;
@@ -196,11 +196,15 @@ public class VariableBase implements Variable {
}
- private static Map<String, Type> validatetypes;
+ private static Map<String, Type> validatetypes = null;
- static {
- validatetypes = new HashMap<>();
- for (Type t : Type.values())
- validatetypes.put(t.tagName, t);
+ /** SOLR-12662: Lazily init validatetypes to avoid Type.values() NPE due to static initializer ordering */
+ private static Map<String, Type> getValidatetypes() {
+ if (validatetypes == null) {
+ validatetypes = new HashMap<>();
+ for (Type t : Type.values())
+ validatetypes.put(t.tagName, t);
+ }
+ return validatetypes;
}
}
[2/2] lucene-solr:branch_7x: SOLR-12662: Reproducing TestPolicy
failures: NPE and NoClassDefFoundError
Posted by sa...@apache.org.
SOLR-12662: Reproducing TestPolicy failures: NPE and NoClassDefFoundError
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f6c06ae5
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f6c06ae5
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f6c06ae5
Branch: refs/heads/branch_7x
Commit: f6c06ae5e58d2c461c7bb7333b82aead753fa295
Parents: 86efdaa
Author: Steve Rowe <sa...@apache.org>
Authored: Tue Aug 28 12:42:59 2018 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Tue Aug 28 12:43:39 2018 -0400
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +++
.../solrj/cloud/autoscaling/VariableBase.java | 16 ++++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f6c06ae5/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 43d4bed..62e70d9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -8108,6 +8108,9 @@ Bug Fixes
* SOLR-6693: bin\solr.cmd doesn't support 32-bit JRE/JDK running on Windows due to
parenthesis in JAVA_HOME. (Timothy Potter, Christopher Hewitt, Jan Høydahl)
+
+* SOLR-12662: Reproducing TestPolicy failures: NPE and NoClassDefFoundError.
+ (Steve Rowe)
Optimizations
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f6c06ae5/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java
index 4387eb1..8b0c1cf 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VariableBase.java
@@ -77,7 +77,7 @@ public class VariableBase implements Variable {
}
public static Type getTagType(String name) {
- Type info = validatetypes.get(name);
+ Type info = getValidatetypes().get(name);
if (info == null && name.startsWith(ImplicitSnitch.SYSPROP)) info = Type.STRING;
if (info == null && name.startsWith(Clause.METRICS_PREFIX)) info = Type.LAZY;
return info;
@@ -196,11 +196,15 @@ public class VariableBase implements Variable {
}
- private static Map<String, Type> validatetypes;
+ private static Map<String, Type> validatetypes = null;
- static {
- validatetypes = new HashMap<>();
- for (Type t : Type.values())
- validatetypes.put(t.tagName, t);
+ /** SOLR-12662: Lazily init validatetypes to avoid Type.values() NPE due to static initializer ordering */
+ private static Map<String, Type> getValidatetypes() {
+ if (validatetypes == null) {
+ validatetypes = new HashMap<>();
+ for (Type t : Type.values())
+ validatetypes.put(t.tagName, t);
+ }
+ return validatetypes;
}
}