优化updateEnvironmentProperty方法
This commit is contained in:
@@ -1720,20 +1720,28 @@ public final class Application {
|
|||||||
} else if (key.startsWith("mimetype.property.")) {
|
} else if (key.startsWith("mimetype.property.")) {
|
||||||
MimeType.add(key.substring("mimetype.property.".length()), val);
|
MimeType.add(key.substring("mimetype.property.".length()), val);
|
||||||
} else if (key.startsWith("property.")) {
|
} else if (key.startsWith("property.")) {
|
||||||
if (changeCache == null) {
|
Object old = resourceFactory.find(key, String.class);
|
||||||
resourceFactory.register(key, val);
|
if (!Objects.equals(val, old)) {
|
||||||
} else {
|
envProperties.put(key, val);
|
||||||
changeCache.put(key, val);
|
if (changeCache == null) {
|
||||||
|
resourceFactory.register(key, val);
|
||||||
|
} else {
|
||||||
|
changeCache.put(key, val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (key.startsWith("redkale.")) {
|
if (key.startsWith("redkale.")) {
|
||||||
throw new RuntimeException("property " + key + " cannot redkale. startsWith");
|
throw new RuntimeException("property " + key + " cannot redkale. startsWith");
|
||||||
}
|
}
|
||||||
envProperties.put(key, val);
|
String newkey = "property." + key;
|
||||||
if (changeCache == null) {
|
Object old = resourceFactory.find(newkey, String.class);
|
||||||
resourceFactory.register("property." + key, val);
|
if (!Objects.equals(val, old)) {
|
||||||
} else {
|
envProperties.put(key, val);
|
||||||
changeCache.put("property." + key, val);
|
if (changeCache == null) {
|
||||||
|
resourceFactory.register(newkey, val);
|
||||||
|
} else {
|
||||||
|
changeCache.put(newkey, val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user