RFR: JDK-8310267: Javadoc for Class#isPrimitive() is incorrect regarding Class objects for primitives

Pavel Rappo prappo at openjdk.org
Fri Jun 23 12:02:02 UTC 2023


On Fri, 23 Jun 2023 11:52:12 GMT, Sam Brannen <duke at openjdk.org> wrote:

> Along that line of thinking, it might be best to change the first sentence to "Determines if the specified Class object represents a primitive type or void."

I was just about to suggest exactly that, but from the superinterface method's perspective. Here's what I had been writing when received your message:

At the same, time java.lang.invoke.TypeDescriptor.OfField#isPrimitive:

        /**
         * Does this field descriptor describe a primitive type (including void.)
         *
         * @return whether this field descriptor describes a primitive type
         */
        boolean isPrimitive();

I suggest rephrasing that and similar text elsewhere, for example, as follows:

    /** {@return whether this field descriptor describes a primitive type or void} */
    boolean isPrimitive();

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14574#discussion_r1239730572


More information about the core-libs-dev mailing list