Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Corruption when retrieving long values #72

Closed

Description

@chipkent

Great library. Thanks for writing it. Much better designed than the other options I looked at.

I found a data corruption bug when calling methods that return longs. The problem exists with both python 2.7 and 3.5. The code below will reproduce the problem. The bug is in the "d.getTime()" call. I've seen this problem with other calls to methods with a "long func()" signature.
https://gist.github.com/chipkent/555a33268044ce4cff19f379654d6965

When i run the reproducer code, I get:
Loading JPy 2.7
Fri Sep 02 14:05:11 MDT 2016
The following long should be >0
-327070828
Types: <type 'java.util.Date'> <type 'long'> <type 'long'>

Clearly the number of millis since the epoch should be positive.

Activity

  1. chipkent commented on Sep 2, 2016

    @chipkent
    ContributorAuthor

    BTW, the bad value is "buggy_value = (int) correct_value". I suspect during copy and paste some int code was copied over for long without replacing the type.

  2. chipkent commented on Sep 9, 2016

    @chipkent
    ContributorAuthor

    Thanks for the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions