Author: vrubezhny
Date: 2010-04-16 04:42:54 -0400 (Fri, 16 Apr 2010)
New Revision: 21517
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java
Log:
JBIDE-6064: CA out of range error occurs sometimes
Because of some exceptions are hidden by CA Pop-up additional try-catch is added while
trying to find the problem
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java 2010-04-16
07:46:54 UTC (rev 21516)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java 2010-04-16
08:42:54 UTC (rev 21517)
@@ -36,6 +36,7 @@
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
import org.eclipse.wst.sse.ui.internal.util.Sorter;
+import org.jboss.tools.common.text.xml.XmlEditorPlugin;
/**
* Reads the plugin.xml file for the processors defined using the
@@ -208,6 +209,8 @@
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset)
{
fErrorMessage = null;
+ ICompletionProposal[] resultArray = new ICompletionProposal[0];
+ try {
String contentType = getContentType(fSourceViewer);
if (contentType == null)
return new ICompletionProposal[0];
@@ -245,11 +248,14 @@
}
}
}
- ICompletionProposal[] resultArray = ret.toArray(new ICompletionProposal[ret.size()]);
+ resultArray = ret.toArray(new ICompletionProposal[ret.size()]);
Object[] sorted = createSorter().sort(resultArray);
System.arraycopy(sorted, 0, resultArray, 0, sorted.length);
resultArray = makeUnique(resultArray);
+ } catch (Exception e) {
+ XmlEditorPlugin.getPluginLog().logError("An error occured while computing the
completion proposals", e);
+ }
return resultArray;
}
Show replies by date