5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-06 22:11:40 +08:00

SQOOP-2533: Sqoop2: Findbugs: Fix warning for ConfigurableServlet

(Colin Ma via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2015-08-27 09:11:27 -07:00
parent a7c705938f
commit e0fbca7faa

View File

@ -37,21 +37,16 @@
public class ConfigurableServlet extends SqoopProtocolServlet {
private static final long serialVersionUID = 1L;
private RequestHandler configurableRequestHandler;
private static String CONNECTOR_CONFIGURABLE = "connector";
private static String DRIVER_CONFIGURABLE = "connector";
public ConfigurableServlet() {
// be default
configurableRequestHandler = new DriverRequestHandler();
}
@Override
protected JsonBean handleGetRequest(RequestContext ctx) throws Exception {
RequestHandler configurableRequestHandler = new DriverRequestHandler();
if (ctx.getPath().contains(CONNECTOR_CONFIGURABLE)) {
configurableRequestHandler = new ConnectorRequestHandler();
} else if (ctx.getPath().contains(DRIVER_CONFIGURABLE)) {
configurableRequestHandler = new DriverRequestHandler();
}
return configurableRequestHandler.handleEvent(ctx);
}