mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Fix Daemon Error
Reflection issue when initializing the daemon; trying to call a constructor with one argument using two arguments. Removed an unused constructor.
This commit is contained in:
parent
9688827a39
commit
830daab8f4
@ -137,7 +137,7 @@ public class HTTPDaemon extends FreedomService
|
||||
|
||||
private void module(String name, Class<? extends HTTPDModule> clazz, boolean async)
|
||||
{
|
||||
modules.put(name, ModuleExecutable.forClass(plugin, clazz, async));
|
||||
modules.put(name, ModuleExecutable.forClass(clazz, async));
|
||||
}
|
||||
|
||||
private class HTTPD extends NanoHTTPD
|
||||
@ -147,11 +147,6 @@ public class HTTPDaemon extends FreedomService
|
||||
super(port);
|
||||
}
|
||||
|
||||
private HTTPD(String hostname, int port)
|
||||
{
|
||||
super(hostname, port);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response serve(HTTPSession session)
|
||||
{
|
||||
|
@ -15,12 +15,12 @@ public abstract class ModuleExecutable
|
||||
this.async = async;
|
||||
}
|
||||
|
||||
public static ModuleExecutable forClass(final TotalFreedomMod plugin, Class<? extends HTTPDModule> clazz, boolean async)
|
||||
public static ModuleExecutable forClass(Class<? extends HTTPDModule> clazz, boolean async)
|
||||
{
|
||||
final Constructor<? extends HTTPDModule> cons;
|
||||
try
|
||||
{
|
||||
cons = clazz.getConstructor(TotalFreedomMod.class, NanoHTTPD.HTTPSession.class);
|
||||
cons = clazz.getConstructor(NanoHTTPD.HTTPSession.class);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -34,7 +34,7 @@ public abstract class ModuleExecutable
|
||||
{
|
||||
try
|
||||
{
|
||||
return cons.newInstance(plugin, session).getResponse();
|
||||
return cons.newInstance(session).getResponse();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user