Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2009-04-21 00:36:20 +0000
committerAlena Laskavaia2009-04-21 00:36:20 +0000
commiteaf73307bcea61c4d49703177aef3bd078f19f3f (patch)
tree449126b2f9ea663fa0f024e929c4deadb438b549 /codan/org.eclipse.cdt.codan.checkers.ui
parentcfa105d23c11c85cfa7dbf6f5657cfb31d0c9812 (diff)
downloadorg.eclipse.cdt-eaf73307bcea61c4d49703177aef3bd078f19f3f.tar.gz
org.eclipse.cdt-eaf73307bcea61c4d49703177aef3bd078f19f3f.tar.xz
org.eclipse.cdt-eaf73307bcea61c4d49703177aef3bd078f19f3f.zip
[272936] - fixed quick fix
Diffstat (limited to 'codan/org.eclipse.cdt.codan.checkers.ui')
-rw-r--r--codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java
index f1c9e4a4fab..1470e7fb0e5 100644
--- a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java
+++ b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java
@@ -10,12 +10,21 @@
*******************************************************************************/
package org.eclipse.cdt.codan.checkers.ui.quickfix;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
import org.eclipse.core.resources.IMarker;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator;
public class CodanProblemMarkerResolutionGenerator implements IMarkerResolutionGenerator {
public IMarkerResolution[] getResolutions(IMarker marker) {
- return new IMarkerResolution[] { new QuickFixAssignmentInCondition() };
+ final Pattern patternBuildDependsAdd = Pattern.compile("Possible assignment in condition.*");
+ String description = marker.getAttribute(IMarker.MESSAGE, "no message");
+ Matcher matcherBuildDependsAdd = patternBuildDependsAdd.matcher(description);
+ if (matcherBuildDependsAdd.matches()) {
+ return new IMarkerResolution[] { new QuickFixAssignmentInCondition() };
+ }
+ return new IMarkerResolution[0];
}
} \ No newline at end of file

Back to the top