参考:
https://blog.csdn.net/weixin_33881041/article/details/94735867

try (InputStream stream = PmdRulesDefinition.class.getResourceAsStream("/org/sonar/l10n/pmd.properties")) {
    properties.load(stream);
} catch (IOException e) {
    throw new IllegalArgumentException("Could not read names from properties", e);
}

优化后

try (InputStream stream = PmdRulesDefinition.class.getResourceAsStream("/org/sonar/l10n/pmd.properties")) {
    // 解决 p3c 中文标题乱码问题
    properties.load(new InputStreamReader(stream, StandardCharsets.UTF_8));
} catch (IOException e) {
    throw new IllegalArgumentException("Could not read names from properties", e);
}
GitHub 加速计划 / p3 / p3c
30.31 K
8.06 K
下载
Alibaba Java Coding Guidelines pmd implements and IDE plugin
最近提交(Master分支:1 个月前 )
6c59c8c3 We optimized two issues in the original document. 2 年前
22ab84e9 - 2 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