1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-08-20 16:23:05 -07:00
parent f248dc94b2
commit 0d95c85386
3 changed files with 18 additions and 21 deletions

View file

@ -551,10 +551,11 @@ public class IndexBugsTests extends BaseTestCase {
fIndex.releaseReadLock(); fIndex.releaseReadLock();
} }
} }
public void test164360_1() throws Exception { public void test164360_1() throws Exception {
waitForIndexer(); waitForIndexer();
IFile include= TestSourceReader.createFile(fCProject.getProject(), "test164360.h", ""); IFile include= TestSourceReader.createFile(fCProject.getProject(), "test164360.h", "");
TestScannerProvider.sIncludeFiles= new String[]{include.getLocation().toOSString()}; TestScannerProvider.sIncludeFiles= new String[] { include.getLocation().toOSString() };
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test164360.cpp", ""); IFile file= TestSourceReader.createFile(fCProject.getProject(), "test164360.cpp", "");
TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME); TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
@ -696,8 +697,7 @@ public class IndexBugsTests extends BaseTestCase {
if (bindings[0] instanceof ICompositeType) { if (bindings[0] instanceof ICompositeType) {
struct= bindings[0]; struct= bindings[0];
typedef= bindings[1]; typedef= bindings[1];
} } else {
else {
struct= bindings[1]; struct= bindings[1];
typedef= bindings[0]; typedef= bindings[0];
} }
@ -730,8 +730,7 @@ public class IndexBugsTests extends BaseTestCase {
if (bindings[0] instanceof ICPPClassType) { if (bindings[0] instanceof ICPPClassType) {
struct= bindings[0]; struct= bindings[0];
typedef= bindings[1]; typedef= bindings[1];
} } else {
else {
struct= bindings[1]; struct= bindings[1];
typedef= bindings[0]; typedef= bindings[0];
} }
@ -1149,8 +1148,7 @@ public class IndexBugsTests extends BaseTestCase {
assertEquals(1, bindings.length); assertEquals(1, bindings.length);
IIndexBinding binding = bindings[0]; IIndexBinding binding = bindings[0];
assertTrue(binding instanceof IVariable); assertTrue(binding instanceof IVariable);
IIndexName[] names = index.findNames(binding, IIndexName[] names = index.findNames(binding, IIndex.FIND_ALL_OCCURRENCES);
IIndex.FIND_ALL_OCCURRENCES);
assertEquals(1, names.length); assertEquals(1, names.length);
assertEquals(f4.getFullPath().toString(), names[0].getFile().getLocation().getFullPath()); assertEquals(f4.getFullPath().toString(), names[0].getFile().getLocation().getFullPath());

View file

@ -25,7 +25,7 @@ class CompositeCStructure extends CompositeCBinding implements ICompositeType, I
} }
public IField findField(String name) { public IField findField(String name) {
IField preresult = ((ICompositeType)rbinding).findField(name); IField preresult = ((ICompositeType) rbinding).findField(name);
return (IField) cf.getCompositeBinding((IIndexFragmentBinding) preresult); return (IField) cf.getCompositeBinding((IIndexFragmentBinding) preresult);
} }
@ -34,24 +34,24 @@ class CompositeCStructure extends CompositeCBinding implements ICompositeType, I
} }
public IField[] getFields() { public IField[] getFields() {
IField[] result = ((ICompositeType)rbinding).getFields(); IField[] result = ((ICompositeType) rbinding).getFields();
for(int i=0; i<result.length; i++) for(int i= 0; i < result.length; i++)
result[i] = (IField) cf.getCompositeBinding((IIndexFragmentBinding)result[i]); result[i] = (IField) cf.getCompositeBinding((IIndexFragmentBinding) result[i]);
return result; return result;
} }
public int getKey() { public int getKey() {
return ((ICompositeType)rbinding).getKey(); return ((ICompositeType) rbinding).getKey();
} }
public boolean isSameType(IType type) { public boolean isSameType(IType type) {
return ((ICompositeType)rbinding).isSameType(type); return ((ICompositeType) rbinding).isSameType(type);
} }
@Override @Override
public Object clone() {fail(); return null;} public Object clone() {fail(); return null;}
public boolean isAnonymous() { public boolean isAnonymous() {
return ((ICompositeType)rbinding).isAnonymous(); return ((ICompositeType) rbinding).isAnonymous();
} }
} }

View file

@ -91,7 +91,7 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
@Override @Override
public void accept(IPDOMVisitor visitor) throws CoreException { public void accept(IPDOMVisitor visitor) throws CoreException {
super.accept(visitor); super.accept(visitor);
new PDOMNodeLinkedList(getLinkage(), record+MEMBERLIST).accept(visitor); new PDOMNodeLinkedList(getLinkage(), record + MEMBERLIST).accept(visitor);
} }
@Override @Override
@ -197,8 +197,7 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
} catch (CoreException e) { } catch (CoreException e) {
if (e.getStatus().equals(Status.OK_STATUS)) { if (e.getStatus().equals(Status.OK_STATUS)) {
result= visitor.getField(); result= visitor.getField();
} } else {
else {
CCorePlugin.log(e); CCorePlugin.log(e);
return null; return null;
} }