Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2015-02-13 19:39:27 +0000
committerMarkus Keller2015-02-13 19:39:27 +0000
commit2665a685362643f4593e1aae34a968d48fe03c5d (patch)
tree1063401ecba29db78e4bde88bb33a06b8066d120
parent8e05771a8bf36c4e10f492357661fe3a9b252a34 (diff)
downloadeclipse.platform.text-2665a685362643f4593e1aae34a968d48fe03c5d.tar.gz
eclipse.platform.text-2665a685362643f4593e1aae34a968d48fe03c5d.tar.xz
eclipse.platform.text-2665a685362643f4593e1aae34a968d48fe03c5d.zip
Bug 459927: [templates] ContributionContextTypeRegistry#createResolver(..) must not throw AFEI20150310-0800I20150305-1200I20150303-0800I20150224-0800I20150217-0800
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java
index a624478f37e..963686cf5fc 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -231,8 +231,14 @@ public class ContributionContextTypeRegistry extends ContextTypeRegistry {
if (type != null) {
TemplateVariableResolver resolver= (TemplateVariableResolver) element.createExecutableExtension(CLASS);
+ if (resolver.getType() != null) {
+ throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, resolver.getClass() + "() must call super() and not set the variable's type", null)); //$NON-NLS-1$
+ }
resolver.setType(type);
+ if (resolver.getDescription() != null) {
+ throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, resolver.getClass() + "() must call super() and not set the variable's description", null)); //$NON-NLS-1$
+ }
String desc= element.getAttribute(DESCRIPTION);
resolver.setDescription(desc == null ? "" : desc); //$NON-NLS-1$

Back to the top