Skip to content

java.lang.Integer produces a different generated output on ubuntu-beta! #696

Open

Description

@HosseinYousefi
No description provided.

Activity

  1. dcharkes commented on Dec 13, 2022

    @dcharkes
    Collaborator
       static final _parseInt1 = jniLookup<
    +          ffi.NativeFunction<
    +              jni.JniResult Function(ffi.Pointer<ffi.Void>, ffi.Int32,
    +                  ffi.Int32, ffi.Int32)>>("Integer__parseInt1")
    +      .asFunction<
    +          jni.JniResult Function(ffi.Pointer<ffi.Void>, int, int, int)>();
    +
    +  /// from: static public int parseInt(java.lang.CharSequence charSequence, int i, int i1, int i2)
    +  static int parseInt1(jni.JObject charSequence, int i, int i1, int i2) =>
    +      _parseInt1(charSequence.reference, i, i1, i2).integer;
    +
    +  static final _parseInt2 = jniLookup<
               ffi.NativeFunction<
                   jni.JniResult Function(
    -                  ffi.Pointer<ffi.Void>)>>("Integer__parseInt1")
    +                  ffi.Pointer<ffi.Void>)>>("Integer__parseInt2")
           .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>();
     
       /// from: static public int parseInt(java.lang.String string)
    -  static int parseInt1(jni.JString string) =>
    -      _parseInt1(string.reference).integer;
    +  static int parseInt2(jni.JString string) =>
    +      _parseInt2(string.reference).integer;

    Looks like our tests are not robust with Java adding new methods.

    We should probably think of an approach that is less error prone. (We have the same issue with ffigen and libclang generating different bindings for different clang versions.)

  2. HosseinYousefi commented on Dec 13, 2022

    @HosseinYousefi
    ContributorAuthor

    IIRC, parseInt(charSequence, i, i1, i2) got added in Java 9, so this entire error is weird! Why does it not exist in the generated files to begin with? I'll need to look into this.

  3. mahesh-hegde commented on Mar 23, 2023

    @mahesh-hegde
    Contributor

    IIRC, parseInt(charSequence, i, i1, i2) got added in Java 9, so this entire error is weird! Why does it not exist in the generated files to begin with? I'll need to look into this.

    Sounds like a classpath issue. It's possible Android JARs were in class_path of config and got picked up when reference bindings were generated, but not on CI.

  4. added
    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
    on Mar 23, 2023
  5. mahesh-hegde commented on Apr 13, 2023

    @mahesh-hegde
    Contributor

    What's the status of this?

  6. HosseinYousefi commented on Apr 20, 2023

    @HosseinYousefi
    ContributorAuthor

    What's the status of this?

    Haven't been working on it. Need to see where the class paths are. Not a priority though.

  7. added
    good first issueA good starting issue for contributors (issues with this label will appear in /contribute)
    contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)
    and removed
    good first issueA good starting issue for contributors (issues with this label will appear in /contribute)
    on Jan 21, 2026
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

    area-summarizercontributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)package:jnipackage:jnigentype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions