mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Performance of class name verification in new class wizard, bug 270924.
This commit is contained in:
parent
7238d0fff7
commit
72a4c706d9
1 changed files with 1 additions and 7 deletions
|
@ -15,7 +15,6 @@ package org.eclipse.cdt.internal.ui.wizards.classwizard;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
@ -418,14 +417,9 @@ public class NewClassWizardUtil {
|
||||||
String fullyQualifiedTypeName = typeName.getFullyQualifiedName();
|
String fullyQualifiedTypeName = typeName.getFullyQualifiedName();
|
||||||
try {
|
try {
|
||||||
IndexFilter filter= IndexFilter.getFilter(ILinkage.CPP_LINKAGE_ID);
|
IndexFilter filter= IndexFilter.getFilter(ILinkage.CPP_LINKAGE_ID);
|
||||||
String[] nameStrs= fullyQualifiedTypeName.split("::"); //$NON-NLS-1$
|
|
||||||
char[][] names= new char[nameStrs.length][];
|
|
||||||
for (int i = 0; i < names.length; i++) {
|
|
||||||
names[i]= nameStrs[i].toCharArray();
|
|
||||||
}
|
|
||||||
//bug 165636: findBindings(char[][]...) does not find nested nodes (classes)
|
//bug 165636: findBindings(char[][]...) does not find nested nodes (classes)
|
||||||
//therefore switching back to findBindings(Pattern...)
|
//therefore switching back to findBindings(Pattern...)
|
||||||
IBinding[] bindings = index.findBindings(Pattern.compile(typeName.getName()), false, filter, new NullProgressMonitor());
|
IBinding[] bindings = index.findBindings(typeName.getName().toCharArray(), false, filter, new NullProgressMonitor());
|
||||||
boolean sameTypeNameExists = false;
|
boolean sameTypeNameExists = false;
|
||||||
boolean sameNameDifferentTypeExists = false;
|
boolean sameNameDifferentTypeExists = false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue