mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
update mustache to version 0.8.13
This commit is contained in:
@@ -456,7 +456,7 @@
|
||||
<aether.version>1.13.1</aether.version>
|
||||
<wagon.version>1.0</wagon.version>
|
||||
<maven.version>3.0.5</maven.version>
|
||||
<mustache.version>0.8.12</mustache.version>
|
||||
<mustache.version>0.8.13</mustache.version>
|
||||
<netbeans.hint.deploy.server>Tomcat</netbeans.hint.deploy.server>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ package sonia.scm.template;
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.github.mustachejava.Mustache;
|
||||
import com.github.mustachejava.MustacheException;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
@@ -92,8 +93,7 @@ public class MustacheTemplateEngine implements TemplateEngine
|
||||
ThreadFactory threadFactory =
|
||||
new ThreadFactoryBuilder().setNameFormat(THREAD_NAME).build();
|
||||
|
||||
factory.setExecutorService(Executors.
|
||||
newCachedThreadPool(threadFactory));
|
||||
factory.setExecutorService(Executors.newCachedThreadPool(threadFactory));
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
@@ -166,29 +166,15 @@ public class MustacheTemplateEngine implements TemplateEngine
|
||||
}
|
||||
catch (MustacheTemplateNotFoundException ex)
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn("could not find mustache template at {}", templatePath);
|
||||
}
|
||||
logger.warn("could not find mustache template at {}", templatePath);
|
||||
}
|
||||
catch (UncheckedExecutionException ex)
|
||||
{
|
||||
Throwable cause = ex.getCause();
|
||||
|
||||
if (cause instanceof MustacheTemplateNotFoundException)
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn("could not find mustache template at {}", templatePath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Throwables.propagateIfInstanceOf(cause, IOException.class);
|
||||
|
||||
throw new TemplateParseException(
|
||||
"could not parse template for resource ".concat(templatePath), cause);
|
||||
}
|
||||
handleWrappedException(ex, templatePath);
|
||||
}
|
||||
catch (MustacheException ex)
|
||||
{
|
||||
handleWrappedException(ex, templatePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -213,6 +199,35 @@ public class MustacheTemplateEngine implements TemplateEngine
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param ex
|
||||
* @param templatePath
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
private void handleWrappedException(Exception ex, String templatePath)
|
||||
throws IOException
|
||||
{
|
||||
Throwable cause = ex.getCause();
|
||||
|
||||
if (cause instanceof MustacheTemplateNotFoundException)
|
||||
{
|
||||
logger.warn("could not find mustache template at {}", templatePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
Throwables.propagateIfInstanceOf(cause, IOException.class);
|
||||
|
||||
throw new TemplateParseException(
|
||||
"could not parse template for resource ".concat(templatePath), cause);
|
||||
}
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
Reference in New Issue
Block a user