org.apache.commons.lang3.StringUtils



API Populatity

41 Client projects

Project: org.apache

Project cgeo/cgeo in file ...84d389e6/tests.src.cgeo.geocaching.cgBaseTest.java (2012-02-20)
@@ -8,6 +8,8 @@ import cgeo.geocaching.test.mock.MockedCache;
 import cgeo.geocaching.utils.BaseUtils;
 import cgeo.geocaching.utils.CancellableHandler;
 
+import org.apache.commons.lang3.StringUtils;
+
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.MediumTest;
 
@@ -89,6 +91,7 @@ public class cgBaseTest extends AndroidTestCase {
             Settings.setGcCustomDate(mockedCache.getDateFormat());
             SearchResult searchResult = cgBase.parseCacheFromText(mockedCache.getData(), 0, null);
             cgCache parsedCache = searchResult.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
+            assertTrue(StringUtils.isNotBlank(mockedCache.getMockedDataUser()));
             cgBaseTest.testCompareCaches(mockedCache, parsedCache);
         }
         Settings.setGcCustomDate(gcCustomDate);
Project danieloeh/AntennaPod in file ...6d6f/src.de.danoeh.antennapod.util.URLChecker.java (2014-07-07)
@@ -1,6 +1,9 @@
 package de.danoeh.antennapod.util;
 
 import android.util.Log;
+
+import org.apache.commons.lang3.StringUtils;
+
 import de.danoeh.antennapod.BuildConfig;
 
 /**
@@ -27,6 +30,7 @@ public final class URLChecker {
      */
     public static String prepareURL(String url) {
         StringBuilder builder = new StringBuilder();
+        url = StringUtils.trim(url);
         if (url.startsWith("feed://")) {
             if (BuildConfig.DEBUG) Log.d(TAG, "Replacing feed:// with http://");
             url = url.replaceFirst("feed://", "http://");
Project cgeo/cgeo in file ...n.src.cgeo.geocaching.geopoint.DistanceParser.java (2012-12-19)
@@ -1,5 +1,7 @@
 package cgeo.geocaching.geopoint;
 
+import org.apache.commons.lang3.StringUtils;
+
 import java.util.Locale;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -29,7 +31,7 @@ public final class DistanceParser {
         final float value = Float.parseFloat(matcher.group(1).replace(',', '.'));
         final String unit = matcher.group(2).toLowerCase(Locale.US);
 
-        if (unit.equals("m") || (unit.isEmpty() && metricUnit)) {
+        if (unit.equals("m") || (StringUtils.isEmpty(unit) && metricUnit)) {
             return value / 1000;
         }
         if (unit.equals("km")) {