You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Qiang Zhang (JIRA)" <ji...@apache.org> on 2017/01/03 07:16:58 UTC

[jira] [Created] (RANGER-1287) Remove code duplication from Java method EmbeddedServer.start()

Qiang Zhang created RANGER-1287:
-----------------------------------

             Summary: Remove code duplication from Java method EmbeddedServer.start()
                 Key: RANGER-1287
                 URL: https://issues.apache.org/jira/browse/RANGER-1287
             Project: Ranger
          Issue Type: Bug
          Components: admin
    Affects Versions: 0.7.0
            Reporter: Qiang Zhang
            Assignee: Qiang Zhang
            Priority: Minor


In java class incubator-ranger\embeddedwebserver\src\main\java\org\apache\ranger\server\tomcat\EmbeddedServer.java,
there is some code duplication in method start().
1.The following code is repeated twice, should remove one of them.
{code}
valve.setRotatable(true);
{code} 

2.The following code is repeated three times which can be refactored.
{code}
try{
	server.start();
	server.getServer().await();
	shutdownServer();
}catch (LifecycleException e) {
	LOG.severe("Tomcat Server failed to start:" + e.toString());
	e.printStackTrace();
}catch (Exception e) {
	LOG.severe("Tomcat Server failed to start:" + e.toString());
	e.printStackTrace();
}
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)