Issue1323

classification
Title: PyList iterator() method; Java objects created in Python, when extracted from a PyList (used as a java.uti.List) in Java code do not get unwrapped
Type: behaviour Severity: normal
Components: Versions: Jython 2.5
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: MrMeanie, fwierzbicki, zyasoft
Priority: normal Keywords: patch

Created on 2009-04-22.12:30:55 by MrMeanie, last changed 2014-05-22.02:10:16 by zyasoft.

Files
File name Uploaded Description Edit Remove
Bug1323_test_20090422.zip MrMeanie, 2009-04-22.12:43:16 Bug 1323 unit test
Issue1323_list_iterator_fix_v1_20090422.patch MrMeanie, 2009-04-22.12:48:06 Patch to latest SVN (rev 6252)
Messages
msg4566 (view) Author: Geoffrey French (MrMeanie) Date: 2009-04-22.12:30:54
In Python code, create some Java objects (eg java.awt.Color). Place them
in a python list.
Pass this list as a parameter to a method of a Java object (as a
java.util.list), which iterates over the contents of the list, using an
iterator obtained from the iterator() method.
The objects received by the Java code are not unwrapped; you get
PyObjectDerived instances.

Problem:
The PyList.iterator() method returns an iterator obtained from the
underlying list. This is different from the implementation of
PyList.listIterator() which wraps the underlying iterator so that value
objects are wrapped and unwrapped as appropriate.
msg4567 (view) Author: Geoffrey French (MrMeanie) Date: 2009-04-22.12:43:16
Please find attached a unit test to demonstrate this bug.

A list of Java objects, created in Python, is passed to a java method,
which returns a list of their class names; this can be checked.
msg4568 (view) Author: Geoffrey French (MrMeanie) Date: 2009-04-22.12:48:06
Please find attached a patch that fixes this issue, by modifying the
PyList.iterator() method.

This patch also enhances Lib/test/test_java_list_delegate.py, so that test
failures give more info about the cause of the failure.
msg4580 (view) Author: Jim Baker (zyasoft) Date: 2009-04-23.07:40:20
Fixed in r6257, pending until a suitable unit test is added (something
based on the attached test should be fine).
msg4669 (view) Author: Jim Baker (zyasoft) Date: 2009-05-10.20:05:01
Changing to normal (not blocking RC), we have a couple of possible tests
here from MrMeanie, Josh Juneau, just need to integrate into regrtest
msg8551 (view) Author: Jim Baker (zyasoft) Date: 2014-05-22.02:10:16
This has been pending for the last 5 years. Someone should close it out :)

Apparently the test patch submitted by MrMeanie was applied as part of the overall fix in 6031:1890b51547ed
History
Date User Action Args
2014-05-22 02:10:16zyasoftsetstatus: pending -> closed
messages: + msg8551
2013-02-26 19:09:12fwierzbickisetversions: + Jython 2.5, - 25rc4
2009-08-05 21:31:10fwierzbickisetnosy: + fwierzbicki
2009-05-10 20:05:01zyasoftsetpriority: high -> normal
messages: + msg4669
2009-04-23 07:40:32zyasoftsetpriority: high
2009-04-23 07:40:22zyasoftsetstatus: open -> pending
assignee: zyasoft
resolution: fixed
messages: + msg4580
nosy: + zyasoft
2009-04-22 12:48:07MrMeaniesetfiles: + Issue1323_list_iterator_fix_v1_20090422.patch
keywords: + patch
messages: + msg4568
2009-04-22 12:43:16MrMeaniesetfiles: + Bug1323_test_20090422.zip
messages: + msg4567
2009-04-22 12:30:55MrMeaniecreate