mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Anonymous classes -> lambdas
GitOrigin-RevId: 186aeca8f513bdc8dbc952b29643e7618018ce20
This commit is contained in:
committed by
intellij-monorepo-bot
parent
19bbc8bde7
commit
cbca352982
+13
-16
@@ -309,23 +309,20 @@ public abstract class BaseStructureConfigurable extends MasterDetailsComponent i
|
||||
|
||||
final class MyRemoveAction extends MyDeleteAction {
|
||||
MyRemoveAction() {
|
||||
super(new Predicate<>() {
|
||||
@Override
|
||||
public boolean test(final Object[] objects) {
|
||||
List<MyNode> nodes = new ArrayList<>();
|
||||
for (Object object : objects) {
|
||||
if (!(object instanceof MyNode)) return false;
|
||||
nodes.add((MyNode)object);
|
||||
}
|
||||
MultiMap<RemoveConfigurableHandler, MyNode> map = groupNodes(nodes);
|
||||
for (Map.Entry<RemoveConfigurableHandler, Collection<MyNode>> entry : map.entrySet()) {
|
||||
//noinspection unchecked
|
||||
if (!entry.getKey().canBeRemoved(getEditableObjects(entry.getValue()))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
super((Predicate<Object[]>)objects -> {
|
||||
List<MyNode> nodes = new ArrayList<>();
|
||||
for (Object object : objects) {
|
||||
if (!(object instanceof MyNode)) return false;
|
||||
nodes.add((MyNode)object);
|
||||
}
|
||||
MultiMap<RemoveConfigurableHandler, MyNode> map = groupNodes(nodes);
|
||||
for (Map.Entry<RemoveConfigurableHandler, Collection<MyNode>> entry : map.entrySet()) {
|
||||
//noinspection unchecked
|
||||
if (!entry.getKey().canBeRemoved(getEditableObjects(entry.getValue()))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -471,12 +471,7 @@ public abstract class AbstractModuleDataService<E extends ModuleData> extends Ab
|
||||
}
|
||||
}
|
||||
|
||||
noOrderAwareItems.sort(new Comparator<>() {
|
||||
@Override
|
||||
public int compare(OrderEntry o1, OrderEntry o2) {
|
||||
return o1.toString().compareTo(o2.toString());
|
||||
}
|
||||
});
|
||||
noOrderAwareItems.sort(Comparator.comparing(Object::toString));
|
||||
|
||||
for (int i = 0; i < noOrderAwareItems.size(); i++) {
|
||||
newOrder[i] = noOrderAwareItems.get(i);
|
||||
|
||||
+4
-7
@@ -95,13 +95,10 @@ public class RecentProjectPanel extends JPanel {
|
||||
myList.setCellRenderer(createRenderer(myPathShortener));
|
||||
|
||||
if (Registry.is("autocheck.availability.welcome.screen.projects")) {
|
||||
myChecker = new FilePathChecker(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (myList.isShowing()) {
|
||||
myList.revalidate();
|
||||
myList.repaint();
|
||||
}
|
||||
myChecker = new FilePathChecker(() -> {
|
||||
if (myList.isShowing()) {
|
||||
myList.revalidate();
|
||||
myList.repaint();
|
||||
}
|
||||
}, pathsToCheck);
|
||||
Disposer.register(parentDisposable, myChecker);
|
||||
|
||||
+2
-10
@@ -2,14 +2,10 @@
|
||||
package com.siyeh.ig.inheritance;
|
||||
|
||||
import com.intellij.codeInspection.InspectionProfileEntry;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiClassOwner;
|
||||
import com.intellij.psi.search.searches.ClassInheritorsSearch;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.QueryExecutor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.siyeh.ig.LightJavaInspectionTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class AbstractMethodWithMissingImplementationsInspectionTest extends LightJavaInspectionTestCase {
|
||||
@@ -23,12 +19,8 @@ public class AbstractMethodWithMissingImplementationsInspectionTest extends Ligh
|
||||
}
|
||||
|
||||
public void testSearchReturnsUnrelatedClass() {
|
||||
ClassInheritorsSearch.EP_NAME.getPoint().registerExtension(new QueryExecutor<>() {
|
||||
@Override
|
||||
public boolean execute(@NotNull ClassInheritorsSearch.SearchParameters p, @NotNull Processor<? super PsiClass> consumer) {
|
||||
return ContainerUtil.process(((PsiClassOwner)p.getClassToProcess().getContainingFile()).getClasses(), consumer);
|
||||
}
|
||||
}, getTestRootDisposable());
|
||||
ClassInheritorsSearch.EP_NAME.getPoint().registerExtension(
|
||||
(p, consumer) -> ContainerUtil.process(((PsiClassOwner)p.getClassToProcess().getContainingFile()).getClasses(), consumer), getTestRootDisposable());
|
||||
doTest();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user