1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Reverted a previous change that caused a breakage in AST2UtilTests.testSimpleParameter. The change itself was innocent since it simply removed unnecessary spaces, but I decided not to mess with it since the code is used for building function signatures.

This commit is contained in:
Sergey Prigogin 2008-03-20 22:02:21 +00:00
parent 4ef0990365
commit 1a05e6b75b
2 changed files with 9 additions and 12 deletions

View file

@ -516,7 +516,7 @@ public class IndexUpdateTests extends IndexTestBase {
fIndex.acquireReadLock();
try {
final char[] nchars = name.toCharArray();
final String refType = name + "&";
final String refType = name + " &";
final String constRefType = "const " + refType;
IIndexBinding[] ctors= fIndex.findBindings(new char[][]{nchars, nchars}, IndexFilter.ALL_DECLARED_OR_IMPLICIT, NPM);

View file

@ -438,25 +438,22 @@ public class ASTTypeUtil {
// pop all of the types off of the stack, and build the string representation while doing so
for (int j = types.length - 1; j >= 0; j--) {
if (types[j] != null && result.length() > 0)
result.append(SPACE); // only add a space if this is not the first type being added
if (types[j] != null) {
if (j > 0 && types[j - 1] instanceof IQualifierType) {
smartAppend(result, getTypeString(types[j - 1]));
smartAppend(result, getTypeString(types[j]));
result.append(getTypeString(types[j - 1]));
result.append(SPACE);
result.append(getTypeString(types[j]));
--j;
} else {
smartAppend(result, getTypeString(types[j]));
result.append(getTypeString(types[j]));
}
}
}
return result.toString();
}
private static void smartAppend(StringBuilder buf, String str) {
if (buf.length() > 0 && str.length() > 0 && "&*".indexOf(str.charAt(0)) < 0) { //$NON-NLS-1$
buf.append(SPACE);
}
buf.append(str);
return result.toString();
}
/**