mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Cosmetics.
This commit is contained in:
parent
00a6c5069f
commit
07924ceeeb
2 changed files with 5 additions and 8 deletions
|
@ -17,16 +17,16 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
|
||||
/**
|
||||
* Checker that find assignment to itself cases, such a
|
||||
* Checker that finds assignment to itself cases, such a
|
||||
* a = a. It can produce some false positives such as
|
||||
* a[f()]=a[f()] - but who write codes like that?
|
||||
* a[f()]=a[f()] - but who writes code like that?
|
||||
*/
|
||||
public class AssignmentToItselfChecker extends AbstractIndexAstChecker {
|
||||
private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem"; //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
public void processAst(IASTTranslationUnit ast) {
|
||||
// traverse the ast using the visitor pattern.
|
||||
// Traverse the ast using the visitor pattern.
|
||||
ast.accept(new ASTVisitor() {
|
||||
{ // constructor
|
||||
shouldVisitExpressions = true;
|
||||
|
@ -49,7 +49,7 @@ public class AssignmentToItselfChecker extends AbstractIndexAstChecker {
|
|||
String op2 = binExpr.getOperand2().getRawSignature();
|
||||
String expr = binExpr.getRawSignature();
|
||||
return op1.equals(op2)
|
||||
// when macro is used RawSignature returns macro name, see Bug 321933
|
||||
// When macro is used, RawSignature returns macro name, see bug 321933
|
||||
&& !op1.equals(expr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,9 +38,6 @@ public class CodanCReconciler implements ICReconcilingListener {
|
|||
editor.removeReconcileListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void initialize() {
|
||||
// nothing?
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue