[
https://issues.apache.org/jira/browse/RANGER-1287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15794433#comment-15794433
]
Qiang Zhang commented on RANGER-1287:
-------------------------------------
Review Requet:
https://reviews.apache.org/r/55128/
> 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
> Labels: patch
> Attachments:
> 0001-RANGER-1287-Remove-code-duplication-from-EmbeddedSer.patch
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> 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)