我的Java类中有方法。
public String getCorrectFormatDate(Issue issue){
Long timespent = issue.getTimeSpent();
if(timespent>0){
int hours = (int) (timespent / 3600);
int remainder = (int) (timespent - hours * 3600);
int min = remainder / 60;
String result = hours + "h " + min +"min";
return result;
}
else{
return "0";
}
}
另外,在我的速度模板中,我有此代码
#foreach ($issue in $issues)
<tr role="row">
<td colspan="1" class="confluenceTd"><a href="$action.getBaseURL()/browse/${issue.getKey()}">$issue.getKey()</a></td>
<td colspan="1" class="confluenceTd">$issue.getSummary()</td>
<td colspan="1" class="confluenceTd">$action.getCorrectFormatDate($issue)</td>
#end
为什么我的某些方法无法正常工作?
$action.getCorrectFormatDate($issue)
引发异常java.lang.NullPointerException