Replace anonymous class with ThreadLocal.withInitial
Java 8 Introduced ThreadLocal.withInitial which is a simpler alternative
to creating an anonymous inner class to initialise a ThreadLocal
instance.
Change-Id: I23a7cefc6318de35c03520893d671c05a2c3c0be
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfig.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfig.java
index 8da5b5d..d7193fd 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfig.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfig.java
@@ -57,12 +57,7 @@
private final Config gerritConfig;
private static final ThreadLocal<Project.NameKey> currentProjectName =
- new ThreadLocal<Project.NameKey>() {
- @Override
- protected Project.NameKey initialValue() {
- return null;
- }
- };
+ ThreadLocal.withInitial(() -> null);
public static void setCurrentProjectName(Project.NameKey projectName) {
currentProjectName.set(projectName);