Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 11:20:42 -0500
committerJonah Graham2018-11-22 16:47:02 -0500
commit170e654b4796bad1453ae85a427b97317d67a69a (patch)
tree6ca9b8a8fedd5fd25f97eb79c408312e256ff981 /codan/org.eclipse.cdt.codan.examples
parent35996a5c5ca5c254959ba48241eaada6dbf8628d (diff)
downloadorg.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.gz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.xz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.zip
Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then Source -> Clean Up... -> choosing: - Format source code - Remove trailing white spaces on all lines and completing the wizard Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
Diffstat (limited to 'codan/org.eclipse.cdt.codan.examples')
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/CToolChecker.java8
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/GrepChecker.java4
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionIIndexChecker.java10
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java2
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/FlexlintHelpLink.java7
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerExamplePreferenceChangeListener.java5
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerHelpLink.java3
7 files changed, 20 insertions, 19 deletions
diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/CToolChecker.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/CToolChecker.java
index b5eff6780c..ed4d568790 100644
--- a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/CToolChecker.java
+++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/CToolChecker.java
@@ -48,8 +48,7 @@ public class CToolChecker extends AbstractCElementChecker {
@Override
public void initPreferences(IProblemWorkingCopy problem) {
getTopLevelPreference(problem); // initialize
- getLaunchModePreference(problem).enableInLaunchModes(
- CheckerLaunchMode.RUN_ON_FILE_SAVE,
+ getLaunchModePreference(problem).enableInLaunchModes(CheckerLaunchMode.RUN_ON_FILE_SAVE,
CheckerLaunchMode.RUN_ON_DEMAND);
}
@@ -65,8 +64,9 @@ public class CToolChecker extends AbstractCElementChecker {
res.add(unit.getFile().getLocation().toPortableString());
String args[] = res.toArray(new String[res.size()]);
try {
- externalToolInvoker.launchOnBuildConsole(unit.getResource().getProject(), new IConsoleParser[] { getConsoleParser(unit) },
- "check", getToolPath(), args, new String[] {}, getWorkingDirectory(), new NullProgressMonitor());
+ externalToolInvoker.launchOnBuildConsole(unit.getResource().getProject(),
+ new IConsoleParser[] { getConsoleParser(unit) }, "check", getToolPath(), args, new String[] {},
+ getWorkingDirectory(), new NullProgressMonitor());
} catch (CoreException | InvocationFailure e) {
Activator.log(e);
}
diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/GrepChecker.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/GrepChecker.java
index 39f86a8337..3536f97358 100644
--- a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/GrepChecker.java
+++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/GrepChecker.java
@@ -31,7 +31,7 @@ import org.eclipse.core.runtime.CoreException;
* This is sample of non AST checker integration. This one is not
* external checker because it does not actually call other process, but it
* can easily made into one.
- *
+ *
* This checker is parametrized by the search strings
*/
public class GrepChecker extends AbstractCheckerWithProblemPreferences {
@@ -96,7 +96,7 @@ public class GrepChecker extends AbstractCheckerWithProblemPreferences {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.codan.core.model.AbstractCheckerWithProblemPreferences
* #initPreferences(org.eclipse.cdt.codan.core.model.IProblemWorkingCopy)
diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionIIndexChecker.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionIIndexChecker.java
index 7d0917d432..7d8a8f006d 100644
--- a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionIIndexChecker.java
+++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionIIndexChecker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Alena Laskavaia
+ * Copyright (c) 2009, 2011 Alena Laskavaia
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -27,9 +27,9 @@ import org.eclipse.cdt.core.model.ITranslationUnit;
/**
* Example demonstrate how to write checked using "C Model"
- *
+ *
* @author Alena
- *
+ *
*/
public class NamingConventionFunctionIIndexChecker extends AbstractCIndexChecker implements ICheckerWithPreferences {
private static final String DEFAULT_PATTERN = "^[a-z]"; // name starts with english lowercase letter //$NON-NLS-1$
@@ -38,7 +38,7 @@ public class NamingConventionFunctionIIndexChecker extends AbstractCIndexChecker
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.codan.core.model.ICIndexChecker#processUnit(org.eclipse
* .cdt.core.model.ITranslationUnit)
@@ -68,7 +68,7 @@ public class NamingConventionFunctionIIndexChecker extends AbstractCIndexChecker
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.codan.core.model.ICheckerWithPreferences#initParameters
* (org.eclipse.cdt.codan.core.model.IProblemWorkingCopy)
diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java
index 8e465d58de..13f63c5a1e 100644
--- a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java
+++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java
@@ -26,7 +26,7 @@ import org.eclipse.cdt.core.ProblemMarkerInfo;
* saved.
*/
public class CppcheckChecker extends AbstractExternalToolBasedChecker {
- private static final String TOOL_NAME = Messages.CppcheckChecker_toolName;
+ private static final String TOOL_NAME = Messages.CppcheckChecker_toolName;
private static final String EXECUTABLE_NAME = "cppcheck"; //$NON-NLS-1$
private static final String DEFAULT_ARGS = "--enable=all"; //$NON-NLS-1$
diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/FlexlintHelpLink.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/FlexlintHelpLink.java
index b73a7d5ec9..267fde1f43 100644
--- a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/FlexlintHelpLink.java
+++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/FlexlintHelpLink.java
@@ -27,12 +27,13 @@ public class FlexlintHelpLink extends AbstractCodanProblemDetailsProvider {
String helpId = parseHelpId(getProblemMessage());
return helpId != null;
}
+
private Pattern messagePattern = Pattern.compile("(Warning|Error|Note|Info) #([0-9]+)"); //$NON-NLS-1$
private String parseHelpId(String problemMessage) {
- // Warning #613:
- // Note #613:
- // Error #613:
+ // Warning #613:
+ // Note #613:
+ // Error #613:
String helpId = null;
Matcher matcher = messagePattern.matcher(problemMessage);
if (matcher.find()) {
diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerExamplePreferenceChangeListener.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerExamplePreferenceChangeListener.java
index 9a4326182a..a22e0c0c85 100644
--- a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerExamplePreferenceChangeListener.java
+++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerExamplePreferenceChangeListener.java
@@ -41,6 +41,7 @@ public class GrepCheckerExamplePreferenceChangeListener implements INodeChangeLi
instance = new GrepCheckerExamplePreferenceChangeListener();
return instance;
}
+
private IProject project;
private GrepCheckerExamplePreferenceChangeListener(IProject project) {
@@ -69,9 +70,9 @@ public class GrepCheckerExamplePreferenceChangeListener implements INodeChangeLi
String val = (String) event.getNewValue();
String fors = (" for " + ((project == null) ? "workspace" : project.getName()));
if (val != null && !val.startsWith("-")) {
- trace("grep checker enabled :)"+fors);
+ trace("grep checker enabled :)" + fors);
} else {
- trace("grep checker disabled :("+fors);
+ trace("grep checker disabled :(" + fors);
}
}
diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerHelpLink.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerHelpLink.java
index 8516a1754f..db46b87aaa 100644
--- a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerHelpLink.java
+++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerHelpLink.java
@@ -24,12 +24,11 @@ public class GrepCheckerHelpLink extends AbstractCodanProblemDetailsProvider {
public boolean isApplicable(String id) {
return id.startsWith("org.eclipse.cdt.codan.examples.checkers.GrepCheckerProblem");
}
-
@Override
public String getStyledProblemDescription() {
String arg = CodanProblemMarker.getProblemArgument(marker, 0);
String url = "http://www.google.ca/search?q=" + arg;
- return "Google " + "<a href=\"" + url + "\">" + arg + "</a>";
+ return "Google " + "<a href=\"" + url + "\">" + arg + "</a>";
}
}

Back to the top