Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1203#discussion_r181033047
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebServer.java 
---
    @@ -296,12 +302,19 @@ private ConstraintSecurityHandler 
createSecurityHandler() {
       }
     
       public int getPort() {
    -    if (embeddedJetty == null || embeddedJetty.getConnectors().length != 
1) {
    +    if (!isRunning()) {
           throw new UnsupportedOperationException("Http is not enabled");
         }
         return ((ServerConnector)embeddedJetty.getConnectors()[0]).getPort();
       }
     
    +  public boolean isRunning() {
    --- End diff --
    
    Method code can be simplified to one line.


---

Reply via email to