From 4245a242bb87f8bd8e80855a8b65069c972f3944 Mon Sep 17 00:00:00 2001 From: "Vitaliy.Bibaev" Date: Fri, 1 Mar 2019 14:31:59 +0300 Subject: [PATCH] [memory-agent] Minor: cleanup --- .../com/intellij/debugger/memory/agent/MemoryAgentUtil.java | 4 ++-- .../debugger/memory/agent/extractor/AgentExtractor.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/memory/agent/MemoryAgentUtil.java b/java/debugger/impl/src/com/intellij/debugger/memory/agent/MemoryAgentUtil.java index d1e7cb71b9c9..fbc6fe959165 100644 --- a/java/debugger/impl/src/com/intellij/debugger/memory/agent/MemoryAgentUtil.java +++ b/java/debugger/impl/src/com/intellij/debugger/memory/agent/MemoryAgentUtil.java @@ -237,7 +237,7 @@ public class MemoryAgentUtil { private static void listenIfStartupFailed() { Project project = JavaDebuggerSupport.getContextProjectForEditorFieldsInDebuggerConfigurables(); - if (project == null || Boolean.TRUE.equals(project.getUserData(LISTEN_MEMORY_AGENT_STARTUP_FAILED))) return; + if (Boolean.TRUE.equals(project.getUserData(LISTEN_MEMORY_AGENT_STARTUP_FAILED))) return; project.getMessageBus().connect().subscribe(ExecutionManager.EXECUTION_TOPIC, new ExecutionListener() { @Override @@ -267,7 +267,7 @@ public class MemoryAgentUtil { String windowId = ExecutionManager.getInstance(project).getContentManager().getToolWindowIdByEnvironment(env); Attachment[] mentionsInOutput = StreamEx.of(mentions).map(x -> new Attachment("agent_mention.txt", x)) - .toArray(new Attachment[0]); + .toArray(Attachment.EMPTY_ARRAY); RuntimeExceptionWithAttachments exception = new RuntimeExceptionWithAttachments("Could not start debug process with memory agent", mentionsInOutput); String checkboxName = DebuggerBundle.message("label.debugger.general.configurable.enable.memory.agent"); diff --git a/java/debugger/memory-agent/src/com/intellij/debugger/memory/agent/extractor/AgentExtractor.kt b/java/debugger/memory-agent/src/com/intellij/debugger/memory/agent/extractor/AgentExtractor.kt index 2ebcd4e8124b..92a9ea92eba9 100644 --- a/java/debugger/memory-agent/src/com/intellij/debugger/memory/agent/extractor/AgentExtractor.kt +++ b/java/debugger/memory-agent/src/com/intellij/debugger/memory/agent/extractor/AgentExtractor.kt @@ -16,7 +16,7 @@ class AgentExtractor { return file } - public enum class AgentLibraryType(val prefix: String, val suffix: String) { + enum class AgentLibraryType(val prefix: String, val suffix: String) { WINDOWS32("", "32.dll"), WINDOWS64("", ".dll"), LINUX("lib", ".so"),