java - 检查样式报告奇怪的缩进问题
问题描述
Checkstyle 仅针对以下代码抱怨不正确的缩进。我尝试通过 intellij 或手动格式化代码,但它们都不起作用。当我通过错误消息修复问题时,缩进级别仍然不正确,但数字发生了变化。
Map<MessageStatusAndErrorCode, Integer> result = MESSAGES_POLLER_EXECUTOR_SERVICE.invokeAll(callables).stream()
.map(stringFuture -> {
try {
return stringFuture.get();
} catch (InterruptedException | ExecutionException ex) {
throw new IllegalStateException(ex);
}
})
.collect(Collectors.groupingBy(Function.identity(), reducing(0, e -> 1, Integer::sum)));
messagesStatusCountMap.putAll(result);
来自 checkstyle 的错误消息:
'try' have incorrect indentation level 20, expected level should be 24.
Line 132'try' child have incorrect indentation level 24, expected level should be 28.
Line 133'try rcurly' have incorrect indentation level 20, expected level should be 24.
Line 134'catch' child have incorrect indentation level 24, expected level should be 28.
Line 135'block rcurly' have incorrect indentation level 22, expected level should be 20.
Line 135'catch rcurly' have incorrect indentation level 20, expected level should be 24.
解决方案
推荐阅读
- json - 如何使用 Scala 从 JSON 文件中读取字符串列表
- android - 一次性读取 Firebase Cloud (Dart/Flutter)
- google-chrome - WebBluetooth GATT Characteric Notification Setup too slow - 如何提高设置时间?
- flash - 如何让 Adobe Flash 在每个网络浏览器上运行
- reactjs - 为什么我的反应应用程序登录后没有重定向到主页?
- anaconda - Anaconda - 无法改变活动环境
- python - MacOS Catalina下无法安装python twint包
- mysql - 根据 LIKE 运算符从一个表中删除到另一个表
- python - 在 Pandas 中排列借方和贷方?
- optimization - 优化 google api 请求以从 youtube 视频中检索数据