skript-reflect
skript-reflect copied to clipboard
corrected static and non-static accessors
This PR fixes ExprJavaCall.java's getters for methods.
If you for example have this code:
public class Test {
private final boolean isActive;
public Test() {
isActive = true;
}
public boolean isActive() {
return isActive;
}
public static boolean isActive(Test instance) {
return instance.isActive();
}
}
As Java compiles isActive() down to isActive(Test this) it falseley takes the instance method isActive instead of the correct method isActive(...).
Here's a small test:
on load:
set {_s} to Test.isActive(new Test())
set {_b} to new Test()
broadcast "-> %{_s}%"
broadcast "-> %{_b}.isActive()%"
Would be nice if someone could look over it If you have better ideas how to fix this feel free to contribute
Okay, what now?
Wait for another review or when we want to do a release