Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Replace ThreadContextClassLoader ignored with unnamed variable
Applied using: sift 'ThreadContextClassLoader ignored =' -l | while read file; do sed -i '' 's/ThreadContextClassLoader ignored/ThreadContextClassLoader _/g' "${file}"; done
  • Loading branch information
wendigo committed May 18, 2024
commit 86da57d6d6790bb88741ab462c89182a606e203f
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected void setConfiguredCatalogStore(String name, Map<String, String> proper
checkState(factory != null, "Catalog store %s is not registered", name);

CatalogStore catalogStore;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
catalogStore = factory.create(ImmutableMap.copyOf(properties));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public void shutdown()
return;
}

try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(connector.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(connector.getClass().getClassLoader())) {
connector.shutdown();
}
catch (Throwable t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private Connector createConnector(
pageSorter,
pageIndexerFactory);

try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(connectorFactory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(connectorFactory.getClass().getClassLoader())) {
return connectorFactory.create(catalogName, properties, context);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private EventListener createEventListener(File configFile)
checkArgument(factory != null, "Event listener factory '%s' is not registered. Available factories: %s", name, eventListenerFactories.keySet());

EventListener eventListener;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
eventListener = factory.create(properties);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public synchronized void loadExchangeManager(String name, Map<String, String> pr
checkArgument(factory != null, "Exchange manager factory '%s' is not registered. Available factories: %s", name, exchangeManagerFactories.keySet());

ExchangeManager exchangeManager;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
exchangeManager = factory.create(properties, new ExchangeManagerContextInstance(openTelemetry, tracer));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void setConfigurationManager(String name, Map<String, String> properties)
checkState(factory != null, "Resource group configuration manager '%s' is not registered", name);

ResourceGroupConfigurationManager<C> configurationManager;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
configurationManager = cast(factory.create(ImmutableMap.copyOf(properties), configurationManagerContext));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private SystemAccessControl createSystemAccessControl(File configFile)
checkState(factory != null, "Access control '%s' is not registered: %s", name, configFile);

SystemAccessControl systemAccessControl;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
systemAccessControl = factory.create(ImmutableMap.copyOf(properties), createContext(name));
}

Expand All @@ -231,7 +231,7 @@ public void loadSystemAccessControl(String name, Map<String, String> properties)
checkState(factory != null, "Access control '%s' is not registered", name);

SystemAccessControl systemAccessControl;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
systemAccessControl = factory.create(ImmutableMap.copyOf(properties), createContext(name));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected void setConfiguredGroupProvider(String name, Map<String, String> prope
checkState(factory != null, "Group provider %s is not registered", name);

GroupProvider groupProvider;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
groupProvider = factory.create(ImmutableMap.copyOf(properties));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private void loadPlugin(String plugin, Supplier<PluginClassLoader> createClassLo
}

handleResolver.registerClassLoader(pluginClassLoader);
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(pluginClassLoader)) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(pluginClassLoader)) {
loadPlugin(pluginClassLoader);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void setConfigurationManager(String name, Map<String, String> properties)
checkState(factory != null, "Session property configuration manager '%s' is not registered", name);

SessionPropertyConfigurationManager manager;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
manager = factory.create(properties, configurationManagerContext);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void loadCertificateAuthenticator()
checkState(factory != null, "Certificate authenticator '%s' is not registered", name);

CertificateAuthenticator authenticator;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
authenticator = factory.create(ImmutableMap.copyOf(properties));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private HeaderAuthenticator loadAuthenticator(File configFile)
checkState(factory != null, "Header authenticator '%s' is not registered", name);

HeaderAuthenticator authenticator;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
authenticator = factory.create(ImmutableMap.copyOf(properties));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private PasswordAuthenticator loadAuthenticator(File configFile)
checkState(factory != null, "Password authenticator '%s' is not registered", name);

PasswordAuthenticator authenticator;
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
authenticator = factory.create(ImmutableMap.copyOf(properties));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static Configuration newEmptyConfiguration()

private static Configuration newConfiguration(boolean loadDefaults)
{
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(ConfigurationUtils.class.getClassLoader())) {
try (ThreadContextClassLoader _ = new ThreadContextClassLoader(ConfigurationUtils.class.getClassLoader())) {
return new Configuration(loadDefaults);
}
}
Expand Down
Loading