[JBoss JIRA] Created: (GTNPORTAL-1506) Unappropriate try/catch block in method renderTemplate of Lifecycle class
by Minh Hoang TO (JIRA)
Unappropriate try/catch block in method renderTemplate of Lifecycle class
-------------------------------------------------------------------------
Key: GTNPORTAL-1506
URL: https://jira.jboss.org/browse/GTNPORTAL-1506
Project: GateIn Portal
Issue Type: Task
Security Level: Public (Everyone can see)
Reporter: Minh Hoang TO
The below try/catch block is in the method renderTemplate of Lifecycle class
try
{
service.merge(template, bcontext);
}
catch (NullPointerException e)
{
log.error("Template: " + template + " not found.");
}
The log message does not reflects exactly the happening problem. In fact, the call service.merge(template, bcontext) throws NullPointerException in two cases:
1. The template file could not be loaded (wrong path, wrong resource resolver scheme)
2. The template file is loaded but there is compilation failure
In case the NPE is due to 2, the log message might confuse developers.
For the moment, the CompilationException is caught within the FutureExoCache
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years