Skip to main content
summaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorSergey Prigogin2015-03-08 04:09:28 -0400
committerSergey Prigogin2015-04-02 23:41:39 -0400
commit4d1b8a8e26556f498f889f1e780483e31ffb3e7f (patch)
tree93d786574a107956b3a8148572e27a020b0a0503 /codan
parent14f7d3e16c69900b12c74278793c6f6d0133bcb7 (diff)
downloadorg.eclipse.cdt-4d1b8a8e26556f498f889f1e780483e31ffb3e7f.tar.gz
org.eclipse.cdt-4d1b8a8e26556f498f889f1e780483e31ffb3e7f.tar.xz
org.eclipse.cdt-4d1b8a8e26556f498f889f1e780483e31ffb3e7f.zip
Cosmetics
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java29
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemLocation.java22
2 files changed, 24 insertions, 27 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java
index e3edb4db8a..443b5c3cd9 100644
--- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java
+++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java
@@ -169,7 +169,7 @@ public final class CxxAstUtils {
* For any BinaryExpression, guess the type from the other operand. (A good
* guess for =, ==; hard to get a better guess for others)
*
- * @return inferred type or null if couldn't infer
+ * @return inferred type or {@code null} if couldn't infer
*/
private static IType tryInferTypeFromBinaryExpr(IASTName astName) {
if (astName.getParent() instanceof IASTIdExpression && astName.getParent().getParent() instanceof IASTBinaryExpression) {
@@ -188,9 +188,8 @@ public final class CxxAstUtils {
* For a function call, tries to find a matching function declaration.
* Checks the argument count.
*
- * @param index
- *
- * @return a generated declaration or null if not suitable
+ * @param index the index
+ * @return a generated declaration or {@code null} if not suitable
*/
private static IASTSimpleDeclaration tryInferTypeFromFunctionCall(IASTName astName, INodeFactory factory, IIndex index) {
if (astName.getParent() instanceof IASTIdExpression && astName.getParent().getParent() instanceof IASTFunctionCallExpression
@@ -303,13 +302,11 @@ public final class CxxAstUtils {
/**
* If the function definition belongs to a class, returns the class.
- * Otherwise, returns null.
+ * Otherwise, returns {@code null}.
*
- * @param function
- * the function definition to check
- * @param index
- * the index to use for name lookup
- * @return Either a type specifier or null
+ * @param function the function definition to check
+ * @param index the index to use for name lookup
+ * @return either a type specifier or {@code null}
*/
public static IASTCompositeTypeSpecifier getCompositeTypeFromFunction(final IASTFunctionDefinition function, final IIndex index) {
// Return value to be set via visitor.
@@ -371,19 +368,19 @@ public final class CxxAstUtils {
return returnSpecifier[0];
}
- public static boolean isThrowStatement(IASTNode body) {
- if (!(body instanceof IASTExpressionStatement))
+ public static boolean isThrowStatement(IASTNode statement) {
+ if (!(statement instanceof IASTExpressionStatement))
return false;
- IASTExpression expression = ((IASTExpressionStatement) body).getExpression();
+ IASTExpression expression = ((IASTExpressionStatement) statement).getExpression();
if (!(expression instanceof IASTUnaryExpression))
return false;
return ((IASTUnaryExpression) expression).getOperator() == IASTUnaryExpression.op_throw;
}
- public static boolean isExitStatement(IASTNode body) {
- if (!(body instanceof IASTExpressionStatement))
+ public static boolean isExitStatement(IASTNode statement) {
+ if (!(statement instanceof IASTExpressionStatement))
return false;
- IASTExpression expression = ((IASTExpressionStatement) body).getExpression();
+ IASTExpression expression = ((IASTExpressionStatement) statement).getExpression();
if (!(expression instanceof IASTFunctionCallExpression))
return false;
IASTExpression functionNameExpression = ((IASTFunctionCallExpression) expression).getFunctionNameExpression();
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemLocation.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemLocation.java
index 1ef8546ec1..bb2240c730 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemLocation.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemLocation.java
@@ -1,55 +1,55 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Alena Laskavaia
+ * Copyright (c) 2009, 2010 Alena Laskavaia
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Alena Laskavaia - initial API and implementation
+ * Alena Laskavaia - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.model;
import org.eclipse.core.resources.IResource;
/**
- * Interface to describe problem location. Usually contains file and linenumber,
+ * Interface to describe problem location. Usually contains file and line number,
* also supports character positions for sophisticated errors.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IProblemLocation {
/**
- *
- * @return File for the problem - absolute full paths
+ *
+ * @return the file where the problem occurred
*/
IResource getFile();
/**
- *
+ *
* @return Primary line for the problem, lines start with 1 for file. If -1
* char position would be used.
*/
int getLineNumber();
/**
- *
+ *
* @return character position where problem starts within file, first char
* is 0, inclusive, tab count as one. If unknown return -1.
*/
int getStartingChar();
/**
- *
+ *
* @return character position where problem ends within file, first char is
* 0, exclusive, tab count as one. If unknown return -1.
*/
int getEndingChar();
/**
- *
- * @return extra data for problem location, checker specific, can be
+ *
+ * @return extra data for the problem location, checker specific, can be
* backtrace for example
*/
Object getData();

Back to the top