Commit 5974e187 authored by DominikE's avatar DominikE

Add ability to call private constructors

parent d3458277
Pipeline #2532 passed with stage
in 40 seconds
......@@ -4,6 +4,7 @@
package edu.tigers.moduli;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -406,7 +407,9 @@ public class Moduli
{
try
{
return clazz.getConstructor().newInstance();
Constructor<? extends AModule> constructor = clazz.getDeclaredConstructor();
constructor.setAccessible(true);
return constructor.newInstance();
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException
| IllegalArgumentException e)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment