IDEMPIERE-455 Discover and fix FindBugs problems / Eclipse warning -> raw type

This commit is contained in:
Richard Morales 2012-12-15 16:18:52 -05:00
parent 526a1653a4
commit 9362bcaed2
27 changed files with 45 additions and 44 deletions

View File

@ -114,7 +114,7 @@ public class ReplicationProcessor extends AdempiereServer {
IImportProcessor importProcessor = null;
try
{
Class clazz = Class.forName(javaClass);
Class<?> clazz = Class.forName(javaClass);
importProcessor = (IImportProcessor)clazz.newInstance();
importProcessor.process(mImportProcessor.getCtx(), this, trxName );
}

View File

@ -104,7 +104,7 @@ public class JasperViewer extends javax.swing.JFrame {
public static void main(String args[]) {
try {
JasperReport myjasperReport = (JasperReport) JasperCompileManager.compileReport(args[0] );
JasperPrint myjasperPrint = JasperFillManager.fillReport( myjasperReport, new HashMap(), getConnection());
JasperPrint myjasperPrint = JasperFillManager.fillReport( myjasperReport, new HashMap<String,Object>(), getConnection());
JasperViewer.viewReport(myjasperPrint);
}
catch (Exception e) {

View File

@ -602,7 +602,7 @@ public class AcctViewer extends CFrame
m_data.AD_Org_ID = kp.getKey();
para.append(", AD_Org_ID=").append(m_data.AD_Org_ID);
//
Iterator it = m_data.whereInfo.values().iterator();
Iterator<String> it = m_data.whereInfo.values().iterator();
while (it.hasNext())
para.append(", ").append(it.next());
}

View File

@ -284,7 +284,7 @@ class Worker extends Thread
// key keys
if (target == null || href == null)
{
Enumeration en = as.getAttributeNames();
Enumeration<?> en = as.getAttributeNames();
while (en.hasMoreElements())
{
Object o = en.nextElement();

View File

@ -669,8 +669,8 @@ public final class Preference extends CDialog
*/
private void cmd_displayErrors()
{
Vector data = CLogErrorBuffer.get(true).getLogData(bErrorsOnly.isSelected());
Vector columnNames = CLogErrorBuffer.get(true).getColumnNames(Env.getCtx());
Vector<Vector<Object>> data = CLogErrorBuffer.get(true).getLogData(bErrorsOnly.isSelected());
Vector<String> columnNames = CLogErrorBuffer.get(true).getColumnNames(Env.getCtx());
DefaultTableModel model = new DefaultTableModel(data, columnNames);
errorTable.setModel(model);
//

View File

@ -67,8 +67,8 @@ public class ScreenShot
file.delete();
// Get Writer
Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
ImageWriter writer = (ImageWriter)writers.next();
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName("jpg");
ImageWriter writer = writers.next();
if (writer == null)
{
log.log(Level.SEVERE, "no ImageWriter");

View File

@ -194,7 +194,7 @@ public class WindowMenu extends JMenu {
Image image = bi.getScaledInstance(width, height, Image.SCALE_SMOOTH);
final JXTitledPanel box = new JXTitledPanel();
final Painter painter = box.getTitlePainter();
final Painter<?> painter = box.getTitlePainter();
box.setTitlePainter(null);
box.setFocusable(true);
box.setTitle(window.getTitle());

View File

@ -27,6 +27,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Level;
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
import javax.swing.JCheckBox;
import javax.swing.JRadioButton;
@ -464,17 +465,17 @@ public class VBOMDrop extends CPanel
if (source instanceof JRadioButton)
{
// find Button Group
Iterator it = m_buttonGroups.values().iterator();
Iterator<ButtonGroup> it = m_buttonGroups.values().iterator();
while (it.hasNext())
{
ButtonGroup group = (ButtonGroup)it.next();
Enumeration en = group.getElements();
ButtonGroup group = it.next();
Enumeration<AbstractButton> en = group.getElements();
while (en.hasMoreElements())
{
// We found the group
if (source == en.nextElement())
{
Enumeration info = group.getElements();
Enumeration<AbstractButton> info = group.getElements();
while (info.hasMoreElements())
{
Object infoObj = info.nextElement();

View File

@ -55,7 +55,7 @@ public class ADempiereAutoCompleteDecorator extends AutoCompleteDecorator{
* @param items contains the items that are used for autocompletion
* @param strictMatching <tt>true</tt>, if only given items should be allowed to be entered
*/
public static void decorate(JTextComponent textComponent, List items, boolean strictMatching) {
public static void decorate(JTextComponent textComponent, List<?> items, boolean strictMatching) {
decorate(textComponent, items, strictMatching, ObjectToStringConverter.DEFAULT_IMPLEMENTATION);
}
@ -68,7 +68,7 @@ public class ADempiereAutoCompleteDecorator extends AutoCompleteDecorator{
* @param strictMatching <tt>true</tt>, if only given items should be allowed to be entered
* @param stringConverter the converter used to transform items to strings
*/
public static void decorate(JTextComponent textComponent, List items, boolean strictMatching, ObjectToStringConverter stringConverter) {
public static void decorate(JTextComponent textComponent, List<?> items, boolean strictMatching, ObjectToStringConverter stringConverter) {
AbstractAutoCompleteAdaptor adaptor = new TextComponentAdaptor(textComponent, items);
AutoCompleteDocument document = new AutoCompleteDocument(adaptor, strictMatching, stringConverter);
decorate(textComponent, document, adaptor);

View File

@ -310,7 +310,7 @@ public class HTMLEditor extends CDialog
* @param actions lookup
* @return menu
*/
private JMenu buildMenu(String name, HTMLEditor_MenuAction[] menuActions, Hashtable actions)
private JMenu buildMenu(String name, HTMLEditor_MenuAction[] menuActions, Hashtable<Object,Action> actions)
{
JMenu menu = new JMenu(name);
for (int i = 0; i < menuActions.length; i++)

View File

@ -337,7 +337,7 @@ public final class VButton extends CButton
* Return value/name
* @return HashMap with Value/Names
*/
public HashMap getValues()
public HashMap<String,String> getValues()
{
return m_values;
} // getValues

View File

@ -31,7 +31,7 @@ import java.beans.SimpleBeanInfo;
public class VStringBeanInfo extends SimpleBeanInfo
{
private Class beanClass = VString.class;
private Class<?> beanClass = VString.class;
private String iconColor16x16Filename;
private String iconColor32x32Filename;
private String iconMono16x16Filename;
@ -81,7 +81,7 @@ public class VStringBeanInfo extends SimpleBeanInfo
}
public BeanInfo[] getAdditionalBeanInfo()
{
Class superclass = beanClass.getSuperclass();
Class<?> superclass = beanClass.getSuperclass();
try
{
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);

View File

@ -31,7 +31,7 @@ import java.beans.SimpleBeanInfo;
public class VTextBeanInfo extends SimpleBeanInfo
{
private Class beanClass = VText.class;
private Class<?> beanClass = VText.class;
private String iconColor16x16Filename;
private String iconColor32x32Filename;
private String iconMono16x16Filename;
@ -93,7 +93,7 @@ public class VTextBeanInfo extends SimpleBeanInfo
}
public BeanInfo[] getAdditionalBeanInfo()
{
Class superclass = beanClass.getSuperclass();
Class<?> superclass = beanClass.getSuperclass();
try
{
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);

View File

@ -47,7 +47,7 @@ public class MiniCellEditor extends AbstractCellEditor implements TableCellEdito
* Default Constructor
* @param c Class
*/
public MiniCellEditor(Class c)
public MiniCellEditor(Class<?> c)
{
super();
// Date

View File

@ -326,7 +326,7 @@ public class MiniTable extends CTable implements IMiniTable
* @param c class of column - determines renderere
* @param readOnly read only flag
*/
public void setColumnClass (int index, Class c, boolean readOnly)
public void setColumnClass (int index, Class<?> c, boolean readOnly)
{
setColumnClass(index, c, readOnly, null);
} // setColumnClass
@ -341,7 +341,7 @@ public class MiniTable extends CTable implements IMiniTable
* @param readOnly read only flag
* @param header optional header value
*/
public void setColumnClass (int index, Class c, boolean readOnly, String header)
public void setColumnClass (int index, Class<?> c, boolean readOnly, String header)
{
// log.config( "MiniTable.setColumnClass - " + index, c.getName() + ", r/o=" + readOnly);
TableColumn tc = getColumnModel().getColumn(index);

View File

@ -703,7 +703,7 @@ public class CColumnControlButton extends JButton {
* @return a list containing all additional actions to include into the popup.
*/
protected List<Action> getAdditionalActions() {
List actionKeys = getColumnControlActionKeys();
List<Object> actionKeys = getColumnControlActionKeys();
List<Action> actions = new ArrayList<Action>();
for (Object key : actionKeys) {
actions.add(table.getActionMap().get(key));
@ -722,9 +722,9 @@ public class CColumnControlButton extends JButton {
* action should be included into the popup.
*/
@SuppressWarnings("unchecked")
protected List getColumnControlActionKeys() {
protected List<Object> getColumnControlActionKeys() {
Object[] allKeys = table.getActionMap().allKeys();
List columnKeys = new ArrayList();
List columnKeys = new ArrayList<Object>();
for (int i = 0; i < allKeys.length; i++) {
if (isColumnControlActionKey(allKeys[i])) {
columnKeys.add(allKeys[i]);

View File

@ -118,7 +118,7 @@ public class CComboBoxEditable extends JComboBox
* @param items an array of vectors to insert into the combo box
* @see DefaultComboBoxModel
*/
public CComboBoxEditable(Vector items)
public CComboBoxEditable(Vector<Object> items)
{
super(items);
init();

View File

@ -378,8 +378,8 @@ public class CTable extends JTable
// teo_sarca: [ 1585369 ] CTable sorting is TOO LAZY
Collections.sort(model.getDataVector(), new Comparator<Object>() {
public int compare(Object o1, Object o2) {
Object item1 = ((Vector)o1).get(modelColumnIndex);
Object item2 = ((Vector)o2).get(modelColumnIndex);
Object item1 = ((Vector<Object>)o1).get(modelColumnIndex);
Object item2 = ((Vector<Object>)o2).get(modelColumnIndex);
return sort.compare(item1, item2);
}
});

View File

@ -51,7 +51,7 @@ public class ListModelTable extends ListModelList implements ListModelExt
/** The number of columns in the table. */
private int m_noColumns;
private ListModelExt sorter = null;
private ListModelExt<Object> sorter = null;
/**
* Default constructor.
@ -388,7 +388,7 @@ public class ListModelTable extends ListModelList implements ListModelExt
}
}
public void setSorter(ListModelExt lme)
public void setSorter(ListModelExt<Object> lme)
{
sorter = lme;
}

View File

@ -45,8 +45,8 @@ public class SimpleListModel extends AbstractListModel<Object> implements Listit
this(new ArrayList<Object>());
}
public SimpleListModel(List list) {
this.list = list;
public SimpleListModel(List<?> list) {
this.list = (List<Object>)list;
}
public Object getElementAt(int index) {

View File

@ -168,7 +168,7 @@ public class BasketServlet extends HttpServlet
String sPrice = WebUtil.getParameter (request, "Price");
// Search for Product ID Add_134 = Add
Enumeration en = request.getParameterNames ();
Enumeration<String> en = request.getParameterNames ();
while (M_Product_ID == 0 && en.hasMoreElements ())
{
String parameter = (String)en.nextElement ();
@ -282,7 +282,7 @@ public class BasketServlet extends HttpServlet
{
log.log(Level.SEVERE, "Set CharacterEncoding=" + WebEnv.ENCODING, e);
}
Enumeration en = request.getParameterNames();
Enumeration<String> en = request.getParameterNames();
while (en.hasMoreElements())
{
String parameter = (String)en.nextElement();

View File

@ -150,7 +150,7 @@ public class Click extends HttpServlet
// Check parameters - /click?www...
if (url == null || url.length() == 0)
{
Enumeration e = request.getParameterNames ();
Enumeration<String> e = request.getParameterNames ();
if (e.hasMoreElements ())
url = (String)e.nextElement ();
}

View File

@ -18,7 +18,7 @@ package org.apache.ecs.storage;
import java.io.Serializable;
public class Array implements java.util.Enumeration, Serializable
public class Array implements java.util.Enumeration<Object>, Serializable
{
/**
*
@ -166,7 +166,7 @@ public class Array implements java.util.Enumeration, Serializable
return elements[location];
}
public java.util.Enumeration elements()
public java.util.Enumeration<Object> elements()
{
return this;
}

View File

@ -95,7 +95,7 @@ public class Hash implements java.io.Serializable
}
}
public Enumeration keys()
public Enumeration<Object> keys()
{
return keys;
}
@ -113,7 +113,7 @@ public class Hash implements java.io.Serializable
return(true);
}
public Enumeration elements()
public Enumeration<Object> elements()
{
return elements;
}

View File

@ -504,7 +504,7 @@ public class a extends MultiPartElement
*/
public boolean getNeedLineBreak ()
{
java.util.Enumeration en = elements ();
java.util.Enumeration<Element> en = elements ();
int i = 0;
int j = 0;
while (en.hasMoreElements ())

View File

@ -561,7 +561,7 @@ public class td extends MultiPartElement
*/
public boolean getNeedLineBreak ()
{
java.util.Enumeration en = elements ();
java.util.Enumeration<Element> en = elements ();
int i = 0;
int j = 0;
while (en.hasMoreElements ())

View File

@ -196,7 +196,7 @@ public class XML extends MultiPartElement
{
boolean linebreak = true;
java.util.Enumeration en = elements ();
java.util.Enumeration<Element> en = elements ();
// if this tag has one child, and it's a String, then don't
// do any linebreaks to preserve whitespace