Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-04-16 02:32:26 +0000
committerSergey Prigogin2012-04-16 02:32:26 +0000
commit7366607b693b6bcb23ecd6017e9b9d34d44aeb05 (patch)
tree45318fe880821365a3e2c708fce44dac022fed40
parentbe137ca3117ab47caecdd04cb9ea462a59aa5920 (diff)
downloadorg.eclipse.cdt-7366607b693b6bcb23ecd6017e9b9d34d44aeb05.tar.gz
org.eclipse.cdt-7366607b693b6bcb23ecd6017e9b9d34d44aeb05.tar.xz
org.eclipse.cdt-7366607b693b6bcb23ecd6017e9b9d34d44aeb05.zip
Cosmetics.
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ProblemBindingChecker.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationMap.java15
3 files changed, 13 insertions, 19 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ProblemBindingChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ProblemBindingChecker.java
index e6efcdea7d4..c57ce603003 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ProblemBindingChecker.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ProblemBindingChecker.java
@@ -61,13 +61,10 @@ public class ProblemBindingChecker extends AbstractIndexAstChecker {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.codan.core.model.AbstractCheckerWithProblemPreferences#initPreferences(org.eclipse.cdt.codan.core.model.IProblemWorkingCopy)
- */
@Override
public void initPreferences(IProblemWorkingCopy problem) {
super.initPreferences(problem);
- // these checkers should not run on full or incremental build
+ // This checker should not run on full or incremental build
getLaunchModePreference(problem).enableInLaunchModes(CheckerLaunchMode.RUN_AS_YOU_TYPE, CheckerLaunchMode.RUN_ON_DEMAND);
}
@@ -150,9 +147,8 @@ public class ProblemBindingChecker extends AbstractIndexAstChecker {
handleMemberProblem(name, parentNode, problemBinding, contextFlagsString);
} else if (parentNode instanceof IASTNamedTypeSpecifier) {
reportProblem(ERR_ID_TypeResolutionProblem, name, name.getRawSignature(), contextFlagsString);
- }
- // Probably a variable
- else {
+ } else {
+ // Probably a variable
handleVariableProblem(name, contextFlagsString);
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java
index 8334909db5f..605bdf42a9c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java
@@ -555,10 +555,10 @@ class ASTFunctionStyleMacroDefinition extends ASTMacroDefinition implements IAST
int endIdx= Math.min(fExpansionNumber - defOffset, image.length);
char start= '(';
for (int i = 0; i < result.length; i++) {
- while(idx < endIdx && image[idx] != start)
+ while (idx < endIdx && image[idx] != start)
idx++;
idx++;
- while(idx < endIdx && Character.isWhitespace(image[idx]))
+ while (idx < endIdx && Character.isWhitespace(image[idx]))
idx++;
start= ',';
@@ -800,7 +800,8 @@ class ASTMacroExpansionLocation implements IASTMacroExpansionLocation, org.eclip
@Override
public IASTFileLocation asFileLocation() {
- return ((LocationCtxContainer) fContext.getParent()).createFileLocation(fContext.fOffsetInParent, fContext.fEndOffsetInParent-fContext.fOffsetInParent);
+ return ((LocationCtxContainer) fContext.getParent()).createFileLocation(fContext.fOffsetInParent,
+ fContext.fEndOffsetInParent - fContext.fOffsetInParent);
}
@Override
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationMap.java
index e797ca97f7c..5c361fb2597 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationMap.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LocationMap.java
@@ -12,7 +12,6 @@ package org.eclipse.cdt.internal.core.parser.scanner;
import java.util.ArrayList;
import java.util.IdentityHashMap;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -657,11 +656,10 @@ public class LocationMap implements ILocationResolver {
@Override
public IASTPreprocessorMacroDefinition[] getMacroDefinitions() {
- ArrayList<Object> result= new ArrayList<Object>();
- for (Iterator<ASTPreprocessorNode> iterator = fDirectives.iterator(); iterator.hasNext();) {
- Object directive= iterator.next();
+ ArrayList<IASTPreprocessorMacroDefinition> result= new ArrayList<IASTPreprocessorMacroDefinition>();
+ for (ASTPreprocessorNode directive : fDirectives) {
if (directive instanceof IASTPreprocessorMacroDefinition) {
- result.add(directive);
+ result.add((IASTPreprocessorMacroDefinition) directive);
}
}
return result.toArray(new IASTPreprocessorMacroDefinition[result.size()]);
@@ -669,11 +667,10 @@ public class LocationMap implements ILocationResolver {
@Override
public IASTPreprocessorIncludeStatement[] getIncludeDirectives() {
- ArrayList<Object> result= new ArrayList<Object>();
- for (Iterator<ASTPreprocessorNode> iterator = fDirectives.iterator(); iterator.hasNext();) {
- Object directive= iterator.next();
+ ArrayList<IASTPreprocessorIncludeStatement> result= new ArrayList<IASTPreprocessorIncludeStatement>();
+ for (ASTPreprocessorNode directive : fDirectives) {
if (directive instanceof IASTPreprocessorIncludeStatement) {
- result.add(directive);
+ result.add((IASTPreprocessorIncludeStatement) directive);
}
}
return result.toArray(new IASTPreprocessorIncludeStatement[result.size()]);

Back to the top