mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
isEmpty for maps
This commit is contained in:
+2
-1
@@ -26,6 +26,7 @@ import com.intellij.psi.JavaRecursiveElementVisitor;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiLocalVariable;
|
||||
import com.intellij.util.StringBuilderSpinAllocator;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.xdebugger.XDebugSession;
|
||||
import com.intellij.xdebugger.XDebuggerManager;
|
||||
import com.intellij.xdebugger.impl.XDebugSessionImpl;
|
||||
@@ -87,7 +88,7 @@ public class CodeFragmentFactoryContextWrapper extends CodeFragmentFactory {
|
||||
XValueMarkers<?, ?> markers = ((XDebugSessionImpl)session).getValueMarkers();
|
||||
Map<?, ValueMarkup> markupMap = markers != null ? markers.getAllMarkers() : null;
|
||||
//final Map<ObjectReference, ValueMarkup> markupMap = ValueDescriptorImpl.getMarkupMap(process);
|
||||
if (markupMap != null && markupMap.size() > 0) {
|
||||
if (ContainerUtil.isEmpty(markupMap)) {
|
||||
final Pair<String, Map<String, ObjectReference>> markupVariables = createMarkupVariablesText(markupMap);
|
||||
int offset = markupVariables.getFirst().length() - 1;
|
||||
final TextWithImportsImpl textWithImports = new TextWithImportsImpl(CodeFragmentKind.CODE_BLOCK, markupVariables.getFirst(), "", myDelegate.getFileType());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -2702,6 +2702,11 @@ public class ContainerUtil extends ContainerUtilRt {
|
||||
return collection == null || collection.isEmpty();
|
||||
}
|
||||
|
||||
@Contract(value = "null -> true", pure = true)
|
||||
public static boolean isEmpty(Map map) {
|
||||
return map == null || map.isEmpty();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Contract(pure=true)
|
||||
public static <T> List<T> notNullize(@Nullable List<T> list) {
|
||||
|
||||
Reference in New Issue
Block a user