Java specify defaults values for primitive and reference types. This
        method returns the default value for a given type.

        :param str type_:   Name of type.
        :return:            Default value for this type.
327715
def get_default_value_by_type(type_, state=None):
        
        if type_ in ['byte', 'char', 'short', 'int', 'boolean']:
            return BVS('default_value_{}'.format(type_), 32)
        elif type_ == "long":
            return BVS('default_value_{}'.format(type_), 64)
        elif type_ == 'float':
            return FPS('default_value_{}'.format(type_), FSORT_FLOAT)
        elif type_ == 'double':
            return FPS('default_value_{}'.format(type_), FSORT_DOUBLE)
        elif state is not None:
            if type_ == 'java.lang.String':
                return SimSootValue_StringRef.new_string(state, StringS('default_value_{}'.format(type_), 1000))
            if type_.endswith('[][]'):
                raise NotImplementedError
                # multiarray = SimSootExpr_NewMultiArray.new_array(self.state, element_type, size)
                # multiarray.add_default_value_generator(lambda s: SimSootExpr_NewMultiArray._generate_inner_array(s, element_type, sizes))
                # return  multiarray
            elif type_.endswith('[]'):
                array = SimSootExpr_NewArray.new_array(state, type_[:-2], BVV(2, 32))
                return array
            else:
                return SimSootValue_ThisRef.new_object(state, type_, symbolic=True, init_object=False)
        else:
            # not a primitive type
            # => treat it as a reference
            return SootNullConstant()
702750
protected static Type getTypeReference(Object type) {
        if (type instanceof Type) {
            return (Type) type;
        } else if (type instanceof Class) {
            return Type.getType((Class) type);
        } else if (type instanceof String) {
            String className = type.toString();

            String internalName = getInternalName(className);
            if (className.endsWith("[]")) {
                internalName = "[L" + internalName + ";";
            }
            return Type.getObjectType(internalName);
        } else {
            throw new IllegalArgumentException("Type reference [" + type + "] should be a Class or a String representing the class name");
        }
    }
503917
public static Primitive getDefaultValue( Class<?> type )
    {
        if ( type == null )
            return Primitive.NULL;
        if ( Boolean.TYPE == type || Boolean.class == type )
            return Primitive.FALSE;
        if ( Character.TYPE == type || Character.class == type )
            return Primitive.ZERO_CHAR;
        if ( Byte.TYPE == type || Byte.class == type )
            return Primitive.ZERO_BYTE;
        if ( Short.TYPE == type || Short.class == type )
            return Primitive.ZERO_SHORT;
        if ( Integer.TYPE == type || Integer.class == type )
            return Primitive.ZERO_INT;
        if ( Long.TYPE == type || Long.class == type )
            return Primitive.ZERO_LONG;
        if ( Float.TYPE == type || Float.class == type )
            return Primitive.ZERO_FLOAT;
        if ( Double.TYPE == type || Double.class == type )
            return Primitive.ZERO_DOUBLE;
        if ( BigInteger.class == type )
            return Primitive.ZERO_BIG_INTEGER;
        if ( BigDecimal.class == type )
            return Primitive.ZERO_BIG_DECIMAL;
        return Primitive.NULL;
    }
112827
def first_value_of(self, name, default_value = None):
        
        vals = self.values_of(name)
        if vals is not None:
            return vals if type(vals) is not list else vals[0]
        return default_value
1126645
def validate_type(self, type_):
        
        if type_ is not None and type_ not in self.types_set:
            raise ValueError('Invalid type for %s:%s' % (self.__class__, type_))
621988
public static Object getPrimitiveDefaultValue(final Class<?> type) {
        
        Objects.requireNonNull(type, "type should not be null.");
        
        if(!type.isPrimitive()) {
            return null;
            
        } else if(boolean.class.isAssignableFrom(type)) {
            return false;
            
        } else if(char.class.isAssignableFrom(type)) {
            return '\u0000';
            
        } else if(byte.class.isAssignableFrom(type)) {
            return (byte)0;
            
        } else if(short.class.isAssignableFrom(type)) {
            return (short)0;
            
        } else if(int.class.isAssignableFrom(type)) {
            return 0;
            
        } else if(long.class.isAssignableFrom(type)) {
            return 0l;
            
        } else if(float.class.isAssignableFrom(type)) {
            return 0.0f;
            
        } else if(double.class.isAssignableFrom(type)) {
            return 0.0d;
        }
        
        return null;
        
    }
