mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +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:
parent
00ab9a82b8
commit
4c0e343b27
2 changed files with 7 additions and 0 deletions
|
@ -60,4 +60,8 @@ public class PseudoNameGeneratorTest extends TestCase {
|
||||||
public void testWithNamespace() {
|
public void testWithNamespace() {
|
||||||
assertEquals("string", pseudoNameGenerator.generateNewName("std::string")); //$NON-NLS-1$//$NON-NLS-2$
|
assertEquals("string", pseudoNameGenerator.generateNewName("std::string")); //$NON-NLS-1$//$NON-NLS-2$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug288736TemplateParam() {
|
||||||
|
assertEquals("tempClass", pseudoNameGenerator.generateNewName("tempClass<int>"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,9 @@ public class PseudoNameGenerator {
|
||||||
|
|
||||||
String[] nameParts = typeName.split("::"); //$NON-NLS-1$
|
String[] nameParts = typeName.split("::"); //$NON-NLS-1$
|
||||||
typeName = nameParts[nameParts.length - 1];
|
typeName = nameParts[nameParts.length - 1];
|
||||||
|
if(typeName.contains("<")) { //$NON-NLS-1$
|
||||||
|
typeName = typeName.substring(0, typeName.indexOf('<'));
|
||||||
|
}
|
||||||
if(typeName.length() != 0) {
|
if(typeName.length() != 0) {
|
||||||
typeName = typeName.substring(0, 1).toLowerCase() + typeName.substring(1);
|
typeName = typeName.substring(0, 1).toLowerCase() + typeName.substring(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue