Get the appropriate default value per JLS 4.5.4
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;
    }
146896
protected Object evaluateDefaultValue()
            throws JspException
    {
        Object val = _defaultValue;

        List defaults = null;
        if (val instanceof String) {
            defaults = new ArrayList();
            defaults.add(val);
        }
        else {
            Iterator optionsIterator = null;
            optionsIterator = IteratorFactory.createIterator(val);

            // default value is optional so only warn
            if (optionsIterator == null && _defaultValue != null)
                logger.warn(Bundle.getString("Tags_IteratorError",
                        new Object[]{getTagName(), "defaultValue", _defaultValue}));

            if (optionsIterator == null)
                optionsIterator = IteratorFactory.EMPTY_ITERATOR;

            defaults = new ArrayList();
            while (optionsIterator.hasNext()) {
                Object o = optionsIterator.next();
                defaults.add(o.toString());
            }
        }

        return defaults;
    }
332436
function defaultValue (req) {
  return (req.body && req.body._csrf) ||
    (req.query && req.query._csrf) ||
    (req.headers['csrf-token']) ||
    (req.headers['xsrf-token']) ||
    (req.headers['x-csrf-token']) ||
    (req.headers['x-xsrf-token'])
}
1308189
public static String getDefaultValueForType( JType type ) {
        JPrimitiveType primitiveType = type.isPrimitive();
        if ( null != primitiveType ) {
            return primitiveType.getUninitializedFieldExpression();
        }
        return "null";
    }
705179
function getValueChangeOption(objectBody, keyChange, changeOption, objectReturn) {
    let value = objectBody[keyChange] ? objectBody[keyChange] : changeOption.$default;
    if (changeOption.$get) {
        return isJsonString(value) ? JSON.parse(value) : value;
    }
    if (changeOption.$update) {
        return changeOption.$update(value, objectReturn)
    }
    if (changeOption.$set) {
        return changeOption.$set;
    }
}
983655
@Override
    public void validateDefault(InputProblemReporter rep, boolean normalize)
        throws XMLStreamException
    {
        // First, basic checks that it's a valid non-empty name:
        String def = validateDefaultName(rep, normalize);

        // And then that it's one of listed values:
        String shared = mEnumValues.find(def);
        if (shared == null) {
            reportValidationProblem(rep, "Invalid default value '"+def+"': has to be one of ("
                                    +mEnumValues+")");
        }

        // Ok, cool it's ok...
        if (normalize) {
            mDefValue.setValue(shared);
        }
    }
1093039
function defaults(target, defs) {
  if (target == null) target = {};
  var ret = {};
  var keys = Object.keys(defs);
  for (var i = 0, len = keys.length; i < len; i++) {
    var key = keys[i];
    ret[key] = target[key] || defs[key];
  }
  return ret;
}
626377
def _parse_bool_default_value(property_name, default_value_string):
    """"""
    lowercased_value_string = default_value_string.lower()
    if lowercased_value_string in {'0', 'false'}:
        return False
    elif lowercased_value_string in {'1', 'true'}:
        return True
    else:
        raise AssertionError(u'Unsupported default value for boolean property "{}": '
                             u'{}'.format(property_name, default_value_string))
1072210
def _get_default_values(self, default_values=None):
        """"""

        if not default_values:
            default_values = self.DEFAULT_VALUES

        if default_values:
            api_version = str(self._connection._apiVersion)
            values = default_values.get(api_version, {}).copy()
        else:
            values = {}

        return values
77159
def get_default(self, node):
        
        if node.inst.properties.get("rset", False):
            return rdltypes.OnReadType.rset
        elif node.inst.properties.get("rclr", False):
            return rdltypes.OnReadType.rclr
        else:
            return self.default
331596
Object getDefaultValue(Session session) {

        return defaultExpression == null ? null
                                         : defaultExpression.getValue(session,
                                         dataType);
    }
460611
def get_default(name, value):
    """"""
    return os.environ.get('EXAMPLE_{}'.format(name.upper()), value)
1004165
def apply_defaults_from_client(args)
      return unless JSS::Client.installed?
      # these settings can come from the jamf binary config, if this machine is a JSS client.
      args[:server] ||= JSS::Client.jss_server
      args[:port] ||= JSS::Client.jss_port.to_i
      args[:use_ssl] ||= JSS::Client.jss_protocol.to_s.end_with? 's'
      args
    end
539088
def get_default(self, node):
        
        if node.inst.properties.get("onwrite", None) == rdltypes.OnWriteType.woclr:
            return True
        else:
            return self.default
1231776
private void checkAndApplyDefaultValue(Option o, Map<String, String> data) throws RequiredParametersException {
		if (hasNoDefaultValueAndNoValuePassedOnAlternativeName(o, data)) {
			throw new RequiredParametersException("No default value for undefined parameter " + o.getName());
		}
	}
245932
def _get_property_values_with_defaults(self, classname, property_values):
        """"""
        # To uphold OrientDB semantics, make a new dict with all property values set
        # to their default values, which are None if no default was set.
        # Then, overwrite its data with the supplied property values.
        final_values = self.get_default_property_values(classname)
        final_values.update(property_values)
        return final_values
563133
def default_value(self):
        
        if self.has_default:
            if hasattr(self.default, '__call__'):
                return self.default()
            else:
                return self.default
        else:
            raise Exception("No default value specified")