-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: failing test_hierharchy_arraylist
with jdk>=21
#736
Comments
i can confirm the tests failing and, I think, the original author of this test. I'll prepare a PR; getting the maintainers to merge it will be another matter! |
Java 18: {
'java.lang.Object': 3,
'java.lang.Iterable': 3,
'java.util.Collection': 2,
'java.util.AbstractCollection': 2,
'java.util.List': 1,
'java.util.AbstractList': 1,
'java.util.RandomAccess': 1,
'java.lang.Cloneable': 1,
'java.io.Serializable': 1,
'java.util.ArrayList': 0
} Java 21: {
'java.lang.Object': 3,
'java.lang.Iterable': 4,
'java.util.Collection': 3,
'java.util.AbstractCollection': 2,
'java.util.SequencedCollection': 2,
'java.util.List': 1,
'java.util.AbstractList': 1,
'java.util.RandomAccess': 1,
'java.lang.Cloneable': 1,
'java.io.Serializable': 1,
'java.util.ArrayList': 0
} java.util.SequencedCollection was introduced as an interface in the Collection -> List hierarchy in Java 21. This meant that Iterable is the highest numbered interface. As to whether Object not being the highest level is a problem, I note that autoclass() says https://github.com/kivy/pyjnius/blob/master/jnius/reflect.py#L232 # we now walk the hierarchy, from top of the tree, identifying methods
# hopefully we start at java.lang.Object But classes that are already done are ignored. (Also the level numbers seem to be ignored in autoclass()?) In this case, what could go wrong? I'm not sure anything unless there is a default method defined in the Iterable and also in Object (e.g. equals()?). |
Fixed via #741 |
When building pyjnius 1.6.1 against newer openjdk (21, 22) in conda-forge, things compile and run fine, with the exception of one test failure:
It seems all the expected hierarchy levels are still there, but either the hierarchy itself changed for real (meaning the test expectation is wrong), or the calculation in
identify_hierarchy_dict
needs to fix something to take into account the new reality.The text was updated successfully, but these errors were encountered: