IDEA-204310: Decompiler adds redundant imports for lambdas

This commit is contained in:
md_5
2018-12-18 16:38:48 +03:00
committed by Egor Ushakov
parent ca01d9877b
commit 8f2a97adc3
2 changed files with 136 additions and 138 deletions

View File

@@ -143,7 +143,8 @@ public class NewExprent extends Exprent {
if (anonymous) {
ClassNode child = DecompilerContext.getClassProcessor().getMapRootClasses().get(newType.value);
if (!enumConst) {
// IDEA-204310 - avoid backtracking later on for lambdas (causes spurious imports)
if (!enumConst && (!lambda || DecompilerContext.getOption(IFernflowerPreferences.LAMBDA_TO_ANONYMOUS_CLASS))) {
String enclosing = null;
if (!lambda && constructor != null) {