> Introduce an instance method, `isClassOrInterface`, to `java.lang.Class` and 
> `java.lang.invoke.TypeDescriptor$OfField`.
> 
> `java.lang.constant.ClassDesc` comes with an `isClassOrInterface` method. It 
> turns out that such a check is frequently needed in the use of `Class` 
> objects, usually as `isArray() || isPrimitive()` or `!isArray() && 
> !isPrimitive()`, with 14 occurrences in various reflective code.
> 
> In addition, `Class` can offer a more efficient implementation than two 
> checks: it can perform a single bit pattern check to derive this result, 
> making such an API more feasible.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Chen Liang has updated the pull request incrementally with one additional 
commit since the last revision:

  Wording review from Joe

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/32109/files
  - new: https://git.openjdk.org/jdk/pull/32109/files/f3f029d4..937dd2ee

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=32109&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=32109&range=01-02

  Stats: 8 lines in 1 file changed: 3 ins; 1 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/32109.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32109/head:pull/32109

PR: https://git.openjdk.org/jdk/pull/32109

Reply via email to