新版IDEA特性--JAVA

新版IDEA特性–JAVA

2017.1 EAP

Replacing streams with loops

Replace complicated chains of stream API calls with for loops for better readability or debugging of complicated chains.
这里写图片描述

JUnit 5 inspections

All JUnit 4 inspections are now available for JUnit 5.
这里写图片描述

Regexp syntax highlighting

Dedicated section in Settings → Editor → Colors & Fonts for RegExp syntax highlighting.
这里写图片描述

Generating toString

Fields from superclasses are available when you’re generating toString methods.
这里写图片描述

Overriding methods

You can now choose which annotations will be copied to the overriding implementation from its super method.
这里写图片描述

2016.3 Nov 22

Refactoring to Java 8

Now, if you press Alt+Enter inside a non-trivial for-loop, the IDE will prompt you to replace it with a chain of stream API calls. It supports count, flatMap, map, mapToInt, collect, filter, anyMatch, and other Stream methods. learn more

Also, when appropriate, the IDE will prompt you to replace certain code with Map.computeIfAbsent, Collections.removeIf or ThreadLocal.withInitial. learn more

Reporting nullability issues

Now, if you have a method with a @NotNull or Guava’s Objects.requireNonNull contract and the IDE notices that this contract is broken somewhere in the project, it will notify you immediately about that next to your parameter definition.

The corresponding inspection also allows you to navigate to those usages breaking your contract–so you can fix that.
这里写图片描述

Inlining local variables used only by return statements

The new inspection finds local variables used only by return statements, and provides a quick fix that inlines these variables–by replacing their assignments with return statements.

When the returned value can’t be inlined into a return statement, the quick fix attempts to move the return statement as close to the computation of the returned value as possible.
learn more
这里写图片描述

Runtime assertions for not-null-annotated code

IntelliJ IDEA’s compiler (Settings → Build, Execution, Deployment → Compiler) has an option to generate runtime assertions for methods and parameters annotated with org.jetbrains.annotations.NotNull.
Starting now it supports non-JetBrains annotations as well, in particular JSR-305.
learn more
这里写图片描述

Some intentions became quick-fixes

Unlike intention actions, inspection quick-fixes can be applied to many files at once. We’ve chosen several intentions that may work better as quick-fixes and converted them: Lambda can be replaced with anonymous class and Diamond can be replaced with explicit type arguments to name a few.
这里写图片描述

Lambdas in Structure view

Now if you press Ctrl+L in the Structure view, it will show lambda expressions.
这里写图片描述

Unused declaration options

Now you can manage the Unused declaration inspection by choosing which members to report.

learn more

Meta-annotations hierarchy

The Type Hierarchy view now works for meta-annotations as well.
这里写图片描述

官网更新日志地址

官网日志链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值