From 665f381488dc26e66fa790ff68fd0287864ba83f Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 6 Sep 2013 16:55:57 -0700 Subject: Cosmetics. --- .../eclipse/cdt/internal/index/tests/IndexSearchTest.java | 13 ++++++------- .../parser/org/eclipse/cdt/internal/core/pdom/PDOM.java | 11 +++++------ .../org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java | 2 +- .../cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java | 4 ++-- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexSearchTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexSearchTest.java index edafd768af0..00ea462be87 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexSearchTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexSearchTest.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.index.tests; @@ -37,7 +37,6 @@ import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; import org.eclipse.core.runtime.CoreException; public class IndexSearchTest extends IndexTestBase { - private static final IndexFilter INDEX_FILTER = IndexFilter.ALL_DECLARED; public static TestSuite suite() { @@ -46,8 +45,8 @@ public class IndexSearchTest extends IndexTestBase { return suite; } - private ICProject fProject= null; - private IIndex fIndex= null; + private ICProject fProject; + private IIndex fIndex; public IndexSearchTest(String name) { super(name); @@ -188,7 +187,7 @@ public class IndexSearchTest extends IndexTestBase { IIndexBinding[] bindings; - // the binding in the unnamed namespace is not visible in global scope. + // The binding in the unnamed namespace is not visible in global scope. bindings= fIndex.findBindings(pcl, true, INDEX_FILTER, npm()); assertEquals(1, bindings.length); assertTrue(bindings[0].isFileLocal()); @@ -196,7 +195,7 @@ public class IndexSearchTest extends IndexTestBase { bindings= fIndex.findBindings(pcl.pattern().toCharArray(), INDEX_FILTER, npm()); assertEquals(1, bindings.length); assertTrue(bindings[0].isFileLocal()); -} + } public void testFindEnumerator() throws CoreException { Pattern pEnumeration= Pattern.compile("E20061017"); @@ -206,7 +205,7 @@ public class IndexSearchTest extends IndexTestBase { IIndexBinding[] bindings; - // enumerators are found in global scope + // Enumerators are found in global scope. bindings= fIndex.findBindings(pEnumerator, true, INDEX_FILTER, npm()); assertEquals(1, bindings.length); checkIsEnumerator(bindings[0]); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java index 7a7d6a430bf..9f6f394ec6b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java @@ -753,8 +753,7 @@ public class PDOM extends PlatformObject implements IPDOM { } catch (CoreException e) { if (e.getStatus() != Status.OK_STATUS) throw e; - else - return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY; + return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY; } } } @@ -847,8 +846,7 @@ public class PDOM extends PlatformObject implements IPDOM { } catch (CoreException e) { if (e.getStatus() != Status.OK_STATUS) throw e; - else - return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY; + return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY; } } } @@ -1326,8 +1324,7 @@ public class PDOM extends PlatformObject implements IPDOM { result.addAll(visitor.getMacroList()); } } - } - catch (OperationCanceledException e) { + } catch (OperationCanceledException e) { } return result.toArray(new IIndexFragmentBinding[result.size()]); } @@ -1601,6 +1598,7 @@ public class PDOM extends PlatformObject implements IPDOM { fTraces.add(Thread.currentThread().getStackTrace()); return fTraces.size(); } + @SuppressWarnings("nls") public void write(String threadName) { System.out.println("Thread: '" + threadName + "': " + fReadLocks + " readlocks, " + fWriteLocks + " writelocks"); @@ -1611,6 +1609,7 @@ public class PDOM extends PlatformObject implements IPDOM { } } } + public void inc(DebugLockInfo val) { fReadLocks+= val.fReadLocks; fWriteLocks+= val.fWriteLocks; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java index b3ed6a1eabb..b6e2d68c186 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java @@ -72,7 +72,7 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage protected static final long[] FILE_LOCAL_REC_DUMMY = new long[]{0}; // Node types - protected static final int LINKAGE= 0; // special one for myself + protected static final int LINKAGE= 0; // Special one for myself private BTree fMacroIndex= null; // No need for volatile, all fields of BTree are final. private final PDOM fPDOM; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java index 559732393d9..afd19a4c97a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java @@ -421,7 +421,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { PDOMBinding pdomBinding= null; PDOMNode parent2= null; - // template parameters are created directly by their owners. + // Template parameters are created directly by their owners. if (binding instanceof ICPPTemplateParameter) return null; if (binding instanceof ICPPUnknownBinding) @@ -864,7 +864,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { return null; } } else { - // Skip unnamed namespaces. + // Skip anonymous namespaces. while (owner instanceof ICPPNamespace) { char[] name= owner.getNameCharArray(); if (name.length > 0) { -- cgit v1.2.3