diff options
author | Dani Megert | 2014-04-16 11:36:42 +0000 |
---|---|---|
committer | Dani Megert | 2014-04-16 11:36:42 +0000 |
commit | ca57b300d79431c27b32ae2113919be546cc42d9 (patch) | |
tree | 786706a3f7bddfac50daa93877b8232cbc0e52ff | |
parent | 12e81d45ded84412e8efcc2435cd85c0c42e951e (diff) | |
download | eclipse.platform.text-ca57b300d79431c27b32ae2113919be546cc42d9.tar.gz eclipse.platform.text-ca57b300d79431c27b32ae2113919be546cc42d9.tar.xz eclipse.platform.text-ca57b300d79431c27b32ae2113919be546cc42d9.zip |
Additional fix for bug 429925: [content assist] Protect against poorly behaved completion proposersI20140520-2000I20140519-2000I20140518-2000I20140517-1500I20140516-2000I20140515-2000I20140515-1230I20140514-2000I20140513-2000I20140512-2000I20140511-2000I20140510-1500I20140509-2000I20140508-2000I20140507-2000I20140506-2000I20140505-2000I20140504-2000I20140503-1500I20140502-2000I20140501-0200I20140430-2000I20140430-0800I20140429-2000I20140429-0800I20140428-2000I20140428-0800I20140427-2030I20140422-0800
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java index ec3e2c5dfc1..350a5e281ca 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -1156,8 +1156,20 @@ class CompletionProposalPopup implements IContentAssistListener { for (int i= 0; i < items.length; i++) { TableItem item= items[i]; ICompletionProposal proposal= proposals[i]; - item.setText(proposal.getDisplayString()); - item.setImage(proposal.getImage()); + Image image= null; + String displayString= null; + try { + displayString= proposal.getDisplayString(); + image= proposal.getImage(); + } catch (RuntimeException e) { + // On failures to retrieve the proposal's text, insert a dummy entry and log the error. + String PLUGIN_ID= "org.eclipse.jface.text"; //$NON-NLS-1$ + ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID)); + log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, JFaceTextMessages.getString("CompletionProposalPopup.unexpected_error"), e)); //$NON-NLS-1$ + displayString= JFaceTextMessages.getString("CompletionProposalPopup.error_retrieving_proposal"); //$NON-NLS-1$ + } + item.setText(displayString); + item.setImage(image); item.setData(proposal); } fProposalTable.setRedraw(true); |