1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17-
18-
1917package org .apache .catalina .startup ;
2018
2119
7169 * @author Remy Maucherat
7270 * @version $Id$
7371 */
74-
7572public class Catalina {
7673
7774
@@ -277,8 +274,9 @@ protected boolean arguments(String args[]) {
277274 protected File configFile () {
278275
279276 File file = new File (configFile );
280- if (!file .isAbsolute ())
277+ if (!file .isAbsolute ()) {
281278 file = new File (System .getProperty (Globals .CATALINA_BASE_PROP ), configFile );
279+ }
282280 return (file );
283281
284282 }
@@ -383,8 +381,9 @@ protected Digester createStartDigester() {
383381 digester .addRuleSet (new ClusterRuleSet ("Server/Service/Engine/Cluster/" ));
384382
385383 long t2 =System .currentTimeMillis ();
386- if (log .isDebugEnabled ())
384+ if (log .isDebugEnabled ()) {
387385 log .debug ("Digester for server.xml created " + ( t2 -t1 ));
386+ }
388387 return (digester );
389388
390389 }
@@ -457,8 +456,9 @@ public void stopServer(String[] arguments) {
457456 Socket socket = new Socket (s .getAddress (), s .getPort ());
458457 OutputStream stream = socket .getOutputStream ();
459458 String shutdown = s .getShutdown ();
460- for (int i = 0 ; i < shutdown .length (); i ++)
459+ for (int i = 0 ; i < shutdown .length (); i ++) {
461460 stream .write (shutdown .charAt (i ));
461+ }
462462 stream .flush ();
463463 stream .close ();
464464 socket .close ();
@@ -572,16 +572,18 @@ public void load() {
572572 try {
573573 getServer ().init ();
574574 } catch (LifecycleException e ) {
575- if (Boolean .getBoolean ("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE" ))
575+ if (Boolean .getBoolean ("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE" )) {
576576 throw new java .lang .Error (e );
577- else
577+ } else {
578578 log .error ("Catalina.start" , e );
579+ }
579580
580581 }
581582
582583 long t2 = System .nanoTime ();
583- if (log .isInfoEnabled ())
584+ if (log .isInfoEnabled ()) {
584585 log .info ("Initialization processed in " + ((t2 - t1 ) / 1000000 ) + " ms" );
586+ }
585587
586588 }
587589
@@ -592,8 +594,9 @@ public void load() {
592594 public void load (String args []) {
593595
594596 try {
595- if (arguments (args ))
597+ if (arguments (args )) {
596598 load ();
599+ }
597600 } catch (Exception e ) {
598601 e .printStackTrace (System .out );
599602 }
@@ -624,8 +627,9 @@ public void start() {
624627 }
625628
626629 long t2 = System .nanoTime ();
627- if (log .isInfoEnabled ())
630+ if (log .isInfoEnabled ()) {
628631 log .info ("Server startup in " + ((t2 - t1 ) / 1000000 ) + " ms" );
632+ }
629633
630634 try {
631635 // Register shutdown hook
@@ -807,8 +811,9 @@ protected void initNaming() {
807811 value = value + ":" + oldValue ;
808812 }
809813 System .setProperty (javax .naming .Context .URL_PKG_PREFIXES , value );
810- if ( log .isDebugEnabled () )
814+ if ( log .isDebugEnabled () ) {
811815 log .debug ("Setting naming prefix=" + value );
816+ }
812817 value = System .getProperty
813818 (javax .naming .Context .INITIAL_CONTEXT_FACTORY );
814819 if (value == null ) {
@@ -889,8 +894,9 @@ public SetParentClassLoaderRule(ClassLoader parentClassLoader) {
889894 public void begin (String namespace , String name , Attributes attributes )
890895 throws Exception {
891896
892- if (digester .getLogger ().isDebugEnabled ())
897+ if (digester .getLogger ().isDebugEnabled ()) {
893898 digester .getLogger ().debug ("Setting parent class loader" );
899+ }
894900
895901 Container top = (Container ) digester .peek ();
896902 top .setParentClassLoader (parentClassLoader );
0 commit comments