@@ -180,8 +180,9 @@ void addAppender(Appender newAppender) {
180180 @since 1.2 */
181181 public
182182 void assertLog (boolean assertion , String msg ) {
183- if (!assertion )
184- this .error (msg );
183+ if (!assertion ) {
184+ this .error (msg );
185+ }
185186 }
186187
187188
@@ -254,8 +255,9 @@ void closeNestedAppenders() {
254255 @param message the message object to log. */
255256 public
256257 void debug (Object message ) {
257- if (repository .isDisabled (Level .DEBUG_INT ))
258- return ;
258+ if (repository .isDisabled (Level .DEBUG_INT )) {
259+ return ;
260+ }
259261 if (Level .DEBUG .isGreaterOrEqual (this .getEffectiveLevel ())) {
260262 forcedLog (FQCN , Level .DEBUG , message , null );
261263 }
@@ -273,10 +275,12 @@ void debug(Object message) {
273275 @param t the exception to log, including its stack trace. */
274276 public
275277 void debug (Object message , Throwable t ) {
276- if (repository .isDisabled (Level .DEBUG_INT ))
277- return ;
278- if (Level .DEBUG .isGreaterOrEqual (this .getEffectiveLevel ()))
279- forcedLog (FQCN , Level .DEBUG , message , t );
278+ if (repository .isDisabled (Level .DEBUG_INT )) {
279+ return ;
280+ }
281+ if (Level .DEBUG .isGreaterOrEqual (this .getEffectiveLevel ())) {
282+ forcedLog (FQCN , Level .DEBUG , message , t );
283+ }
280284 }
281285
282286 /**
@@ -299,10 +303,12 @@ void debug(Object message, Throwable t) {
299303 @param message the message object to log */
300304 public
301305 void error (Object message ) {
302- if (repository .isDisabled (Level .ERROR_INT ))
303- return ;
304- if (Level .ERROR .isGreaterOrEqual (this .getEffectiveLevel ()))
305- forcedLog (FQCN , Level .ERROR , message , null );
306+ if (repository .isDisabled (Level .ERROR_INT )) {
307+ return ;
308+ }
309+ if (Level .ERROR .isGreaterOrEqual (this .getEffectiveLevel ())) {
310+ forcedLog (FQCN , Level .ERROR , message , null );
311+ }
306312 }
307313
308314 /**
@@ -316,10 +322,12 @@ void error(Object message) {
316322 @param t the exception to log, including its stack trace. */
317323 public
318324 void error (Object message , Throwable t ) {
319- if (repository .isDisabled (Level .ERROR_INT ))
320- return ;
321- if (Level .ERROR .isGreaterOrEqual (this .getEffectiveLevel ()))
322- forcedLog (FQCN , Level .ERROR , message , t );
325+ if (repository .isDisabled (Level .ERROR_INT )) {
326+ return ;
327+ }
328+ if (Level .ERROR .isGreaterOrEqual (this .getEffectiveLevel ())) {
329+ forcedLog (FQCN , Level .ERROR , message , t );
330+ }
323331
324332 }
325333
@@ -359,10 +367,12 @@ Logger exists(String name) {
359367 @param message the message object to log */
360368 public
361369 void fatal (Object message ) {
362- if (repository .isDisabled (Level .FATAL_INT ))
363- return ;
364- if (Level .FATAL .isGreaterOrEqual (this .getEffectiveLevel ()))
365- forcedLog (FQCN , Level .FATAL , message , null );
370+ if (repository .isDisabled (Level .FATAL_INT )) {
371+ return ;
372+ }
373+ if (Level .FATAL .isGreaterOrEqual (this .getEffectiveLevel ())) {
374+ forcedLog (FQCN , Level .FATAL , message , null );
375+ }
366376 }
367377
368378 /**
@@ -376,10 +386,12 @@ void fatal(Object message) {
376386 @param t the exception to log, including its stack trace. */
377387 public
378388 void fatal (Object message , Throwable t ) {
379- if (repository .isDisabled (Level .FATAL_INT ))
380- return ;
381- if (Level .FATAL .isGreaterOrEqual (this .getEffectiveLevel ()))
382- forcedLog (FQCN , Level .FATAL , message , t );
389+ if (repository .isDisabled (Level .FATAL_INT )) {
390+ return ;
391+ }
392+ if (Level .FATAL .isGreaterOrEqual (this .getEffectiveLevel ())) {
393+ forcedLog (FQCN , Level .FATAL , message , t );
394+ }
383395 }
384396
385397
@@ -409,10 +421,11 @@ boolean getAdditivity() {
409421 synchronized
410422 public
411423 Enumeration getAllAppenders () {
412- if (aai == null )
413- return NullEnumeration .getInstance ();
414- else
415- return aai .getAllAppenders ();
424+ if (aai == null ) {
425+ return NullEnumeration .getInstance ();
426+ } else {
427+ return aai .getAllAppenders ();
428+ }
416429 }
417430
418431 /**
@@ -423,8 +436,9 @@ Enumeration getAllAppenders() {
423436 synchronized
424437 public
425438 Appender getAppender (String name ) {
426- if (aai == null || name == null )
427- return null ;
439+ if (aai == null || name == null ) {
440+ return null ;
441+ }
428442
429443 return aai .getAppender (name );
430444 }
@@ -440,8 +454,9 @@ Appender getAppender(String name) {
440454 public
441455 Level getEffectiveLevel () {
442456 for (Category c = this ; c != null ; c =c .parent ) {
443- if (c .level != null )
444- return c .level ;
457+ if (c .level != null ) {
458+ return c .level ;
459+ }
445460 }
446461 return null ; // If reached will cause an NullPointerException.
447462 }
@@ -454,8 +469,9 @@ Level getEffectiveLevel() {
454469 public
455470 Priority getChainedPriority () {
456471 for (Category c = this ; c != null ; c =c .parent ) {
457- if (c .level != null )
458- return c .level ;
472+ if (c .level != null ) {
473+ return c .level ;
474+ }
459475 }
460476 return null ; // If reached will cause an NullPointerException.
461477 }
@@ -601,8 +617,9 @@ Category getRoot() {
601617 public
602618 ResourceBundle getResourceBundle () {
603619 for (Category c = this ; c != null ; c =c .parent ) {
604- if (c .resourceBundle != null )
605- return c .resourceBundle ;
620+ if (c .resourceBundle != null ) {
621+ return c .resourceBundle ;
622+ }
606623 }
607624 // It might be the case that there is no resource bundle
608625 return null ;
@@ -660,10 +677,12 @@ String getResourceBundleString(String key) {
660677 @param message the message object to log */
661678 public
662679 void info (Object message ) {
663- if (repository .isDisabled (Level .INFO_INT ))
664- return ;
665- if (Level .INFO .isGreaterOrEqual (this .getEffectiveLevel ()))
666- forcedLog (FQCN , Level .INFO , message , null );
680+ if (repository .isDisabled (Level .INFO_INT )) {
681+ return ;
682+ }
683+ if (Level .INFO .isGreaterOrEqual (this .getEffectiveLevel ())) {
684+ forcedLog (FQCN , Level .INFO , message , null );
685+ }
667686 }
668687
669688 /**
@@ -677,20 +696,22 @@ void info(Object message) {
677696 @param t the exception to log, including its stack trace. */
678697 public
679698 void info (Object message , Throwable t ) {
680- if (repository .isDisabled (Level .INFO_INT ))
681- return ;
682- if (Level .INFO .isGreaterOrEqual (this .getEffectiveLevel ()))
683- forcedLog (FQCN , Level .INFO , message , t );
699+ if (repository .isDisabled (Level .INFO_INT )) {
700+ return ;
701+ }
702+ if (Level .INFO .isGreaterOrEqual (this .getEffectiveLevel ())) {
703+ forcedLog (FQCN , Level .INFO , message , t );
704+ }
684705 }
685706
686707 /**
687708 Is the appender passed as parameter attached to this category?
688709 */
689710 public
690711 boolean isAttached (Appender appender ) {
691- if (appender == null || aai == null )
692- return false ;
693- else {
712+ if (appender == null || aai == null ) {
713+ return false ;
714+ } else {
694715 return aai .isAttached (appender );
695716 }
696717 }
@@ -731,8 +752,9 @@ boolean isAttached(Appender appender) {
731752 * */
732753 public
733754 boolean isDebugEnabled () {
734- if (repository .isDisabled ( Level .DEBUG_INT ))
735- return false ;
755+ if (repository .isDisabled ( Level .DEBUG_INT )) {
756+ return false ;
757+ }
736758 return Level .DEBUG .isGreaterOrEqual (this .getEffectiveLevel ());
737759 }
738760
@@ -746,8 +768,9 @@ boolean isDebugEnabled() {
746768 */
747769 public
748770 boolean isEnabledFor (Priority level ) {
749- if (repository .isDisabled (level .level ))
750- return false ;
771+ if (repository .isDisabled (level .level )) {
772+ return false ;
773+ }
751774 return level .isGreaterOrEqual (this .getEffectiveLevel ());
752775 }
753776
@@ -760,8 +783,9 @@ boolean isEnabledFor(Priority level) {
760783 */
761784 public
762785 boolean isInfoEnabled () {
763- if (repository .isDisabled (Level .INFO_INT ))
764- return false ;
786+ if (repository .isDisabled (Level .INFO_INT )) {
787+ return false ;
788+ }
765789 return Level .INFO .isGreaterOrEqual (this .getEffectiveLevel ());
766790 }
767791
@@ -806,10 +830,11 @@ void l7dlog(Priority priority, String key, Object[] params, Throwable t) {
806830 if (priority .isGreaterOrEqual (this .getEffectiveLevel ())) {
807831 String pattern = getResourceBundleString (key );
808832 String msg ;
809- if (pattern == null )
810- msg = key ;
811- else
812- msg = java .text .MessageFormat .format (pattern , params );
833+ if (pattern == null ) {
834+ msg = key ;
835+ } else {
836+ msg = java .text .MessageFormat .format (pattern , params );
837+ }
813838 forcedLog (FQCN , priority , msg , t );
814839 }
815840 }
@@ -822,8 +847,9 @@ void log(Priority priority, Object message, Throwable t) {
822847 if (repository .isDisabled (priority .level )) {
823848 return ;
824849 }
825- if (priority .isGreaterOrEqual (this .getEffectiveLevel ()))
826- forcedLog (FQCN , priority , message , t );
850+ if (priority .isGreaterOrEqual (this .getEffectiveLevel ())) {
851+ forcedLog (FQCN , priority , message , t );
852+ }
827853 }
828854
829855 /**
@@ -834,8 +860,9 @@ void log(Priority priority, Object message) {
834860 if (repository .isDisabled (priority .level )) {
835861 return ;
836862 }
837- if (priority .isGreaterOrEqual (this .getEffectiveLevel ()))
838- forcedLog (FQCN , priority , message , null );
863+ if (priority .isGreaterOrEqual (this .getEffectiveLevel ())) {
864+ forcedLog (FQCN , priority , message , null );
865+ }
839866 }
840867
841868 /**
@@ -905,8 +932,9 @@ void removeAllAppenders() {
905932 synchronized
906933 public
907934 void removeAppender (Appender appender ) {
908- if (appender == null || aai == null )
909- return ;
935+ if (appender == null || aai == null ) {
936+ return ;
937+ }
910938 boolean wasAttached = aai .isAttached (appender );
911939 aai .removeAppender (appender );
912940 if (wasAttached ) {
@@ -922,7 +950,9 @@ void removeAppender(Appender appender) {
922950 synchronized
923951 public
924952 void removeAppender (String name ) {
925- if (name == null || aai == null ) return ;
953+ if (name == null || aai == null ) {
954+ return ;
955+ }
926956 Appender appender = aai .getAppender (name );
927957 aai .removeAppender (name );
928958 if (appender != null ) {
@@ -1036,11 +1066,13 @@ void shutdown() {
10361066 @param message the message object to log. */
10371067 public
10381068 void warn (Object message ) {
1039- if (repository .isDisabled ( Level .WARN_INT ))
1040- return ;
1069+ if (repository .isDisabled ( Level .WARN_INT )) {
1070+ return ;
1071+ }
10411072
1042- if (Level .WARN .isGreaterOrEqual (this .getEffectiveLevel ()))
1043- forcedLog (FQCN , Level .WARN , message , null );
1073+ if (Level .WARN .isGreaterOrEqual (this .getEffectiveLevel ())) {
1074+ forcedLog (FQCN , Level .WARN , message , null );
1075+ }
10441076 }
10451077
10461078 /**
@@ -1054,9 +1086,11 @@ void warn(Object message) {
10541086 @param t the exception to log, including its stack trace. */
10551087 public
10561088 void warn (Object message , Throwable t ) {
1057- if (repository .isDisabled (Level .WARN_INT ))
1058- return ;
1059- if (Level .WARN .isGreaterOrEqual (this .getEffectiveLevel ()))
1060- forcedLog (FQCN , Level .WARN , message , t );
1089+ if (repository .isDisabled (Level .WARN_INT )) {
1090+ return ;
1091+ }
1092+ if (Level .WARN .isGreaterOrEqual (this .getEffectiveLevel ())) {
1093+ forcedLog (FQCN , Level .WARN , message , t );
1094+ }
10611095 }
10621096}
0 commit comments