Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2008-12-11 01:12:48 +0000
committernitind2008-12-11 01:12:48 +0000
commitadfc3715f00848bccf416ae6352b6fcd4d0776b6 (patch)
treea1a6632be9604a847a844c2ca51b2154c1e18650
parent82d1e0745170518f0a2f56fffed09c8c4ede4ed6 (diff)
downloadwebtools.sourceediting-adfc3715f00848bccf416ae6352b6fcd4d0776b6.tar.gz
webtools.sourceediting-adfc3715f00848bccf416ae6352b6fcd4d0776b6.tar.xz
webtools.sourceediting-adfc3715f00848bccf416ae6352b6fcd4d0776b6.zip
[nobug] catch extension exceptions
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java26
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java17
2 files changed, 32 insertions, 11 deletions
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
index 1382a52272..f491ed6e9d 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
@@ -36,6 +36,7 @@ import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.internal.Logger;
/**
* A processor that aggregates the proposals of multiple other processors.
@@ -297,18 +298,25 @@ class CompoundContentAssistProcessor implements IContentAssistProcessor, ISubjec
List ret = new LinkedList();
for (Iterator it = fProcessors.iterator(); it.hasNext();) {
IContentAssistProcessor p = (IContentAssistProcessor) it.next();
- ICompletionProposal[] proposals = p.computeCompletionProposals(viewer, documentOffset);
- if (proposals != null && proposals.length > 0) {
- ret.addAll(Arrays.asList(proposals));
- fErrorMessage = null; // Hide previous errors
- } else {
- if (fErrorMessage == null && ret.isEmpty()) {
- String errorMessage = p.getErrorMessage();
- if (errorMessage != null) {
- fErrorMessage = errorMessage;
+ try {
+ // isolate calls to each processor
+ ICompletionProposal[] proposals = p.computeCompletionProposals(viewer, documentOffset);
+ if (proposals != null && proposals.length > 0) {
+ ret.addAll(Arrays.asList(proposals));
+ fErrorMessage = null; // Hide previous errors
+ }
+ else {
+ if (fErrorMessage == null && ret.isEmpty()) {
+ String errorMessage = p.getErrorMessage();
+ if (errorMessage != null) {
+ fErrorMessage = errorMessage;
+ }
}
}
}
+ catch (Exception e) {
+ Logger.logException(e);
+ }
}
return (ICompletionProposal[]) ret.toArray(new ICompletionProposal[ret.size()]);
}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
index 468c12edce..3ae68fabbc 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
@@ -36,6 +36,7 @@ import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.internal.Logger;
import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
import org.eclipse.wst.sse.ui.internal.reconcile.StructuredTextReconcilingStrategy;
@@ -184,10 +185,22 @@ public class ValidatorStrategy extends StructuredTextReconcilingStrategy {
if (file != null) {
for (Iterator it = ValidationFramework.getDefault().getDisabledValidatorsFor(file).iterator(); it.hasNext();) {
Validator v = (Validator) it.next();
- IValidator iv = v.asIValidator();
+ IValidator iv = null;
+ try {
+ iv = v.asIValidator();
+ }
+ catch (Exception e) {
+ Logger.logException(e);
+ }
if (iv != null && v.getSourceId() != null)
disabledValsBySourceId.add(v.getSourceId());
- Validator.V1 v1 = v.asV1Validator();
+ Validator.V1 v1 = null;
+ try {
+ v1 = v.asV1Validator();
+ }
+ catch (Exception e) {
+ Logger.logException(e);
+ }
if (v1 != null)
disabledValsByClass.add(v1.getId());
}

Back to the top