Title: Jython selects wrong overload when Boolean/boolean choices are involved
Type: Severity: normal
Components: Core Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: doublep, fwierzbicki, zyasoft
Priority: high Keywords:

Created on 2011-07-25.15:50:12 by doublep, last changed 2014-06-19.00:55:37 by zyasoft.

File name Uploaded Description Edit Remove doublep, 2011-07-25.15:50:11 standalone example demonstrating the bug
msg6584 (view) Author: (doublep) Date: 2011-07-25.15:50:11
This is a real-world failure with JFreeCharts.  Attached testcase is just what I saw there distilled to 20 lines, without dependencies.
msg7738 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-25.18:35:29
Thanks for the detailed report, sorry this has stagnated. I'll try to get this looked at. Setting to high to try to poke my future self.
msg8693 (view) Author: Jim Baker (zyasoft) Date: 2014-06-19.00:55:29
In part this is a historical artifact of how Python, and consequently, Jython, implemented boolean support. Prior to 2.3, there was no boolean type, only int support.

But we have moved on. The relevant logic is in ReflectedArgs; it selects integer first, which is a valid conversion from boolean, if the parameter is primitive (see the precedence method). We should special case this to select boolean first, since this clearly should have precedence.

2.7.0 is a good time to make this change, since it can break code.

Target beta 4
Date User Action Args
2014-06-19 00:55:37zyasoftsetversions: + Jython 2.7, - Jython 2.5
2014-06-19 00:55:29zyasoftsetnosy: + zyasoft
messages: + msg8693
2013-02-25 18:35:29fwierzbickisetpriority: high
assignee: fwierzbicki
messages: + msg7738
nosy: + fwierzbicki
versions: + Jython 2.5, - 2.5.1
2011-07-25 15:50:12doublepcreate