HandlersOnComplexUpdate.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:openjdk-jdk10 作者:
static void updateConfigurationWith(Properties propertyFile, boolean append) {
    try {
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        propertyFile.store(bytes, propertyFile.getProperty("test.name"));
        ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
        Function<String, BiFunction<String,String,String>> remapper =
                append ? (x) -> ((o, n) -> n == null ? o : n)
                       : (x) -> ((o, n) -> n);
        LogManager.getLogManager().updateConfiguration(bais, remapper);
    } catch (IOException ex) {
        throw new RuntimeException(ex);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号