Skip to content

forbidden apis does not detect signature polymorphic methods #105

Closed
@rmuir

Description

@rmuir

I want to ban MethodHandle.invoke() for some reasons (e.g. its lenient in tests, slow in production, but has a too easy sounding name). If someone wants to do the same thing, they can be explicit they want that.

But forbidden apis never detects violations, because they won't match a "wildcard" signature for these methods (since any parameters can be pushed on stack as-is). Instead it ignores all uses of this method.

A method is signature polymorphic if all of the following are true:
    It is declared in the java.lang.invoke.MethodHandle class.
    It takes a single variable arity parameter (§8.4.1) whose declared type is Object[].
    It has a return type of Object.
    It is native.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions