=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java' --- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java 2013-04-17 09:03:38 +0000 +++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java 2013-05-09 17:17:28 +0000 @@ -85,7 +85,7 @@ String gatewayId = transportService.getDefaultGateway(); - if ( gatewayId != null || gatewayId.trim().length() != 0 ) + if ( gatewayId != null && !gatewayId.trim().isEmpty() ) { boolean sendSMSNotification = false; for ( User user : users ) @@ -146,7 +146,7 @@ text = "From " + name + subject + ": " + text; - // Simplistic cutoff 160 characters.. + // Simplistic cutoff 160 characters int length = text.length(); return (length > 160) ? text.substring( 0, 157 ) + "..." : text; @@ -183,7 +183,5 @@ { log.warn( "Unable to send message through sms: " + sms, e ); } - } - }