Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/org/adblockplus/android/StringUtils.java

Issue 29348632: Issue 4260 - Replace Apache Commons Lang classes (Closed)
Patch Set: two-space indentation Created July 29, 2016, 12:16 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/adblockplus/android/StringUtils.java
diff --git a/src/org/adblockplus/android/StringUtils.java b/src/org/adblockplus/android/StringUtils.java
index be7c0af193d9c371c4ede9ea9c5847db44e57761..3af67b321b1fa25445c8055c4ae133219fb574cf 100644
--- a/src/org/adblockplus/android/StringUtils.java
+++ b/src/org/adblockplus/android/StringUtils.java
@@ -19,38 +19,38 @@ package org.adblockplus.android;
public class StringUtils
Felix Dahlke 2016/09/12 15:53:28 Might be worth a doc comment that this is supposed
anton 2016/09/13 06:27:14 Actually this class has exactly the same methods s
Felix Dahlke 2016/09/13 08:23:29 Fair enough, let's leave it as is.
anton 2016/09/13 10:39:04 Acknowledged.
{
- public static boolean isNotEmpty(String value)
- {
- return value != null && value.length() > 0;
- }
+ public static boolean isNotEmpty(String value)
+ {
+ return value != null && value.length() > 0;
+ }
+
+ public static boolean isEmpty(String value)
+ {
+ return !isNotEmpty(value);
+ }
- public static boolean isEmpty(String value)
+ public static String join(Object[] array, String separator)
+ {
+ if (array == null)
{
- return !isNotEmpty(value);
+ return null;
}
- public static String join(Object[] array, String separator)
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < array.length; i++)
{
- if (array == null)
- {
- return null;
- }
+ String eachValue = array[i].toString();
+ if (i > 0 && separator != null)
+ {
+ sb.append(separator);
+ }
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < array.length; i++)
- {
- String eachValue = array[i].toString();
- if (i > 0 && separator != null)
- {
- sb.append(separator);
- }
-
- if (eachValue != null)
- {
- sb.append(eachValue);
- }
- }
-
- return sb.toString();
+ if (eachValue != null)
Felix Dahlke 2016/09/12 15:53:28 So if the value is null, we'd just print the separ
anton 2016/09/13 06:27:14 There is a difference between null string and empt
Felix Dahlke 2016/09/13 08:23:29 Makes sense, just wanted to make sure that's the i
anton 2016/09/13 10:39:04 Acknowledged.
+ {
+ sb.append(eachValue);
+ }
}
+
+ return sb.toString();
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld