Skip to content

Commit 6a589d8

Browse files
committed
some rephrasing according to the review comments
1 parent 5377b9d commit 6a589d8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

app/pages/learn/01_tutorial/04_mastering-the-api/02_invoke/00_methodhandle.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ last_update: 2024-05-04
3131
Method handles are a low level mechanism used for method lookup and invocation. It is often compared to reflection,
3232
because both the Reflection API and method handles provide means to invoke methods, constructors and access fields.
3333

34-
What exactly is a method handle? It's a direct reference to a method, constructor, or field, which can be invoked.
34+
What exactly is a method handle? It's a directly invocable reference to an underlying method, constructor, or field.
3535
The Method Handle API allows manipulations on top of simple pointer to the method, that allow us to insert or reorder the
3636
arguments, or transform the return values, for example.
3737

@@ -618,11 +618,9 @@ In this tutorial, we have looked into the method handle mechanism and learned ho
618618
that method handles provide means for efficient method invocation, but this mechanism is not meant to replace the
619619
Reflection API.
620620

621-
The biggest differences are:
621+
Method handles offer a performance advantage for method invocation due to a different access checking approach. However,
622+
since access is checked only on method handle creation, method handles should be passed around with caution.
622623

623-
- Access checking happens only on method handle creation, which means that method handles should be passed around with
624-
caution.
625-
- Method invocation is more performant with method handles due to a different access checking approach.
626-
- Method handles don't provide any tooling for listing the class members and inspecting their properties.
627-
- Method handles make it easy to wrap the direct pointers to methods and fields into more complicated logic which
628-
includes argument and return value manipulations.
624+
Unlike the Reflection API, method handles don't provide any tooling for listing class members and inspecting their properties.
625+
On the other hand, the Method Handle API allows us to wrap direct pointers to methods and fields into more complex
626+
logic, such as argument and return value manipulations.

0 commit comments

Comments
 (0)