Message4883
Please find attached a patch that fixes the issues relating to this bug
report.
Here is a description of the issues and fixes:
PyList.setSlice():
Invokes one of setslicePyList(), setsliceIterator(), or setsliceList()
to do the actual work, depending on the type of the source list.
setSliceList() was never invoked, due to:
} else if (vlaue != null && !(value instanceof List)) {
setsliceIterator(start, stop, step, value.asIterable().iterator());
} else {
// convert to list and invoke setsliceList()
}
The first test will fail on wrapped java.util.List objects, since they
will be of type PyObjectDerived, which does not implement java.util.List.
This if-else block has been modified so that setsliceList() will be used.
PyList.setsliceList():
This method does not work where the source list does not have the same
length as the destination slice; it fails with an index out of bounds
error. The implementation was replaced by copying setslicePyList(), and
modifying it slightly.
PyJavaType.ListIndexDelegate.setSlice():
This method does not work where the source list does not have the same
length as the destination slice; it fails with an index out of bounds
error. It used effectively the same code as PyList.setsliceList() did.
The implementation has been replaced by duplicating the
setslicePyList/setsliceIterator/setsliceList functionality of PyList.
Lib/test/test_java_list_delegate.py:
- Sizes of lists and ranges tested has been reduced. This should speed
this test up without comprimising its correctness.
- All slice tests now test None as a parameter when constructing the
slices, they didn't before; this resulted in some gaps in the testing.
- method test_set_slice_from_input_types() added to test the operation
of the modifications to the PyList slice setting methods
This patch has been tested with the regression test suite. |
|
Date |
User |
Action |
Args |
2009-07-05 14:45:53 | MrMeanie | set | recipients:
+ MrMeanie |
2009-07-05 14:45:53 | MrMeanie | set | messageid: <1246805153.47.0.90064467041.issue1397@psf.upfronthosting.co.za> |
2009-07-05 14:45:53 | MrMeanie | link | issue1397 messages |
2009-07-05 14:45:52 | MrMeanie | create | |
|