Returns ? extends X if any of bounds is a subtype of X[]; or null otherwise.
(Type[] bounds)
| 220 | */ |
| 221 | |
| 222 | @Nullable |
| 223 | private static Type subtypeOfComponentType(Type[] bounds) { |
| 224 | for (Type bound : bounds) { |
| 225 | Type componentType = getComponentType(bound); |
| 226 | if (componentType != null) { |
| 227 | // Only the first bound can be a class or array. |
| 228 | // Bounds after the first can only be interfaces. |
| 229 | if (componentType instanceof Class) { |
| 230 | Class<?> componentClass = (Class<?>) componentType; |
| 231 | if (componentClass.isPrimitive()) { |
| 232 | return componentClass; |
| 233 | } |
| 234 | } |
| 235 | return subtypeOf(componentType); |
| 236 | } |
| 237 | } |
| 238 | return null; |
| 239 | } |
| 240 | |
| 241 | private static final class GenericArrayTypeImpl implements GenericArrayType, Serializable { |
| 242 |
no test coverage detected