apache / apache/dubbo

[Defect] About method "isPrimitive" in ClassUtils

Open
#5,665 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

The concrete code as below:

```java
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.