1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 17:25:38 +02:00

FIXED - bug 288736: Source->Implement Method goes into an infinite loop for methods which have a templated parameter with no name

https://bugs.eclipse.org/bugs/show_bug.cgi?id=288736
This commit is contained in:
Emanuel Graf 2009-09-07 12:10:05 +00:00
parent 00ab9a82b8
commit 4c0e343b27
2 changed files with 7 additions and 0 deletions

View file

@ -60,4 +60,8 @@ public class PseudoNameGeneratorTest extends TestCase {
public void testWithNamespace() {
assertEquals("string", pseudoNameGenerator.generateNewName("std::string")); //$NON-NLS-1$//$NON-NLS-2$
}
public void testBug288736TemplateParam() {
assertEquals("tempClass", pseudoNameGenerator.generateNewName("tempClass<int>"));
}
}

View file

@ -32,6 +32,9 @@ public class PseudoNameGenerator {
String[] nameParts = typeName.split("::"); //$NON-NLS-1$
typeName = nameParts[nameParts.length - 1];
if(typeName.contains("<")) { //$NON-NLS-1$
typeName = typeName.substring(0, typeName.indexOf('<'));
}
if(typeName.length() != 0) {
typeName = typeName.substring(0, 1).toLowerCase() + typeName.substring(1);
}