Make method getReportPrefix(Report)
simpler
This commit is contained in:
parent
8d2916c23e
commit
b9f1dcbcd5
@ -395,16 +395,10 @@ public class ReportManager
|
||||
*/
|
||||
public static String getReportPrefix(Report report)
|
||||
{
|
||||
Optional<Long> reportIdOptional = report.getId();
|
||||
long reportId = report.getId().orElseThrow(() ->
|
||||
new IllegalStateException("Report has not yet been assigned an id."));
|
||||
|
||||
if (reportIdOptional.isPresent())
|
||||
{
|
||||
return getReportPrefix(reportIdOptional.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalStateException("Report has not yet been assigned an id.");
|
||||
}
|
||||
return getReportPrefix(reportId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user