From 4e112eca7750a4f530c986be55c178c43c16d3ea Mon Sep 17 00:00:00 2001 From: Elliott Baron Date: Sat, 26 Jun 2010 22:27:34 -0400 Subject: Update codan plugins to CDT 7.0. * org.eclipse.cdt.codan.checkers.ui: Updated. * org.eclipse.cdt.codan.checkers: Updated. * org.eclipse.cdt.codan.core: Updated. * org.eclipse.cdt.codan.ui: Updated. * org.eclipse.cdt.codan.core.cxx: Added. * org.eclipse.cdt.codan.extension/META-INF/MANIFEST.MF: Import org.eclipse.cdt.codan.core.cxx.model. * org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/checkers/AbstractPropSimChecker.java: Superclass moved. --- .../org/eclipse/cdt/codan/checkers/ui/CVS/Entries | 2 - .../eclipse/cdt/codan/checkers/ui/CVS/Repository | 1 - .../src/org/eclipse/cdt/codan/checkers/ui/CVS/Root | 1 - .../org/eclipse/cdt/codan/checkers/ui/CVS/Template | 0 .../cdt/codan/checkers/ui/CheckersUiActivator.java | 50 ------------- .../cdt/codan/checkers/ui/quickfix/CVS/Entries | 2 - .../cdt/codan/checkers/ui/quickfix/CVS/Repository | 1 - .../cdt/codan/checkers/ui/quickfix/CVS/Root | 1 - .../cdt/codan/checkers/ui/quickfix/CVS/Template | 0 .../CodanProblemMarkerResolutionGenerator.java | 30 -------- .../ui/quickfix/QuickFixAssignmentInCondition.java | 82 ---------------------- 11 files changed, 170 deletions(-) delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Entries delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Repository delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Root delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Template delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CheckersUiActivator.java delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Entries delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Repository delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Root delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Template delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java delete mode 100644 org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixAssignmentInCondition.java (limited to 'org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui') diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Entries b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Entries deleted file mode 100644 index fc31844..0000000 --- a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Entries +++ /dev/null @@ -1,2 +0,0 @@ -/CheckersUiActivator.java/1.1/Sat Apr 18 02:11:07 2009// -D/quickfix//// diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Repository b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Repository deleted file mode 100644 index 25cd7cf..0000000 --- a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.cdt/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Root b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Root deleted file mode 100644 index 04efa23..0000000 --- a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:pserver:anonymous@dev.eclipse.org:/cvsroot/tools diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Template b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Template deleted file mode 100644 index e69de29..0000000 diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CheckersUiActivator.java b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CheckersUiActivator.java deleted file mode 100644 index 1635684..0000000 --- a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CheckersUiActivator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.cdt.codan.checkers.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class CheckersUiActivator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.cdt.codan.checkers.ui"; - - // The shared instance - private static CheckersUiActivator plugin; - - /** - * The constructor - */ - public CheckersUiActivator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static CheckersUiActivator getDefault() { - return plugin; - } - -} diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Entries b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Entries deleted file mode 100644 index 641ef34..0000000 --- a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Entries +++ /dev/null @@ -1,2 +0,0 @@ -/CodanProblemMarkerResolutionGenerator.java/1.2/Tue Apr 21 00:36:20 2009// -/QuickFixAssignmentInCondition.java/1.1/Sat Apr 18 02:11:07 2009// diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Repository b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Repository deleted file mode 100644 index 3bdd833..0000000 --- a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.cdt/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Root b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Root deleted file mode 100644 index 04efa23..0000000 --- a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:pserver:anonymous@dev.eclipse.org:/cvsroot/tools diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Template b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Template deleted file mode 100644 index e69de29..0000000 diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java deleted file mode 100644 index 1470e7f..0000000 --- a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Andrew Gvozdev - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andrew Gvozdev - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.codan.checkers.ui.quickfix; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.ui.IMarkerResolution; -import org.eclipse.ui.IMarkerResolutionGenerator; - -public class CodanProblemMarkerResolutionGenerator implements IMarkerResolutionGenerator { - public IMarkerResolution[] getResolutions(IMarker marker) { - final Pattern patternBuildDependsAdd = Pattern.compile("Possible assignment in condition.*"); - String description = marker.getAttribute(IMarker.MESSAGE, "no message"); - Matcher matcherBuildDependsAdd = patternBuildDependsAdd.matcher(description); - if (matcherBuildDependsAdd.matches()) { - return new IMarkerResolution[] { new QuickFixAssignmentInCondition() }; - } - return new IMarkerResolution[0]; - } -} \ No newline at end of file diff --git a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixAssignmentInCondition.java b/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixAssignmentInCondition.java deleted file mode 100644 index 5c28d53..0000000 --- a/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixAssignmentInCondition.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Andrew Gvozdev - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andrew Gvozdev - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.codan.checkers.ui.quickfix; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.FindReplaceDocumentAdapter; -import org.eclipse.jface.text.IDocument; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IMarkerResolution; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.texteditor.ITextEditor; - -public class QuickFixAssignmentInCondition implements IMarkerResolution { - public String getLabel() { - return "Change to '=='"; - } - - public void run(IMarker marker) { - // See if there is an open editor on the file containing the marker - IWorkbenchWindow w = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow(); - if (w == null) { - return; - } - IWorkbenchPage page = w.getActivePage(); - if (page == null) { - return; - } - IFileEditorInput input = new FileEditorInput((IFile) marker - .getResource()); - IEditorPart editorPart = page.findEditor(input); - if (editorPart == null) { - // open an editor - try { - editorPart = IDE.openEditor(page, (IFile) marker.getResource(), - true); - } catch (PartInitException e) { - e.printStackTrace(); - } - } - if (editorPart == null) { - return; - } - if (editorPart instanceof ITextEditor) { - ITextEditor editor = (ITextEditor) editorPart; - IDocument doc = editor.getDocumentProvider().getDocument( - editor.getEditorInput()); - int line = marker.getAttribute(IMarker.LINE_NUMBER, -1) - 1; - FindReplaceDocumentAdapter dad = new FindReplaceDocumentAdapter(doc); - try { - dad.find(doc.getLineOffset(line), "=", /* forwardSearch */ - true, /* caseSensitive */false, - /* wholeWord */false, /* regExSearch */false); - dad.replace("==", /* regExReplace */false); - marker.delete(); - } catch (BadLocationException e) { - // TODO: log the error - e.printStackTrace(); - } catch (CoreException e) { - // TODO: log the error - e.printStackTrace(); - } - } - } -} -- cgit