Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mercyblitz opened this issue Jan 16, 2020 · 0 comments
Open

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

mercyblitz opened this issue Jan 16, 2020 · 0 comments
Milestone

Comments

@mercyblitz
Copy link
Contributor

mercyblitz commented Jan 16, 2020

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.

@mercyblitz mercyblitz added this to the 2.7.6 milestone Jan 16, 2020
@mercyblitz mercyblitz modified the milestones: 2.7.6, some day Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant