diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java index f526125903..1a0a9fb586 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -1183,18 +1183,15 @@ public class AutoAnalysisManager { } /** - * Get the time taken by a named task - * The names of tasks that have run can be retrieved using getTimedTasks + * {@return the time taken by a named task, or {@code -1} if the named task could not be found} + *

+ * The names of tasks that have run can be retrieved using {@link #getTimedTasks()}. + * * @param map the times by task names * @param taskName the task name - * @return the time taken by a named task */ public long getTaskTime(Map map, String taskName) { - Long time = map.get(taskName); - if (time == null) { - return -1; - } - return time.longValue(); + return map.getOrDefault(taskName, -1L); } /** @@ -1249,9 +1246,7 @@ public class AutoAnalysisManager { long taskTime = getTaskTime(timedTasks, element); double totalTime = taskTime / 1000.00; - String partTime = (((int) (totalTime * 1000.0)) % 1000) + ""; - String secString = - ((int) totalTime) + "." + "000".substring(partTime.length()) + partTime + " secs"; + String secString = String.format("%.3f secs", totalTime); int testLen = element.length() + secString.length(); if (testLen > spacer.length()) { testLen = spacer.length() - 5;