Skip to content

Conversation

Vulcano771
Copy link
Contributor

@Vulcano771 Vulcano771 commented Aug 31, 2025

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()%"

@Vulcano771
Copy link
Contributor Author

Would be nice if someone could look over it
If you have better ideas how to fix this feel free to contribute

Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine to me

@Vulcano771
Copy link
Contributor Author

Okay, what now?

@sovdeeth
Copy link
Member

sovdeeth commented Sep 3, 2025

Wait for another review or when we want to do a release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants