1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-03 14:25:37 +02:00

2005-03-29 Chris Wiebe

prevent duplicate #includes
	* src/org/eclipse/cdt/internal/ui/wizards/NewClassCodeGenerator.java
This commit is contained in:
Chris Wiebe 2005-03-30 00:58:50 +00:00
parent 12aaa62fa7
commit 5a3d496550
2 changed files with 12 additions and 4 deletions

View file

@ -1,5 +1,8 @@
2005-03-29 Chris Wiebe
prevent duplicate #includes
* src/org/eclipse/cdt/internal/ui/wizards/NewClassCodeGenerator.java
2005-03-29 Chris Wiebe
fix PR#87328 by making class wizard page publicly accessible
refactored wizard code and added comments
* src/org/eclipse/cdt/internal/ui/wizards/AbstractMethodStub.java

View file

@ -556,7 +556,7 @@ public class NewClassCodeGenerator {
boolean foundPath = false;
for (Iterator ipIter = includePaths.iterator(); ipIter.hasNext(); ) {
IPath includePath = (IPath) ipIter.next();
if (includePath.isPrefixOf(folderToAdd)) {
if (includePath.isPrefixOf(folderToAdd) || includePath.equals(folderToAdd)) {
foundPath = true;
break;
}
@ -569,7 +569,9 @@ public class NewClassCodeGenerator {
newIter.remove();
}
}
newIncludePaths.add(folderToAdd);
if (!newIncludePaths.contains(folderToAdd)) {
newIncludePaths.add(folderToAdd);
}
}
}
}
@ -594,7 +596,10 @@ public class NewClassCodeGenerator {
List list = new ArrayList();
for (int i = 0; i < includePaths.length; ++i) {
//TODO do we need to canonicalize these paths first?
list.add(new Path(includePaths[i]));
IPath path = new Path(includePaths[i]);
if (!list.contains(path)) {
list.add(path);
}
}
return list;
}
@ -617,7 +622,7 @@ public class NewClassCodeGenerator {
if (verifyLocation) {
throw new CodeGeneratorException("Could not find base class " + baseClass.toString()); //$NON-NLS-1$
}
} else {
} else if (!list.contains(baseClassLocation)) {
list.add(baseClassLocation);
}
}