mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Move AndroidUtil.isAndroidVM into DebuggerUtils
This commit is contained in:
@@ -461,7 +461,7 @@ public class ClassesFilteredView extends BorderLayoutPanel implements Disposable
|
||||
}
|
||||
|
||||
private Map<ReferenceType, Long> getInstancesCounts(@NotNull List<ReferenceType> classes, @NotNull VirtualMachine vm) {
|
||||
final int batchSize = AndroidUtil.isAndroidVM(vm)
|
||||
final int batchSize = DebuggerUtils.isAndroidVM(vm)
|
||||
? AndroidUtil.ANDROID_COUNT_BY_CLASSES_BATCH_SIZE
|
||||
: DEFAULT_BATCH_SIZE;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.intellij.debugger.memory.ui;
|
||||
|
||||
import com.intellij.debugger.DebuggerManager;
|
||||
import com.intellij.debugger.engine.DebugProcessImpl;
|
||||
import com.intellij.debugger.engine.DebuggerUtils;
|
||||
import com.intellij.debugger.engine.JavaValue;
|
||||
import com.intellij.debugger.engine.SuspendContextImpl;
|
||||
import com.intellij.debugger.engine.evaluation.EvaluationContext;
|
||||
@@ -260,7 +261,7 @@ public class InstancesWindow extends DialogWrapper {
|
||||
|
||||
@Override
|
||||
public void threadAction(@NotNull SuspendContextImpl suspendContext) {
|
||||
myIsAndroidVM = AndroidUtil.isAndroidVM(myDebugProcess.getVirtualMachineProxy().getVirtualMachine());
|
||||
myIsAndroidVM = DebuggerUtils.isAndroidVM(myDebugProcess.getVirtualMachineProxy().getVirtualMachine());
|
||||
final int limit = myIsAndroidVM
|
||||
? AndroidUtil.ANDROID_INSTANCES_LIMIT
|
||||
: DEFAULT_INSTANCES_LIMIT;
|
||||
|
||||
@@ -15,16 +15,7 @@
|
||||
*/
|
||||
package com.intellij.debugger.memory.utils;
|
||||
|
||||
import com.sun.jdi.VirtualMachine;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class AndroidUtil {
|
||||
public static final int ANDROID_COUNT_BY_CLASSES_BATCH_SIZE = 500;
|
||||
public static final int ANDROID_INSTANCES_LIMIT = 30000;
|
||||
|
||||
public static boolean isAndroidVM(@NotNull VirtualMachine vm) {
|
||||
return vm.name().toLowerCase(Locale.ENGLISH).contains("dalvik");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,4 +566,8 @@ public abstract class DebuggerUtils {
|
||||
return Arrays.stream(JavaDebugAware.EP_NAME.getExtensions())
|
||||
.anyMatch(provider -> breakpointAware ? provider.isBreakpointAware(file) : provider.isActionAware(file));
|
||||
}
|
||||
|
||||
public static boolean isAndroidVM(@NotNull VirtualMachine virtualMachine) {
|
||||
return StringUtil.containsIgnoreCase(virtualMachine.name(), "dalvik");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user