|
@@ -15,15 +15,13 @@ import java.util.Properties;
|
|
|
*/
|
|
|
public class PropertiesUtils {
|
|
|
private static final Logger log = LoggerFactory.getLogger(PropertiesUtils.class);
|
|
|
- private static Map<String, String> cache = new HashMap<String, String>();
|
|
|
-
|
|
|
+ private static Map<String, String> cache = new HashMap<>();
|
|
|
public static String getConfig(String key) {
|
|
|
return getValue("kuaishou_config", key);
|
|
|
}
|
|
|
-
|
|
|
public static String getValue(String name, String key) {
|
|
|
try {
|
|
|
- String cacheValue = (String) cache.get(name + key);
|
|
|
+ String cacheValue = cache.get(name + key);
|
|
|
if (cacheValue != null) {
|
|
|
return cacheValue;
|
|
|
}
|
|
@@ -49,7 +47,7 @@ public class PropertiesUtils {
|
|
|
+ name + ".properties");
|
|
|
props.load(in);
|
|
|
Iterator<Object> it = props.keySet().iterator();
|
|
|
- Map<String, String> map = new HashMap<String, String>();
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
while (it.hasNext()) {
|
|
|
String key = it.next().toString();
|
|
|
String value = props.getProperty(key);
|