mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-04 13:15:10 +00:00
generic tag panel: binary editor now can edit byte[]
This commit is contained in:
@@ -41,6 +41,10 @@ public class ReflectionTools {
|
||||
}
|
||||
|
||||
public static Object getValue(Object obj, Field field, int index) throws IllegalArgumentException, IllegalAccessException {
|
||||
if (index == -1) {
|
||||
return getValue(obj, field);
|
||||
}
|
||||
|
||||
if (getFieldSubSize(obj, field) <= index) {
|
||||
return null;
|
||||
}
|
||||
@@ -87,6 +91,11 @@ public class ReflectionTools {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void setValue(Object obj, Field field, int index, Object newValue) throws IllegalArgumentException, IllegalAccessException {
|
||||
if (index == -1) {
|
||||
setValue(obj, field, newValue);
|
||||
return;
|
||||
}
|
||||
|
||||
Object value = field.get(obj);
|
||||
if (needsIndex(field) && index >= getFieldSubSize(obj, field)) { //outofbounds, ignore
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user