Here you can find the source of getImmutableDefaults()
public static synchronized Map<Class<?>, Object> getImmutableDefaults()
//package com.java2s; /**/*from w w w . jav a 2 s . c o m*/ * $Id: ConstructorUtils.java 61 2009-09-25 11:14:16Z azeckoski $ * $URL: http://reflectutils.googlecode.com/svn/trunk/src/main/java/org/azeckoski/reflectutils/ConstructorUtils.java $ * FieldUtils.java - genericdao - May 19, 2008 10:10:15 PM - azeckoski ************************************************************************** * Copyright (c) 2008 Aaron Zeckoski * Licensed under the Apache License, Version 2.0 * * A copy of the Apache License has been included in this * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt * * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk) */ import java.math.BigDecimal; import java.math.BigInteger; import java.sql.Timestamp; import java.util.Date; import java.util.HashMap; import java.util.Map; public class Main { private static Map<Class<?>, Object> immutableDefaults = null; private static char c; /** * @return the map of all immutable types -> the default values for those types */ public static synchronized Map<Class<?>, Object> getImmutableDefaults() { if (immutableDefaults == null || immutableDefaults.isEmpty()) { makeImmutableDefaultsMap(); } return immutableDefaults; } private static void makeImmutableDefaultsMap() { immutableDefaults = new HashMap<Class<?>, Object>(); immutableDefaults.put(BigDecimal.class, new BigDecimal(0)); immutableDefaults.put(BigInteger.class, BigInteger.valueOf(0l)); immutableDefaults.put(Boolean.class, Boolean.FALSE); immutableDefaults.put(Byte.class, Byte.valueOf((byte) 0)); immutableDefaults.put(Character.class, (Character) c); immutableDefaults.put(Date.class, new Date(0)); immutableDefaults.put(Double.class, Double.valueOf(0)); immutableDefaults.put(Float.class, Float.valueOf(0)); immutableDefaults.put(Long.class, Long.valueOf(0)); immutableDefaults.put(Integer.class, Integer.valueOf(0)); immutableDefaults.put(String.class, ""); immutableDefaults.put(Short.class, Short.valueOf((short) 0)); immutableDefaults.put(Timestamp.class, new Timestamp(0)); } }