Skip to content

Add new (default) signatures #241

@rmannibucau

Description

@rmannibucau

Hi,

It would be neat to have some new built-in signature bundles.
I identified two needs:

  • Ensure there is no reflection in the code (ease graalvm native-image usage)
  • Ensure CompletionFutures async utilities are not called without an explicit constructor (can likely be extended to more calls but it was my immediate need)

Here is the signatures.txt I'm using right now (covers most of the common patterns I saw even if not 100% complete):

java.lang.Class @ No reflection using class api.
java.lang.invoke.MethodHandle @ No reflection using java.lang.invoke.MethodHandle api.

java.util.concurrent.CompletableFuture#supplyAsync(java.util.function.Supplier) @ No CompletableFuture.supplyAsync without an explicit executor.
java.util.concurrent.CompletableFuture#runAsync(java.lang.Runnable) @ No CompletableFuture.runAsync without an explicit executor.

Indeed I can bundle this as a jar and make it a dependency of the forbidden apis plugin but if it was built-in it would be more convenient to enable (in the same spirit than commons-io I'd say).

Hope it makes sense

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