Github user bzz commented on the issue: https://github.com/apache/zeppelin/pull/1168 I have applied `ZeppelinStyle` Java formatter in Eclipse and re-formatted `ZeppelinServer.java` here is the diff below ``` diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java index 4ef6f44..686d6ea 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java @@ -1,18 +1,16 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. */ package org.apache.zeppelin.server; @@ -105,8 +103,9 @@ public class ZeppelinServer extends Application { this.notebookIndex = new LuceneSearch(); this.notebookAuthorization = new NotebookAuthorization(conf); this.credentials = new Credentials(conf.credentialsPersist(), conf.getCredentialsPath()); - notebook = new Notebook(conf, notebookRepo, schedulerFactory, replFactory, notebookWsServer, - notebookIndex, notebookAuthorization, credentials); + notebook = + new Notebook(conf, notebookRepo, schedulerFactory, replFactory, notebookWsServer, + notebookIndex, notebookAuthorization, credentials); // to update notebook from application event from remote process. heliumApplicationFactory.setNotebook(notebook); @@ -135,12 +134,12 @@ public class ZeppelinServer extends Application { // Notebook server setupNotebookServer(webApp, conf); - //Below is commented since zeppelin-docs module is removed. - //final WebAppContext webAppSwagg = setupWebAppSwagger(conf); + // Below is commented since zeppelin-docs module is removed. + // final WebAppContext webAppSwagg = setupWebAppSwagger(conf); LOG.info("Starting zeppelin server"); try { - jettyWebServer.start(); //Instantiates ZeppelinServer + jettyWebServer.start(); // Instantiates ZeppelinServer } catch (Exception e) { LOG.error("Error while running jettyServer", e); System.exit(-1); @@ -148,7 +147,8 @@ public class ZeppelinServer extends Application { LOG.info("Done, zeppelin server started"); Runtime.getRuntime().addShutdownHook(new Thread() { - @Override public void run() { + @Override + public void run() { LOG.info("Shutting down Zeppelin Server ... "); try { jettyWebServer.stop(); @@ -192,13 +192,13 @@ public class ZeppelinServer extends Application { HttpConfiguration httpsConfig = new HttpConfiguration(httpConfig); SecureRequestCustomizer src = new SecureRequestCustomizer(); // Only with Jetty 9.3.x - // src.setStsMaxAge(2000); - // src.setStsIncludeSubDomains(true); + // src.setStsMaxAge(2000); + // src.setStsIncludeSubDomains(true); httpsConfig.addCustomizer(src); - connector = new ServerConnector(server, - new SslConnectionFactory(getSslContextFactory(conf), HttpVersion.HTTP_1_1.asString()), - new HttpConnectionFactory(httpsConfig)); + connector = + new ServerConnector(server, new SslConnectionFactory(getSslContextFactory(conf), + HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(httpsConfig)); } else { @@ -260,8 +260,8 @@ public class ZeppelinServer extends Application { webapp.setSessionHandler(new SessionHandler()); webapp.addServlet(cxfServletHolder, "/api/*"); - webapp - .setInitParameter("shiroConfigLocations", new File(conf.getShiroPath()).toURI().toString()); + webapp.setInitParameter("shiroConfigLocations", new File(conf.getShiroPath()).toURI() + .toString()); SecurityUtils.initSecurityManager(conf.getShiroPath()); webapp.addFilter(org.apache.shiro.web.servlet.ShiroFilter.class, "/api/*", @@ -300,12 +300,14 @@ public class ZeppelinServer extends Application { } - @Override public Set<Class<?>> getClasses() { + @Override + public Set<Class<?>> getClasses() { Set<Class<?>> classes = new HashSet<Class<?>>(); return classes; } - @Override public Set<Object> getSingletons() { + @Override + public Set<Object> getSingletons() { Set<Object> singletons = new HashSet<>(); /** Rest-api root endpoint */ @@ -336,4 +338,3 @@ public class ZeppelinServer extends Application { return singletons; } } - ```
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---