IDEMPIERE-455 Discover and fix FindBugs problems / Eclipse warning -> raw type
This commit is contained in:
parent
16773b295b
commit
dce3b0d46f
|
@ -102,8 +102,8 @@ public abstract class AdempiereServer implements Runnable
|
||||||
/** Initial nap is seconds */
|
/** Initial nap is seconds */
|
||||||
private int m_initialNap = 0;
|
private int m_initialNap = 0;
|
||||||
|
|
||||||
/** Milliseconds to sleep - 10 Min default */
|
/** Milliseconds to sleep - 0 Sec default */
|
||||||
protected long m_sleepMS = 600000;
|
protected long m_sleepMS = 0;
|
||||||
/** Sleeping */
|
/** Sleeping */
|
||||||
private volatile boolean m_sleeping = true;
|
private volatile boolean m_sleeping = true;
|
||||||
/** Server start time */
|
/** Server start time */
|
||||||
|
@ -178,6 +178,17 @@ public abstract class AdempiereServer implements Runnable
|
||||||
*/
|
*/
|
||||||
public void run ()
|
public void run ()
|
||||||
{
|
{
|
||||||
|
final Thread currentThread = Thread.currentThread();
|
||||||
|
final String oldThreadName = currentThread.getName();
|
||||||
|
String newThreadName = getName();
|
||||||
|
boolean renamed = false;
|
||||||
|
if (!oldThreadName.equals(newThreadName)) {
|
||||||
|
try {
|
||||||
|
currentThread.setName(newThreadName);
|
||||||
|
renamed = true;
|
||||||
|
} catch (SecurityException e) {}
|
||||||
|
}
|
||||||
|
|
||||||
m_sleeping = false;
|
m_sleeping = false;
|
||||||
if (m_start == 0)
|
if (m_start == 0)
|
||||||
m_start = System.currentTimeMillis();
|
m_start = System.currentTimeMillis();
|
||||||
|
@ -215,6 +226,11 @@ public abstract class AdempiereServer implements Runnable
|
||||||
p_model.setDateNextRun(new Timestamp(m_nextWork));
|
p_model.setDateNextRun(new Timestamp(m_nextWork));
|
||||||
p_model.saveEx();
|
p_model.saveEx();
|
||||||
m_sleeping = true;
|
m_sleeping = true;
|
||||||
|
if (renamed) {
|
||||||
|
// Revert the name back if the current thread was renamed.
|
||||||
|
// We do not check the exception here because we know it works.
|
||||||
|
currentThread.setName(oldThreadName);
|
||||||
|
}
|
||||||
} // run
|
} // run
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -82,6 +82,7 @@ import org.zkoss.zul.Div;
|
||||||
import org.zkoss.zul.Separator;
|
import org.zkoss.zul.Separator;
|
||||||
import org.zkoss.zul.Space;
|
import org.zkoss.zul.Space;
|
||||||
import org.zkoss.zul.Style;
|
import org.zkoss.zul.Style;
|
||||||
|
import org.zkoss.zul.TreeModel;
|
||||||
import org.zkoss.zul.Treeitem;
|
import org.zkoss.zul.Treeitem;
|
||||||
import org.zkoss.zul.Vlayout;
|
import org.zkoss.zul.Vlayout;
|
||||||
import org.zkoss.zul.West;
|
import org.zkoss.zul.West;
|
||||||
|
@ -1051,10 +1052,10 @@ DataStatusListener, IADTabpanel, IdSpace
|
||||||
private void deleteNode(int recordId) {
|
private void deleteNode(int recordId) {
|
||||||
if (recordId <= 0) return;
|
if (recordId <= 0) return;
|
||||||
|
|
||||||
SimpleTreeModel model = (SimpleTreeModel) treePanel.getTree().getModel();
|
SimpleTreeModel model = (SimpleTreeModel)(TreeModel<?>) treePanel.getTree().getModel();
|
||||||
|
|
||||||
if (treePanel.getTree().getSelectedItem() != null) {
|
if (treePanel.getTree().getSelectedItem() != null) {
|
||||||
DefaultTreeNode<Object> treeNode = (DefaultTreeNode<Object>) treePanel.getTree().getSelectedItem().getValue();
|
DefaultTreeNode<Object> treeNode = treePanel.getTree().getSelectedItem().getValue();
|
||||||
MTreeNode data = (MTreeNode) treeNode.getData();
|
MTreeNode data = (MTreeNode) treeNode.getData();
|
||||||
if (data.getNode_ID() == recordId) {
|
if (data.getNode_ID() == recordId) {
|
||||||
model.removeNode(treeNode);
|
model.removeNode(treeNode);
|
||||||
|
@ -1075,7 +1076,7 @@ DataStatusListener, IADTabpanel, IdSpace
|
||||||
boolean summary = gridTab.getValueAsBoolean("IsSummary");
|
boolean summary = gridTab.getValueAsBoolean("IsSummary");
|
||||||
String imageIndicator = (String)gridTab.getValue("Action"); // Menu - Action
|
String imageIndicator = (String)gridTab.getValue("Action"); // Menu - Action
|
||||||
//
|
//
|
||||||
SimpleTreeModel model = (SimpleTreeModel) treePanel.getTree().getModel();
|
SimpleTreeModel model = (SimpleTreeModel)(TreeModel<?>) treePanel.getTree().getModel();
|
||||||
DefaultTreeNode<Object> treeNode = model.getRoot();
|
DefaultTreeNode<Object> treeNode = model.getRoot();
|
||||||
MTreeNode root = (MTreeNode) treeNode.getData();
|
MTreeNode root = (MTreeNode) treeNode.getData();
|
||||||
MTreeNode node = new MTreeNode (gridTab.getRecord_ID(), 0, name, description,
|
MTreeNode node = new MTreeNode (gridTab.getRecord_ID(), 0, name, description,
|
||||||
|
@ -1096,9 +1097,9 @@ DataStatusListener, IADTabpanel, IdSpace
|
||||||
treePanel.getTree().onInitRender();
|
treePanel.getTree().onInitRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleTreeModel model = (SimpleTreeModel) treePanel.getTree().getModel();
|
SimpleTreeModel model = (SimpleTreeModel)(TreeModel<?>) treePanel.getTree().getModel();
|
||||||
if (treePanel.getTree().getSelectedItem() != null) {
|
if (treePanel.getTree().getSelectedItem() != null) {
|
||||||
DefaultTreeNode<Object> treeNode = (DefaultTreeNode<Object>) treePanel.getTree().getSelectedItem().getValue();
|
DefaultTreeNode<Object> treeNode = treePanel.getTree().getSelectedItem().getValue();
|
||||||
MTreeNode data = (MTreeNode) treeNode.getData();
|
MTreeNode data = (MTreeNode) treeNode.getData();
|
||||||
if (data.getNode_ID() == recordId) {
|
if (data.getNode_ID() == recordId) {
|
||||||
int[] path = model.getPath(treeNode);
|
int[] path = model.getPath(treeNode);
|
||||||
|
|
|
@ -51,6 +51,7 @@ import org.zkoss.zul.DefaultTreeNode;
|
||||||
import org.zkoss.zul.Space;
|
import org.zkoss.zul.Space;
|
||||||
import org.zkoss.zul.Splitter;
|
import org.zkoss.zul.Splitter;
|
||||||
import org.zkoss.zul.Tree;
|
import org.zkoss.zul.Tree;
|
||||||
|
import org.zkoss.zul.TreeModel;
|
||||||
import org.zkoss.zul.TreeNode;
|
import org.zkoss.zul.TreeNode;
|
||||||
import org.zkoss.zul.Treeitem;
|
import org.zkoss.zul.Treeitem;
|
||||||
|
|
||||||
|
@ -304,8 +305,8 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
|
||||||
log.info("Selected=" + selected);
|
log.info("Selected=" + selected);
|
||||||
if (selected != null) // allow add if not in tree
|
if (selected != null) // allow add if not in tree
|
||||||
{
|
{
|
||||||
SimpleTreeModel tm = (SimpleTreeModel) centerTree.getModel();
|
SimpleTreeModel tm = (SimpleTreeModel)(TreeModel<?>) centerTree.getModel();
|
||||||
DefaultTreeNode<?> stn = tm.find(tm.getRoot(), selected.id);
|
DefaultTreeNode<Object> stn = tm.find(tm.getRoot(), selected.id);
|
||||||
if (stn != null) {
|
if (stn != null) {
|
||||||
int[] path = tm.getPath(stn);
|
int[] path = tm.getPath(stn);
|
||||||
Treeitem ti = centerTree.renderItemByPath(path);
|
Treeitem ti = centerTree.renderItemByPath(path);
|
||||||
|
@ -348,7 +349,7 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
|
||||||
log.info("Item=" + item);
|
log.info("Item=" + item);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
SimpleTreeModel model = (SimpleTreeModel) centerTree.getModel();
|
SimpleTreeModel model = (SimpleTreeModel)(TreeModel<?>) centerTree.getModel();
|
||||||
DefaultTreeNode<Object> stn = model.find(model.getRoot(), item.id);
|
DefaultTreeNode<Object> stn = model.find(model.getRoot(), item.id);
|
||||||
if (stn != null) {
|
if (stn != null) {
|
||||||
MTreeNode tNode = (MTreeNode) stn.getData();
|
MTreeNode tNode = (MTreeNode) stn.getData();
|
||||||
|
@ -377,7 +378,7 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
|
||||||
log.info("Item=" + item);
|
log.info("Item=" + item);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
SimpleTreeModel model = (SimpleTreeModel) centerTree.getModel();
|
SimpleTreeModel model = (SimpleTreeModel)(TreeModel<?>) centerTree.getModel();
|
||||||
DefaultTreeNode<Object> stn = model.find(model.getRoot(), item.id);
|
DefaultTreeNode<Object> stn = model.find(model.getRoot(), item.id);
|
||||||
if (stn != null)
|
if (stn != null)
|
||||||
model.removeNode(stn);
|
model.removeNode(stn);
|
||||||
|
|
|
@ -40,7 +40,7 @@ import org.zkoss.zul.event.ListDataEvent;
|
||||||
* @author Andrew Kimball
|
* @author Andrew Kimball
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ListModelTable extends ListModelList implements ListModelExt
|
public class ListModelTable extends ListModelList<Object> implements ListModelExt<Object>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -117,7 +117,7 @@ public class ListModelTable extends ListModelList implements ListModelExt
|
||||||
*/
|
*/
|
||||||
private void ensureRowSize()
|
private void ensureRowSize()
|
||||||
{
|
{
|
||||||
Iterator<List<Object>> rowIterator = (Iterator<List<Object>>)this.getInnerList().iterator();
|
Iterator<List<Object>> rowIterator = (Iterator<List<Object>>)(Object)this.getInnerList().iterator();
|
||||||
|
|
||||||
while (rowIterator.hasNext())
|
while (rowIterator.hasNext())
|
||||||
{
|
{
|
||||||
|
@ -324,7 +324,7 @@ public class ListModelTable extends ListModelList implements ListModelExt
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.zkoss.zul.ListModelList#sort(java.util.Comparator, boolean)
|
* @see org.zkoss.zul.ListModelList#sort(java.util.Comparator, boolean)
|
||||||
*/
|
*/
|
||||||
public void sort(Comparator cmpr, boolean ascending)
|
public void sort(Comparator<Object> cmpr, boolean ascending)
|
||||||
{
|
{
|
||||||
if (sorter != null)
|
if (sorter != null)
|
||||||
sorter.sort(cmpr, ascending);
|
sorter.sort(cmpr, ascending);
|
||||||
|
|
|
@ -41,7 +41,7 @@ import org.zkoss.zul.event.TreeDataEvent;
|
||||||
* @author Low Heng Sin
|
* @author Low Heng Sin
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SimpleTreeModel extends org.zkoss.zul.DefaultTreeModel implements TreeitemRenderer<Object>, EventListener<Event> {
|
public class SimpleTreeModel extends org.zkoss.zul.DefaultTreeModel<Object> implements TreeitemRenderer<Object>, EventListener<Event> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -174,7 +174,6 @@ public class SimpleTreeModel extends org.zkoss.zul.DefaultTreeModel implements T
|
||||||
return (DefaultTreeNode<Object>) super.getRoot();
|
return (DefaultTreeNode<Object>) super.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public DefaultTreeNode<Object> getChild(Object parent, int index) {
|
public DefaultTreeNode<Object> getChild(Object parent, int index) {
|
||||||
return (DefaultTreeNode<Object>) super.getChild((TreeNode<Object>)parent, index);
|
return (DefaultTreeNode<Object>) super.getChild((TreeNode<Object>)parent, index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -953,7 +953,7 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
|
||||||
private void setValueAccordingToClass(PO po, POInfo poinfo, DataField field, int idxcol) {
|
private void setValueAccordingToClass(PO po, POInfo poinfo, DataField field, int idxcol) {
|
||||||
CompiereService m_cs = getCompiereService();
|
CompiereService m_cs = getCompiereService();
|
||||||
// Evaluate the type of the column and assign a proper variable
|
// Evaluate the type of the column and assign a proper variable
|
||||||
Class columnClass = poinfo.getColumnClass(idxcol);
|
Class<?> columnClass = poinfo.getColumnClass(idxcol);
|
||||||
Object value = null;
|
Object value = null;
|
||||||
String strValue = field.getVal();
|
String strValue = field.getVal();
|
||||||
String lookupValue = field.getLval();
|
String lookupValue = field.getLval();
|
||||||
|
@ -1047,7 +1047,7 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
|
||||||
//Is ctx variable
|
//Is ctx variable
|
||||||
if (fieldInput.getAD_Column_ID() == 0 && fieldInput.getColumnName() != null) {
|
if (fieldInput.getAD_Column_ID() == 0 && fieldInput.getColumnName() != null) {
|
||||||
String varName = fieldInput.getColumnName();
|
String varName = fieldInput.getColumnName();
|
||||||
Class columnClass = getVariableType(varName, fieldInput.getAD_Reference_ID());
|
Class<?> columnClass = getVariableType(varName, fieldInput.getAD_Reference_ID());
|
||||||
Object objVal = convertToObj(field.getVal(),columnClass,varName);
|
Object objVal = convertToObj(field.getVal(),columnClass,varName);
|
||||||
requestCtx.put(varName, objVal);
|
requestCtx.put(varName, objVal);
|
||||||
|
|
||||||
|
|
|
@ -435,7 +435,7 @@ public class AbstractService {
|
||||||
* @param m_webservicetype
|
* @param m_webservicetype
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected Object convertToObj(String strValue,Class columnClass,String colName){
|
protected Object convertToObj(String strValue,Class<?> columnClass,String colName){
|
||||||
|
|
||||||
Object value = null;
|
Object value = null;
|
||||||
|
|
||||||
|
@ -494,8 +494,8 @@ public class AbstractService {
|
||||||
* @param displayType
|
* @param displayType
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected Class getVariableType(String columnName,int displayType){
|
protected Class<?> getVariableType(String columnName,int displayType){
|
||||||
Class ColumnClass= null;
|
Class<?> ColumnClass= null;
|
||||||
if (columnName.equals("AD_Language") || columnName.equals("EntityType"))
|
if (columnName.equals("AD_Language") || columnName.equals("EntityType"))
|
||||||
{
|
{
|
||||||
ColumnClass = String.class;
|
ColumnClass = String.class;
|
||||||
|
|
Loading…
Reference in New Issue