Program: 92267
Project: 92267
Buggy source:
/** 
 * Returns a new   {@code Boolean},   {@link Byte},   {@link Short},   {@code Integer},   {@link Long},  {@link Float},   {@code Double} or {@code String} instance to be considered as a nil value.The caller is responsible for registering the value in  {@link PrimitiveTypeProperties}. <p><b>REMINDER:<b> If more special cases are added, do not forget to update the   {@link #mayBeNil(Object)}method and to update the   {@link #createNilObject(Class)} and {@link #forObject(Object)} javadoc.</p><div class="note"><b>Implementation note:</b> There is no special case for  {@link Character} because Java {@code char}s are not really full Unicode characters. They are parts of UTF-16 encoding instead. If there is a need to represent a single Unicode character, we should probably still use a   {@link String} where the string contain 1 or 2 Java characters. This may also facilitate theencoding in the XML files, since many files use an other encoding than UTF-16 anyway.</div>
 * @throws IllegalArgumentException If the given type is not a supported type.
 */
private static Object createNilPrimitive(final Class<?> type){
  if (type == String.class)   return new String("String_Node_Str");
  if (type == Boolean.class)   return new Boolean(false);
  if (type == Byte.class)   return new Byte((byte)0);
  if (type == Short.class)   return new Short((byte)0);
  if (type == Integer.class)   return new Integer(0);
  if (type == Long.class)   return new Long(0);
  if (type == Float.class)   return new Float(Float.NaN);
  if (type == Double.class)   return new Double(Double.NaN);
  throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentValue_2,"String_Node_Str",type));
}

Fixed version (ground truth):
/** 
 * Returns a new   {@code Boolean},   {@link Byte},   {@link Short},   {@code Integer},   {@link Long},  {@link Float},   {@code Double} or {@code String} instance to be considered as a nil value.The caller is responsible for registering the value in  {@link PrimitiveTypeProperties}. <p><b>REMINDER:</b> If more special cases are added, do not forget to update the   {@link #mayBeNil(Object)}method and to update the   {@link #createNilObject(Class)} and {@link #forObject(Object)} javadoc.</p><div class="note"><b>Implementation note:</b> There is no special case for  {@link Character} because Java {@code char}s are not really full Unicode characters. They are parts of UTF-16 encoding instead. If there is a need to represent a single Unicode character, we should probably still use a   {@link String} where the string contain 1 or 2 Java characters. This may also facilitate theencoding in the XML files, since many files use an other encoding than UTF-16 anyway.</div>
 * @throws IllegalArgumentException If the given type is not a supported type.
 */
private static Object createNilPrimitive(final Class<?> type){
  if (type == String.class)   return new String("String_Node_Str");
  if (type == Boolean.class)   return new Boolean(false);
  if (type == Byte.class)   return new Byte((byte)0);
  if (type == Short.class)   return new Short((byte)0);
  if (type == Integer.class)   return new Integer(0);
  if (type == Long.class)   return new Long(0);
  if (type == Float.class)   return new Float(Float.NaN);
  if (type == Double.class)   return new Double(Double.NaN);
  throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentValue_2,"String_Node_Str",type));
}