mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fixed a typo.
This commit is contained in:
parent
50640df3c0
commit
9f0e997443
1 changed files with 4 additions and 16 deletions
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Alena Laskavaia - initial API and implementation
|
* Alena Laskavaia - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.codan.internal.checkers;
|
package org.eclipse.cdt.codan.internal.checkers;
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
||||||
/**
|
/**
|
||||||
* This is style checker for function name code style. Pattern parameter is
|
* This is style checker for function name code style. Pattern parameter is
|
||||||
* regular expression defining the style.
|
* regular expression defining the style.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class NamingConventionFunctionChecker extends AbstractIndexAstChecker implements ICheckerWithPreferences {
|
public class NamingConventionFunctionChecker extends AbstractIndexAstChecker implements ICheckerWithPreferences {
|
||||||
private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker"; //$NON-NLS-1$
|
private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker"; //$NON-NLS-1$
|
||||||
|
@ -50,7 +49,7 @@ public class NamingConventionFunctionChecker extends AbstractIndexAstChecker imp
|
||||||
public int visit(IASTDeclaration element) {
|
public int visit(IASTDeclaration element) {
|
||||||
if (element instanceof IASTFunctionDefinition) {
|
if (element instanceof IASTFunctionDefinition) {
|
||||||
IASTName astName = ((IASTFunctionDefinition) element).getDeclarator().getName();
|
IASTName astName = ((IASTFunctionDefinition) element).getDeclarator().getName();
|
||||||
String name = getSearchibleName(astName);
|
String name = getSearchableName(astName);
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
for (Iterator<IProblem> iterator = pts.iterator(); iterator.hasNext();) {
|
for (Iterator<IProblem> iterator = pts.iterator(); iterator.hasNext();) {
|
||||||
IProblem pt = iterator.next();
|
IProblem pt = iterator.next();
|
||||||
|
@ -68,18 +67,14 @@ public class NamingConventionFunctionChecker extends AbstractIndexAstChecker imp
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shouldReport(IASTName astName, IProblem pt) {
|
private boolean shouldReport(IASTName astName, IProblem pt) {
|
||||||
if (astName instanceof ICPPASTQualifiedName) {
|
if (astName instanceof ICPPASTQualifiedName) {
|
||||||
return shouldReportCppMethods(pt);
|
return shouldReportCppMethods(pt);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private String getSearchableName(IASTName astName) {
|
||||||
* @param astName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getSearchibleName(IASTName astName) {
|
|
||||||
String name = astName.toString();
|
String name = astName.toString();
|
||||||
if (astName instanceof ICPPASTQualifiedName) {
|
if (astName instanceof ICPPASTQualifiedName) {
|
||||||
ICPPASTQualifiedName cppAstName = (ICPPASTQualifiedName) astName;
|
ICPPASTQualifiedName cppAstName = (ICPPASTQualifiedName) astName;
|
||||||
|
@ -104,13 +99,6 @@ public class NamingConventionFunctionChecker extends AbstractIndexAstChecker imp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.cdt.codan.core.model.ICheckerWithPreferences#initParameters
|
|
||||||
* (org.eclipse.cdt.codan.core.model.IProblemWorkingCopy)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void initPreferences(IProblemWorkingCopy problem) {
|
public void initPreferences(IProblemWorkingCopy problem) {
|
||||||
super.initPreferences(problem);
|
super.initPreferences(problem);
|
||||||
|
|
Loading…
Add table
Reference in a new issue