From b44b47201be8957a730c3adb7cfeea53bb0d6da0 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Fri, 9 Sep 2016 17:16:08 +0700 Subject: [PATCH] IDEA-CR-13656 AntIntrospector.java: ContainerUtil.isEmpty() used; AntExplorer: better linebreaks --- plugins/ant/src/com/intellij/lang/ant/AntIntrospector.java | 3 ++- .../com/intellij/lang/ant/config/explorer/AntExplorer.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/ant/src/com/intellij/lang/ant/AntIntrospector.java b/plugins/ant/src/com/intellij/lang/ant/AntIntrospector.java index ff03f9506c81..cfd4c3241918 100644 --- a/plugins/ant/src/com/intellij/lang/ant/AntIntrospector.java +++ b/plugins/ant/src/com/intellij/lang/ant/AntIntrospector.java @@ -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 getExtensionPointTypes() { final List 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()); diff --git a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java index 75bcf481615b..5f64ea732aab 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java @@ -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() {