Reuse Objects.toString()

This commit is contained in:
Gary Gregory 2023-09-20 09:14:35 -04:00
parent d0f65ab0a4
commit 5571b9b464
1 changed files with 2 additions and 5 deletions

View File

@ -17,6 +17,7 @@
package org.apache.commons.lang3.text;
import java.util.Map;
import java.util.Objects;
import org.apache.commons.lang3.SystemProperties;
@ -164,11 +165,7 @@ public abstract class StrLookup<V> {
if (map == null) {
return null;
}
final Object obj = map.get(key);
if (obj == null) {
return null;
}
return obj.toString();
return Objects.toString(map.get(key), null);
}
}