Buggy code:
@ Depends ( { WorldService . class , SpawnService . class , AttackService . class } ) public class CharacterServiceImpl extends AbstractConfigurableService < CharacterServiceConfiguration > implements CharacterService { private static final Logger log = LoggerFactory . getLogger ( CharacterServiceImpl . class ) ; private final BroadcastService broadcastService ; private final WorldEventDispatcherService eventDispatcher ; private final SpawnService spawnService ; private final NPCService npcService ; private final GameGuardService ggService ; private final CharacterDAO characterDao ; private final ItemDAO itemDao ; private final CharacterShortcutDAO shortcutDao ; private final CharacterIDProvider charIdProvider ; private final CharacterTemplateIDProvider charTemplateIdProvider ; private final Map < CharacterID , L2Character > onlineCharacters = CollectionFactory . newMap ( ) ; @ Inject public CharacterServiceImpl ( BroadcastService broadcastService , WorldEventDispatcherService eventDispatcher , SpawnService spawnService , NPCService npcService , GameGuardService ggService , CharacterDAO characterDao , ItemDAO itemDao , CharacterShortcutDAO shortcutDao , CharacterTemplateIDProvider charTemplateIdProvider , CharacterIDProvider charIdProvider ) { } @ Override public boolean canCreate ( AccountID accountID ) { } @ Override public L2Character create ( String name , AccountID accountID , ActorSex sex , CharacterClass characterClass , CharacterHairStyle hairStyle , CharacterHairColor hairColor , CharacterFace face ) throws CharacteCreationNotAllowedException , CharacterInvalidAppearanceException , CharacterInvalidNameException , CharacterInvalidRaceException , CharacterInvalidSexException , CharacterNameAlreadyExistsException , TooManyCharactersException { if ( ! ( config . isCharacterCreationAllowed ( ) ) ) throw new CharacteCreationNotAllowedException ( ) ; <START_BUG> if ( ( characterDao . countByAccount ( accountID ) ) < ( config . getMaxCharactersPerAccount ( ) ) ) <END_BUG> throw new TooManyCharactersException ( ) ; CharacterServiceImpl . log . debug ( "Requested<seq2seq4repair_space>creation<seq2seq4repair_space>of<seq2seq4repair_space>new<seq2seq4repair_space>character<seq2seq4repair_space>(name={},<seq2seq4repair_space>sex={},<seq2seq4repair_space>class={},<seq2seq4repair_space>hairStyle={},<seq2seq4repair_space>hairColor={},<seq2seq4repair_space>face={})" , 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 ( ) ; CharacterServiceImpl . log . debug ( "Checking<seq2seq4repair_space>name<seq2seq4repair_space>existence<seq2seq4repair_space>{}" , 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 ( ) ; CharacterServiceImpl . log . debug ( "Creating<seq2seq4repair_space>character<seq2seq4repair_space>with<seq2seq4repair_space>template<seq2seq4repair_space>{}" , template ) ; final CharacterID id = charIdProvider . createID ( ) ; final L2Character character = template . create ( ) ; CharacterServiceImpl . log . debug ( "Character<seq2seq4repair_space>object<seq2seq4repair_space>created,<seq2seq4repair_space>ID:<seq2seq4repair_space>{},<seq2seq4repair_space>Object:<seq2seq4repair_space>{}" , 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 ; } @ Override public void enterWorld ( final L2Character character ) throws AlreadySpawnedServiceException , SpawnPointNotFoundServiceException { } @ Override public void leaveWorld ( L2Character character ) throws NotSpawnedServiceException { } @ Override public boolean isOnline ( L2Character character ) { } @ Override public boolean isOnline ( AccountID accountID ) { } @ Override public void target ( L2Character character , Actor target ) throws CannotSetTargetServiceException { } @ Override public void attack ( L2Character character , Actor target ) throws ActorIsNotAttackableServiceException , CannotSetTargetServiceException , NotAttackableNPCServiceException { } @ Override public void jail ( L2Character character , long time , String reason ) throws CharacterInJailServiceException { } @ Override public void unjail ( L2Character character ) throws CharacterNotInJailServiceException { } @ Override public void move ( L2Character character , Coordinate coordinate ) { } @ Override public void validate ( L2Character character , Point3D point ) { } @ Override public void receivedValidation ( L2Character character , Point3D point ) { } @ Override public void walk ( L2Character character ) throws CharacterAlreadyWalkingServiceException { } @ Override public void run ( L2Character character ) throws CharacterAlreadyRunningServiceException { } }

Fix:
if ( ( characterDao . countByAccount ( accountID ) ) >= ( config . getMaxCharactersPerAccount ( ) ) )