Buggy code:
public class BonitaHomeUtil { public static final String ENGINE_LOG_DESTINATION_FILE = "org.bonitasoft.studio.engine.log.destination.file" ; private static final String STUDIO_ENGINE_LOGGING_PROPERTIES = ( ( ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getLocation ( ) . toFile ( ) . getAbsolutePath ( ) ) + ( File . separator ) ) + "logback.xml" ; private static final String API_TYPE = "org.bonitasoft.engine.api-type" ; public static final String HTTP = "HTTP" ; private static final String SERVER_URL = "server.url" ; private static final String APPLICATION_NAME = "application.name" ; private static final String BONITA_APPLICATION = "bonita" ; public static File getBonitaHome ( ) { } public static String getJaasPath ( ) { } public static File getPortalI18NFolder ( ) { } public static InputStream getLoggingFile ( ) { } public static File getReferenceExternalFolder ( ) { } public static File getReferenceBonitaHome ( ) throws IOException { } public static synchronized File initBonitaHome ( ) { } public static void configureBonitaClient ( final String apiType , final String host , final int serverPort ) { BonitaStudioLog . debug ( ( ( ( ( ( "Configuring<seq2seq4repair_space>bonita<seq2seq4repair_space>client<seq2seq4repair_space>on<seq2seq4repair_space>host<seq2seq4repair_space>" + host ) + ":" ) + serverPort ) + "<seq2seq4repair_space>with<seq2seq4repair_space>API_TYPE=" ) + apiType ) , PLUGIN_ID ) ; final File clientWorkFolder = new File ( BonitaHomeUtil . getBonitaHome ( ) , ( ( "engine-client" + ( File . separatorChar ) ) + "work" ) ) ; final File clientConfFolder = new File ( BonitaHomeUtil . getBonitaHome ( ) , ( ( "engine-client" + ( File . separatorChar ) ) + "conf" ) ) ; final File defaultBonitaClientFile = new File ( clientWorkFolder , "bonita-client-community.properties" ) ; final File customBonitaClientFile = new File ( clientConfFolder , "bonita-client-custom.properties" ) ; if ( ! ( bonitaClientFile . exists ( ) ) ) { BonitaHomeUtil . initBonitaHome ( ) ; <START_BUG> if ( ! ( bonitaClientFile . exists ( ) ) ) { <END_BUG> throw new RuntimeException ( "bonita-client.properties<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>bonita<seq2seq4repair_space>home" ) ; } } final Properties p = new Properties ( ) ; FileInputStream inStream = null ; FileOutputStream out = null ; try { inStream = new FileInputStream ( defaultBonitaClientFile ) ; p . load ( inStream ) ; p . setProperty ( BonitaHomeUtil . API_TYPE , apiType ) ; if ( BonitaHomeUtil . HTTP . equals ( apiType ) ) { p . setProperty ( BonitaHomeUtil . SERVER_URL , ( ( ( "http:////" + host ) + ":" ) + serverPort ) ) ; p . setProperty ( BonitaHomeUtil . APPLICATION_NAME , BonitaHomeUtil . BONITA_APPLICATION ) ; } out = new FileOutputStream ( customBonitaClientFile ) ; p . store ( out , null ) ; APITypeManager . refresh ( ) ; } catch ( final Exception e ) { BonitaStudioLog . error ( e ) ; } finally { if ( inStream != null ) { try { inStream . close ( ) ; } catch ( final IOException e ) { } } if ( out != null ) { try { out . close ( ) ; } catch ( final IOException e ) { } } } } public static File getStudioLoggingFile ( ) { } public static File getDefaultTenantSecurityConfigFile ( final long tenantId ) { } public static File getDefaultTenantSecurityConfigStudioFile ( ) { } public static File getDefaultPlatformTenantConfigFile ( ) { } }

Fix:
if ( ! ( defaultBonitaClientFile . exists ( ) ) ) {