Skip to content

Jython 2.7.2 not calling the right overloaded java method for boolean #276

@yogi1967

Description

@yogi1967

I'm using 3rd party jar file which defines:

public class StreamTable extends HashMap {etc}
it defines:

public final void put(Object key, Object value)
**public final void put(String key, boolean value)
public final void put(Object key, boolean value)
public final void put(Object key, String value)
public Object put(String key, Object value)
public final void put(Object key, long value)
public final void put(String key, long value)
public final void put(String key, String value)
public final void put(Object key, int value)
public final void put(String key, int value)
etc

My Jython:
key="a"
value=True
if I call the object using .put(key, value) then it's not calling the .put(String key, boolean value) method. I'm fairly sure it's calling the .put(Object key, Object value) method (or one of the others).

However if I call .put(key, Boolean(value)) then it does call the right boolean method.

Is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions