From 456afb3b8fa8433b347b493ffd61829e727e7e15 Mon Sep 17 00:00:00 2001 From: Alexander Fedorov Date: Wed, 1 Apr 2020 12:31:59 +0300 Subject: [PATCH] Bug 561637 - Remove Activator for CDT CodAn UI Cxx Removed org.eclipse.cdt.codan.internal.ui.cxx.Activator Change-Id: I0c1d55c0756762044d66746c276d28ae72ded7e6 Signed-off-by: Alexander Fedorov --- .../META-INF/MANIFEST.MF | 3 +- .../cdt/codan/internal/ui/cxx/Activator.java | 84 ------------------- .../codan/ui/AbstractAstRewriteQuickFix.java | 6 +- 3 files changed, 4 insertions(+), 89 deletions(-) delete mode 100644 codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Activator.java diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF index 213ec4dc694..b24969275f5 100644 --- a/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF +++ b/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF @@ -2,8 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.cdt.codan.ui.cxx;singleton:=true -Bundle-Version: 3.5.100.qualifier -Bundle-Activator: org.eclipse.cdt.codan.internal.ui.cxx.Activator +Bundle-Version: 3.5.200.qualifier Bundle-Vendor: %Bundle-Vendor Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Activator.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Activator.java deleted file mode 100644 index 6597696f1f1..00000000000 --- a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Activator.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Alena Laskavaia and others. - * - * 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 - * - * Contributors: - * Alena Laskavaia - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.codan.internal.ui.cxx; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.cdt.codan.internal.ui.cxx"; //$NON-NLS-1$ - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * Logs the specified status with this plug-in's log. - * - * @param status the status to log - */ - public static void log(IStatus status) { - getDefault().getLog().log(status); - } - - /** - * Logs an internal error with the specified throwable - * - * @param e the exception to be logged - */ - public static void log(Throwable e) { - log(new Status(IStatus.ERROR, PLUGIN_ID, 1, Messages.Activatior_Error, e)); - } - - /** - * Logs an internal error with the specified message. - * - * @param message - * the error message to log - */ - public static void log(String message) { - log(new Status(IStatus.ERROR, PLUGIN_ID, 1, message, null)); - } -} diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractAstRewriteQuickFix.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractAstRewriteQuickFix.java index 5711e00f035..2ec41a21fee 100644 --- a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractAstRewriteQuickFix.java +++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractAstRewriteQuickFix.java @@ -13,13 +13,13 @@ *******************************************************************************/ package org.eclipse.cdt.codan.ui; -import org.eclipse.cdt.codan.internal.ui.cxx.Activator; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.index.IIndex; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Platform; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.FindReplaceDocumentAdapter; import org.eclipse.jface.text.IDocument; @@ -42,7 +42,7 @@ public abstract class AbstractAstRewriteQuickFix extends AbstractCodanCMarkerRes try { index = getIndexFromMarker(marker); } catch (CoreException e) { - Activator.log(e); + Platform.getLog(getClass()).log(e.getStatus()); return; } // lock the index for read access @@ -57,7 +57,7 @@ public abstract class AbstractAstRewriteQuickFix extends AbstractCodanCMarkerRes index.releaseReadLock(); } } catch (Exception e) { - Activator.log(e); + Platform.getLog(getClass()).error(e.getMessage(), e); } }