Bug introduced with new process invocation methods.

processClass is not forced to be a SvrProcess class, it can be also a ReportStarter one (used with Jasper Reports)
Fixed by class validation and minimal usage of reflection.
Jasper Reports as well as normal processes are now both working again.
This commit is contained in:
deathmeat 2007-06-13 15:21:22 +00:00
parent 3f543ffcea
commit 608771cc21
1 changed files with 12 additions and 1 deletions

View File

@ -78,7 +78,18 @@ public final class ProcessUtil {
ProcessCall process = null;
try
{
process = (SvrProcess)processClass.newInstance ();
if(processClass.getName().equals("org.compiere.report.ReportStarter"))
{
Class clazz = Class.forName("org.compiere.report.ReportStarter");
Object processObj = processClass.newInstance();
process = (ProcessCall)clazz.cast(processObj);
}
else
{
Class clazz = Class.forName("org.compiere.process.SvrProcess");
Object processObj = processClass.newInstance();
process = (ProcessCall)clazz.cast(processObj);
}
}
catch (Exception ex)
{