From 45872aa127839238b0640c196e8a1cb649187a57 Mon Sep 17 00:00:00 2001 From: Emanuel Graf Date: Wed, 21 Oct 2009 09:20:31 +0000 Subject: [PATCH] FIXED - bug 291268: Source->Implement Method goes into an infinite loop for parameter with white spaces in type name https://bugs.eclipse.org/bugs/show_bug.cgi?id=291268 --- .../ui/refactoring/utils/PseudoNameGenerator.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/PseudoNameGenerator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/PseudoNameGenerator.java index 8e744aa8bca..bea2edf203b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/PseudoNameGenerator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/PseudoNameGenerator.java @@ -38,7 +38,19 @@ public class PseudoNameGenerator { if(typeName.length() != 0) { typeName = typeName.substring(0, 1).toLowerCase() + typeName.substring(1); } - + + nameParts = typeName.split("\\s"); //$NON-NLS-1$ + for (int i = 0; i < nameParts.length; i++) { + if(i <= 0) { + typeName = nameParts[i]; + }else { + typeName = typeName.concat(nameParts[i].substring(0,1).toUpperCase()); + if(nameParts[i].length() > 1) { + typeName = typeName.concat(nameParts[i].substring(1)); + } + } + } + String numberString = ""; //$NON-NLS-1$ String newNameCandidate; int index = 0;