From 73d921c32058dd5ebe6e9a651e70c30172f5f353 Mon Sep 17 00:00:00 2001 From: m0rkeulv Date: Tue, 16 Feb 2021 21:17:28 +0100 Subject: [PATCH] Convert stream to for-loop --- .../plugins/haxe/lang/psi/impl/HaxeReferenceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxeReferenceImpl.java b/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxeReferenceImpl.java index fb72e942c..2111fdb53 100644 --- a/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxeReferenceImpl.java +++ b/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxeReferenceImpl.java @@ -639,10 +639,13 @@ private HaxeClassResolveResult resolveHaxeClassInternal() { HaxeTypeList list = listPart.getTypeList(); if(list != null) { list.getTypeListPartList(); - List classReferences = list.getTypeListPartList().stream() - .map(part -> part.getTypeOrAnonymous() == null ? null : part.getTypeOrAnonymous().getType()) - .filter(Objects::nonNull) - .collect(Collectors.toList()); + List classReferences = new ArrayList<>(); + for (HaxeTypeListPart part : list.getTypeListPartList()) { + HaxeType type = part.getTypeOrAnonymous() == null ? null : part.getTypeOrAnonymous().getType(); + if (type != null) { + classReferences.add(type); + } + } HaxeTypeParameterMultiType constraint = new HaxeTypeParameterMultiType(listPart.getContext().getNode(), classReferences); return HaxeClassResolveResult.create(constraint);