mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
debugger agent: ability to disable capturing
This commit is contained in:
+14
@@ -26,9 +26,13 @@ public class CaptureStorage {
|
||||
private static final JavaLangAccess ourJavaLangAccess = SharedSecrets.getJavaLangAccess();
|
||||
|
||||
private static boolean DEBUG = false;
|
||||
private static boolean ENABLED = true;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void capture(Object key) {
|
||||
if (!ENABLED) {
|
||||
return;
|
||||
}
|
||||
if (DEBUG) {
|
||||
System.out.println("capture - " + key);
|
||||
}
|
||||
@@ -50,6 +54,9 @@ public class CaptureStorage {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void insertEnter(Object key) {
|
||||
if (!ENABLED) {
|
||||
return;
|
||||
}
|
||||
CapturedStack stack = STORAGE.get(key);
|
||||
Deque<InsertMatch> currentStacks = CURRENT_STACKS.get();
|
||||
if (stack != null) {
|
||||
@@ -68,6 +75,9 @@ public class CaptureStorage {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void insertExit(Object key) {
|
||||
if (!ENABLED) {
|
||||
return;
|
||||
}
|
||||
Deque<InsertMatch> currentStacks = CURRENT_STACKS.get();
|
||||
currentStacks.removeLast();
|
||||
if (DEBUG) {
|
||||
@@ -156,4 +166,8 @@ public class CaptureStorage {
|
||||
public static void setDebug(boolean debug) {
|
||||
DEBUG = debug;
|
||||
}
|
||||
|
||||
public static void setEnabled(boolean enabled) {
|
||||
ENABLED = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,9 @@ public class CaptureAgent {
|
||||
DEBUG = true;
|
||||
CaptureStorage.setDebug(true);
|
||||
}
|
||||
else if ("disabled".equals(s)) {
|
||||
CaptureStorage.setEnabled(false);
|
||||
}
|
||||
else {
|
||||
asmPath = s;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user