mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-19 06:05:56 +02:00
Cosmetics.
This commit is contained in:
parent
f1275ddaaa
commit
665f381488
4 changed files with 14 additions and 16 deletions
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.index.tests;
|
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;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
public class IndexSearchTest extends IndexTestBase {
|
public class IndexSearchTest extends IndexTestBase {
|
||||||
|
|
||||||
private static final IndexFilter INDEX_FILTER = IndexFilter.ALL_DECLARED;
|
private static final IndexFilter INDEX_FILTER = IndexFilter.ALL_DECLARED;
|
||||||
|
|
||||||
public static TestSuite suite() {
|
public static TestSuite suite() {
|
||||||
|
@ -46,8 +45,8 @@ public class IndexSearchTest extends IndexTestBase {
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICProject fProject= null;
|
private ICProject fProject;
|
||||||
private IIndex fIndex= null;
|
private IIndex fIndex;
|
||||||
|
|
||||||
public IndexSearchTest(String name) {
|
public IndexSearchTest(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
|
@ -188,7 +187,7 @@ public class IndexSearchTest extends IndexTestBase {
|
||||||
|
|
||||||
IIndexBinding[] bindings;
|
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());
|
bindings= fIndex.findBindings(pcl, true, INDEX_FILTER, npm());
|
||||||
assertEquals(1, bindings.length);
|
assertEquals(1, bindings.length);
|
||||||
assertTrue(bindings[0].isFileLocal());
|
assertTrue(bindings[0].isFileLocal());
|
||||||
|
@ -196,7 +195,7 @@ public class IndexSearchTest extends IndexTestBase {
|
||||||
bindings= fIndex.findBindings(pcl.pattern().toCharArray(), INDEX_FILTER, npm());
|
bindings= fIndex.findBindings(pcl.pattern().toCharArray(), INDEX_FILTER, npm());
|
||||||
assertEquals(1, bindings.length);
|
assertEquals(1, bindings.length);
|
||||||
assertTrue(bindings[0].isFileLocal());
|
assertTrue(bindings[0].isFileLocal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFindEnumerator() throws CoreException {
|
public void testFindEnumerator() throws CoreException {
|
||||||
Pattern pEnumeration= Pattern.compile("E20061017");
|
Pattern pEnumeration= Pattern.compile("E20061017");
|
||||||
|
@ -206,7 +205,7 @@ public class IndexSearchTest extends IndexTestBase {
|
||||||
|
|
||||||
IIndexBinding[] bindings;
|
IIndexBinding[] bindings;
|
||||||
|
|
||||||
// enumerators are found in global scope
|
// Enumerators are found in global scope.
|
||||||
bindings= fIndex.findBindings(pEnumerator, true, INDEX_FILTER, npm());
|
bindings= fIndex.findBindings(pEnumerator, true, INDEX_FILTER, npm());
|
||||||
assertEquals(1, bindings.length);
|
assertEquals(1, bindings.length);
|
||||||
checkIsEnumerator(bindings[0]);
|
checkIsEnumerator(bindings[0]);
|
||||||
|
|
|
@ -753,8 +753,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
if (e.getStatus() != Status.OK_STATUS)
|
if (e.getStatus() != Status.OK_STATUS)
|
||||||
throw e;
|
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) {
|
} catch (CoreException e) {
|
||||||
if (e.getStatus() != Status.OK_STATUS)
|
if (e.getStatus() != Status.OK_STATUS)
|
||||||
throw e;
|
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());
|
result.addAll(visitor.getMacroList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (OperationCanceledException e) {
|
||||||
catch (OperationCanceledException e) {
|
|
||||||
}
|
}
|
||||||
return result.toArray(new IIndexFragmentBinding[result.size()]);
|
return result.toArray(new IIndexFragmentBinding[result.size()]);
|
||||||
}
|
}
|
||||||
|
@ -1601,6 +1598,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
fTraces.add(Thread.currentThread().getStackTrace());
|
fTraces.add(Thread.currentThread().getStackTrace());
|
||||||
return fTraces.size();
|
return fTraces.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("nls")
|
@SuppressWarnings("nls")
|
||||||
public void write(String threadName) {
|
public void write(String threadName) {
|
||||||
System.out.println("Thread: '" + threadName + "': " + fReadLocks + " readlocks, " + fWriteLocks + " writelocks");
|
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) {
|
public void inc(DebugLockInfo val) {
|
||||||
fReadLocks+= val.fReadLocks;
|
fReadLocks+= val.fReadLocks;
|
||||||
fWriteLocks+= val.fWriteLocks;
|
fWriteLocks+= val.fWriteLocks;
|
||||||
|
|
|
@ -72,7 +72,7 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage
|
||||||
protected static final long[] FILE_LOCAL_REC_DUMMY = new long[]{0};
|
protected static final long[] FILE_LOCAL_REC_DUMMY = new long[]{0};
|
||||||
|
|
||||||
// Node types
|
// 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 BTree fMacroIndex= null; // No need for volatile, all fields of BTree are final.
|
||||||
private final PDOM fPDOM;
|
private final PDOM fPDOM;
|
||||||
|
|
|
@ -421,7 +421,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
PDOMBinding pdomBinding= null;
|
PDOMBinding pdomBinding= null;
|
||||||
PDOMNode parent2= null;
|
PDOMNode parent2= null;
|
||||||
|
|
||||||
// template parameters are created directly by their owners.
|
// Template parameters are created directly by their owners.
|
||||||
if (binding instanceof ICPPTemplateParameter)
|
if (binding instanceof ICPPTemplateParameter)
|
||||||
return null;
|
return null;
|
||||||
if (binding instanceof ICPPUnknownBinding)
|
if (binding instanceof ICPPUnknownBinding)
|
||||||
|
@ -864,7 +864,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Skip unnamed namespaces.
|
// Skip anonymous namespaces.
|
||||||
while (owner instanceof ICPPNamespace) {
|
while (owner instanceof ICPPNamespace) {
|
||||||
char[] name= owner.getNameCharArray();
|
char[] name= owner.getNameCharArray();
|
||||||
if (name.length > 0) {
|
if (name.length > 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue