From 411edba67903a895bf9754c792207a1c30a2003f Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 24 Aug 2010 05:16:01 +0000 Subject: [PATCH] Cosmetics. --- .../internal/core/model/CModelBuilder2.java | 19 ++++++++++--------- .../internal/core/model/TranslationUnit.java | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java index 30cf38ff6a1..d8eb9ad4a7b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java @@ -92,7 +92,6 @@ import org.eclipse.core.runtime.OperationCanceledException; * @since 4.0 */ public class CModelBuilder2 implements IContributedModelBuilder { - private final static boolean DEBUG= Util.isActive(DebugLogConstants.MODEL); private final TranslationUnit fTranslationUnit; @@ -145,11 +144,13 @@ public class CModelBuilder2 implements IContributedModelBuilder { final IASTTranslationUnit ast; try { ast= fTranslationUnit.getAST(index, parseFlags, fProgressMonitor); - if (DEBUG) Util.debugLog("CModelBuilder2: parsing " //$NON-NLS-1$ - + fTranslationUnit.getElementName() - + " mode="+ (quickParseMode ? "skip all " : "skip indexed ") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - + " time="+ ( System.currentTimeMillis() - startTime ) + "ms", //$NON-NLS-1$ //$NON-NLS-2$ - DebugLogConstants.MODEL, false); + if (DEBUG) { + Util.debugLog("CModelBuilder2: parsing " //$NON-NLS-1$ + + fTranslationUnit.getElementName() + + " mode="+ (quickParseMode ? "skip all " : "skip indexed ") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + + " time="+ ( System.currentTimeMillis() - startTime ) + "ms", //$NON-NLS-1$ //$NON-NLS-2$ + DebugLogConstants.MODEL, false); + } } catch (ParseError e) { checkCanceled(); throw e; @@ -315,7 +316,7 @@ public class CModelBuilder2 implements IContributedModelBuilder { createSimpleDeclarations(parent, (IASTSimpleDeclaration)declaration, false); } else if (declaration instanceof ICPPASTVisibilityLabel) { handleVisibilityLabel((ICPPASTVisibilityLabel)declaration); - } else if(declaration instanceof ICPPASTNamespaceDefinition) { + } else if (declaration instanceof ICPPASTNamespaceDefinition) { createNamespace(parent, (ICPPASTNamespaceDefinition) declaration); } else if (declaration instanceof ICPPASTNamespaceAlias) { // TODO [cmodel] namespace alias? @@ -612,7 +613,7 @@ public class CModelBuilder2 implements IContributedModelBuilder { element.setActive(enumDef.isActive()); IASTExpression initialValue= enumDef.getValue(); - if(initialValue != null){ + if (initialValue != null){ element.setConstantExpression(ASTSignatureUtil.getExpressionString(initialValue)); } // add to parent @@ -695,7 +696,7 @@ public class CModelBuilder2 implements IContributedModelBuilder { // add to parent parent.addChild(element); // set positions - if(!isTemplate){ + if (!isTemplate){ setBodyPosition(info, compositeTypeSpecifier); } if (className.length() > 0) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java index 7bd5c0d8844..e67812cf54b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java @@ -603,7 +603,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit { * Parse the buffer contents of this element. */ private void parse(Map newElements, IProgressMonitor monitor) { - boolean quickParseMode = ! (CCorePlugin.getDefault().useStructuralParseMode()); + boolean quickParseMode = !(CCorePlugin.getDefault().useStructuralParseMode()); IContributedModelBuilder mb = LanguageManager.getInstance().getContributedModelBuilderFor((ITranslationUnit) this); if (mb == null) { parseUsingCModelBuilder(newElements, quickParseMode, monitor);