You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2019/01/14 09:30:37 UTC

[tomee] branch master updated: Fix checkstyle

This is an automated email from the ASF dual-hosted git repository.

jlmonteiro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/master by this push:
     new e265081  Fix checkstyle
e265081 is described below

commit e265081fff87576f3bcf49678c3d74c3eede318d
Author: Jean-Louis Monteiro <je...@gmail.com>
AuthorDate: Mon Jan 14 10:30:30 2019 +0100

    Fix checkstyle
---
 .../org/apache/tomee/loader/TomcatEmbedder.java    | 47 +++++++++++-----------
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/TomcatEmbedder.java b/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/TomcatEmbedder.java
index 2125fea..fbb2d7c 100644
--- a/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/TomcatEmbedder.java
+++ b/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/TomcatEmbedder.java
@@ -1,19 +1,18 @@
 /**
- *
  * 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.
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.tomee.loader;
 
@@ -28,7 +27,7 @@ import java.util.Properties;
 
 /**
  * Ultimately this class does nothing lasting and just calls {@link TomcatHook#hook}
- * 
+ *
  * This class needs to know the path to the tomee.war file.
  *
  * With that information this class finds the openejb-loader jar in the tomee.war
@@ -45,10 +44,10 @@ public class TomcatEmbedder {
 
     /**Prefix for jar openejb-loader*/
     private static final String OPENEJB_LOADER_PREFIX = "openejb-loader";
-    
+
     /**OpenEJB War name*/
     private static final String TOMEE_WAR_NAME = "tomee.war";
-    
+
     /**
      * Starts to embed process.
      * @param properties this instance contains all System properties as well as all initialization parameters of the LoaderServlet
@@ -76,7 +75,7 @@ public class TomcatEmbedder {
         Thread.currentThread().setContextClassLoader(catalinaCl);
         URLClassLoader childCl = null;
         try {
-        	childCl = new URLClassLoader(new URL[] {
+            childCl = new URLClassLoader(new URL[]{
                     getThisJar().toURI().toURL(),
                     findOpenEJBJar(openejbWar, OPENEJB_LOADER_PREFIX).toURI().toURL()
             });
@@ -90,17 +89,17 @@ public class TomcatEmbedder {
         } catch (final Throwable e) {
             e.printStackTrace();
         } finally {
-        	if(childCl != null) {
-        		try {
-					childCl.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-        	}
+            if (childCl != null) {
+                try {
+                    childCl.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
             Thread.currentThread().setContextClassLoader(oldCl);
         }
     }
-    
+
     /**
      * Return path to jar file that contains this class.
      * <p>
@@ -139,12 +138,12 @@ public class TomcatEmbedder {
 
             uri = new URI(url);
 
-            if (uri.getPath() == null){
+            if (uri.getPath() == null) {
                 uri = new URI(uri.getRawSchemeSpecificPart());
             }
 
             String path = uri.getPath();
-            if (path.contains("!")){
+            if (path.contains("!")) {
                 path = path.substring(0, path.indexOf('!'));
             } else {
                 path = path.substring(0, path.length() - classFileName.length());
@@ -156,7 +155,7 @@ public class TomcatEmbedder {
             throw new IllegalStateException(e);
         }
     }
-    
+
     /**
      * Gets path to jar file that has namePrefix
      * and in the tomee.war/lib location.