Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xorg.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
index b04824be2..6e60a803c 100755
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
@@ -377,17 +377,24 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
- final ContextTypeRegistry codeTemplateContextRegistry = JavaPlugin
- .getDefault().getCodeTemplateContextRegistry();
- final Iterator<?> ctIter = codeTemplateContextRegistry
- .contextTypes();
-
- while (ctIter.hasNext()) {
- final TemplateContextType contextType = (TemplateContextType) ctIter
- .next();
- contextType.addResolver(new GitTemplateVariableResolver(
- "git_config", //$NON-NLS-1$
- UIText.GitTemplateVariableResolver_GitConfigDescription));
+ try {
+ final ContextTypeRegistry codeTemplateContextRegistry = JavaPlugin
+ .getDefault().getCodeTemplateContextRegistry();
+ final Iterator<?> ctIter = codeTemplateContextRegistry
+ .contextTypes();
+
+ while (ctIter.hasNext()) {
+ final TemplateContextType contextType = (TemplateContextType) ctIter
+ .next();
+ contextType.addResolver(new GitTemplateVariableResolver(
+ "git_config", //$NON-NLS-1$
+ UIText.GitTemplateVariableResolver_GitConfigDescription));
+ }
+ } catch (Throwable e) {
+ // while catching Throwable is an anti-pattern, we may
+ // experience NoClassDefFoundErrors here
+ logError("Cannot register git support for Java templates", //$NON-NLS-1$
+ e);
}
return Status.OK_STATUS;
}

Back to the top