【J2SE】IntelliJ IDEA中Lambda表达式警告:Can be replaced with method reference less
来源:互联网 发布:社交网络中文 编辑:程序博客网 时间:2024/06/02 19:15
IntelliJ IDEA中Lambda表达式警告:Can be replaced with method reference less
Can be replaced with method reference less… (Ctrl+F1) This
inspection reports lambdas which can be replaced with method
references Lambda/method references syntax is not supported under Java
1.7 or earlier JVMs.
代码如下
@Test public void test() { ArrayList<String> strings = new ArrayList<>(); strings.add("1"); strings.add("2"); strings.add("3"); strings.add("4"); strings.forEach((String str)-> System.out.println(str)); }
应该把爆警告的那句话修改成
strings.forEach(System.out::println);
无警告多清爽!
3 0
- 【J2SE】IntelliJ IDEA中Lambda表达式警告:Can be replaced with method reference less
- Statement lambda can be replaced with expression lambda 的Warning
- IntelliJ Idea中使用Java8新特性lambda表达式
- Compile Less to CSS with IntelliJ IDEA
- Lambda Expressions (Method Reference)
- HashMap can be replaced with SparseArray--Android应用性能优化之使用SparseArray替代HashMap
- Intellij IDEA取消access can be private提示
- 设置Intellij idea和maven,支持lambda表达式
- IntelliJ 支持Lambda表达式
- IntelliJ IDEA中js代码报如下警告的解决方法
- IntelliJ IDEA中js代码报如下警告的解决方法
- IntelliJ IDEA中js代码报如下警告的解决方法
- IntelliJ IDEA 中 mybatis 对应的 xml 文件警告
- 去掉IntelliJ IDEA 中 mybatis 对应的 xml 文件警告
- git警告LF will be replaced by CRLF
- Git 警告 LF will be replaced by CRLF
- Git中的“LF will be replaced by CRLF”警告详解
- idea警告:'xxx==false' can be simplified to '!xxx'
- C语言基础知识总结
- 自定义的弹出浮动框-自动消失
- c++并发编程小记1
- 自定义view与自定义drawable在设置图像中的使用
- 学习jsp01
- 【J2SE】IntelliJ IDEA中Lambda表达式警告:Can be replaced with method reference less
- C语言错题集
- Java网络编程(一) TCP/IP,http,socket,长连接,短连接
- PL/Sql Dev调试Oracle存储过程、触发器、函数
- 采用系统API实现的二维码扫描、识别和生成
- centos 删除文件夹 permission denied, xxx is not in the sudoers file.
- 简单工厂模式学习
- 清风徐留一笑而过
- Lintcode_108 Palindrome Partitioning II