Program: 178345
Project: 178345
Buggy source:
@Override public L2Character create(String name,AccountID accountID,ActorSex sex,CharacterClass characterClass,CharacterHairStyle hairStyle,CharacterHairColor hairColor,CharacterFace face) throws CharacterInvalidNameException, CharacterInvalidAppearanceException, CharacterNameAlreadyExistsException, CharacteCreationNotAllowedException, CharacterInvalidRaceException, CharacterInvalidSexException, TooManyCharactersException {
  if (!config.isCharacterCreationAllowed())   throw new CharacteCreationNotAllowedException();
  if (characterDao.countByAccount(accountID) < config.getMaxCharactersPerAccount())   throw new TooManyCharactersException();
  log.debug("String_Node_Str",new Object[]{name,sex,characterClass,hairStyle,hairColor,face});
  if ((name.length() < 1) || (name.length() > 16)) {
    throw new CharacterInvalidNameException();
  }
  if (sex == null || hairStyle == null || hairColor == null || face == null)   throw new CharacterInvalidAppearanceException();
  log.debug("String_Node_Str",name);
  final L2Character existenceCheck=characterDao.selectByName(name);
  if (existenceCheck != null)   throw new CharacterNameAlreadyExistsException();
  final CharacterTemplateID templateId=charTemplateIdProvider.resolveID(characterClass.id);
  final CharacterTemplate template=templateId.getTemplate();
  if (!ArrayUtils.contains(config.getAllowedNewCharacterRaces(),template.getRace()))   throw new CharacterInvalidRaceException();
  if (!ArrayUtils.contains(config.getAllowedNewCharacterGenders(),sex))   throw new CharacterInvalidSexException();
  log.debug("String_Node_Str",template);
  final CharacterID id=charIdProvider.createID();
  final L2Character character=template.create();
  log.debug("String_Node_Str",id,character);
  character.setID(id);
  character.setName(name);
  character.setAccountID(accountID);
  character.setSex(sex);
  character.setPoint(Point3D.fromXYZA(146783,25808,-2008,0));
  character.getAppearance().setHairStyle(hairStyle);
  character.getAppearance().setHairColor(hairColor);
  character.getAppearance().setFace(face);
  if (characterDao.save(character) > 0)   return character;
  return null;
}

Fixed version (ground truth):
@Override public L2Character create(String name,AccountID accountID,ActorSex sex,CharacterClass characterClass,CharacterHairStyle hairStyle,CharacterHairColor hairColor,CharacterFace face) throws CharacterInvalidNameException, CharacterInvalidAppearanceException, CharacterNameAlreadyExistsException, CharacteCreationNotAllowedException, CharacterInvalidRaceException, CharacterInvalidSexException, TooManyCharactersException {
  if (!config.isCharacterCreationAllowed())   throw new CharacteCreationNotAllowedException();
  if (characterDao.countByAccount(accountID) >= config.getMaxCharactersPerAccount())   throw new TooManyCharactersException();
  log.debug("String_Node_Str",new Object[]{name,sex,characterClass,hairStyle,hairColor,face});
  if ((name.length() < 1) || (name.length() > 16)) {
    throw new CharacterInvalidNameException();
  }
  if (sex == null || hairStyle == null || hairColor == null || face == null)   throw new CharacterInvalidAppearanceException();
  log.debug("String_Node_Str",name);
  final L2Character existenceCheck=characterDao.selectByName(name);
  if (existenceCheck != null)   throw new CharacterNameAlreadyExistsException();
  final CharacterTemplateID templateId=charTemplateIdProvider.resolveID(characterClass.id);
  final CharacterTemplate template=templateId.getTemplate();
  if (!ArrayUtils.contains(config.getAllowedNewCharacterRaces(),template.getRace()))   throw new CharacterInvalidRaceException();
  if (!ArrayUtils.contains(config.getAllowedNewCharacterGenders(),sex))   throw new CharacterInvalidSexException();
  log.debug("String_Node_Str",template);
  final CharacterID id=charIdProvider.createID();
  final L2Character character=template.create();
  log.debug("String_Node_Str",id,character);
  character.setID(id);
  character.setName(name);
  character.setAccountID(accountID);
  character.setSex(sex);
  character.setPoint(Point3D.fromXYZA(146783,25808,-2008,0));
  character.getAppearance().setHairStyle(hairStyle);
  character.getAppearance().setHairColor(hairColor);
  character.getAppearance().setFace(face);
  if (characterDao.save(character) > 0)   return character;
  return null;
}