Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Defect] About method "isPrimitive" in ClassUtils #5665

@mercyblitz

Description

@mercyblitz

The concrete code as below:

    public static boolean isPrimitive(Class<?> type) {
        return type.isPrimitive()
                || type == String.class
                || type == Character.class
                || type == Boolean.class
                || type == Byte.class
                || type == Short.class
                || type == Integer.class
                || type == Long.class
                || type == Float.class
                || type == Double.class
                || type == Object.class;
    }

Actually, String.class and other classes should not be classified in the "primitive" type, as the "simple" type better, the javax.management.openmbean.SimpleType is an example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions