Closed LauLauThom closed 6 years ago
That's a Python/Jython limitation. True
and False
are simply 1
and 0
in Java, and will therefore be treated as int
s when trying to match overloaded Java methods.
The only solution I see would be to rename the put
methods in PrefService
to putBoolean
and putInt
to avoid overloading altogether. But that's only one of many places where overloaded methods are used, and Jython simply doesn't play well with them...
See jython issue #1781. There is a workaround given there:
from java.lang import Boolean
prefs.put(None, "persistedBool", Boolean(not retrievedValue))
And maybe some day, this will be fixed in Jython 3.x.
This was pointed on the forum by @imagejan
While it works with getInt