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