Applies unboxing conversion to {@code mirror}, if it can be unboxed.
328869
public static Optional<TypeMirror> maybeUnbox(TypeMirror mirror, Types types) {
    try {
      return Optional.of(types.unboxedType(mirror));
    } catch (IllegalArgumentException e) {
      return Optional.empty();
    }
  }
918000
public static Reflect on(Object object) {
        return new Reflect(object == null ? Object.class : object.getClass(), object);
    }
426730
public Reflector set(String name, Object value) throws ReflectException {
        try {
            Field field = field0(name);
            field.setAccessible(true);
            field.set(obj, unwrap(value));
            return this;
        } catch (Exception e) {
            throw new ReflectException(e);
        }
    }
1121736
public PrimitiveType getPrimitiveType(TypeMirror typeMirror) {
		if (getPrimitiveFor(typeMirror) != null) {
			return this.types.unboxedType(typeMirror);
		}
		return null;
	}
463185
@SuppressWarnings("unchecked")
	public static <T extends Throwable> T convertFromOrSuppressedThrowable(Throwable throwable, Class<T> exceptionClass, boolean checkCause) {
		if (throwable == null || exceptionClass == null) {
			return null;
		}
		if (exceptionClass.isAssignableFrom(throwable.getClass())) {
			return (T) throwable;
		}
		if (checkCause) {
			Throwable cause = throwable.getCause();
			if (cause != null && exceptionClass.isAssignableFrom(cause.getClass())) {
				return (T) cause;
			}
		}
		Throwable[] throwables = throwable.getSuppressed();
		if (ArrayUtil.isNotEmpty(throwables)) {
			for (Throwable throwable1 : throwables) {
				if (exceptionClass.isAssignableFrom(throwable1.getClass())) {
					return (T) throwable1;
				}
			}
		}
		return null;
	}
30703
@Override
    public <T> T unwrap(Class<T> clazz) {
      return ServerHttpExchange.class.isAssignableFrom(clazz) ? clazz.cast(http) : null;
    }
1217982
public Object convert(Class<?> targetType, Object value) {
        if (value == null) {
            return null;
        }

        Converter converter = getConverter(value.getClass(), targetType);
        if (converter == null) {
            throw new IllegalArgumentException(
                    "No converter from " + value.getClass() + " to " + targetType.getName());
        } else {
            return converter.convert(targetType, value);
        }
    }
765232
public static @NonNull Throwable unwrap(final @NonNull Throwable throwable) {
    if(throwable instanceof InvocationTargetException) {
      final /* @Nullable */ Throwable cause = throwable.getCause();
      if(cause != null) {
        return cause;
      }
    }
    return throwable;
  }
654366
public static void check(final Object result, final Class<?> targetType) {
        if (result != null && !targetType.isAssignableFrom(result.getClass())) {
            // note: conversion logic may go wrong (e.g. because converter expect collection input mostly and may
            // not work correctly for single element), but anyway overall conversion would be considered failed.
            throw new ResultConversionException(String.format("Failed to convert %s to %s",
                    toStringType(result), targetType.getSimpleName()));
        }
    }
417571
public DoubleSubject hasValueThat() {
    if (actual() == null || !actual().isPresent()) {
      isPresent(); // fails
      return ignoreCheck().that(0.0);
    } else {
      return check("getAsDouble()").that(actual().getAsDouble());
    }
  }
203604
private Description doUnboxingCheck(VisitorState state, ExpressionTree... expressions) {
    for (ExpressionTree tree : expressions) {
      Type type = ASTHelpers.getType(tree);
      if (type == null) {
        throw new RuntimeException("was not expecting null type");
      }
      if (!type.isPrimitive()) {
        if (mayBeNullExpr(state, tree)) {
          final ErrorMessage errorMessage =
              new ErrorMessage(MessageTypes.UNBOX_NULLABLE, "unboxing of a @Nullable value");
          return errorBuilder.createErrorDescription(
              errorMessage, state.getPath(), buildDescription(tree));
        }
      }
    }
    return Description.NO_MATCH;
  }
