Skip to content

Commit

Permalink
Merge branch 'develop' into feature/modularize-editor
Browse files Browse the repository at this point in the history
Conflicts:
	WordPress/src/main/java/org/wordpress/android/models/ReaderBlog.java
	libs/utils/WordPressUtils/src/main/java/org/wordpress/android/util/StringUtils.java
  • Loading branch information
maxme committed Feb 17, 2015
2 parents f25f93e + 34aab4c commit 0f47623
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,17 @@ public static int stringToInt(String s, int defaultValue) {
return defaultValue;
}
}

public static long stringToLong(String s) {
return stringToLong(s, 0L);
}
public static long stringToLong(String s, long defaultValue) {
if (s == null)
return defaultValue;
try {
return Long.valueOf(s);
} catch (NumberFormatException e) {
return defaultValue;
}
}
}

0 comments on commit 0f47623

Please sign in to comment.