From 6dc4ea755986d89cf8c7b4e0602b1b5c176f8eb5 Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Thu, 23 May 2024 11:49:14 -0400 Subject: [PATCH] analysis.graph: Cleanup non-API deprecation issues in dependency graph Fixes issue #87 [Removed] CriticalPathModule [Removed] CriticalPathPalette Signed-off-by: Patrick Tasse --- .../AbstractCriticalPathModule.java | 11 ++- .../graph/core/base/CriticalPathPalette.java | 31 ------ .../analysis/graph/core/base/TmfGraph.java | 4 - .../core/criticalpath/CriticalPathModule.java | 98 ------------------- .../CriticalPathDataProvider.java | 4 +- .../graph/legacy/TmfGraphLegacyWrapper.java | 1 - 6 files changed, 10 insertions(+), 139 deletions(-) delete mode 100644 analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/base/CriticalPathPalette.java delete mode 100644 analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/criticalpath/CriticalPathModule.java diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/criticalpath/AbstractCriticalPathModule.java b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/criticalpath/AbstractCriticalPathModule.java index 6ea67b62ad..46358eeef9 100644 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/criticalpath/AbstractCriticalPathModule.java +++ b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/criticalpath/AbstractCriticalPathModule.java @@ -25,9 +25,9 @@ import org.eclipse.tracecompass.analysis.graph.core.graph.WorkerSerializer; import org.eclipse.tracecompass.common.core.NonNullUtils; import org.eclipse.tracecompass.internal.analysis.graph.core.Activator; -import org.eclipse.tracecompass.internal.analysis.graph.core.criticalpath.CriticalPathModule; import org.eclipse.tracecompass.internal.analysis.graph.core.criticalpath.Messages; import org.eclipse.tracecompass.internal.analysis.graph.core.criticalpath.OSCriticalPathAlgorithm; +import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule; import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException; import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager; @@ -41,7 +41,13 @@ * @author Geneviève Bastien * @since 4.0 */ -public abstract class AbstractCriticalPathModule extends CriticalPathModule { +public abstract class AbstractCriticalPathModule extends TmfAbstractAnalysisModule implements ICriticalPathProvider { + + /** + * Analysis ID for this module + * @since 5.0 + */ + public static final String ANALYSIS_ID = "org.eclipse.tracecompass.analysis.graph.core.criticalpath"; //$NON-NLS-1$ /** Worker_id parameter name */ public static final String PARAM_WORKER = "workerid"; //$NON-NLS-1$ @@ -62,7 +68,6 @@ public abstract class AbstractCriticalPathModule extends CriticalPathModule { * @since 1.1 */ public AbstractCriticalPathModule(AbstractTmfGraphBuilderModule graph) { - super(graph); addParameter(PARAM_WORKER); setId(ANALYSIS_ID); fGraphModule = graph; diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/base/CriticalPathPalette.java b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/base/CriticalPathPalette.java deleted file mode 100644 index 205faa2010..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/base/CriticalPathPalette.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020, 2022 École Polytechnique de Montréal - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - *******************************************************************************/ - -package org.eclipse.tracecompass.internal.analysis.graph.core.base; - -import java.util.Map; - -import org.eclipse.tracecompass.tmf.core.model.OutputElementStyle; - -@Deprecated -public class CriticalPathPalette { - - /** - * Get the map of all styles provided by this palette. These are the base - * styles, mapping to the key for each style. Styles for object can then - * refer to those base styles as parents. - * - * @return The map of style name to full style description. - */ - public static Map getStyles() { - return OSCriticalPathPalette.getStyles(); - } -} diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/base/TmfGraph.java b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/base/TmfGraph.java index 72e4165711..c0e7ea4e1d 100644 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/base/TmfGraph.java +++ b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/base/TmfGraph.java @@ -32,7 +32,6 @@ import org.eclipse.tracecompass.analysis.graph.core.graph.ITmfGraph; import org.eclipse.tracecompass.analysis.graph.core.graph.ITmfGraphVisitor; import org.eclipse.tracecompass.analysis.graph.core.graph.ITmfVertex; -import org.eclipse.tracecompass.analysis.graph.core.graph.TmfGraphFactory; import org.eclipse.tracecompass.common.core.NonNullUtils; import org.eclipse.tracecompass.internal.analysis.graph.core.base.TmfEdge.EdgeType; import org.eclipse.tracecompass.internal.analysis.graph.core.base.TmfVertex.EdgeDirection; @@ -55,10 +54,7 @@ * * @author Francis Giraldeau * @author Geneviève Bastien - * @deprecated Use the {@link ITmfGraph} API instead, and the - * {@link TmfGraphFactory} to create new graphs. */ -@Deprecated public class TmfGraph { private final ListMultimap fNodeMap; diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/criticalpath/CriticalPathModule.java b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/criticalpath/CriticalPathModule.java deleted file mode 100644 index a7f2166be0..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/criticalpath/CriticalPathModule.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015, 2024 École Polytechnique de Montréal and others - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - *******************************************************************************/ -package org.eclipse.tracecompass.internal.analysis.graph.core.criticalpath; - -import java.util.Objects; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.tracecompass.analysis.graph.core.base.IGraphWorker; -import org.eclipse.tracecompass.analysis.graph.core.building.AbstractTmfGraphBuilderModule; -import org.eclipse.tracecompass.analysis.graph.core.criticalpath.ICriticalPathProvider; -import org.eclipse.tracecompass.analysis.graph.core.criticalpath.OSCriticalPathModule; -import org.eclipse.tracecompass.internal.analysis.graph.core.base.TmfGraph; -import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule; -import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException; - -import com.google.common.annotations.VisibleForTesting; - -/** - * Class to implement the critical path analysis - * - * @author Francis Giraldeau - * @author Geneviève Bastien - */ -@Deprecated -public class CriticalPathModule extends TmfAbstractAnalysisModule implements ICriticalPathProvider { - /** - * Analysis ID for this module - */ - public static final String ANALYSIS_ID = "org.eclipse.tracecompass.analysis.graph.core.criticalpath"; //$NON-NLS-1$ - /** Worker_id parameter name */ - private @Nullable OSCriticalPathModule fCriticalPathModule; - private AbstractTmfGraphBuilderModule fGraph; - private @Nullable IGraphWorker fWorker; - - /** - * Default constructor - * - * @param graph - * The graph module that will be used to calculate the critical - * path on - * @since 4.0 - */ - public CriticalPathModule(AbstractTmfGraphBuilderModule graph) { - fGraph = graph; - } - - /** - * Constructor with the parameter. Can be used by benchmarks, to avoid that - * setting the parameter causes the module to be schedule and run in a job - * which keeps it in memory forever (and thus can cause OOME) - * - * @param graph - * The graph module that will be used to calculate the critical - * path on - * @param worker - * The worker parameter to set - * @since 4.0 - */ - @VisibleForTesting - public CriticalPathModule(AbstractTmfGraphBuilderModule graph, IGraphWorker worker) { - fGraph = graph; - fWorker = worker; - } - - private CriticalPathModule getCriticalPathModule() { - if (fCriticalPathModule == null) { - if (fWorker == null) { - fCriticalPathModule = new OSCriticalPathModule(fGraph); - } else { - fCriticalPathModule = new OSCriticalPathModule(fGraph, Objects.requireNonNull(fWorker)); - } - } - return Objects.requireNonNull(fCriticalPathModule); - } - - public @Nullable TmfGraph getCriticalPath() { - return getCriticalPathModule().getCriticalPath(); - } - - @Override - protected boolean executeAnalysis(IProgressMonitor monitor) throws TmfAnalysisException { - return getCriticalPathModule().executeAnalysis(monitor); - } - - @Override - protected void canceling() { - getCriticalPathModule().canceling(); - } -} \ No newline at end of file diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/dataprovider/CriticalPathDataProvider.java b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/dataprovider/CriticalPathDataProvider.java index 6526f0a43c..0dca8d7e3f 100644 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/dataprovider/CriticalPathDataProvider.java +++ b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/dataprovider/CriticalPathDataProvider.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2018, 2022 Ericsson + * Copyright (c) 2018, 2024 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License 2.0 which @@ -151,7 +151,7 @@ public CriticalPathDataProvider(@NonNull ITmfTrace trace, @NonNull AbstractCriti } /** - * Get the current {@link IGraphWorker} from the {@link CriticalPathModule} + * Get the current {@link IGraphWorker} from the critical path module * * @return the current graph worker if it is set, else null. */ diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/graph/legacy/TmfGraphLegacyWrapper.java b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/graph/legacy/TmfGraphLegacyWrapper.java index 41a27d182a..289a5da620 100644 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/graph/legacy/TmfGraphLegacyWrapper.java +++ b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/graph/legacy/TmfGraphLegacyWrapper.java @@ -35,7 +35,6 @@ * * @author Geneviève Bastien */ -@SuppressWarnings("deprecation") public class TmfGraphLegacyWrapper implements ITmfGraph { /* Latch tracking if the graph is done building or not */