TaskService getTaskComments throws NullPointerException if the task is not found
--------------------------------------------------------------------------------
Key: JBPM-2340
URL:
https://jira.jboss.org/jira/browse/JBPM-2340
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.0.CR1
Reporter: Flavio Donzé
taskService.getTaskComments(-1);
Throws a NullPointerException, instead of returning null or an empty list.
java.lang.NullPointerException
at org.jbpm.pvm.internal.cmd.GetTaskCommentsCmd.execute(GetTaskCommentsCmd.java:50)
at org.jbpm.pvm.internal.cmd.GetTaskCommentsCmd.execute(GetTaskCommentsCmd.java:37)
at
org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at
org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at
org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.TaskServiceImpl.getTaskComments(TaskServiceImpl.java:123)
GetTaskCommentsCmd.java
public List<Comment> execute(Environment environment) throws Exception {
DbSession dbSession = environment.get(DbSession.class);
TaskImpl task = dbSession.get(TaskImpl.class, taskDbid);
List<Comment> comments = task.getComments();
forceInitializationAndClean(comments);
return comments;
}
"task" is null since it's not found.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira