diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/CppcheckChecker.java b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/CppcheckChecker.java
index 1c5f672a890..d29d1a7db4e 100644
--- a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/CppcheckChecker.java
+++ b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/CppcheckChecker.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.internal.checkers.ui;
@@ -41,11 +41,13 @@ public class CppcheckChecker extends AbstractCxxExternalToolBasedChecker {
// key: severity (error, warning, etc.) - value : problem ID associated to severity
private static final Map
@@ -43,7 +45,6 @@ public abstract class AbstractExternalToolBasedChecker extends AbstractCheckerWi
private static final boolean DO_NOT_TRAVERSE_CHILDREN = false;
private final IInvocationParametersProvider parametersProvider;
- private final ISupportedResourceVerifier supportedResourceVerifier;
private final IArgsSeparator argsSeparator;
private final ConfigurationSettings settings;
private final ExternalToolInvoker externalToolInvoker;
@@ -52,8 +53,6 @@ public abstract class AbstractExternalToolBasedChecker extends AbstractCheckerWi
/**
* Constructor.
* @param parametersProvider provides the parameters to pass when invoking the external tool.
- * @param supportedResourceVerifier indicates whether a resource can be processed by the
- * external tool.
* @param argsSeparator separates the arguments to pass to the external tool executable. These
* arguments are stored in a single {@code String}.
* @param consolePrinterProvider creates an Eclipse console that uses the name of an external
@@ -61,27 +60,15 @@ public abstract class AbstractExternalToolBasedChecker extends AbstractCheckerWi
* @param settings user-configurable external tool configuration settings.
*/
public AbstractExternalToolBasedChecker(IInvocationParametersProvider parametersProvider,
- ISupportedResourceVerifier supportedResourceVerifier, IArgsSeparator argsSeparator,
- IConsolePrinterProvider consolePrinterProvider, ConfigurationSettings settings) {
+ IArgsSeparator argsSeparator, IConsolePrinterProvider consolePrinterProvider,
+ ConfigurationSettings settings) {
this.parametersProvider = parametersProvider;
- this.supportedResourceVerifier = supportedResourceVerifier;
this.argsSeparator = argsSeparator;
this.settings = settings;
externalToolInvoker = new ExternalToolInvoker(consolePrinterProvider);
preferences = new SharedRootProblemPreference();
}
- /**
- * Indicates whether this checker can process the given resource. For more details, please
- * see
- * The minimum requirements that the given {@code IResource} should satisfy
- * are:
- * {@link ExternalToolInvoker}
.
*
@@ -73,7 +73,7 @@ public class ExternalToolInvokerTest extends CodanTestCase {
MapProblemPreference preferences = createPreferences(new File(externalToolPath),
"--include=all --debug=true", shouldDisplayOutput);
settings.updateValuesFrom(preferences);
- argsSeparator = new SpaceDelimitedArgsSeparator();
+ argsSeparator = new SpaceArgsSeparator();
externalToolInvoker = new ExternalToolInvoker(consolePrinterProvider, processInvoker);
}
@@ -83,7 +83,7 @@ public class ExternalToolInvokerTest extends CodanTestCase {
preferences.addChildDescriptor(createPreference(PathSetting.KEY, executablePath));
preferences.addChildDescriptor(createPreference(ArgsSetting.KEY, args));
preferences.addChildDescriptor(
- createPreference(ShouldDisplayOutputSetting.KEY, shouldDisplayOutput));
+ createPreference(ConsoleOutputSetting.KEY, shouldDisplayOutput));
return preferences;
}
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 8f13f952a72..53ac0b012e6 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,5 +1,9 @@
-#Wed Feb 23 19:43:25 EST 2011
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -19,6 +23,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
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.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -26,6 +31,7 @@ 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.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
@@ -38,11 +44,12 @@ 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.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
@@ -53,20 +60,30 @@ 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.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=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.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
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.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
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 632bdbb384d..a49d2de3aa0 100644
--- a/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF
+++ b/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF
@@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.core.runtime,
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.cdt.codan.core,
- org.eclipse.cdt.codan.core.externaltool,
+ org.eclipse.cdt.codan.core.externaltool;x-friends:="org.eclipse.cdt.codan.ui,org.eclipse.cdt.codan.core.test",
org.eclipse.cdt.codan.core.model,
org.eclipse.cdt.codan.core.model.cfg;x-friends:="org.eclipse.cdt.codan.core.cxx,org.eclipse.cdt.codan.checkers",
org.eclipse.cdt.codan.core.param,
@@ -20,5 +20,5 @@ Export-Package: org.eclipse.cdt.codan.core,
org.eclipse.cdt.codan.core.test,
org.eclipse.cdt.codan.ui",
org.eclipse.cdt.codan.internal.core.cfg;x-friends:="org.eclipse.cdt.codan.core.cxx",
- org.eclipse.cdt.codan.internal.core.externaltool,
+ org.eclipse.cdt.codan.internal.core.externaltool;x-friends:="org.eclipse.cdt.codan.core.test",
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/model/AbstractExternalToolBasedChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/AbstractExternalToolBasedChecker.java
similarity index 80%
rename from codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractExternalToolBasedChecker.java
rename to codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/AbstractExternalToolBasedChecker.java
index 818a947662b..911def92993 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractExternalToolBasedChecker.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/AbstractExternalToolBasedChecker.java
@@ -1,20 +1,20 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-
-package org.eclipse.cdt.codan.core.model;
-
-import java.util.List;
+/*******************************************************************************
+ * Copyright (c) 2012 Google, Inc and others.
+ * 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:
+ * Alex Ruiz (Google) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.codan.core.externaltool;
import org.eclipse.cdt.codan.core.CodanCorePlugin;
-import org.eclipse.cdt.codan.core.externaltool.AbstractOutputParser;
-import org.eclipse.cdt.codan.core.externaltool.ConfigurationSettings;
-import org.eclipse.cdt.codan.core.externaltool.IArgsSeparator;
-import org.eclipse.cdt.codan.core.externaltool.IConsolePrinterProvider;
-import org.eclipse.cdt.codan.core.externaltool.IInvocationParametersProvider;
-import org.eclipse.cdt.codan.core.externaltool.IProblemDisplay;
-import org.eclipse.cdt.codan.core.externaltool.ISupportedResourceVerifier;
-import org.eclipse.cdt.codan.core.externaltool.InvocationFailure;
-import org.eclipse.cdt.codan.core.externaltool.InvocationParameters;
-import org.eclipse.cdt.codan.core.externaltool.SingleConfigurationSetting;
+import org.eclipse.cdt.codan.core.model.AbstractCheckerWithProblemPreferences;
+import org.eclipse.cdt.codan.core.model.IProblem;
+import org.eclipse.cdt.codan.core.model.IProblemLocation;
+import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy;
import org.eclipse.cdt.codan.core.param.IProblemPreference;
import org.eclipse.cdt.codan.core.param.MapProblemPreference;
import org.eclipse.cdt.codan.core.param.RootProblemPreference;
@@ -22,6 +22,8 @@ import org.eclipse.cdt.codan.core.param.SharedRootProblemPreference;
import org.eclipse.cdt.codan.internal.core.externaltool.ExternalToolInvoker;
import org.eclipse.core.resources.IResource;
+import java.util.List;
+
/**
* Base class for checkers that invoke external command-line tools to perform code checking.
* {@link ISupportedResourceVerifier#isSupported(IResource)}
.
- * @param resource the given resource.
- * @return {@code true} if this checker can process the given resource, {@code false} otherwise.
- */
- @Override
- public boolean enabledInContext(IResource resource) {
- return supportedResourceVerifier.isSupported(resource);
- }
-
/**
* Indicates whether this checker is enabled to run while the user types. By default, this
* method returns {@code false}.
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/AbstractOutputParser.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/AbstractOutputParser.java
index 2e78ae8ab18..66a29ca2e6b 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/AbstractOutputParser.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/AbstractOutputParser.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/ConfigurationSettings.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/ConfigurationSettings.java
index 16d6e7e0aba..4cad52dfa8f 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/ConfigurationSettings.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/ConfigurationSettings.java
@@ -1,21 +1,21 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
-import java.io.File;
-
import org.eclipse.cdt.codan.core.param.MapProblemPreference;
import org.eclipse.cdt.codan.internal.core.externaltool.ArgsSetting;
import org.eclipse.cdt.codan.internal.core.externaltool.PathSetting;
-import org.eclipse.cdt.codan.internal.core.externaltool.ShouldDisplayOutputSetting;
+import org.eclipse.cdt.codan.internal.core.externaltool.ConsoleOutputSetting;
+
+import java.io.File;
/**
* User-configurable external tool settings.
@@ -27,7 +27,7 @@ import org.eclipse.cdt.codan.internal.core.externaltool.ShouldDisplayOutputSetti
public final class ConfigurationSettings {
private final PathSetting path;
private final ArgsSetting args;
- private final ShouldDisplayOutputSetting shouldDisplayOutput;
+ private final ConsoleOutputSetting shouldDisplayOutput;
private final String externalToolName;
/**
@@ -43,7 +43,7 @@ public final class ConfigurationSettings {
this.externalToolName = externalToolName;
this.path = new PathSetting(externalToolName, defaultPath);
this.args = new ArgsSetting(externalToolName, defaultArgs);
- this.shouldDisplayOutput = new ShouldDisplayOutputSetting(defaultShouldDisplayOutput);
+ this.shouldDisplayOutput = new ConsoleOutputSetting(defaultShouldDisplayOutput);
}
/**
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IArgsSeparator.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IArgsSeparator.java
index 85afa587f26..2b37d538bd7 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IArgsSeparator.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IArgsSeparator.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
@@ -22,8 +22,7 @@ public interface IArgsSeparator {
/**
* Parses a given {@code String} containing the arguments to pass to an external tool and
* separates them into individual values.
- * @param args contains the arguments to pass to the external tool
- * executable.
+ * @param args contains the arguments to pass to the external tool executable.
* @return the separated argument values.
*/
String[] separateArgs(String args);
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinter.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinter.java
index b12669d1b2b..e174be9279e 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinter.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinter.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
@@ -14,6 +14,9 @@ package org.eclipse.cdt.codan.core.externaltool;
* Prints the output of an external tool to an Eclipse console. It uses the name of the external
* tool as the console ID.
*
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @noextend This interface is not intended to be extended by clients.
+ *
* @author alruiz@google.com (Alex Ruiz)
*
* @since 2.1
@@ -22,21 +25,21 @@ public interface IConsolePrinter {
/**
* Clears the contents of the console.
*/
- void clear();
+ public void clear();
/**
* Prints the specified message to the console, followed by a line separator string.
* @param message the message to print.
*/
- void println(String message);
+ public void println(String message);
/**
* Prints a line separator to the console.
*/
- void println();
+ public void println();
/**
* Closes the output stream of the console.
*/
- void close();
+ public void close();
}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterProvider.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterProvider.java
index 3b388a56529..8c7e5375e97 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterProvider.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterProvider.java
@@ -1,18 +1,21 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
/**
* Creates or finds an Eclipse console that uses the name of an external tool as its own.
*
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @noextend This interface is not intended to be extended by clients.
+ *
* @author alruiz@google.com (Alex Ruiz)
*
* @since 2.1
@@ -26,5 +29,5 @@ public interface IConsolePrinterProvider {
* tool in the console.
* @return the created or found console.
*/
- IConsolePrinter createConsole(String externalToolName, boolean shouldDisplayOutput);
+ public IConsolePrinter createConsole(String externalToolName, boolean shouldDisplayOutput);
}
\ No newline at end of file
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IInvocationParametersProvider.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IInvocationParametersProvider.java
index 8d67dad3913..8dce431db2d 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IInvocationParametersProvider.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IInvocationParametersProvider.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IProblemDisplay.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IProblemDisplay.java
index 49ce23b008d..60176209b17 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IProblemDisplay.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IProblemDisplay.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
@@ -15,6 +15,9 @@ import org.eclipse.cdt.codan.core.model.IProblemLocation;
/**
* Reports problems found in code, reported by an external tool.
*
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @noextend This interface is not intended to be extended by clients.
+ *
* @author alruiz@google.com (Alex Ruiz)
*
* @since 2.1
@@ -25,7 +28,7 @@ public interface IProblemDisplay {
* @param location the problem's location (e.g. file and line number.)
* @param description the description of the problem.
*/
- void reportProblem(IProblemLocation location, String description);
+ public void reportProblem(IProblemLocation location, String description);
/**
* Reports a problem found by an external tool.
@@ -33,5 +36,5 @@ public interface IProblemDisplay {
* @param description the description of the problem.
* @param severity the problem's severity (e.g. "error", "warning", etc.)
*/
- void reportProblem(IProblemLocation location, String description, String severity);
+ public void reportProblem(IProblemLocation location, String description, String severity);
}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/ISupportedResourceVerifier.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/ISupportedResourceVerifier.java
deleted file mode 100644
index bc3db8f1025..00000000000
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/ISupportedResourceVerifier.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
- * 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:
- * Alex Ruiz - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.codan.core.externaltool;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-
-/**
- * Verifies that a {@link IResource}
can be processed by an external tool.
- *
- * @author alruiz@google.com (Alex Ruiz)
- *
- * @since 2.1
- */
-public interface ISupportedResourceVerifier {
- /**
- * Indicates whether the external tool is capable of processing the given
- * {@link IResource}
.
- *
- *
- * {@link IFile}
{@link #getCause()}
method.)
+ * @param cause the cause (which is saved for later retrieval by
+ * the {@link #getCause()}
method.)
*/
public InvocationFailure(String message, Throwable cause) {
super(message, cause);
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/InvocationParameters.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/InvocationParameters.java
index 58faad2c0dc..b7a68abd81c 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/InvocationParameters.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/InvocationParameters.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
@@ -45,8 +45,8 @@ public final class InvocationParameters {
}
/**
- * Returns the original file to process. This is the file that triggered execution of a
- * command-line tool when saved.
+ * Returns the original file to process. This is the file that triggered execution of
+ * a command-line tool when saved.
* @return the original file to process.
*/
public IResource getOriginalFile() {
@@ -55,11 +55,11 @@ public final class InvocationParameters {
/**
* Returns the actual file to process. It may not be the same as
- * {@link #getActualFile()}
, depending on how the external tool works.
+ * {@link #getOriginalFile()}
, depending on how the external tool works.
* - * A good example is an external tool that can only process C++ files but header files. If the - * original file is a header file, the checker could potentially find a C++ file that - * includes such header and use it as the actual file to process. + * A good example is an external tool that can only process C++ source files but not header + * files. If the original file is a header file, the checker could potentially find + * a C++ file that includes such header and use it as the actual file to process. *
*
* We still need to keep a reference to the actual file, in order to add markers to
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/InvocationParametersProvider.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/InvocationParametersProvider.java
index db9867c4223..b5593c0ac31 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/InvocationParametersProvider.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/InvocationParametersProvider.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SingleConfigurationSetting.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SingleConfigurationSetting.java
index 7ae5a4e0db3..0b04cf8a3fe 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SingleConfigurationSetting.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SingleConfigurationSetting.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SpaceDelimitedArgsSeparator.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SpaceArgsSeparator.java
similarity index 80%
rename from codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SpaceDelimitedArgsSeparator.java
rename to codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SpaceArgsSeparator.java
index 8e9f092c5c9..eff95236fa3 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SpaceDelimitedArgsSeparator.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/SpaceArgsSeparator.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
@@ -20,13 +20,10 @@ import java.util.regex.Pattern;
*
* @since 2.1
*/
-public final class SpaceDelimitedArgsSeparator implements IArgsSeparator {
- private static final String[] NO_ARGS = new String[0];
+public final class SpaceArgsSeparator implements IArgsSeparator {
+ private static final String[] NO_ARGS = {};
private static final Pattern EMPTY_SPACE_PATTERN = Pattern.compile("\\s+"); //$NON-NLS-1$
- /**
- * {@inheritDoc}
- */
@Override
public String[] separateArgs(String args) {
if (args == null || args.isEmpty()) {
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java
index 13425b8ed41..cd60472d620 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java
@@ -11,15 +11,15 @@
*******************************************************************************/
package org.eclipse.cdt.codan.core.model;
-import java.util.ArrayList;
-import java.util.List;
-
import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.internal.core.CheckersRegistry;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.OperationCanceledException;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Convenience implementation of IChecker interface. Has a default
* implementation for common methods.
@@ -43,7 +43,7 @@ public abstract class AbstractChecker implements IChecker {
*/
@Override
public boolean enabledInContext(IResource res) {
- return res instanceof IFile;
+ return res.getType() == IResource.FILE;
}
/**
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/ArgsSetting.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/ArgsSetting.java
index 61f0f9a4e47..46347280855 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/ArgsSetting.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/ArgsSetting.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.internal.core.externaltool;
@@ -22,8 +22,6 @@ import org.eclipse.cdt.codan.core.param.IProblemPreferenceDescriptor;
* The arguments are stored in a single {@code String}.
*
* @author alruiz@google.com (Alex Ruiz)
- *
- * @since 2.1
*/
public class ArgsSetting extends SingleConfigurationSetting
- * The minimum requirements that the given {@code IResource} should satisfy are:
- * {@link ISupportedResourceVerifier}
for C/C++ files.
- *
- * @author alruiz@google.com (Alex Ruiz)
- */
-public class CxxSupportedResourceVerifier implements ISupportedResourceVerifier {
- /**
- * Indicates whether the external tool is capable of processing the given
- * {@link IResource}
.
- *
- *
- *
{@link IResource}
.
+ * + * The minimum requirements that the given {@code IResource} should satisfy are: + *
{@link IConsolePrinter}
.
*
* @author alruiz@google.com (Alex Ruiz)
- *
- * @since 2.1
*/
class ConsolePrinter implements IConsolePrinter {
private final MessageConsole console;
@@ -32,18 +30,22 @@ class ConsolePrinter implements IConsolePrinter {
out = console.newMessageStream();
}
+ @Override
public void clear() {
console.clearConsole();
}
+ @Override
public void println(String s) {
out.println(s);
}
+ @Override
public void println() {
out.println();
}
+ @Override
public void close() {
try {
out.close();
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/ConsolePrinterProvider.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/externaltool/ConsolePrinterProvider.java
similarity index 93%
rename from codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/ConsolePrinterProvider.java
rename to codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/externaltool/ConsolePrinterProvider.java
index 65cee6024f4..14e6b763b6b 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/ConsolePrinterProvider.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/externaltool/ConsolePrinterProvider.java
@@ -1,14 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.ui.externaltool;
+package org.eclipse.cdt.codan.internal.ui.externaltool;
import static org.eclipse.ui.console.IConsoleConstants.ID_CONSOLE_VIEW;
@@ -28,13 +28,10 @@ import org.eclipse.ui.console.MessageConsole;
* Default implementation of {@link IConsolePrinterProvider}
.
*
* @author alruiz@google.com (Alex Ruiz)
- *
- * @since 2.1
*/
public class ConsolePrinterProvider implements IConsolePrinterProvider {
private static final NullConsolePrinter NULL_CONSOLE = new NullConsolePrinter();
- /** {@inheritDoc} */
@Override
public IConsolePrinter createConsole(String externalToolName, boolean shouldDisplayOutput) {
if (shouldDisplayOutput) {
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/NullConsolePrinter.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/externaltool/NullConsolePrinter.java
similarity index 71%
rename from codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/NullConsolePrinter.java
rename to codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/externaltool/NullConsolePrinter.java
index 022ff99bb64..bab9f02959d 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/NullConsolePrinter.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/externaltool/NullConsolePrinter.java
@@ -1,14 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2012 Google, Inc.
+ * Copyright (c) 2012 Google, Inc and others.
* 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:
- * Alex Ruiz - initial API and implementation
+ * Alex Ruiz (Google) - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.codan.ui.externaltool;
+package org.eclipse.cdt.codan.internal.ui.externaltool;
import org.eclipse.cdt.codan.core.externaltool.IConsolePrinter;
@@ -19,14 +19,18 @@ import org.eclipse.cdt.codan.core.externaltool.IConsolePrinter;
*/
class NullConsolePrinter implements IConsolePrinter {
@Override
- public void clear() {}
+ public void clear() {
+ }
@Override
- public void println(String message) {}
+ public void println(String message) {
+ }
@Override
- public void println() {}
+ public void println() {
+ }
@Override
- public void close() {}
+ public void close() {
+ }
}