-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Remove additional file-io from phantom generation, fix UI compil…
…er not loading in phantoms
- Loading branch information
Showing
7 changed files
with
112 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package me.coley.recaf.util; | ||
|
||
import java.lang.reflect.Constructor; | ||
|
||
/** | ||
* Reflection utils | ||
* | ||
* @author Matt | ||
*/ | ||
public class ReflectUtil { | ||
/** | ||
* @param type | ||
* Class to construct. | ||
* @param argTypes | ||
* Argument types. | ||
* @param args | ||
* Argument values. | ||
* @param <T> | ||
* Assumed class type. | ||
* | ||
* @return New instance of class. | ||
*/ | ||
public static <T> T quietNew(Class<T> type, Class<?>[] argTypes, Object[] args) { | ||
try { | ||
Constructor<T> constructor = type.getDeclaredConstructor(argTypes); | ||
constructor.setAccessible(true); | ||
return constructor.newInstance(args); | ||
} catch (ReflectiveOperationException ex) { | ||
throw new IllegalStateException("Constructor failure: " + type.getName(), ex); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters