Skip to content

Commit

Permalink
190: don't use iterable extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Jun 5, 2020
1 parent 20d0c90 commit a42c768
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions edelta.parent/edelta/src/edelta/compiler/EdeltaCompilerUtil.java
@@ -1,12 +1,12 @@
package edelta.compiler;

import static org.eclipse.xtext.xbase.lib.CollectionLiterals.newArrayList;
import static org.eclipse.xtext.xbase.lib.IterableExtensions.filterNull;
import static org.eclipse.xtext.xbase.lib.IterableExtensions.toList;
import static java.util.stream.Collectors.toList;

import java.util.List;
import java.util.Objects;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.emf.ecore.EPackage;

Expand Down Expand Up @@ -55,7 +55,12 @@ public <T extends Object> T buildMethodToCallForEcoreReference(final EdeltaEcore
ecoreReferenceInformationHelper.getOrComputeInformation(e);
return function.apply(
"get" + info.getType(),
toList(filterNull(newArrayList(
info.getEPackageName(), info.getEClassifierName(), info.getENamedElementName()))));
Stream.of(
info.getEPackageName(),
info.getEClassifierName(),
info.getENamedElementName())
.filter(Objects::nonNull)
.collect(toList())
);
}
}

0 comments on commit a42c768

Please sign in to comment.