question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

superclass methods not accessible in 1.2.1

See original GitHub issue
arraylist = autoclass("java.util.ArrayList")()
arraylist.iterator()
arraylist.stream()

This works for 1.2.0 but not for 1.2.1.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-5e67e1c90388> in <module>()
----> 1 arraylist.stream()

AttributeError: 'java.util.ArrayList' object has no attribute 'stream'

Reproducible notebook at https://colab.research.google.com/drive/1F9u2jVQR5JFw_mk5Bq--VH1Ki91Xe5x3

stream() is defined in the super-interface as a default.

We also had problem accessing methods in interfaces that extended java.util.List.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:20 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
asmirnov69commented, Jan 25, 2020

I observe the same problem, superclass methods are not accessible in 1.2.1 but everything works in 1.2.0. This is quite nasty bug, don’t you think it make sense to remove 1.2.1 release or somehow mark it as unusable ?

1reaction
cmacdonaldcommented, Jan 29, 2020

I had wondered if this was a concurrency issue as per #480, but I don’t think pytest is concurrent by default.

I tried reproducing locally, but didn’t succeed in reproducing #480. Here was my command - its a Debian-based image:

docker run -i continuumio/anaconda3 /bin/bash <<EOF

cat /etc/os-release
apt-get update
mkdir /usr/share/man/man1
apt-get -y install openjdk-11-jdk-headless gcc ant

conda create -y -n pyjnius python=3.7.5
conda activate pyjnius

git clone https://github.com/kivy/pyjnius.git
cd pyjnius/
python -m pip install -U setuptools cython
python setup.py bdist_wheel
pip install --timeout=120 .[dev,ci]
ant all
cd tests/
CLASSPATH="../build/test-classes:../build/classes" PYTHONPATH=/opt/conda/envs/pyjnius/lib/python3.7/site-packages/ pytest -v
cd ../
git checkout -b issue_465 origin/issue_465

python setup.py bdist_wheel
pip install --timeout=120 .[dev,ci]
ant all
cd tests/
CLASSPATH="../build/test-classes:../build/classes" PYTHONPATH=/opt/conda/envs/pyjnius/lib/python3.7/site-packages/ pytest -v

EOF

All tests passed on master and on the branch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object of type super class not able to access method of Sub ...
I am a beginner in java and i am not able to understand what does this line B obj = new A(); mean....
Read more >
Chapter 8. Classes - Oracle Help Center
Any of C's superclasses has an abstract method declared with package access, and there exists no method that overrides the abstract method from...
Read more >
OOP Inheritance & Polymorphism - Java Programming Tutorial
A subclass inherits all the variables and methods from its superclasses, including its immediate parent as well as all the ancestors. It is...
Read more >
BeanInfoIndexedProperty (Apache Standard Taglib 1.2.1 API)
In this case, a publicly accessible version of the method must be found by searching for a public superclass/interface that declares the method...
Read more >
Python Tutorial - Object-Oriented Programming (OOP)
In Python, the overridden version replaces the inherited version, as shown in the above function references. To access superclass' version of a method,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found