diff --git a/codan/org.eclipse.cdt.codan.core/schema/checkers.exsd b/codan/org.eclipse.cdt.codan.core/schema/checkers.exsd
index bd88d43bc8a..6634a51baf2 100644
--- a/codan/org.eclipse.cdt.codan.core/schema/checkers.exsd
+++ b/codan/org.eclipse.cdt.codan.core/schema/checkers.exsd
@@ -168,56 +168,6 @@ where xxx what checker would post as an argument for the problem.
-
-
-
- Example parameter for 'messagePattern' (with position 0.) This value is used only in the "Code Analysis" Preference UI to provide some context to the message shown for a particular problem.
-
-
-
-
-
-
-
-
-
- Example parameter for 'messagePattern' (with position 1.) This value is used only in the "Code Analysis" Preference UI to provide some context to the message shown for a particular problem.
-
-
-
-
-
-
-
-
-
- Example parameter for 'messagePattern' (with position 2.) This value is used only in the "Code Analysis" Preference UI to provide some context to the message shown for a particular problem.
-
-
-
-
-
-
-
-
-
- Example parameter for 'messagePattern' (with position 3.) This value is used only in the "Code Analysis" Preference UI to provide some context to the message shown for a particular problem.
-
-
-
-
-
-
-
-
-
- Example parameter for 'messagePattern' (with position 4.) This value is used only in the "Code Analysis" Preference UI to provide some context to the message shown for a particular problem.
-
-
-
-
-
-
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblem.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblem.java
index 5d6ac5968af..6db3ea93a69 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblem.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblem.java
@@ -68,15 +68,6 @@ public interface IProblem extends IProblemElement {
*/
String getMessagePattern();
- /**
- * Returns the example parameters to use with {@link #getMessagePattern()}.
- * These parameters are used only in the "Code Analysis" Preference UI.
- *
- * @return example parameters
- * @since 2.0
- */
- public String[] getExampleMessageParameters();
-
/**
* Returns root preference descriptor or null if not defined (used by UI to
* generate user controls for changing parameters)
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java
index b213202e964..249be2e3c56 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java
@@ -193,13 +193,6 @@ public class CheckersRegistry implements Iterable, ICheckersRegistry {
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$
- ArrayList exampleParams = new ArrayList();
- for (int i = 0; ; i++) {
- String param = configurationElement.getAttribute("exampleParam" + i); //$NON-NLS-1$
- if (param == null)
- break;
- exampleParams.add(param);
- }
String desc = getAtt(configurationElement, "description", false); //$NON-NLS-1$
String markerType = getAtt(configurationElement, "markerType", false); //$NON-NLS-1$
if (enab != null) {
@@ -213,9 +206,6 @@ public class CheckersRegistry implements Iterable, ICheckersRegistry {
if (patt != null) {
p.setMessagePattern(patt);
}
- if (!exampleParams.isEmpty()) {
- p.setExampleMessageParameters(exampleParams.toArray(new String[exampleParams.size()]));
- }
if (markerType != null) {
p.setMarkerType(markerType);
}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblem.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblem.java
index 6dcbc3361dd..9a4a9a4e22d 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblem.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblem.java
@@ -29,7 +29,6 @@ public class CodanProblem implements IProblemWorkingCopy, Cloneable {
private boolean frozen;
private String description;
private String markerType = IProblemReporter.GENERIC_CODE_ANALYSIS_MARKER_TYPE;
- private String[] exampleParams = { "X", "Y", "Z", "U", "V" }; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$
public CodanSeverity getSeverity() {
return severity;
@@ -163,25 +162,4 @@ public class CodanProblem implements IProblemWorkingCopy, Cloneable {
public void setMarkerType(String markerType) {
this.markerType = markerType;
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.cdt.codan.core.model.IProblem#getExampleParameters()
- */
- public String[] getExampleMessageParameters() {
- return exampleParams.clone();
- }
-
- /**
- * Sets an example message parameter to use with {@link #getMessagePattern()}.
- *
- * @param exampleParameters - the example message parameters to set,
- * e.g. { "<variable_name>" }.
- * @see #getExampleMessageParameters()
- */
- public void setExampleMessageParameters(String[] exampleParameters) {
- checkSet();
- this.exampleParams = exampleParameters;
- }
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
index de78de9c748..62d1e4becb7 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
@@ -55,6 +55,9 @@ import org.eclipse.ui.preferences.ScopedPreferenceStore;
* preferences can be accessed directly via the preference store.
*/
public class CodanPreferencePage extends FieldEditorOverlayPage implements IWorkbenchPreferencePage {
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+ private static final String SINGLE_PLACEHOLDER_ONLY = "{0}"; //$NON-NLS-1$
+
private IProblemProfile profile;
private ISelectionChangedListener problemSelectionListener;
private IProblem selectedProblem;
@@ -208,7 +211,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork
private void saveWidgetValues() {
CodanUIActivator.getDefault().getDialogSettings().put(getWidgetId(),
- selectedProblem == null ? "" : selectedProblem.getId()); //$NON-NLS-1$
+ selectedProblem == null ? EMPTY_STRING : selectedProblem.getId());
}
private void restoreWidgetValues() {
@@ -230,21 +233,23 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork
private void updateProblemInfo() {
if (selectedProblem == null) {
- infoMessage.setText(""); //$NON-NLS-1$
- infoDesc.setText(""); //$NON-NLS-1$
+ infoMessage.setText(EMPTY_STRING);
+ infoDesc.setText(EMPTY_STRING);
// infoParams.setText(""); //$NON-NLS-1$
infoButton.setEnabled(false);
} else {
String description = selectedProblem.getDescription();
if (description == null)
description = CodanUIMessages.CodanPreferencePage_NoInfo;
- String messageToShow = CodanUIMessages.CodanPreferencePage_NoInfo;
String messagePattern = selectedProblem.getMessagePattern();
- if (messagePattern != null) {
- Object[] exampleParams = selectedProblem.getExampleMessageParameters();
- messageToShow = MessageFormat.format(messagePattern, exampleParams);
+ String message = CodanUIMessages.CodanPreferencePage_NoInfo;
+ if (SINGLE_PLACEHOLDER_ONLY.equals(messagePattern)) {
+ message = EMPTY_STRING;
}
- infoMessage.setText(messageToShow);
+ else if (messagePattern != null) {
+ message = MessageFormat.format(messagePattern, "X", "Y", "Z"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ infoMessage.setText(message);
infoDesc.setText(description);
// IProblemPreference pref = selectedProblem.getPreference();
// infoParams.setText(pref == null ?