diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/AssignmentInConditionChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AssignmentInConditionChecker.java
similarity index 89%
rename from codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/AssignmentInConditionChecker.java
rename to codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AssignmentInConditionChecker.java
index d6881b045e0..ae8c8ecab36 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/AssignmentInConditionChecker.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AssignmentInConditionChecker.java
@@ -8,9 +8,9 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.examples.checkers;
+package org.eclipse.cdt.codan.internal.checkers;
-import org.eclipse.cdt.codan.core.model.AbstractIndexAstChecker;
+import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
@@ -20,7 +20,7 @@ import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
public class AssignmentInConditionChecker extends AbstractIndexAstChecker {
- private static final String ER_ID = "org.eclipse.cdt.codan.examples.checkers.AssignmentInConditionProblem";
+ private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem";
public void processAst(IASTTranslationUnit ast) {
// traverse the ast using the visitor pattern.
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/CatchUsesReference.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CatchUsesReference.java
similarity index 92%
rename from codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/CatchUsesReference.java
rename to codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CatchUsesReference.java
index 40a6a7b515e..d484f9204e1 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/CatchUsesReference.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CatchUsesReference.java
@@ -9,9 +9,9 @@
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.examples.checkers;
+package org.eclipse.cdt.codan.internal.checkers;
-import org.eclipse.cdt.codan.core.model.AbstractIndexAstChecker;
+import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -28,7 +28,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTryBlockStatement;
*
*/
public class CatchUsesReference extends AbstractIndexAstChecker {
- private static final String ER_ID = "org.eclipse.cdt.codan.examples.checkers.CatchUsesReference";
+ private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.CatchUsesReference";
public void processAst(IASTTranslationUnit ast) {
// traverse the ast using the visitor pattern.
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NamingConventionFunctionChecker.java
similarity index 90%
rename from codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionChecker.java
rename to codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NamingConventionFunctionChecker.java
index aa59036c65a..8de54135ead 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionChecker.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NamingConventionFunctionChecker.java
@@ -8,10 +8,11 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.examples.checkers;
+package org.eclipse.cdt.codan.internal.checkers;
import java.util.regex.Pattern;
-import org.eclipse.cdt.codan.core.model.AbstractCIndexChecker;
+
+import org.eclipse.cdt.codan.core.cxx.model.AbstractCIndexChecker;
import org.eclipse.cdt.codan.core.model.ICheckerWithParameters;
import org.eclipse.cdt.codan.core.model.IProblem;
import org.eclipse.cdt.codan.core.model.IProblemParameterInfo;
@@ -29,7 +30,7 @@ public class NamingConventionFunctionChecker extends AbstractCIndexChecker
implements ICheckerWithParameters {
private static final String DEFAULT_PATTERN = "^[a-z]"; // name starts with english lowercase letter //$NON-NLS-1$
public static final String PARAM_KEY = "pattern"; //$NON-NLS-1$
- private static final String ER_ID = "org.eclipse.cdt.codan.examples.checkers.NamingConventionFunctionProblem"; //$NON-NLS-1$
+ private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionProblem"; //$NON-NLS-1$
/*
* (non-Javadoc)
@@ -96,4 +97,11 @@ public class NamingConventionFunctionChecker extends AbstractCIndexChecker
problem.setParameter(PARAM_KEY, DEFAULT_PATTERN);
}
+
+
+
+ @Override
+ public boolean runInEditor() {
+ return false;
+ }
}
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/NonVirtualDestructor.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java
similarity index 96%
rename from codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/NonVirtualDestructor.java
rename to codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java
index 9a85168eb1e..68a6695dcea 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/NonVirtualDestructor.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java
@@ -8,12 +8,12 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.examples.checkers;
+package org.eclipse.cdt.codan.internal.checkers;
import java.text.MessageFormat;
import org.eclipse.cdt.codan.checkers.CodanCheckersActivator;
-import org.eclipse.cdt.codan.core.model.AbstractIndexAstChecker;
+import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
@@ -33,7 +33,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding;
*
*/
public class NonVirtualDestructor extends AbstractIndexAstChecker {
- private static final String ER_ID = "org.eclipse.cdt.codan.examples.checkers.NonVirtualDestructorProblem";
+ private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem";
public void processAst(IASTTranslationUnit ast) {
// traverse the ast using the visitor pattern.
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/StatementHasNoEffectChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/StatementHasNoEffectChecker.java
similarity index 93%
rename from codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/StatementHasNoEffectChecker.java
rename to codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/StatementHasNoEffectChecker.java
index 46e1647aea6..d380204e1ca 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/StatementHasNoEffectChecker.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/StatementHasNoEffectChecker.java
@@ -8,9 +8,9 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.examples.checkers;
+package org.eclipse.cdt.codan.internal.checkers;
-import org.eclipse.cdt.codan.core.model.AbstractIndexAstChecker;
+import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
@@ -36,7 +36,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
*
*/
public class StatementHasNoEffectChecker extends AbstractIndexAstChecker {
- private static final String ER_ID = "org.eclipse.cdt.codan.examples.checkers.StatementHasNoEffectProblem";
+ private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem";
public void processAst(IASTTranslationUnit ast) {
// traverse the ast using the visitor pattern.
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/SuggestedParenthesisChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/SuggestedParenthesisChecker.java
similarity index 95%
rename from codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/SuggestedParenthesisChecker.java
rename to codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/SuggestedParenthesisChecker.java
index b35ea559d00..b19e0e440f0 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/examples/checkers/SuggestedParenthesisChecker.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/SuggestedParenthesisChecker.java
@@ -8,9 +8,9 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.examples.checkers;
+package org.eclipse.cdt.codan.internal.checkers;
-import org.eclipse.cdt.codan.core.model.AbstractIndexAstChecker;
+import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
@@ -29,7 +29,7 @@ import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
*
*/
public class SuggestedParenthesisChecker extends AbstractIndexAstChecker {
- private static final String ER_ID = "org.eclipse.cdt.codan.examples.checkers.SuggestedParenthesisProblem";
+ private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem";
public void processAst(IASTTranslationUnit ast) {
// traverse the ast using the visitor pattern.
diff --git a/codan/org.eclipse.cdt.codan.core.cxx/.classpath b/codan/org.eclipse.cdt.codan.core.cxx/.classpath
new file mode 100644
index 00000000000..64c5e31b7a2
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.core.cxx/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/codan/org.eclipse.cdt.codan.core.cxx/.project b/codan/org.eclipse.cdt.codan.core.cxx/.project
new file mode 100644
index 00000000000..e7f17756d70
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.core.cxx/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.cdt.codan.core.cxx
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/codan/org.eclipse.cdt.codan.core.cxx/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.core.cxx/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..875ea0a7a71
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.core.cxx/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,75 @@
+#Thu Mar 18 10:02:18 EDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/codan/org.eclipse.cdt.codan.core.cxx/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.core.cxx/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..6e773161d2c
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.core.cxx/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Code Analysis Core for C/C++
+Bundle-SymbolicName: org.eclipse.cdt.codan.core.cxx;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.cdt.codan.core.cxx.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.cdt.core;bundle-version="5.2.0",
+ org.eclipse.cdt.codan.core;bundle-version="1.0.0",
+ org.eclipse.core.resources;bundle-version="3.6.0"
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.cdt.codan.core.cxx,
+ org.eclipse.cdt.codan.core.cxx.internal.model;x-friends:="org.eclipse.cdt.codan.checkers.ui,org.eclipse.cdt.codan.ui,org.eclipse.cdt.codan.ui.cxx",
+ org.eclipse.cdt.codan.core.cxx.model
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: CDT
diff --git a/codan/org.eclipse.cdt.codan.core.cxx/build.properties b/codan/org.eclipse.cdt.codan.core.cxx/build.properties
new file mode 100644
index 00000000000..34d2e4d2dad
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.core.cxx/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/Activator.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/Activator.java
new file mode 100644
index 00000000000..ab9f071891e
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.cdt.codan.core.cxx;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.cdt.codan.core.cxx"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#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 Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/internal/model/CxxCodanRenciler.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/internal/model/CxxCodanRenciler.java
new file mode 100644
index 00000000000..aad4ddbac60
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/internal/model/CxxCodanRenciler.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Alena Laskavaia
+ * 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:
+ * Alena Laskavaia - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.codan.core.cxx.internal.model;
+
+import java.io.File;
+import java.net.URI;
+
+import org.eclipse.cdt.codan.internal.core.CodanBuilder;
+import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * @author Alena
+ *
+ */
+
+public class CxxCodanRenciler {
+ private CodanBuilder builder = new CodanBuilder();
+
+ public void reconciledAst(IASTTranslationUnit ast, IProgressMonitor monitor) {
+ if (ast == null)
+ return;
+ String filePath = ast.getFilePath();
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ IWorkspaceRoot root = workspace.getRoot();
+ IFile[] resources;
+ URI uri = new File(filePath).toURI();
+ resources = root.findFilesForLocationURI(uri);
+ if (resources != null && resources.length > 0) {
+ IFile resource = resources[0];
+ builder.runInEditor(ast, resource, monitor);
+ }
+ }
+}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractCIndexChecker.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractCIndexChecker.java
similarity index 94%
rename from codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractCIndexChecker.java
rename to codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractCIndexChecker.java
index fba9a0e093a..f2ca77c7c01 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractCIndexChecker.java
+++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractCIndexChecker.java
@@ -8,9 +8,10 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.core.model;
+package org.eclipse.cdt.codan.core.cxx.model;
import org.eclipse.cdt.codan.core.CodanCorePlugin;
+import org.eclipse.cdt.codan.core.model.AbstractChecker;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.CoreModel;
@@ -68,6 +69,6 @@ public abstract class AbstractCIndexChecker extends AbstractChecker implements I
@Override
public boolean runInEditor() {
- return true;
+ return false;
}
}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java
similarity index 68%
rename from codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java
rename to codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java
index 660c019c9fe..9e9c646de40 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java
+++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java
@@ -8,9 +8,12 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.core.model;
+package org.eclipse.cdt.codan.core.cxx.model;
import org.eclipse.cdt.codan.core.CodanCorePlugin;
+import org.eclipse.cdt.codan.core.model.AbstractChecker;
+import org.eclipse.cdt.codan.core.model.IRunnableInEditorChecker;
+import org.eclipse.cdt.codan.core.model.IProblemLocation;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
import org.eclipse.cdt.core.dom.ast.IASTNode;
@@ -27,11 +30,13 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
/**
- * Convenience implementation of checker that work on index based ast of a c/c++ program.
+ * Convenience implementation of checker that work on index based ast of a c/c++
+ * program.
*
* Clients may extend this class.
*/
-public abstract class AbstractIndexAstChecker extends AbstractChecker implements ICAstChecker {
+public abstract class AbstractIndexAstChecker extends AbstractChecker implements
+ ICAstChecker, IRunnableInEditorChecker {
private IFile file;
protected IFile getFile() {
@@ -41,14 +46,16 @@ public abstract class AbstractIndexAstChecker extends AbstractChecker implements
void processFile(IFile file) throws CoreException, InterruptedException {
// create translation unit and access index
ICElement model = CoreModel.getDefault().create(file);
- if (!(model instanceof ITranslationUnit)) return; // not a C/C++ file
+ if (!(model instanceof ITranslationUnit))
+ return; // not a C/C++ file
ITranslationUnit tu = (ITranslationUnit) model;
IIndex index = CCorePlugin.getIndexManager().getIndex(tu.getCProject());
// lock the index for read access
index.acquireReadLock();
try {
// create index based ast
- IASTTranslationUnit ast = tu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
+ IASTTranslationUnit ast = tu.getAST(index,
+ ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
// traverse the ast using the visitor pattern.
this.file = file;
processAst(ast);
@@ -76,16 +83,24 @@ public abstract class AbstractIndexAstChecker extends AbstractChecker implements
public void reportProblem(String id, IASTNode astNode, String message) {
IASTFileLocation astLocation = astNode.getFileLocation();
IPath location = new Path(astLocation.getFileName());
- IFile astFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(location);
+ IFile astFile = ResourcesPlugin.getWorkspace().getRoot()
+ .getFileForLocation(location);
if (astFile == null) {
astFile = file;
}
IProblemLocation loc;
- if (astLocation.getStartingLineNumber() == astLocation.getEndingLineNumber()) loc = getRuntime()
- .getProblemLocationFactory().createProblemLocation(astFile, astLocation.getNodeOffset(),
- astLocation.getNodeOffset() + astLocation.getNodeLength());
- else loc = getRuntime().getProblemLocationFactory().createProblemLocation(astFile,
- astLocation.getStartingLineNumber());
+ if (astLocation.getStartingLineNumber() == astLocation
+ .getEndingLineNumber())
+ loc = getRuntime().getProblemLocationFactory()
+ .createProblemLocation(
+ astFile,
+ astLocation.getNodeOffset(),
+ astLocation.getNodeOffset()
+ + astLocation.getNodeLength());
+ else
+ loc = getRuntime().getProblemLocationFactory()
+ .createProblemLocation(astFile,
+ astLocation.getStartingLineNumber());
getProblemReporter().reportProblem(id, loc, message);
}
@@ -93,4 +108,16 @@ public abstract class AbstractIndexAstChecker extends AbstractChecker implements
public boolean runInEditor() {
return true;
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.cdt.codan.core.model.IRunnableInEditorChecker#processModel
+ * (java.lang.Object)
+ */
+ public void processModel(Object model) {
+ if (model instanceof IASTTranslationUnit)
+ processAst((IASTTranslationUnit) model);
+ }
}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICAstChecker.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/ICAstChecker.java
similarity index 92%
rename from codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICAstChecker.java
rename to codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/ICAstChecker.java
index 2a16a8bddf1..958dcc8539d 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICAstChecker.java
+++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/ICAstChecker.java
@@ -8,8 +8,9 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.core.model;
+package org.eclipse.cdt.codan.core.cxx.model;
+import org.eclipse.cdt.codan.core.model.IChecker;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
/**
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICIndexChecker.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/ICIndexChecker.java
similarity index 92%
rename from codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICIndexChecker.java
rename to codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/ICIndexChecker.java
index c619b220511..c9489d3c735 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICIndexChecker.java
+++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/ICIndexChecker.java
@@ -8,8 +8,9 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.core.model;
+package org.eclipse.cdt.codan.core.cxx.model;
+import org.eclipse.cdt.codan.core.model.IChecker;
import org.eclipse.cdt.core.model.ITranslationUnit;
/**
diff --git a/codan/org.eclipse.cdt.codan.core.test/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.core.test/.settings/org.eclipse.jdt.core.prefs
index 8f0056bb774..ce1edfa7abc 100644
--- a/codan/org.eclipse.cdt.codan.core.test/.settings/org.eclipse.jdt.core.prefs
+++ b/codan/org.eclipse.cdt.codan.core.test/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,71 @@
-#Fri Nov 20 21:39:21 EST 2009
+#Thu Mar 18 10:02:24 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
diff --git a/codan/org.eclipse.cdt.codan.core.test/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.core.test/META-INF/MANIFEST.MF
index 262a81bc8ee..f1f83637388 100644
--- a/codan/org.eclipse.cdt.codan.core.test/META-INF/MANIFEST.MF
+++ b/codan/org.eclipse.cdt.codan.core.test/META-INF/MANIFEST.MF
@@ -12,4 +12,4 @@ Require-Bundle: org.eclipse.core.runtime,
org.junit;bundle-version="3.8.2",
org.eclipse.cdt.codan.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/codan/org.eclipse.cdt.codan.core/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.core/.settings/org.eclipse.jdt.core.prefs
index 4452aeeb4a3..3bb329ccc8a 100644
--- a/codan/org.eclipse.cdt.codan.core/.settings/org.eclipse.jdt.core.prefs
+++ b/codan/org.eclipse.cdt.codan.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Mon Aug 10 14:23:53 EDT 2009
+#Thu Mar 18 10:02:03 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
@@ -7,6 +7,69 @@ org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
diff --git a/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF
index b6eba46dfdd..c850ba6e49b 100644
--- a/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF
+++ b/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF
@@ -2,14 +2,18 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Code Analysis Core
Bundle-SymbolicName: org.eclipse.cdt.codan.core;singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.codan.core.CodanCorePlugin
Bundle-Vendor: CDT
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.cdt.core
+ org.eclipse.core.resources
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.eclipse.cdt.codan.core,
org.eclipse.cdt.codan.core.model,
- org.eclipse.cdt.codan.internal.core;x-friends:="org.eclipse.cdt.codan.core,org.eclipse.cdt.codan.core.test,org.eclipse.cdt.codan.ui"
+ org.eclipse.cdt.codan.internal.core;
+ x-friends:="org.eclipse.cdt.codan.core,
+ org.eclipse.cdt.codan.core.cxx,
+ org.eclipse.cdt.codan.core.test,
+ org.eclipse.cdt.codan.ui",
+ org.eclipse.cdt.codan.internal.core.model;x-friends:="org.eclipse.cdt.codan.core.cxx,org.eclipse.cdt.codan.core.test,org.eclipse.cdt.codan.ui"
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanRuntime.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanRuntime.java
index 2b0d603c665..c311ee6c2a7 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanRuntime.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanRuntime.java
@@ -11,7 +11,6 @@
package org.eclipse.cdt.codan.core;
import org.eclipse.cdt.codan.core.model.ICheckersRegistry;
-import org.eclipse.cdt.codan.core.model.ICodanAstReconciler;
import org.eclipse.cdt.codan.core.model.ICodanBuilder;
import org.eclipse.cdt.codan.core.model.IProblemLocationFactory;
import org.eclipse.cdt.codan.core.model.IProblemReporter;
@@ -26,20 +25,21 @@ import org.eclipse.cdt.codan.internal.core.model.ProblemLocationFactory;
* Clients may extend this class to override default framework parts.
*
*
- * EXPERIMENTAL. This class or interface has been added as
- * part of a work in progress. There is no guarantee that this API will
- * work or that it will remain the same.
+ * EXPERIMENTAL. This class or interface has been added as part
+ * of a work in progress. There is no guarantee that this API will work or that
+ * it will remain the same.
*
*/
public class CodanRuntime {
private static CodanRuntime instance = new CodanRuntime();
private IProblemReporter problemReporter = new CodanMarkerProblemReporter();
- private CodanBuilder builder = new CodanBuilder();
+ private ICodanBuilder builder = new CodanBuilder();
private CheckersRegisry checkers = CheckersRegisry.getInstance();
private IProblemLocationFactory locFactory = new ProblemLocationFactory();
/**
- * CodanRuntime - only can be called by subclasses to override default constructor
+ * CodanRuntime - only can be called by subclasses to override default
+ * constructor
*/
protected CodanRuntime() {
// nothing here
@@ -47,6 +47,7 @@ public class CodanRuntime {
/**
* Get runtime problem reporter. Default reported generated problem markers.
+ *
* @return
*/
public IProblemReporter getProblemReporter() {
@@ -55,6 +56,7 @@ public class CodanRuntime {
/**
* Set different problem reporter.
+ *
* @param reporter
*/
public void setProblemReporter(IProblemReporter reporter) {
@@ -63,6 +65,7 @@ public class CodanRuntime {
/**
* Get instance of of Codan Runtime
+ *
* @return
*/
public static CodanRuntime getInstance() {
@@ -70,7 +73,9 @@ public class CodanRuntime {
}
/**
- * Get builder. Builder can used to run code analysis on given resource using API.
+ * Get builder. Builder can used to run code analysis on given resource
+ * using API.
+ *
* @return
*/
public ICodanBuilder getBuilder() {
@@ -78,15 +83,8 @@ public class CodanRuntime {
}
/**
- * Get quick builder. Can be used to run code analysis on given ast.
- * @return
- */
- public ICodanAstReconciler getAstQuickBuilder() {
- return builder;
- }
-
- /**
- * Get checkers registry.
+ * Get checkers registry.
+ *
* @return
*/
public ICheckersRegistry getChechersRegistry() {
@@ -95,6 +93,7 @@ public class CodanRuntime {
/**
* Get problem location factory.
+ *
* @return
*/
public IProblemLocationFactory getProblemLocationFactory() {
@@ -102,8 +101,9 @@ public class CodanRuntime {
}
/**
- * Set another problem location factory - only need if default is not sufficient, i.e
- * IProblemLocation is implemented differently
+ * Set another problem location factory - only need if default is not
+ * sufficient, i.e IProblemLocation is implemented differently
+ *
* @param factory
*/
public void setProblemLocationFactory(IProblemLocationFactory factory) {
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemReporterPersistent.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemReporterPersistent.java
new file mode 100644
index 00000000000..26c79912405
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemReporterPersistent.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Alena Laskavaia
+ * 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:
+ * Alena Laskavaia - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.codan.core.model;
+
+import org.eclipse.core.resources.IResource;
+
+/**
+ * IProblemReporterPersistent - interface to report problems, which are
+ * persistent, ex. markers
+ *
+ * Clients may implement and extend this interface
+ *
+ * EXPERIMENTAL. This class or interface has been added as part
+ * of a work in progress. There is no guarantee that this API will work or that
+ * it will remain the same.
+ *
+ */
+public interface IProblemReporterPersistent extends IProblemReporter {
+ /**
+ * Delete all problems associated with resource created by given checker
+ *
+ * @param resource
+ * @param checker
+ */
+ public void deleteProblems(IResource resource, IChecker checker);
+
+ /**
+ * Delete all problems associated with resource
+ *
+ * @param resource
+ */
+ public void deleteProblems(IResource resource);
+
+ /**
+ * Delete all persisted problems
+ */
+ public void deleteAllProblems();
+}
\ No newline at end of file
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICodanAstReconciler.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IRunnableInEditorChecker.java
similarity index 64%
rename from codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICodanAstReconciler.java
rename to codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IRunnableInEditorChecker.java
index 1920180e39e..f77b90885e0 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICodanAstReconciler.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IRunnableInEditorChecker.java
@@ -10,21 +10,17 @@
*******************************************************************************/
package org.eclipse.cdt.codan.core.model;
-import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
-import org.eclipse.core.runtime.IProgressMonitor;
-
/**
- * Allows to run all checkers that can run on ast via editing using API
+ * Interface for checkers that can be run when user is typing, checker has to be
+ * very quick to run in this mode
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
- *
+ * Extend AbstractChecker class instead.
*/
-public interface ICodanAstReconciler {
+public interface IRunnableInEditorChecker {
/**
- * Run code analysis on ast
- * @param ast - ast to be reconciled
- * @param monitor - progress monitor
+ * @param model
*/
- public void reconcileAst(IASTTranslationUnit ast, IProgressMonitor monitor);
-}
\ No newline at end of file
+ void processModel(Object model);
+}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegisry.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegisry.java
index 90dea4cdb9b..d7f1a1ec504 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegisry.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegisry.java
@@ -58,9 +58,10 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
}
private void readCheckersRegistry() {
- IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(CodanCorePlugin.PLUGIN_ID,
- EXTENSION_POINT_NAME);
- if (ep == null) return;
+ IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(
+ CodanCorePlugin.PLUGIN_ID, EXTENSION_POINT_NAME);
+ if (ep == null)
+ return;
IConfigurationElement[] elements = ep.getConfigurationElements();
// process categories
for (int i = 0; i < elements.length; i++) {
@@ -78,14 +79,17 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
processChecker(configurationElement);
}
// init parameters for checkers with parameters
- for (Iterator iterator = problemList.keySet().iterator(); iterator.hasNext();) {
+ for (Iterator iterator = problemList.keySet().iterator(); iterator
+ .hasNext();) {
IChecker c = iterator.next();
if (c instanceof ICheckerWithParameters) {
Collection list = problemList.get(c);
- for (Iterator iterator2 = list.iterator(); iterator2.hasNext();) {
+ for (Iterator iterator2 = list.iterator(); iterator2
+ .hasNext();) {
IProblem p = iterator2.next();
if (p instanceof IProblemWorkingCopy) {
- ((ICheckerWithParameters) c).initParameters((IProblemWorkingCopy) p);
+ ((ICheckerWithParameters) c)
+ .initParameters((IProblemWorkingCopy) p);
}
}
}
@@ -98,11 +102,14 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
private void processCategories(IConfigurationElement configurationElement) {
if (configurationElement.getName().equals(CATEGORY_ELEMENT)) {
String id = getAtt(configurationElement, ID_ATTR);
- if (id == null) return;
+ if (id == null)
+ return;
String name = getAtt(configurationElement, NAME_ATTR);
- if (name == null) return;
+ if (name == null)
+ return;
CodanProblemCategory cat = new CodanProblemCategory(id, name);
- String category = getAtt(configurationElement, "parentCategory", false); //$NON-NLS-1$
+ String category = getAtt(configurationElement,
+ "parentCategory", false); //$NON-NLS-1$
addCategory(cat, category);
}
}
@@ -114,21 +121,26 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
try {
if (configurationElement.getName().equals(CHECKER_ELEMENT)) {
String id = getAtt(configurationElement, ID_ATTR);
- if (id == null) return;
+ if (id == null)
+ return;
String name = getAtt(configurationElement, NAME_ATTR, false);
- if (name == null) name = id;
+ if (name == null)
+ name = id;
IChecker checkerObj = null;
try {
- Object checker = configurationElement.createExecutableExtension("class"); //$NON-NLS-1$
+ Object checker = configurationElement
+ .createExecutableExtension("class"); //$NON-NLS-1$
checkerObj = (IChecker) checker;
addChecker(checkerObj);
} catch (CoreException e) {
CodanCorePlugin.log(e);
return;
}
- IConfigurationElement[] children1 = configurationElement.getChildren("problemRef"); //$NON-NLS-1$
+ IConfigurationElement[] children1 = configurationElement
+ .getChildren("problemRef"); //$NON-NLS-1$
boolean hasRef = false;
- IConfigurationElement[] children2 = configurationElement.getChildren(PROBLEM_ELEMENT);
+ IConfigurationElement[] children2 = configurationElement
+ .getChildren(PROBLEM_ELEMENT);
if (children2 != null) {
for (IConfigurationElement ref : children2) {
IProblem p = processProblem(ref);
@@ -139,7 +151,8 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
if (children1 != null) {
for (IConfigurationElement ref : children1) {
hasRef = true;
- IProblem p = getDefaultProfile().findProblem(ref.getAttribute("refId")); //$NON-NLS-1$
+ IProblem p = getDefaultProfile().findProblem(
+ ref.getAttribute("refId")); //$NON-NLS-1$
addRefProblem(checkerObj, p);
}
}
@@ -158,15 +171,19 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
* @param configurationElement
* @return
*/
- private CodanProblem processProblem(IConfigurationElement configurationElement) {
+ private CodanProblem processProblem(
+ IConfigurationElement configurationElement) {
if (configurationElement.getName().equals(PROBLEM_ELEMENT)) {
String id = getAtt(configurationElement, ID_ATTR);
- if (id == null) return null;
+ if (id == null)
+ return null;
String name = getAtt(configurationElement, NAME_ATTR);
- if (name == null) name = id;
+ if (name == null)
+ name = id;
CodanProblem p = new CodanProblem(id, name);
String category = getAtt(configurationElement, "category", false); //$NON-NLS-1$
- if (category == null) category = "org.eclipse.cdt.codan.core.categories.ProgrammingProblems"; //$NON-NLS-1$
+ if (category == null)
+ category = "org.eclipse.cdt.codan.core.categories.ProgrammingProblems"; //$NON-NLS-1$
String enab = getAtt(configurationElement, "defaultEnabled", false); //$NON-NLS-1$
String sev = getAtt(configurationElement, "defaultSeverity", false); //$NON-NLS-1$
String patt = getAtt(configurationElement, "messagePattern", false); //$NON-NLS-1$
@@ -175,7 +192,8 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
}
if (sev != null) {
CodanSeverity cSev = CodanSeverity.valueOf(sev);
- if (cSev != null) p.setSeverity(cSev);
+ if (cSev != null)
+ p.setSeverity(cSev);
}
if (patt != null) {
p.setMessagePattern(patt);
@@ -186,15 +204,18 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
return null;
}
- private static String getAtt(IConfigurationElement configurationElement, String name) {
+ private static String getAtt(IConfigurationElement configurationElement,
+ String name) {
return getAtt(configurationElement, name, true);
}
- private static String getAtt(IConfigurationElement configurationElement, String name, boolean req) {
+ private static String getAtt(IConfigurationElement configurationElement,
+ String name, boolean req) {
String elementValue = configurationElement.getAttribute(name);
if (elementValue == null && req)
- CodanCorePlugin.log("Extension " + configurationElement.getDeclaringExtension().getUniqueIdentifier() //$NON-NLS-1$
- + " missing required attribute: " + configurationElement.getName() + "." + name); //$NON-NLS-1$ //$NON-NLS-2$
+ CodanCorePlugin
+ .log("Extension " + configurationElement.getDeclaringExtension().getUniqueIdentifier() //$NON-NLS-1$
+ + " missing required attribute: " + configurationElement.getName() + "." + name); //$NON-NLS-1$ //$NON-NLS-2$
return elementValue;
}
@@ -208,7 +229,8 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
}
public static CheckersRegisry getInstance() {
- if (instance == null) return new CheckersRegisry();
+ if (instance == null)
+ return new CheckersRegisry();
return instance;
}
@@ -232,7 +254,8 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
*/
public void addProblem(IProblem p, String category) {
IProblemCategory cat = getDefaultProfile().findCategory(category);
- if (cat == null) cat = getDefaultProfile().getRoot();
+ if (cat == null)
+ cat = getDefaultProfile().getRoot();
((ProblemProfile) getDefaultProfile()).addProblem(p, cat);
}
@@ -245,7 +268,8 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
*/
public void addCategory(IProblemCategory p, String category) {
IProblemCategory cat = getDefaultProfile().findCategory(category);
- if (cat == null) cat = getDefaultProfile().getRoot();
+ if (cat == null)
+ cat = getDefaultProfile().getRoot();
((ProblemProfile) getDefaultProfile()).addCategory(p, cat);
}
@@ -312,7 +336,8 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
IProblemProfile defaultProfile = getDefaultProfile();
profiles.clear();
profiles.put(DEFAULT, defaultProfile);
- if (profile != null && element != null) profiles.put(element, profile);
+ if (profile != null && element != null)
+ profiles.put(element, profile);
}
/*
@@ -329,9 +354,13 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
try {
prof = (IProblemProfile) getWorkspaceProfile().clone();
// load default values
- CodanPreferencesLoader loader = new CodanPreferencesLoader(prof);
- IEclipsePreferences node = new ProjectScope((IProject) element).getNode(CodanCorePlugin.PLUGIN_ID);
- boolean useWorkspace = node.getBoolean(PreferenceConstants.P_USE_PARENT, false);
+ CodanPreferencesLoader loader = new CodanPreferencesLoader(
+ prof);
+ IEclipsePreferences node = new ProjectScope(
+ (IProject) element)
+ .getNode(CodanCorePlugin.PLUGIN_ID);
+ boolean useWorkspace = node.getBoolean(
+ PreferenceConstants.P_USE_PARENT, false);
if (!useWorkspace) {
loader.load(node);
}
@@ -356,13 +385,38 @@ public class CheckersRegisry implements Iterable, ICheckersRegistry {
* getResourceProfileWorkingCopy(org.eclipse.core.resources.IResource)
*/
public IProblemProfile getResourceProfileWorkingCopy(IResource element) {
-
try {
- IProblemProfile prof = (IProblemProfile) getResourceProfile(element).clone();
+ IProblemProfile prof = (IProblemProfile) getResourceProfile(element)
+ .clone();
return prof;
} catch (CloneNotSupportedException e) {
// cant
return null;
}
}
+
+ /**
+ * Test if checker is enabled (needs to be run) or not. Checker is enabled
+ * if at least one problem it prints is enabled.
+ *
+ * @param checker
+ * @param resource
+ * @return
+ */
+ public boolean isCheckerEnabled(IChecker checker, IResource resource) {
+ IProblemProfile resourceProfile = getResourceProfile(resource);
+ Collection refProblems = getRefProblems(checker);
+ for (Iterator iterator = refProblems.iterator(); iterator
+ .hasNext();) {
+ IProblem p = iterator.next();
+ // we need to check problem enablement in particular profile
+ IProblem problem = resourceProfile.findProblem(p.getId());
+ if (problem == null)
+ throw new IllegalArgumentException("Id is not registered"); //$NON-NLS-1$
+ if (problem.isEnabled())
+ return true;
+ }
+ // no problem is enabled for this checker, skip the checker
+ return false;
+ }
}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java
index 086d7255631..40a80416a35 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java
@@ -10,38 +10,28 @@
*******************************************************************************/
package org.eclipse.cdt.codan.internal.core;
-import java.io.File;
-import java.net.URI;
-import java.util.Collection;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.cdt.codan.core.CodanCorePlugin;
import org.eclipse.cdt.codan.core.CodanRuntime;
-import org.eclipse.cdt.codan.core.model.ICAstChecker;
import org.eclipse.cdt.codan.core.model.IChecker;
-import org.eclipse.cdt.codan.core.model.ICodanAstReconciler;
+import org.eclipse.cdt.codan.core.model.IRunnableInEditorChecker;
import org.eclipse.cdt.codan.core.model.ICodanBuilder;
-import org.eclipse.cdt.codan.core.model.IProblem;
-import org.eclipse.cdt.codan.core.model.IProblemProfile;
import org.eclipse.cdt.codan.core.model.IProblemReporter;
+import org.eclipse.cdt.codan.core.model.IProblemReporterPersistent;
import org.eclipse.cdt.codan.internal.core.model.CodanMarkerProblemReporter;
-import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
-public class CodanBuilder extends IncrementalProjectBuilder implements ICodanBuilder, ICodanAstReconciler {
+public class CodanBuilder extends IncrementalProjectBuilder implements
+ ICodanBuilder {
public static final String BUILDER_ID = "org.eclipse.cdt.codan.core.codanBuilder"; //$NON-NLS-1$
public class CodanDeltaVisitor implements IResourceDeltaVisitor {
@@ -62,17 +52,17 @@ public class CodanBuilder extends IncrementalProjectBuilder implements ICodanBui
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
switch (delta.getKind()) {
- case IResourceDelta.ADDED:
- // handle added resource
- processResource(resource, new NullProgressMonitor());
- break;
- case IResourceDelta.REMOVED:
- // handle removed resource
- break;
- case IResourceDelta.CHANGED:
- // handle changed resource
- processResource(resource, new NullProgressMonitor());
- break;
+ case IResourceDelta.ADDED:
+ // handle added resource
+ processResource(resource, new NullProgressMonitor());
+ break;
+ case IResourceDelta.REMOVED:
+ // handle removed resource
+ break;
+ case IResourceDelta.CHANGED:
+ // handle changed resource
+ processResource(resource, new NullProgressMonitor());
+ break;
}
// return true to continue visiting children.
return true;
@@ -81,7 +71,8 @@ public class CodanBuilder extends IncrementalProjectBuilder implements ICodanBui
public class CodanResourceVisitor implements IResourceVisitor {
public boolean visit(IResource resource) {
- if (!(resource instanceof IProject)) processResource(resource, new NullProgressMonitor());
+ if (!(resource instanceof IProject))
+ processResource(resource, new NullProgressMonitor());
// return true to continue visiting children.
return true;
}
@@ -95,7 +86,8 @@ public class CodanBuilder extends IncrementalProjectBuilder implements ICodanBui
*/
@SuppressWarnings("rawtypes")
@Override
- protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
+ protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
+ throws CoreException {
if (kind == FULL_BUILD) {
fullBuild(monitor);
} else {
@@ -114,16 +106,22 @@ public class CodanBuilder extends IncrementalProjectBuilder implements ICodanBui
// CodanCorePlugin.PLUGIN_ID, "problems", "", null);
// System.err.println("set = " + string);
// delete general markers
- IProblemReporter problemReporter = CodanRuntime.getInstance().getProblemReporter();
+ IProblemReporter problemReporter = CodanRuntime.getInstance()
+ .getProblemReporter();
if (problemReporter instanceof CodanMarkerProblemReporter) {
- ((CodanMarkerProblemReporter) problemReporter).deleteMarkers(resource);
+ ((CodanMarkerProblemReporter) problemReporter)
+ .deleteProblems(resource);
}
- for (IChecker checker : CheckersRegisry.getInstance()) {
+ CheckersRegisry chegistry = CheckersRegisry.getInstance();
+ for (IChecker checker : chegistry) {
try {
boolean run = false;
- if (checker.enabledInContext(resource)) run = true;
- if (areProblemsForCheckerEnabled(checker, resource)) run = true;
- if (run) checker.processResource(resource);
+ if (checker.enabledInContext(resource))
+ run = true;
+ if (chegistry.isCheckerEnabled(checker, resource))
+ run = true;
+ if (run)
+ checker.processResource(resource);
} catch (Throwable e) {
CodanCorePlugin.log(e);
}
@@ -137,65 +135,16 @@ public class CodanBuilder extends IncrementalProjectBuilder implements ICodanBui
}
}
- public void reconcileAst(IASTTranslationUnit ast, IProgressMonitor monitor) {
- if (ast == null) return;
- String filePath = ast.getFilePath();
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot root = workspace.getRoot();
- IFile[] resources;
- URI uri = new File(filePath).toURI();
- resources = root.findFilesForLocationURI(uri);
- if (resources != null && resources.length > 0) {
- IFile resource = resources[0];
- IProblemReporter problemReporter = CodanRuntime.getInstance().getProblemReporter();
- // TODO: this is wrong - should not delete all markers -
- // only those that contributed by the checker that we run now
- if (problemReporter instanceof CodanMarkerProblemReporter) {
- ((CodanMarkerProblemReporter) problemReporter).deleteMarkers(resource);
- }
- for (IChecker checker : CheckersRegisry.getInstance()) {
- try {
- boolean run = false;
- if (checker.enabledInContext(resource)) run = true;
- if (areProblemsForCheckerEnabled(checker, resource)) {
- run = true;
- }
- if (run && checker instanceof ICAstChecker && checker.runInEditor())
- ((ICAstChecker) checker).processAst(ast);
- } catch (Throwable e) {
- CodanCorePlugin.log(e);
- }
- }
- }
- }
-
- /**
- * @param checker
- * @param resource
- * @return
- */
- private boolean areProblemsForCheckerEnabled(IChecker checker, IResource resource) {
- IProblemProfile resourceProfile = CheckersRegisry.getInstance().getResourceProfile(resource);
- Collection refProblems = CheckersRegisry.getInstance().getRefProblems(checker);
- for (Iterator iterator = refProblems.iterator(); iterator.hasNext();) {
- IProblem p = iterator.next();
- // we need to check problem enablement in particular profile
- IProblem problem = resourceProfile.findProblem(p.getId());
- if (problem == null) throw new IllegalArgumentException("Id is not registered"); //$NON-NLS-1$
- if (problem.isEnabled()) return true;
- }
- // no problem is enabled for this checker, skip the checker
- return false;
- }
-
- protected void fullBuild(final IProgressMonitor monitor) throws CoreException {
+ protected void fullBuild(final IProgressMonitor monitor)
+ throws CoreException {
try {
getProject().accept(new CodanResourceVisitor());
} catch (CoreException e) {
}
}
- protected void incrementalBuild(IResourceDelta delta, IProgressMonitor monitor) throws CoreException {
+ protected void incrementalBuild(IResourceDelta delta,
+ IProgressMonitor monitor) throws CoreException {
// the visitor does the work.
delta.accept(new CodanDeltaVisitor());
}
@@ -208,4 +157,34 @@ public class CodanBuilder extends IncrementalProjectBuilder implements ICodanBui
public CodanResourceVisitor getResourceVisitor() {
return new CodanResourceVisitor();
}
+
+ public void runInEditor(Object model, IResource resource,
+ IProgressMonitor monitor) {
+ if (model == null)
+ return;
+ IProblemReporter problemReporter = CodanRuntime.getInstance()
+ .getProblemReporter();
+ // TODO: this is wrong - should not delete all markers -
+ // only those that contributed by the checker that we run now
+ if (problemReporter instanceof IProblemReporterPersistent) {
+ ((IProblemReporterPersistent) problemReporter)
+ .deleteProblems(resource);
+ }
+ for (IChecker checker : CheckersRegisry.getInstance()) {
+ try {
+ boolean run = false;
+ if (checker.enabledInContext(resource))
+ run = true;
+ if (CheckersRegisry.getInstance().isCheckerEnabled(checker,
+ resource)) {
+ run = true;
+ }
+ if (run && checker.runInEditor()
+ && checker instanceof IRunnableInEditorChecker)
+ ((IRunnableInEditorChecker) checker).processModel(model);
+ } catch (Throwable e) {
+ CodanCorePlugin.log(e);
+ }
+ }
+ }
}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanMarkerProblemReporter.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanMarkerProblemReporter.java
index f906e63fff0..82073ed6d1f 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanMarkerProblemReporter.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanMarkerProblemReporter.java
@@ -11,10 +11,10 @@
package org.eclipse.cdt.codan.internal.core.model;
import java.text.MessageFormat;
-
+import org.eclipse.cdt.codan.core.model.IChecker;
import org.eclipse.cdt.codan.core.model.IProblem;
import org.eclipse.cdt.codan.core.model.IProblemLocation;
-import org.eclipse.cdt.codan.core.model.IProblemReporter;
+import org.eclipse.cdt.codan.core.model.IProblemReporterPersistent;
import org.eclipse.cdt.codan.internal.core.CheckersRegisry;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
@@ -22,8 +22,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-public class CodanMarkerProblemReporter implements IProblemReporter {
-
+public class CodanMarkerProblemReporter implements IProblemReporterPersistent {
/*
* (non-Javadoc)
*
@@ -35,20 +34,27 @@ public class CodanMarkerProblemReporter implements IProblemReporter {
public void reportProblem(String id, IProblemLocation loc, Object... args) {
IFile file = loc.getFile();
int lineNumber = loc.getLineNumber();
- if (file == null) throw new NullPointerException("file"); //$NON-NLS-1$
- if (id == null) throw new NullPointerException("id"); //$NON-NLS-1$
- IProblem problem = CheckersRegisry.getInstance().getResourceProfile(file).findProblem(id);
- if (problem == null) throw new IllegalArgumentException("Id is not registered"); //$NON-NLS-1$
- if (problem.isEnabled() == false) return; // skip
+ if (file == null)
+ throw new NullPointerException("file"); //$NON-NLS-1$
+ if (id == null)
+ throw new NullPointerException("id"); //$NON-NLS-1$
+ IProblem problem = CheckersRegisry.getInstance().getResourceProfile(
+ file).findProblem(id);
+ if (problem == null)
+ throw new IllegalArgumentException("Id is not registered"); //$NON-NLS-1$
+ if (problem.isEnabled() == false)
+ return; // skip
int severity = problem.getSeverity().intValue();
String messagePattern = problem.getMessagePattern();
String message = id;
if (messagePattern == null) {
- if (args != null && args.length > 0 && args[0] instanceof String) message = (String) args[0];
+ if (args != null && args.length > 0 && args[0] instanceof String)
+ message = (String) args[0];
} else {
message = MessageFormat.format(messagePattern, args);
}
- reportProblem(id, severity, file, lineNumber, loc.getStartingChar(), loc.getEndingChar(), message);
+ reportProblem(id, severity, file, lineNumber, loc.getStartingChar(),
+ loc.getEndingChar(), message);
}
/*
@@ -58,22 +64,28 @@ public class CodanMarkerProblemReporter implements IProblemReporter {
* org.eclipse.cdt.codan.core.model.IProblemReporter#reportProblem(java.
* lang.String, org.eclipse.core.resources.IFile, int, java.lang.String)
*/
- public void reportProblem(String id, int severity, IFile file, int lineNumber, int startChar, int endChar,
- String message) {
+ public void reportProblem(String id, int severity, IFile file,
+ int lineNumber, int startChar, int endChar, String message) {
try {
// Do not put in duplicates
- IMarker[] cur = file.findMarkers(GENERIC_CODE_ANALYSIS_MARKER_TYPE, false, IResource.DEPTH_ZERO);
+ IMarker[] cur = file.findMarkers(GENERIC_CODE_ANALYSIS_MARKER_TYPE,
+ false, IResource.DEPTH_ZERO);
if (cur != null) {
for (IMarker element : cur) {
- int line = ((Integer) element.getAttribute(IMarker.LINE_NUMBER)).intValue();
+ int line = ((Integer) element
+ .getAttribute(IMarker.LINE_NUMBER)).intValue();
if (line == lineNumber) {
- String mesg = (String) element.getAttribute(IMarker.MESSAGE);
- int sev = ((Integer) element.getAttribute(IMarker.SEVERITY)).intValue();
- if (sev == severity && mesg.equals(message)) return;
+ String mesg = (String) element
+ .getAttribute(IMarker.MESSAGE);
+ int sev = ((Integer) element
+ .getAttribute(IMarker.SEVERITY)).intValue();
+ if (sev == severity && mesg.equals(message))
+ return;
}
}
}
- IMarker marker = file.createMarker(GENERIC_CODE_ANALYSIS_MARKER_TYPE);
+ IMarker marker = file
+ .createMarker(GENERIC_CODE_ANALYSIS_MARKER_TYPE);
marker.setAttribute(IMarker.MESSAGE, message);
marker.setAttribute(IMarker.SEVERITY, severity);
marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
@@ -85,22 +97,36 @@ public class CodanMarkerProblemReporter implements IProblemReporter {
}
}
- public void deleteMarkers(IResource file) {
+ public void deleteProblems(IResource file) {
try {
- file.deleteMarkers(GENERIC_CODE_ANALYSIS_MARKER_TYPE, false, IResource.DEPTH_ZERO);
+ file.deleteMarkers(GENERIC_CODE_ANALYSIS_MARKER_TYPE, false,
+ IResource.DEPTH_ZERO);
} catch (CoreException ce) {
ce.printStackTrace();
}
}
- public void deleteAllMarkers() {
+ public void deleteAllProblems() {
try {
// TODO delete contributed markers too
- ResourcesPlugin.getWorkspace().getRoot().deleteMarkers(GENERIC_CODE_ANALYSIS_MARKER_TYPE, false,
+ ResourcesPlugin.getWorkspace().getRoot().deleteMarkers(
+ GENERIC_CODE_ANALYSIS_MARKER_TYPE, false,
IResource.DEPTH_INFINITE);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.cdt.codan.core.model.IProblemReporterPersistent#deleteProblems
+ * (org.eclipse.core.resources.IResource,
+ * org.eclipse.cdt.codan.core.model.IChecker)
+ */
+ public void deleteProblems(IResource file, IChecker checker) {
+ deleteProblems(file);
+ }
}
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/.classpath b/codan/org.eclipse.cdt.codan.ui.cxx/.classpath
new file mode 100644
index 00000000000..64c5e31b7a2
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/.project b/codan/org.eclipse.cdt.codan.ui.cxx/.project
new file mode 100644
index 00000000000..26bef111065
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/.project
@@ -0,0 +1,34 @@
+
+
+ org.eclipse.cdt.codan.internal.ui.cxx
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.api.tools.apiAnalysisBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.api.tools.apiAnalysisNature
+
+
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.ui.cxx/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..daee5fec67e
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,71 @@
+#Thu Mar 18 10:02:38 EDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
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
new file mode 100644
index 00000000000..ce833547dd2
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Codan Analysis UI for C/C++
+Bundle-SymbolicName: org.eclipse.cdt.codan.ui.cxx;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.cdt.codan.internal.ui.cxx.Activator
+Bundle-Vendor: CDT
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.cdt.codan.core;bundle-version="1.0.0",
+ org.eclipse.cdt.codan.core.cxx;bundle-version="1.0.0",
+ org.eclipse.ui.editors;bundle-version="3.6.0",
+ org.eclipse.cdt.core;bundle-version="5.2.0",
+ org.eclipse.cdt.ui;bundle-version="5.2.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/build.properties b/codan/org.eclipse.cdt.codan.ui.cxx/build.properties
new file mode 100644
index 00000000000..e9863e281ea
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/plugin.xml b/codan/org.eclipse.cdt.codan.ui.cxx/plugin.xml
new file mode 100644
index 00000000000..ed16e308094
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/plugin.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
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
new file mode 100644
index 00000000000..e046c528e4f
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.cdt.codan.internal.ui.cxx;
+
+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() {
+ }
+
+ /*
+ * (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 Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanCReconciler.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/CodanCReconciler.java
similarity index 88%
rename from codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanCReconciler.java
rename to codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/CodanCReconciler.java
index a7893f7bb68..a94143c2734 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanCReconciler.java
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/CodanCReconciler.java
@@ -8,9 +8,9 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.internal.ui;
+package org.eclipse.cdt.codan.internal.ui.cxx;
-import org.eclipse.cdt.codan.core.CodanRuntime;
+import org.eclipse.cdt.codan.core.cxx.internal.model.CxxCodanRenciler;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.internal.ui.editor.CEditor;
import org.eclipse.cdt.internal.ui.text.ICReconcilingListener;
@@ -22,6 +22,8 @@ import org.eclipse.ui.texteditor.ITextEditor;
*
*/
public class CodanCReconciler implements ICReconcilingListener {
+ private CxxCodanRenciler reconsiler = new CxxCodanRenciler();
+
void install(ITextEditor editor) {
if (editor instanceof CEditor) {
initialize();
@@ -64,8 +66,7 @@ public class CodanCReconciler implements ICReconcilingListener {
*/
public void reconciled(IASTTranslationUnit ast, boolean force,
IProgressMonitor progressMonitor) {
- CodanRuntime.getInstance().getAstQuickBuilder().reconcileAst(ast,
- progressMonitor);
+ reconsiler.reconciledAst(ast, progressMonitor);
// System.err.println("ast reconsiled");
}
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/Startup.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
similarity index 98%
rename from codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/Startup.java
rename to codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
index 939b3efaff6..b17fed1bd52 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/Startup.java
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
@@ -8,7 +8,7 @@
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.internal.ui;
+package org.eclipse.cdt.codan.internal.ui.cxx;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IPartListener2;
diff --git a/codan/org.eclipse.cdt.codan.ui/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.ui/.settings/org.eclipse.jdt.core.prefs
index 57703d3f61d..f7e128a5c72 100644
--- a/codan/org.eclipse.cdt.codan.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/codan/org.eclipse.cdt.codan.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,71 @@
-#Fri Apr 03 21:34:42 EDT 2009
+#Thu Mar 18 10:02:29 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
diff --git a/codan/org.eclipse.cdt.codan.ui/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.ui/META-INF/MANIFEST.MF
index 340c6c679fd..ffdbddbd1c5 100644
--- a/codan/org.eclipse.cdt.codan.ui/META-INF/MANIFEST.MF
+++ b/codan/org.eclipse.cdt.codan.ui/META-INF/MANIFEST.MF
@@ -2,17 +2,16 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Code Analyzers Framework
Bundle-SymbolicName: org.eclipse.cdt.codan.ui; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.codan.internal.ui.CodanUIActivator
Bundle-Vendor: Eclipse
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
- org.eclipse.cdt.core;bundle-version="5.1.0",
- org.eclipse.cdt.codan.core;bundle-version="1.0.0",
org.eclipse.cdt.ui;bundle-version="5.1.0",
org.eclipse.ui.workbench.texteditor;bundle-version="3.5.0",
- org.eclipse.ui.editors;bundle-version="3.5.0"
+ org.eclipse.ui.editors;bundle-version="3.5.0",
+ org.eclipse.cdt.codan.core;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
diff --git a/codan/org.eclipse.cdt.codan.ui/plugin.xml b/codan/org.eclipse.cdt.codan.ui/plugin.xml
index 3c4976be284..fc386277def 100644
--- a/codan/org.eclipse.cdt.codan.ui/plugin.xml
+++ b/codan/org.eclipse.cdt.codan.ui/plugin.xml
@@ -62,9 +62,5 @@
class="org.eclipse.cdt.codan.internal.ui.preferences.PreferenceInitializer">