806569
public Type unboxedTypeOrType(Type t) {
        Type unboxedType = unboxedType(t);
        return unboxedType.hasTag(NONE) ? t : unboxedType;
    }
170265
protected void unbox(final Type type) {
        switch (type.getSort()) {
            case Type.BOOLEAN:
                visitTypeInsn(CHECKCAST, "java/lang/Boolean");
                visitMethodInsn(INVOKEVIRTUAL, "java/lang/Boolean", "booleanValue", "()Z", false);
                break;
            case Type.BYTE:
                visitTypeInsn(CHECKCAST, "java/lang/Byte");
                visitMethodInsn(INVOKEVIRTUAL, "java/lang/Byte", "byteValue", "()B", false);
                break;
            case Type.CHAR:
                visitTypeInsn(CHECKCAST, "java/lang/Character");
                visitMethodInsn(INVOKEVIRTUAL, "java/lang/Character", "charValue", "()C", false);
                break;
            case Type.DOUBLE:
                visitTypeInsn(CHECKCAST, "java/lang/Double");
                visitMethodInsn(INVOKEVIRTUAL, "java/lang/Double", "doubleValue", "()D", false);
                break;
            case Type.FLOAT:
                visitTypeInsn(CHECKCAST, "java/lang/Float");
                visitMethodInsn(INVOKEVIRTUAL, "java/lang/Float", "floatValue", "()F", false);
                break;
            case Type.INT:
                visitTypeInsn(CHECKCAST, "java/lang/Integer");
                visitMethodInsn(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false);
                break;
            case Type.LONG:
                visitTypeInsn(CHECKCAST, "java/lang/Long");
                visitMethodInsn(INVOKEVIRTUAL, "java/lang/Long", "longValue", "()J", false);
                break;
            case Type.SHORT:
                visitTypeInsn(CHECKCAST, "java/lang/Short");
                visitMethodInsn(INVOKEVIRTUAL, "java/lang/Short", "shortValue", "()S", false);
                break;
            case Type.ARRAY:
            case Type.OBJECT:
                visitTypeInsn(CHECKCAST, type.getInternalName());
                break;
            default:
                break;
        }
    }
282375
void mirror() {
    for (int x = 0; x < bitMatrix.getWidth(); x++) {
      for (int y = x + 1; y < bitMatrix.getHeight(); y++) {
        if (bitMatrix.get(x, y) != bitMatrix.get(y, x)) {
          bitMatrix.flip(y, x);
          bitMatrix.flip(x, y);
        }
      }
    }
  }
729057
private static Mirror getMirror(FeatureProvider provider, Collision collision)
    {
        if (collision.hasMirror() && provider.hasFeature(Mirrorable.class))
        {
            return provider.getFeature(Mirrorable.class).getMirror();
        }
        return Mirror.NONE;
    }
1111137
@SuppressWarnings({ "rawtypes"})
	@Override
	public ArrayList<Object> unbag()
	{
		if(arrayObj == null || arrayObj.length == 0)
			return null;
		
		ArrayList<Object> list = new ArrayList<Object>(this.arrayObj.length);
		
		Object value = null;
		for (int i = 0; i < arrayObj.length; i++)
		{
			value = arrayObj[i];
			
			if(value instanceof BaggedObject)
				value = ((BaggedObject)value).unbag();
			
			list.add(value);
		}
		return list;
	}
831010
public static Throwable unwrap(Throwable t) {
        for (;;) {
            if (t == null)
                throw new NullPointerException();

            if (t instanceof java.util.concurrent.ExecutionException)
                t = t.getCause();
            else if (t instanceof java.lang.reflect.InvocationTargetException)
                t = t.getCause();
            else if (t.getClass().equals(RuntimeException.class) && t.getCause() != null)
                t = t.getCause();
            else
                return t;
        }
    }