Buggy code:
public class AddPropertiesUser { public static final String [ ] BAD_USER_NAMES = new String [ ] { "admin" , "administrator" , "root" } ; public static final String SERVER_BASE_DIR = "jboss.server.base.dir" ; public static final String SERVER_CONFIG_DIR = "jboss.server.config.dir" ; public static final String SERVER_CONFIG_USER_DIR = "jboss.server.config.user.dir" ; public static final String DOMAIN_BASE_DIR = "jboss.domain.base.dir" ; public static final String DOMAIN_CONFIG_DIR = "jboss.domain.config.dir" ; public static final String DOMAIN_CONFIG_USER_DIR = "jboss.domain.config.user.dir" ; public static final String DEFAULT_MANAGEMENT_REALM = "ManagementRealm" ; public static final String DEFAULT_APPLICATION_REALM = "ApplicationRealm" ; public static final String MGMT_USERS_PROPERTIES = "mgmt-users.properties" ; public static final String APPLICATION_USERS_PROPERTIES = "application-users.properties" ; public static final String APPLICATION_ROLES_PROPERTIES = "application-roles.properties" ; public static final String NEW_LINE = String . format ( "%n" ) ; public static final String SPACE = "<seq2seq4repair_space>" ; private static final Properties argsCliProps = new Properties ( ) ; private final ConsoleWrapper theConsole ; protected State nextState ; protected AddPropertiesUser ( ConsoleWrapper console ) { } private AddPropertiesUser ( ConsoleWrapper console , final boolean management , final String user , final String password , final String realm ) { } private AddPropertiesUser ( ConsoleWrapper consoleWrapper , boolean management , final String user , final String password ) { } protected void run ( ) { } public static void main ( String [ ] args ) { boolean management = true ; JavaConsole javaConsole = new JavaConsole ( ) ; if ( ( args . length ) >= 1 ) { Iterator < String > it = Arrays . asList ( args ) . iterator ( ) ; String temp ; while ( it . hasNext ( ) ) { temp = it . next ( ) ; if ( AddPropertiesUser . CommandLineArgument . HELP . match ( temp ) ) { AddPropertiesUser . usage ( javaConsole ) ; return ; } if ( AddPropertiesUser . CommandLineArgument . DOMAIN_CONFIG_DIR_USERS . match ( temp ) ) { System . setProperty ( AddPropertiesUser . DOMAIN_CONFIG_DIR , it . next ( ) ) ; } else if ( AddPropertiesUser . CommandLineArgument . SERVER_CONFIG_DIR_USERS . match ( temp ) ) { System . setProperty ( AddPropertiesUser . SERVER_CONFIG_DIR , it . next ( ) ) ; } else if ( AddPropertiesUser . CommandLineArgument . APPLICATION_USERS . match ( temp ) ) { management = false ; } else { AddPropertiesUser . CommandLineArgument commandLineArgument = AddPropertiesUser . findCommandLineOption ( temp ) ; if ( commandLineArgument != null ) { final String value ; if ( AddPropertiesUser . CommandLineArgument . SILENT . equals ( commandLineArgument ) ) { value = Boolean . TRUE . toString ( ) ; } else { value = ( it . hasNext ( ) ) ? it . next ( ) : null ; } if ( value != null ) { AddPropertiesUser . argsCliProps . setProperty ( commandLineArgument . key ( ) , value ) ; } } else { final String userKey = AddPropertiesUser . CommandLineArgument . USER . key ( ) ; if ( ! ( AddPropertiesUser . argsCliProps . containsKey ( userKey ) ) ) { AddPropertiesUser . argsCliProps . setProperty ( userKey , temp ) ; } else { final String passwordKey = AddPropertiesUser . CommandLineArgument . PASSWORD . key ( ) ; if ( ! ( AddPropertiesUser . argsCliProps . containsKey ( passwordKey ) ) ) { AddPropertiesUser . argsCliProps . setProperty ( passwordKey , temp ) ; } else { final String realmKey = AddPropertiesUser . CommandLineArgument . REALM . key ( ) ; if ( ! ( AddPropertiesUser . argsCliProps . containsKey ( realmKey ) ) ) { AddPropertiesUser . argsCliProps . setProperty ( realmKey , temp ) ; } } } } } } } if ( ( AddPropertiesUser . argsCliProps . containsKey ( AddPropertiesUser . CommandLineArgument . PASSWORD . key ( ) ) ) || ( AddPropertiesUser . argsCliProps . containsKey ( AddPropertiesUser . CommandLineArgument . USER . key ( ) ) ) ) { final String password = AddPropertiesUser . argsCliProps . getProperty ( AddPropertiesUser . CommandLineArgument . PASSWORD . key ( ) ) ; final String user = AddPropertiesUser . argsCliProps . getProperty ( AddPropertiesUser . CommandLineArgument . USER . key ( ) ) ; <START_BUG> if ( AddPropertiesUser . argsCliProps . contains ( AddPropertiesUser . CommandLineArgument . REALM . key ( ) ) ) { <END_BUG> new AddPropertiesUser ( javaConsole , management , user , password , AddPropertiesUser . argsCliProps . getProperty ( AddPropertiesUser . CommandLineArgument . REALM . key ( ) ) ) . run ( ) ; } else { new AddPropertiesUser ( javaConsole , management , user , password ) . run ( ) ; } } else { new AddPropertiesUser ( javaConsole ) . run ( ) ; } } private static void usage ( ConsoleWrapper consoleWrapper ) { } public enum Interactiveness { SILENT , NON_INTERACTIVE , INTERACTIVE ; } private static AddPropertiesUser . CommandLineArgument findCommandLineOption ( String arg ) { } protected enum CommandLineArgument { APPLICATION_USERS ( "-a" ) { @ Override public String instructions ( ) { } } , DOMAIN_CONFIG_DIR_USERS ( "-dc" ) { @ Override public String argumentExample ( ) { } @ Override public String instructions ( ) { } } , SERVER_CONFIG_DIR_USERS ( "-sc" ) { @ Override public String argumentExample ( ) { } @ Override public String instructions ( ) { } } , PASSWORD ( "-p" , "--password" ) { @ Override public String argumentExample ( ) { } @ Override public String instructions ( ) { } } , USER ( "-u" , "--user" ) { @ Override public String argumentExample ( ) { } @ Override public String instructions ( ) { } } , REALM ( "-r" , "--realm" ) { @ Override public String argumentExample ( ) { } @ Override public String instructions ( ) { } } , SILENT ( "-s" , "--silent" ) { @ Override public String instructions ( ) { } }

Fix:
if ( AddPropertiesUser . argsCliProps . containsKey ( AddPropertiesUser . CommandLineArgument . REALM . key ( ) ) ) {