报告可用函数样式重写的、用作
if
或条件表达式条件的
Optional
表达式。 结果往往更短,更易于阅读。
示例:
if (str.isPresent()) str.get().trim();
在应用快速修复后:
str.ifPresent(String::trim);