Author: yradtsevich
Date: 2010-12-14 15:57:59 -0500 (Tue, 14 Dec 2010)
New Revision: 27482
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
Log:
https://issues.jboss.org/browse/JBIDE-7841 :
Fix spring tests
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2010-12-14
20:19:53 UTC (rev 27481)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2010-12-14
20:57:59 UTC (rev 27482)
@@ -1008,25 +1008,28 @@
String nameSpaceIdentifyer = templateElement
.getAttribute(VpeTemplateManager.NAMESPACE_IDENTIFIER_ATTRIBUTE);
if (templateClassName != null && templateClassName.length() > 0) {
- try {
- Bundle bundle;
- if (nameSpaceIdentifyer == null
- || nameSpaceIdentifyer.length() == 0) {
- nameSpaceIdentifyer = confElement.getNamespaceIdentifier();
+ if (nameSpaceIdentifyer == null
+ || nameSpaceIdentifyer.length() == 0) {
+ nameSpaceIdentifyer = confElement.getNamespaceIdentifier();
+ }
+
+ Bundle bundle = Platform.getBundle(nameSpaceIdentifyer);
+ if (bundle == null) {
+ template = null;
+ } else {
+ try {
+ Class templateClass = bundle.loadClass(templateClassName);
+ template = (VpeTemplate) templateClass.newInstance();
+ } catch (ClassNotFoundException e) {
+ template = handleTemplateClassLoadException(template,
+ templateClassName, nameSpaceIdentifyer, e);
+ } catch (IllegalAccessException e) {
+ template = handleTemplateClassLoadException(template,
+ templateClassName, nameSpaceIdentifyer, e);
+ } catch (InstantiationException e) {
+ template = handleTemplateClassLoadException(template,
+ templateClassName, nameSpaceIdentifyer, e);
}
- bundle = Platform.getBundle(nameSpaceIdentifyer);
-
- Class templateClass = bundle.loadClass(templateClassName);
- template = (VpeTemplate) templateClass.newInstance();
- } catch (ClassNotFoundException e) {
- template = handleTemplateClassLoadException(template,
- templateClassName, nameSpaceIdentifyer, e);
- } catch (IllegalAccessException e) {
- template = handleTemplateClassLoadException(template,
- templateClassName, nameSpaceIdentifyer, e);
- } catch (InstantiationException e) {
- template = handleTemplateClassLoadException(template,
- templateClassName, nameSpaceIdentifyer, e);
}
} else {
template = new VpeHtmlTemplate();