Returns the no-args constructor for {@code type}, or null if no such
constructor exists.
164284
public static ExecutableElement getNoArgsConstructor(TypeElement type) {
    for (Element enclosed : type.getEnclosedElements()) {
      if (enclosed.getKind() != ElementKind.CONSTRUCTOR) {
        continue;
      }
      ExecutableElement constructor = (ExecutableElement) enclosed;
      if (constructor.getParameters().isEmpty()) {
        return constructor;
      }
    }
    return null;
  }
1118982
protected Constructor<?> getNIOFileResourceConstructor(Class<?>... args) {
		final String method = "getNIOFileResourceConstructor"; //$NON-NLS-1$

		if (tryNIO && nioFileResourceConstructor == null) {
			try {
				Class<?> clazz = getNIOFileResourceClass();
				if (clazz != null)
					nioFileResourceConstructor = clazz.getConstructor(args);
			} catch (NoSuchMethodException e) {
				tryNIO = false; // Don't try this again.
				if (log.isLoggable(Level.SEVERE)) {
					log.log(Level.SEVERE, e.getMessage(), e);
				}
				if (log.isLoggable(Level.WARNING))
					log.logp(Level.WARNING, CLAZZ, method, WARN_MESSAGE);
			} catch (SecurityException e) {
				tryNIO = false; // Don't try this again.
				if (log.isLoggable(Level.SEVERE)) {
					log.log(Level.SEVERE, e.getMessage(), e);
				}
				if (log.isLoggable(Level.WARNING))
					log.logp(Level.WARNING, CLAZZ, method, WARN_MESSAGE);
			}
		}
		return nioFileResourceConstructor;
	}
201623
private @NotNull <T> Optional<Instantiator<T>> implicitInstantiatorFrom(@NotNull Constructor<T> constructor, @NotNull NamedTypeList types) {
        if (!isPublic(constructor.getModifiers()))
            return Optional.empty();

        List<String> columnNames = types.getNames();
        return findTargetTypes(constructor, columnNames)
                .flatMap(targetTypes -> resolveConversions(types, targetTypes)
                        .map(conversions -> new ReflectionInstantiator<>(constructor, conversions, createPropertyAccessorsForValuesNotCoveredByConstructor(constructor, columnNames))));
    }
20042
public static Class<?>[] getTypes( Object[] args )
    {
        if ( args == null )
            return Reflect.ZERO_TYPES;

        Class<?>[] types = new Class[ args.length ];

        for( int i=0; i < args.length; i++ )
            types[i] = getType(args[i]);

        return types;
    }
1177875
public static Class<?> getType( Object arg, boolean boxed ) {
        if ( null == arg || Primitive.NULL == arg )
            return null;
        if ( arg instanceof Primitive && !boxed )
            return ((Primitive) arg).getType();
       return Primitive.unwrap(arg).getClass();
    }
968101
private Class<?> resolveArgument(Type type) {
    if (type instanceof ParameterizedType) {
      ParameterizedType paramType = (ParameterizedType) type;
      return resolveClass(paramType.getActualTypeArguments()[0]);
    } else if (type instanceof TypeVariable) {
      return resolveClass(type);
    } else if (type instanceof Class) {
      TypeVariable<?>[] typeParams = ((Class<?>) type).getTypeParameters();
      return resolveClass(typeParams[0]);
    }
    return null;
  }
300499
public static Type getTypeArgument(Type type) {
        if (!(type instanceof ParameterizedType)) {
            return null;
        }
        return ((ParameterizedType) type).getActualTypeArguments()[0];
    }
49113
public static Class<?> getFirstTypeArgument(Type type) {
        if (type instanceof ParameterizedType) {
            ParameterizedType p = (ParameterizedType) type;
            return getRawClass(p.getActualTypeArguments()[0]);
        } else {
            return null;
        }
    }
