Source:
<code>public void init(ServletConfig servletConfig) throws ServletException { try { ServletContext ctx = servletConfig.getServletContext(); configProps = ConfigurationProperties.getBean(ctx); <START> if (!configurationPresent()) { <END> throw new ServletException("TPF not in config"); } else { if (!tpfActiveFlag.equals("true")) { throw new ServletException("TPF not set to true"); } } RDFService rdfService = ModelAccess.on(ctx).getRDFService(); RDFServiceBasedRequestProcessorForTPFs.setRDFService(rdfService); OntologyDao dao = ModelAccess.on(ctx).getWebappDaoFactory().getOntologyDao(); config = new ConfigReader(new StringReader(getConfigJson(dao))); for ( Entry<String,IDataSourceType> typeEntry : config.getDataSourceTypes().entrySet() ) { if (!DataSourceTypesRegistry.isRegistered(typeEntry.getKey())) { DataSourceTypesRegistry.register( typeEntry.getKey(), typeEntry.getValue() ); } } for (Entry<String, JsonNode> dataSource : config.getDataSources().entrySet()) { dataSources.put(dataSource.getKey(), DataSourceFactory.create(dataSource.getValue())); } MIMEParse.register("text/html"); MIMEParse.register(Lang.TTL.getHeaderString()); MIMEParse.register(Lang.JSONLD.getHeaderString()); MIMEParse.register(Lang.NTRIPLES.getHeaderString()); MIMEParse.register(Lang.RDFXML.getHeaderString()); HtmlTriplePatternFragmentWriterImpl.setContextPath(servletConfig.getServletContext().getContextPath()); } catch (Exception e) { throw new ServletException(e); } }</code><technical_language>simplify this configurationPresent() return a boolean... changing name isTPFEnabled(). remove new tpfActiveFlag instance variable a single check: if (!isTPFEnabled()) { throw new ServletException("TPF configuration present set 'true'"); }</technical_language>

Target:
public void init(ServletConfig servletConfig) throws ServletException { try { ServletContext ctx = servletConfig.getServletContext(); configProps = ConfigurationProperties.getBean(ctx); if (!configurationPresent()) { throw new ServletException("TPF is currently disabled. To enable, add 'tpfActive.flag=true' to the runtime.properties."); } else { if (!tpfActiveFlag.equalsIgnoreCase("true")) { throw new ServletException("TPF is currently disabled. To enable, set 'tpfActive.flag=true' in runtime.properties."); } } RDFService rdfService = ModelAccess.on(ctx).getRDFService(); RDFServiceBasedRequestProcessorForTPFs.setRDFService(rdfService); OntologyDao dao = ModelAccess.on(ctx).getWebappDaoFactory().getOntologyDao(); config = new ConfigReader(new StringReader(getConfigJson(dao))); for ( Entry<String,IDataSourceType> typeEntry : config.getDataSourceTypes().entrySet() ) { if (!DataSourceTypesRegistry.isRegistered(typeEntry.getKey())) { DataSourceTypesRegistry.register( typeEntry.getKey(), typeEntry.getValue() ); } } for (Entry<String, JsonNode> dataSource : config.getDataSources().entrySet()) { dataSources.put(dataSource.getKey(), DataSourceFactory.create(dataSource.getValue())); } MIMEParse.register("text/html"); MIMEParse.register(Lang.TTL.getHeaderString()); MIMEParse.register(Lang.JSONLD.getHeaderString()); MIMEParse.register(Lang.NTRIPLES.getHeaderString()); MIMEParse.register(Lang.RDFXML.getHeaderString()); HtmlTriplePatternFragmentWriterImpl.setContextPath(servletConfig.getServletContext().getContextPath()); } catch (Exception e) { throw new ServletException(e); } }