Buggy code:
public class RestliServlet extends HttpServlet { private static final Logger log = LoggerFactory . getLogger ( RestliServlet . class ) ; private static final long serialVersionUID = 1L ; private static final String RESOURCE_PACKAGES_PARAM = "resourcePackages" ; private static final String PAR_SEQ_THREAD_POOL_SIZE = "parSeqThreadPoolSize" ; private static final String PACKAGE_PARAM_SEPARATOR = ";" ; private static final String USE_ASYNC_PARAM = "useAsync" ; private static final String ASYNC_TIMEOUT_PARAM = "asyncTimeout" ; public static final int DEFAULT_ASYNC_TIMEOUT = 30000 ; private HttpServlet _r2Servlet ; @ Override public void init ( ServletConfig servletConfig ) throws ServletException { } <START_BUG> private AbstractR2Servlet buildR2ServletFromServletParams ( ServletConfig servletConfig ) { <END_BUG> ResourceFactory resourceFactory = new PrototypeResourceFactory ( ) ; RestLiConfig config = new RestLiConfig ( ) ; config . setResourcePackageNamesSet ( getResourcePackageSet ( servletConfig ) ) ; final ScheduledExecutorService scheduler = Executors . newScheduledThreadPool ( getParseqThreadPoolSize ( servletConfig ) ) ; Engine engine = new EngineBuilder ( ) . setTaskExecutor ( scheduler ) . setTimerScheduler ( scheduler ) . build ( ) ; DelegatingTransportDispatcher dispatcher = new DelegatingTransportDispatcher ( new RestLiServer ( config , resourceFactory , engine ) ) ; boolean useAsync = getUseAsync ( servletConfig ) ; long asyncTimeOut = getAsyncTimeout ( servletConfig ) ; if ( useAsync && ( ( servletConfig . getServletContext ( ) . getMajorVersion ( ) ) < 3 ) ) { throw new IllegalArgumentException ( ( "This<seq2seq4repair_space>servlet<seq2seq4repair_space>is<seq2seq4repair_space>configured<seq2seq4repair_space>with<seq2seq4repair_space>useAsync=true,<seq2seq4repair_space>but<seq2seq4repair_space>the<seq2seq4repair_space>current<seq2seq4repair_space>servlet<seq2seq4repair_space>" + "context<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>support<seq2seq4repair_space>the<seq2seq4repair_space>required<seq2seq4repair_space>Servlet<seq2seq4repair_space>API<seq2seq4repair_space>3.0." ) ) ; } if ( ! useAsync ) { RestliServlet . log . info ( "Initializing<seq2seq4repair_space>Rest.li<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>thread<seq2seq4repair_space>based<seq2seq4repair_space>request<seq2seq4repair_space>handling.<seq2seq4repair_space>Set<seq2seq4repair_space>useAsync=true<seq2seq4repair_space>on<seq2seq4repair_space>a<seq2seq4repair_space>Servlet<seq2seq4repair_space>API<seq2seq4repair_space>3.0<seq2seq4repair_space>container<seq2seq4repair_space>to<seq2seq4repair_space>enable<seq2seq4repair_space>Rest.li's<seq2seq4repair_space>async<seq2seq4repair_space>servlet." ) ; return new com . linkedin . r2 . transport . http . server . RAPServlet ( dispatcher ) ; } else { RestliServlet . log . info ( "Initializing<seq2seq4repair_space>Rest.li<seq2seq4repair_space>with<seq2seq4repair_space>an<seq2seq4repair_space>async<seq2seq4repair_space>request<seq2seq4repair_space>handling<seq2seq4repair_space>enabled." ) ; return new com . linkedin . r2 . transport . http . server . AsyncR2Servlet ( dispatcher , asyncTimeOut ) ; } } private boolean getUseAsync ( ServletConfig servletConfig ) { } private long getAsyncTimeout ( ServletConfig servletConfig ) { } private Set < String > getResourcePackageSet ( ServletConfig servletConfig ) { } private int getParseqThreadPoolSize ( ServletConfig servletConfig ) { } @ Override public void destroy ( ) { } @ Override public void service ( ServletRequest req , ServletResponse res ) throws IOException , ServletException { } }

Fix:
private HttpServlet buildR2ServletFromServletParams ( ServletConfig servletConfig ) {