Skip to content

Commit a284e36

Browse files
refactor: Use Platform.getDebugBoolean to read boolean tracing options (#1404)
1 parent fb5de3e commit a284e36

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/DSPPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* The activator class controls the plug-in life cycle
2323
*/
2424
public class DSPPlugin extends AbstractUIPlugin {
25-
public static final boolean DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.lsp4e.debug/debug")); //$NON-NLS-1$
25+
public static final boolean DEBUG = Platform.getDebugBoolean("org.eclipse.lsp4e.debug/debug"); //$NON-NLS-1$
2626

2727
// The plug-in ID
2828
public static final String PLUGIN_ID = "org.eclipse.lsp4e.debug"; //$NON-NLS-1$

org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/debugmodel/DSPDebugTarget.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,8 @@
9292
import org.eclipse.lsp4j.jsonrpc.validation.ReflectiveMessageValidator;
9393

9494
public class DSPDebugTarget extends DSPDebugElement implements IDebugTarget, IDebugProtocolClient {
95-
private static final boolean TRACE_IO = Boolean
96-
.parseBoolean(Platform.getDebugOption("org.eclipse.lsp4e.debug/trace/io")); //$NON-NLS-1$
97-
private static final boolean TRACE_MESSAGES = Boolean
98-
.parseBoolean(Platform.getDebugOption("org.eclipse.lsp4e.debug/trace/messages")); //$NON-NLS-1$
95+
private static final boolean TRACE_IO = Platform.getDebugBoolean("org.eclipse.lsp4e.debug/trace/io"); //$NON-NLS-1$
96+
private static final boolean TRACE_MESSAGES = Platform.getDebugBoolean("org.eclipse.lsp4e.debug/trace/messages"); //$NON-NLS-1$
9997

10098
/**
10199
* Any events we receive from the adapter that require further contact with the

org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class LanguageServerPlugin extends AbstractUIPlugin {
4747
public static final String PLUGIN_ID = "org.eclipse.lsp4e"; //$NON-NLS-1$
4848
private static final String TRACE_ID = PLUGIN_ID + "/trace"; //$NON-NLS-1$
4949

50-
public static final boolean DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.lsp4e/debug")); //$NON-NLS-1$
50+
public static final boolean DEBUG = Platform.getDebugBoolean("org.eclipse.lsp4e/debug"); //$NON-NLS-1$
5151

5252
// The shared instance
5353
private static volatile @Nullable LanguageServerPlugin plugin;
@@ -155,7 +155,7 @@ public static void logWarning(final @Nullable String message, final @Nullable Th
155155
* @return true if the trace debug option is enabled, false otherwise
156156
*/
157157
public static boolean isLogTraceEnabled() {
158-
return Boolean.parseBoolean(Platform.getDebugOption(TRACE_ID));
158+
return Platform.getDebugBoolean(TRACE_ID);
159159
}
160160

161161
}

0 commit comments

Comments
 (0)