From fb7fd15b7a140a3bb983f75bc5d6deed708ef579 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 10 Sep 2015 15:14:45 +0200 Subject: Fixes (backwards compat) --- src/main/java/org/openslx/imagemaster/util/Util.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/main/java/org/openslx/imagemaster/util') diff --git a/src/main/java/org/openslx/imagemaster/util/Util.java b/src/main/java/org/openslx/imagemaster/util/Util.java index 79589c4..e9146e0 100644 --- a/src/main/java/org/openslx/imagemaster/util/Util.java +++ b/src/main/java/org/openslx/imagemaster/util/Util.java @@ -16,7 +16,7 @@ import org.apache.log4j.Logger; public class Util { - private static Logger log = Logger.getLogger( Util.class ); + private static Logger LOGGER = Logger.getLogger( Util.class ); /** * Check if the given object is null, abort program if true. @@ -35,7 +35,7 @@ public class Util { if ( something == null ) { if ( message != null ) - log.fatal( "[NOTNULL] " + message, new NullPointerException() ); + LOGGER.fatal( "[NOTNULL] " + message, new NullPointerException() ); System.exit( 2 ); } } @@ -57,7 +57,7 @@ public class Util { if ( number == 0 ) { if ( message != null ) - log.fatal( "[NOTNULL] " + message, new NullPointerException() ); + LOGGER.fatal( "[NOTNULL] " + message, new NullPointerException() ); System.exit( 2 ); } } @@ -75,7 +75,7 @@ public class Util { if ( something == null || something.isEmpty() ) { if ( message != null ) - log.fatal( "[NOTNULL] " + message, new NullPointerException() ); + LOGGER.fatal( "[NOTNULL] " + message, new NullPointerException() ); System.exit( 2 ); } } @@ -123,6 +123,14 @@ public class Util return str != null && !str.isEmpty(); } + public static boolean isEmpty( String str, String message, Logger logger ) + { + if ( str != null && !str.isEmpty() ) + return false; + logger.debug( message ); + return true; + } + /** * Tries to parse an int. Returns 0 on error. * -- cgit v1.2.3-55-g7522