* java generics warning fix

* refactored duplicate JASPER_STARTER_CLASS constant (use ProcessUtil.JASPER_STARTER_CLASS)
This commit is contained in:
teo_sarca 2008-02-09 14:36:16 +00:00
parent fcf59d7f7f
commit 23e35757c4
2 changed files with 5 additions and 8 deletions

View File

@ -30,7 +30,7 @@ import org.compiere.wf.MWorkflow;
*/ */
public final class ProcessUtil { public final class ProcessUtil {
private static final String JASPER_STARTER_CLASS = "org.compiere.report.ReportStarter"; public static final String JASPER_STARTER_CLASS = "org.compiere.report.ReportStarter";
/** Logger */ /** Logger */
private static CLogger log = CLogger.getCLogger(ProcessUtil.class); private static CLogger log = CLogger.getCLogger(ProcessUtil.class);
@ -81,7 +81,7 @@ public final class ProcessUtil {
className = JASPER_STARTER_CLASS; className = JASPER_STARTER_CLASS;
} }
//Get Class //Get Class
Class processClass = null; Class<?> processClass = null;
try try
{ {
processClass = Class.forName (className); processClass = Class.forName (className);

View File

@ -61,8 +61,6 @@ import org.compiere.wf.MWFProcess;
*/ */
public class ProcessCtl implements Runnable public class ProcessCtl implements Runnable
{ {
private static final String JASPER_STARTER_CLASS = "org.compiere.report.ReportStarter";
/** /**
* Process Control * Process Control
* <code> * <code>
@ -379,7 +377,7 @@ public class ProcessCtl implements Runnable
boolean isJasper = false; boolean isJasper = false;
if (JasperReport != null && JasperReport.trim().length() > 0) { if (JasperReport != null && JasperReport.trim().length() > 0) {
isJasper = true; isJasper = true;
if (JASPER_STARTER_CLASS.equals(m_pi.getClassName())) { if (ProcessUtil.JASPER_STARTER_CLASS.equals(m_pi.getClassName())) {
m_pi.setClassName(null); m_pi.setClassName(null);
} }
} }
@ -442,7 +440,7 @@ public class ProcessCtl implements Runnable
if (isJasper) if (isJasper)
{ {
m_pi.setClassName(JASPER_STARTER_CLASS); m_pi.setClassName(ProcessUtil.JASPER_STARTER_CLASS);
startProcess(); startProcess();
unlock(); unlock();
return; return;
@ -603,9 +601,8 @@ public class ProcessCtl implements Runnable
//hengsin, bug [ 1633995 ] //hengsin, bug [ 1633995 ]
boolean clientOnly = false; boolean clientOnly = false;
if (! m_pi.getClassName().toLowerCase().startsWith(MRule.SCRIPT_PREFIX)) { if (! m_pi.getClassName().toLowerCase().startsWith(MRule.SCRIPT_PREFIX)) {
Class processClass = null;
try { try {
processClass = Class.forName(m_pi.getClassName()); Class<?> processClass = Class.forName(m_pi.getClassName());
if (ClientProcess.class.isAssignableFrom(processClass)) if (ClientProcess.class.isAssignableFrom(processClass))
clientOnly = true; clientOnly = true;
} catch (Exception e) {} } catch (Exception e) {}