120102
public JvmTypeReference typeRef(JvmType type, JvmTypeReference... typeArgs) {
		int typeParams = 0;
		if (type instanceof JvmGenericType) {
			typeParams = ((JvmGenericType) type).getTypeParameters().size();
		}
		if (typeParams < typeArgs.length) {
			throw new IllegalArgumentException("The type "+type.getIdentifier()+" only declares "+typeParams+" type parameters. You passed "+typeArgs.length+".");
		}
		LightweightTypeReference reference = typeReferenceOwner.toPlainTypeReference(type);
		for (JvmTypeReference jvmTypeReference : typeArgs) {
			((ParameterizedTypeReference)reference).addTypeArgument(typeReferenceOwner.toLightweightTypeReference(jvmTypeReference));
		}
		return reference.toJavaCompliantTypeReference();
	}
443843
def get_default_val(self):
        """"""
        val = self.default
        while callable(val):
            val = val()
        return val
646429
def _parse_type(value, type_func):
        
        default = type_func(0)
        if value is None:
            return default
        try:
            return type_func(value)
        except ValueError:
            return default
1095251
def value(self, key, type_=None):
        
        if type_ is None:
            default = self._default_value(key)
            val = self._value(key, default)
            if type(val) == type(default):
                return val
            else:
                return self._convert_value(val, type(default))
        else:
            val = self._value(key, None)
            if val is None:
                return None
            return self._convert_value(val, type_)
1325030
public static String getPrimitiveDefault(Class type) {
        if (type == Boolean.class) {
            return "false";
        }
        if (type == Character.class) {
            return Character.toString((char) 0);
        }
        return "0";
    }
129960
def typecast(self, type_):
        
        self.value = SymbolTYPECAST.make_node(type_, self.value, self.lineno)
        return self.value is not None
346669
def get_default_value(self, state):
        
        if self._default_value_generator:
            return self._default_value_generator(state)
        else:
            return state.project.simos.get_default_value_by_type(self.element_type, state=state)
1267734
def _resolve_default(data_type, listify=False):
    """"""
    if isinstance(data_type, _ATOMIC):
        # A Python's object type needs to be left as is instead of being
        # wrapped into a NumPy type.
        out = (data_type.default if isinstance(data_type, Object)
               else _get_atomic_dtype(data_type)(data_type.default))
    elif isinstance(data_type, Array):
        element_default = _resolve_default(data_type.element_type,
                                           listify=listify)
        Sequence = list if listify else tuple
        shape = ((data_type.shape,) if isinstance(data_type.shape, int)
                 else data_type.shape)
        out = element_default
        for dimension in shape:
            out = Sequence(copy.deepcopy(out) for _ in _range(dimension))
    elif isinstance(data_type, Structure):
        if listify:
            out = [_resolve_default(field.type, listify=listify)
                   for field in data_type.fields]
        else:
            field_defaults = collections.OrderedDict(
                (field.name, _resolve_default(field.type, listify=listify))
                for field in data_type.fields)
            name = ('StructureDefault_%s' % (data_type.name,)
                    if data_type.name else 'StructureDefault')
            struct = collections.namedtuple(name, field_defaults.keys())
            out = struct(**field_defaults)

    return out
31612
def type=(type)
      allowed_values = ["lti1"]
      if type && !allowed_values.include?(type)
        fail ArgumentError, "invalid value for 'type', must be one of #{allowed_values}."
      end
      @type = type
    end
726615
@SuppressWarnings("unchecked")
	public <T> Converter<T> getDefaultConverter(Type type) {
		return (null == defaultConverterMap) ? null : (Converter<T>) defaultConverterMap.get(type);
	}
522402
def option_getter(type):
    
    option_getters = {None: ConfigParser.get,
                      int: ConfigParser.getint,
                      float: ConfigParser.getfloat,
                      bool: ConfigParser.getboolean}
    return option_getters.get(type, option_getters[None])