mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
return default value if null
This commit is contained in:
@@ -200,7 +200,11 @@ public class StringUtilRt {
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
public static int parseInt(final String string, final int defaultValue) {
|
||||
public static int parseInt(@Nullable String string, final int defaultValue) {
|
||||
if (string == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
try {
|
||||
return Integer.parseInt(string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user