Skip to main content
summaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorAlena Laskavaia2010-05-24 17:54:19 -0400
committerAlena Laskavaia2010-05-24 17:54:19 -0400
commit6e50087a2bf60509442f89cb85f79556e2333319 (patch)
treeef63fc0d9250c6b456da12d4d4b370ce904510bc /codan
parentf4f2bfd6eeb9be3d6a0a93e8329f8f3981f574f0 (diff)
downloadorg.eclipse.cdt-6e50087a2bf60509442f89cb85f79556e2333319.tar.gz
org.eclipse.cdt-6e50087a2bf60509442f89cb85f79556e2333319.tar.xz
org.eclipse.cdt-6e50087a2bf60509442f89cb85f79556e2333319.zip
Added arguments, description and externalized strings
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/plugin.xml8
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AssignmentInConditionChecker.java2
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CatchByReference.java2
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CheckersMessages.java1
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/SuggestedParenthesisChecker.java6
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/messages.properties1
6 files changed, 12 insertions, 8 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers/plugin.xml b/codan/org.eclipse.cdt.codan.checkers/plugin.xml
index 117593b011..607d62fe16 100644
--- a/codan/org.eclipse.cdt.codan.checkers/plugin.xml
+++ b/codan/org.eclipse.cdt.codan.checkers/plugin.xml
@@ -13,7 +13,7 @@
defaultSeverity="Warning"
description="Finds statements like 'if (a=b)'"
id="org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem"
- messagePattern="Possible assignment in condition"
+ messagePattern="Possible assignment in condition ''{0}''"
name="Assignment in condition">
</problem>
@@ -39,6 +39,7 @@
<problem
category="org.eclipse.cdt.codan.core.categories.ProgrammingProblems"
defaultSeverity="Warning"
+ description="If destructor is not declared virtual - destructor of derived class would not be called."
id="org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem"
messagePattern="Class &apos;&apos;{0}&apos;&apos; has virtual method &apos;&apos;{1}&apos;&apos; but non-virtual destructor &apos;&apos;{2}&apos;&apos;"
name="Class has a virtual method and non-virtual destructor">
@@ -55,7 +56,7 @@
description="Catching by reference is recommended by C++ experts, &quot;Throw by value, catch by reference&quot;. For one thing, this avoids copying and potentially slicing the exception."
id="org.eclipse.cdt.codan.internal.checkers.CatchByReference"
name="Catching by reference is recommended"
- messagePattern="Catching by reference is recommended for non-basic types">
+ messagePattern="Catching by reference is recommended &apos;&apos;{0}&apos;&apos;">
</problem>
</checker>
<checker
@@ -65,8 +66,9 @@
<problem
category="org.eclipse.cdt.codan.core.categories.ProgrammingProblems"
defaultSeverity="Warning"
+ description="This checker finds problems related to either lack of understanding precedence of operators or misspelling of operators in expression. For example (!a&lt;10) or (a &amp;&amp; b &amp; c)"
id="org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem"
- messagePattern="Suggested parenthesis around expression"
+ messagePattern="Suggested parenthesis around expression &apos;&apos;{0}&apos;&apos;"
name="Suggested parenthesis around expression">
</problem>
</checker>
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AssignmentInConditionChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AssignmentInConditionChecker.java
index aae0025ccc..8cf57d264f 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AssignmentInConditionChecker.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AssignmentInConditionChecker.java
@@ -35,7 +35,7 @@ public class AssignmentInConditionChecker extends AbstractIndexAstChecker {
public int visit(IASTExpression expression) {
if (isAssignmentExpression(expression)
&& isUsedAsCondition(expression)) {
- reportProblem(ER_ID, expression);
+ reportProblem(ER_ID, expression, expression.getRawSignature());
}
return PROCESS_CONTINUE;
}
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CatchByReference.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CatchByReference.java
index ac9e852f85..a96d3218f4 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CatchByReference.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CatchByReference.java
@@ -75,7 +75,7 @@ public class CatchByReference extends AbstractIndexAstChecker {
|| typeName instanceof IPointerType
|| typeName == null)
continue;
- reportProblem(ER_ID, decl);
+ reportProblem(ER_ID, decl, decl.getRawSignature());
}
}
}
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CheckersMessages.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CheckersMessages.java
index 2eff513b4f..6263a60b2f 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CheckersMessages.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CheckersMessages.java
@@ -22,6 +22,7 @@ public class CheckersMessages extends NLS {
public static String StatementHasNoEffectChecker_ParameterExceptions;
public static String StatementHasNoEffectChecker_ParameterExceptionsItem;
public static String StatementHasNoEffectChecker_ParameterMacro;
+ public static String SuggestedParenthesisChecker_SuggestParanthesesAroundNot;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, CheckersMessages.class);
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/SuggestedParenthesisChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/SuggestedParenthesisChecker.java
index 72f1892dfb..9ea8bba677 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/SuggestedParenthesisChecker.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/SuggestedParenthesisChecker.java
@@ -56,14 +56,14 @@ public class SuggestedParenthesisChecker extends AbstractIndexAstChecker {
return PROCESS_CONTINUE;
if (precedence == 2) { // unary not
if (isParamNot() && isUsedAsOperand(expression)) {
- reportProblem(ER_ID, expression);
+ reportProblem(ER_ID, expression, expression.getRawSignature());
return PROCESS_SKIP;
}
} else if (precedence >= 0) {
int pp = getPrecedence(parentExpr);
if (pp == -1 || pp == precedence)
return PROCESS_CONTINUE;
- reportProblem(ER_ID, expression);
+ reportProblem(ER_ID, expression, expression.getRawSignature());
}
}
return PROCESS_CONTINUE;
@@ -136,6 +136,6 @@ public class SuggestedParenthesisChecker extends AbstractIndexAstChecker {
public void initPreferences(IProblemWorkingCopy problem) {
super.initPreferences(problem);
addPreference(problem, PARAM_NOT,
- "Suggest parentesis around not operator", Boolean.FALSE);
+ CheckersMessages.SuggestedParenthesisChecker_SuggestParanthesesAroundNot, Boolean.FALSE);
}
}
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/messages.properties b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/messages.properties
index a20ffc9fba..efc7aedd8a 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/messages.properties
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/messages.properties
@@ -3,3 +3,4 @@ ReturnChecker_Param0=Also check functions with implicit return value
StatementHasNoEffectChecker_ParameterExceptions=Exceptions (value of the problem argument)
StatementHasNoEffectChecker_ParameterExceptionsItem=Value of the argument
StatementHasNoEffectChecker_ParameterMacro=Report problem in statements that comes from macro expansion
+SuggestedParenthesisChecker_SuggestParanthesesAroundNot=Suggest parentesis around not operator

Back to the top