Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2008-03-20 22:02:21 +0000
committerSergey Prigogin2008-03-20 22:02:21 +0000
commit1a05e6b75b66fc5c852e93d5217ef196c4ea0f51 (patch)
treefacf63d503da8298ddf874676bcdcc5da76fc79a /core/org.eclipse.cdt.core/parser
parent4ef099036570984a40f9323c7d8d0e8855958cc4 (diff)
downloadorg.eclipse.cdt-1a05e6b75b66fc5c852e93d5217ef196c4ea0f51.tar.gz
org.eclipse.cdt-1a05e6b75b66fc5c852e93d5217ef196c4ea0f51.tar.xz
org.eclipse.cdt-1a05e6b75b66fc5c852e93d5217ef196c4ea0f51.zip
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.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java19
1 files changed, 8 insertions, 11 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
index f3c39447e53..bc46e01cca7 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
@@ -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();
}
/**

Back to the top