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 result= new ArrayList(); - for (Iterator iterator = fDirectives.iterator(); iterator.hasNext();) { - Object directive= iterator.next(); + ArrayList result= new ArrayList(); + 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 result= new ArrayList(); - for (Iterator iterator = fDirectives.iterator(); iterator.hasNext();) { - Object directive= iterator.next(); + ArrayList result= new ArrayList(); + for (ASTPreprocessorNode directive : fDirectives) { if (directive instanceof IASTPreprocessorIncludeStatement) { - result.add(directive); + result.add((IASTPreprocessorIncludeStatement) directive); } } return result.toArray(new IASTPreprocessorIncludeStatement[result.size()]);