[nobug] rename variable for clarity, prevent a AIOOBException
diff --git a/web/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/resources/ContentTypeSpecs.java b/web/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/resources/ContentTypeSpecs.java
index 7f28306..ed49b86 100644
--- a/web/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/resources/ContentTypeSpecs.java
+++ b/web/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/resources/ContentTypeSpecs.java
@@ -49,16 +49,16 @@
filenames.add(names[j]);
}
Arrays.sort(baseExtensions);
- IContentType[] allContentTypes1 = Platform.getContentTypeManager().getAllContentTypes();
- for (int i = 0, length = allContentTypes1.length; i < length; i++) {
- if (allContentTypes1[i].isKindOf(baseContentType)) {
- String[] fileExtension = allContentTypes1[i].getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
+ IContentType[] allContentTypes = Platform.getContentTypeManager().getAllContentTypes();
+ for (int i = 0, length = allContentTypes.length; i < length; i++) {
+ if (!baseContentType.equals(allContentTypes[i]) && allContentTypes[i].isKindOf(baseContentType)) {
+ String[] fileExtension = allContentTypes[i].getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
for (int j = 0; j < fileExtension.length; j++) {
if (!filenameExtensions.contains(fileExtension[j])) {
filenameExtensions.add(fileExtension[j]);
}
}
- names = allContentTypes1[i].getFileSpecs(IContentType.FILE_NAME_SPEC);
+ names = allContentTypes[i].getFileSpecs(IContentType.FILE_NAME_SPEC);
for (int j = 0; j < names.length; j++) {
filenames.add(names[j]);
}
diff --git a/xml/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java b/xml/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java
index 2a282c3..1e620d2 100644
--- a/xml/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java
+++ b/xml/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java
@@ -1057,7 +1057,7 @@
int end = offset;
IDocument document = parent.getParentDocument();
try {
- while (start >= 0 && !Character.isWhitespace(document.getChar(start - 1))) {
+ while (start > 0 && !Character.isWhitespace(document.getChar(start - 1))) {
start--;
}
matchString = document.get(start, end - start);