285059
public static <T> JavaType constructType(@Nonnull Argument<T> type, @Nonnull TypeFactory typeFactory) {
        ArgumentUtils.requireNonNull("type", type);
        ArgumentUtils.requireNonNull("typeFactory", typeFactory);
        Map<String, Argument<?>> typeVariables = type.getTypeVariables();
        JavaType[] objects = toJavaTypeArray(typeFactory, typeVariables);
        final Class<T> rawType = type.getType();
        if (ArrayUtils.isNotEmpty(objects)) {
            final JavaType javaType = typeFactory.constructType(
                    rawType
            );
            if (javaType.isCollectionLikeType()) {
                return typeFactory.constructCollectionLikeType(
                        rawType,
                        objects[0]
                );
            } else if (javaType.isMapLikeType()) {
                return typeFactory.constructMapLikeType(
                        rawType,
                        objects[0],
                        objects[1]
                );
            } else if (javaType.isReferenceType()) {
                return typeFactory.constructReferenceType(rawType, objects[0]);
            }
            return typeFactory.constructParametricType(rawType, objects);
        } else {
            return typeFactory.constructType(
                    rawType
            );
        }
    }
1230839
public final <T> Optional<T> getValue(Class<T> type) {
        return getValue(ConversionContext.of(type));
    }
150196
public static <T> Class<FieldParser<T>> getParserForType(Class<T> type) {
		Class<? extends FieldParser<?>> parser = PARSERS.get(type);
		if (parser == null) {
			return null;
		} else {
			@SuppressWarnings("unchecked")
			Class<FieldParser<T>> typedParser = (Class<FieldParser<T>>) parser;
			return typedParser;
		}
	}
1181372
public static <E> OptionalFunction<Selection<Constructor<?>>, E> instantiate(Object... args) {
    return OptionalFunction.of(selection -> factory.createInvoker(selection.result()).withArgs(args));
  }
153073
protected String argumentTypeString(final Type type) {
        if (type instanceof ParameterizedType) {
            final ParameterizedType parameterizedType = (ParameterizedType) type;
            final List<String> subs = new ArrayList<>();
            for (final Type actualType : parameterizedType.getActualTypeArguments())
                subs.add(argumentTypeString(actualType));
            return argumentTypeString(((ParameterizedType) type).getRawType()) + "[" + String.join(",", subs) + "]";
        } else if (type instanceof GenericArrayType) {
            return argumentTypeString(((GenericArrayType) type).getGenericComponentType()) + "[]";
        } else if (type instanceof WildcardType) {
            throw new RuntimeException("We don't support wildcards in arguments: " + type);
        } else if (type instanceof Class<?>) {
            return ((Class) type).getSimpleName();
        } else {
            throw new DocException("Unknown type: " + type);
        }
    }
170194
public static <T> T callConstructor(Class<T> c, Class<?>[] argTypes, Object[] args) {
        try {
            Constructor<T> cons = c.getConstructor(argTypes);
            return cons.newInstance(args);
        } catch(InvocationTargetException e) {
            throw getCause(e);
        } catch(IllegalAccessException e) {
            throw new IllegalStateException(e);
        } catch(NoSuchMethodException e) {
            throw new IllegalArgumentException(e);
        } catch(InstantiationException e) {
            throw new IllegalArgumentException(e);
        }
    }
677023
def get_nullable_type(type_):  # noqa: F811
    """"""
    if is_non_null_type(type_):
        type_ = cast(GraphQLNonNull, type_)
        type_ = type_.of_type
    return cast(Optional[GraphQLNullableType], type_)
621654
private <T> Instantiator<T> getByDefaultConstructor(TypeToken<T> type) {
    try {
      final Constructor<? super T> defaultCons = type.getRawType().getDeclaredConstructor();
      defaultCons.setAccessible(true);

      return new Instantiator<T>() {
        @Override
        public T create() {
          try {
            return (T) defaultCons.newInstance();
          } catch (Exception e) {
            throw Throwables.propagate(e);
          }
        }
      };

    } catch (NoSuchMethodException e) {
      return null;
    }
  }
474153
public static <T> Constructor<T> getConstructor(Class<T> type, Class<?>... parameterTypes) {
        try {
            return type.getConstructor(parameterTypes);
        } catch (NoSuchMethodException e) {
            log.error(StringUtils.format("类[{0}]中不存在参数列表为[{1}]的构造器", type,
                parameterTypes == null ? "null" : Arrays.toString(parameterTypes)));
            throw new ReflectException(StringUtils.format("类[{0}]中不存在参数列表为[{1}]的构造器", type,
                parameterTypes == null ? "null" : Arrays.toString(parameterTypes)), e);
        }
    }