Skip to content

Commit

Permalink
Fix some deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
Mumfrey committed Mar 1, 2021
1 parent 4e4c72e commit 088e8bc
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void loadConnectors() {
}

try {
IMixinConnector connector = connectorClass.newInstance();
IMixinConnector connector = connectorClass.getDeclaredConstructor().newInstance();
this.connectors.add(connector);
MixinConnectorManager.logger.info("Successfully loaded Mixin Connector [" + connectorClassName + "]");
} catch (ReflectiveOperationException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public MixinContainer(MixinPlatformManager manager, IContainerHandle handle) {
String simpleName = clazz.getSimpleName();

MixinContainer.logger.debug("Instancing new {} for {}", simpleName, this.handle);
IMixinPlatformAgent agent = clazz.newInstance();
IMixinPlatformAgent agent = clazz.getDeclaredConstructor().newInstance();

AcceptResult acceptAction = agent.accept(manager, this.handle);
if (acceptAction == AcceptResult.ACCEPTED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ final void addTokenProvider(String provider) {
*/
final void addConnector(String connectorClass) {
this.connectors.addConnector(connectorClass);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ public MixinEnvironment registerTokenProviderClass(String providerName) {
@SuppressWarnings("unchecked")
Class<? extends IEnvironmentTokenProvider> providerClass =
(Class<? extends IEnvironmentTokenProvider>)this.service.getClassProvider().findClass(providerName, true);
IEnvironmentTokenProvider provider = providerClass.newInstance();
IEnvironmentTokenProvider provider = providerClass.getDeclaredConstructor().newInstance();
this.registerTokenProvider(provider);
} catch (Throwable th) {
MixinEnvironment.logger.error("Error instantiating " + providerName, th);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ enum CompatibilityMode {
if (!Strings.isNullOrEmpty(pluginClassName)) {
try {
Class<?> pluginClass = service.getClassProvider().findClass(pluginClassName, true);
plugin = (IMixinConfigPlugin)pluginClass.newInstance();
plugin = (IMixinConfigPlugin)pluginClass.getDeclaredConstructor().newInstance();
} catch (Throwable th) {
PluginHandle.logger.error("Error loading companion plugin class [{}] for mixin config [{}]. The plugin may be out of date: {}:{}",
pluginClassName, parent, th.getClass().getSimpleName(), th.getMessage(), th);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private List<IMixinPlatformServiceAgent> getServiceAgents() {
try {
@SuppressWarnings("unchecked")
Class<IMixinPlatformAgent> agentClass = (Class<IMixinPlatformAgent>)this.getClassProvider().findClass(agentClassName, false);
IMixinPlatformAgent agent = agentClass.newInstance();
IMixinPlatformAgent agent = agentClass.getDeclaredConstructor().newInstance();
if (agent instanceof IMixinPlatformServiceAgent) {
this.serviceAgents.add((IMixinPlatformServiceAgent)agent);
}
Expand Down

0 comments on commit 088e8bc

Please sign in to comment.