Skip to content

Add java.util.Collection.toArray(IntFunction<T[]>), introduced in JDK 11 #2565

@AsheraCordova

Description

@AsheraCordova

When we try to compile this file:

https://github.com/AsheraCordova/AndroidJ/blob/main/src/main/java/r/android/util/MapCollections.java

The source is translated to objc.

But gives the following error:

  • (IOSObjectArray *)toArrayWithJavaUtilFunctionIntFunction:(id)arg0 {
    return JavaUtilCollection_toArrayWithJavaUtilFunctionIntFunction_(self, arg0);
    }

JavaUtilCollection_toArrayWithJavaUtilFunctionIntFunction_ is not found.. I hato manually remove this method.

I think that:

default <T> T[] toArray(IntFunction<T[]> generator) {
    return toArray(generator.apply(0));
}

has not been implemented in java.util.Collection but the translator is generating the code

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