java 17 fix

This commit is contained in:
Daniella 2022-04-30 12:15:00 +02:00
parent 2428fe3035
commit fd5e2e737f

View file

@ -184,6 +184,9 @@ public class ISBPL {
if(stop.amount == -1) { if(stop.amount == -1) {
System.exit(exitCode); System.exit(exitCode);
} }
} catch (ISBPLError err) {
if(err.type.equals("Java"))
((Throwable)s.pop().object).printStackTrace();
} }
}).start(); }).start();
return i.get(); return i.get();
@ -1090,6 +1093,7 @@ public class ISBPL {
} }
} }
// TODO: Resolve with subclass weight
public Object[] resolve(AtomicInteger mid, Stack<ISBPLObject> stack, int paramCount, Class<?>[][] paramTypes) { public Object[] resolve(AtomicInteger mid, Stack<ISBPLObject> stack, int paramCount, Class<?>[][] paramTypes) {
ISBPLObject[] o = new ISBPLObject[paramCount]; ISBPLObject[] o = new ISBPLObject[paramCount];
Object[][] params = new Object[paramTypes.length][paramCount]; Object[][] params = new Object[paramTypes.length][paramCount];
@ -1556,9 +1560,13 @@ public class ISBPL {
return bytes.toString(); return bytes.toString();
} }
// Used for theSafe
private static class FakeAccessibleObject {
boolean override;
}
private static void forceAccessible(AccessibleObject thing) { private static void forceAccessible(AccessibleObject thing) {
try { try {
theSafe.putBoolean(thing, theSafe.objectFieldOffset(AccessibleObject.class.getDeclaredField("override")), true); theSafe.putBoolean(thing, theSafe.objectFieldOffset(FakeAccessibleObject.class.getDeclaredField("override")), true);
} catch(Exception e) { //we are doomed } catch(Exception e) { //we are doomed
e.printStackTrace(); e.printStackTrace();
System.err.println("Failed to set accessible property. We are doomed."); System.err.println("Failed to set accessible property. We are doomed.");