mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-04 13:15:10 +00:00
raw edit fix
This commit is contained in:
@@ -33,6 +33,11 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class ReflectionTools {
|
||||
|
||||
public static Object getValue(Object obj, Field field) throws IllegalArgumentException, IllegalAccessException {
|
||||
Object value = field.get(obj);
|
||||
return value;
|
||||
}
|
||||
|
||||
public static Object getValue(Object obj, Field field, int index) throws IllegalArgumentException, IllegalAccessException {
|
||||
if (getFieldSubSize(obj, field) <= index) {
|
||||
return null;
|
||||
@@ -74,6 +79,10 @@ public class ReflectionTools {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void setValue(Object obj, Field field, Object newValue) throws IllegalArgumentException, IllegalAccessException {
|
||||
field.set(obj, newValue);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void setValue(Object obj, Field field, int index, Object newValue) throws IllegalArgumentException, IllegalAccessException {
|
||||
Object value = field.get(obj);
|
||||
|
||||
Reference in New Issue
Block a user