IDEA-CR-13656 AntIntrospector.java: ContainerUtil.isEmpty() used; AntExplorer: better linebreaks

This commit is contained in:
Tagir Valeev
2016-09-09 17:18:05 +07:00
parent d6a072ba13
commit b44b47201b
2 changed files with 6 additions and 3 deletions
@@ -18,6 +18,7 @@ package com.intellij.lang.ant;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.Alarm;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.containers.ContainerUtil;
import org.apache.tools.ant.IntrospectionHelper;
import org.apache.tools.ant.TaskContainer;
import org.jetbrains.annotations.NonNls;
@@ -90,7 +91,7 @@ public final class AntIntrospector {
public Set<String> getExtensionPointTypes() {
final List<Method> methods = invokeMethod("getExtensionPoints", true);
if (methods == null || methods.isEmpty()) {
if (ContainerUtil.isEmpty(methods)) {
return Collections.emptySet();
}
return methods.stream().map(Method::getParameterTypes).flatMap(Arrays::stream).map(Class::getName).collect(Collectors.toSet());
@@ -345,9 +345,11 @@ public class AntExplorer extends SimpleToolWindowPanel implements DataProvider,
}
private static AntBuildTarget[] getTargetObjectsFromPaths(TreePath[] paths) {
return Arrays.stream(paths).map(path -> ((DefaultMutableTreeNode)path.getLastPathComponent()).getUserObject())
return Arrays.stream(paths)
.map(path -> ((DefaultMutableTreeNode)path.getLastPathComponent()).getUserObject())
.filter(userObject -> userObject instanceof AntTargetNodeDescriptor)
.map(userObject -> ((AntTargetNodeDescriptor)userObject).getTarget()).toArray(AntBuildTarget[]::new);
.map(userObject -> ((AntTargetNodeDescriptor)userObject).getTarget())
.toArray(AntBuildTarget[]::new);
}
public boolean isBuildFileSelected() {