diff options
Diffstat (limited to 'xmerge/source/xmerge/java')
37 files changed, 198 insertions, 197 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java index 1629f768b9dc..3dec93a56481 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java @@ -212,7 +212,7 @@ public class Convert implements Cloneable { DocumentSerializerFactory myDocSerializerFactory = ci.getDocSerializerFactory(); - Iterator e = inputCD.getDocumentEnumeration(); + Iterator<Object> e = inputCD.getDocumentEnumeration(); Document doc = (Document) e.next(); DocumentSerializer ser = myDocSerializerFactory.createDocumentSerializer(doc); @@ -266,7 +266,7 @@ public class Convert implements Cloneable { DocumentSerializerFactory myDocSerializerFactory = ci.getDocSerializerFactory(); - Iterator e = inputCD.getDocumentEnumeration(); + Iterator<Object> e = inputCD.getDocumentEnumeration(); Document doc = (Document) e.next(); DocumentSerializer ser = myDocSerializerFactory.createDocumentSerializer(doc); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/ConvertData.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/ConvertData.java index 035453459d3d..afa85efdd672 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/ConvertData.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/ConvertData.java @@ -34,7 +34,7 @@ public class ConvertData { /** * Vector of <code>Document</code> objects. */ - private ArrayList v = new ArrayList(); + private ArrayList<Object> v = new ArrayList<Object>(); /** * Name of the <code>ConvertData</code> object. @@ -89,8 +89,8 @@ public class ConvertData { * @return The <code>Enumeration</code> to access the * <code>Vector</code> of <code>Document</code> objects. */ - public Iterator getDocumentEnumeration() { - Iterator enumerate = v.iterator(); + public Iterator<Object> getDocumentEnumeration() { + Iterator<Object> enumerate = v.iterator(); return (enumerate); } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java index 2b0fe101443b..936bd021ab9e 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java @@ -240,7 +240,7 @@ public class DOMDocument ByteArrayOutputStream baos = new ByteArrayOutputStream(); - java.lang.reflect.Constructor con; + java.lang.reflect.Constructor<?> con; java.lang.reflect.Method meth; String domImpl = doc.getClass().getName(); @@ -257,7 +257,7 @@ public class DOMDocument // First of all try for JAXP 1.0 if (domImpl.equals("com.sun.xml.tree.XmlDocument")) { System.out.println("Using JAXP"); - Class jaxpDoc = Class.forName("com.sun.xml.tree.XmlDocument"); + Class<?> jaxpDoc = Class.forName("com.sun.xml.tree.XmlDocument"); // The method is in the XMLDocument class itself, not a helper meth = jaxpDoc.getMethod("write", @@ -268,7 +268,7 @@ public class DOMDocument else if (domImpl.equals("org.apache.crimson.tree.XmlDocument")) { System.out.println("Using Crimson"); - Class crimsonDoc = Class.forName("org.apache.crimson.tree.XmlDocument"); + Class<?> crimsonDoc = Class.forName("org.apache.crimson.tree.XmlDocument"); // The method is in the XMLDocument class itself, not a helper meth = crimsonDoc.getMethod("write", new Class[] { Class.forName("java.io.OutputStream") } ); @@ -279,7 +279,7 @@ public class DOMDocument || domImpl.equals("org.apache.xerces.dom.DeferredDocumentImpl")) { System.out.println("Using Xerces"); // Try for Xerces - Class xercesSer = + Class<?> xercesSer = Class.forName("org.apache.xml.serialize.XMLSerializer"); // Get the OutputStream constructor @@ -304,7 +304,7 @@ public class DOMDocument else if (domImpl.equals("gnu.xml.dom.DomDocument")) { System.out.println("Using GNU"); - Class gnuSer = Class.forName("gnu.xml.dom.ls.DomLSSerializer"); + Class<?> gnuSer = Class.forName("gnu.xml.dom.ls.DomLSSerializer"); // Get the serialize method meth = gnuSer.getMethod("serialize", @@ -387,7 +387,7 @@ public class DOMDocument } - Element root = (Element) doc.createElement(rootName); + Element root = doc.createElement(rootName); doc.appendChild(root); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java index 2eda2fa6e31b..c5abd5ee8bd4 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java @@ -201,7 +201,7 @@ public final class PdbDecoder { // last record dis.reset(); - len = (int) dis.available() - recOffset[lastIndex]; + len = dis.available() - recOffset[lastIndex]; dis.skip(recOffset[lastIndex]); bytes = new byte[len]; dis.readFully(bytes); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbEncoder.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbEncoder.java index f025ceadeb4b..b30d38f0de83 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbEncoder.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbEncoder.java @@ -160,7 +160,7 @@ public final class PdbEncoder { // unique ID (uid) in 4 bytes (int) chunk. // unique ID's have to be unique, thus // increment each time. - int attr = (((int) recAttr[i]) << 24 ); + int attr = (recAttr[i] << 24 ); attr |= uid; dos.writeInt(attr); uid++; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbHeader.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbHeader.java index cd0c2e71af8f..e40fef1ee368 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbHeader.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbHeader.java @@ -111,10 +111,10 @@ final class PdbHeader { in.readFully(pdbName); attribute = in.readShort(); version = in.readUnsignedShort(); - creationDate = ((long) in.readInt()) & 0xffffffffL; - modificationDate = ((long) in.readInt()) & 0xffffffffL; - lastBackupDate = ((long) in.readInt()) & 0xffffffffL; - modificationNumber = ((long) in.readInt()) & 0xffffffffL; + creationDate = in.readInt() & 0xffffffffL; + modificationDate = in.readInt() & 0xffffffffL; + lastBackupDate = in.readInt() & 0xffffffffL; + modificationNumber = in.readInt() & 0xffffffffL; appInfoID = in.readInt(); sortInfoID = in.readInt(); creatorID = in.readInt(); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java index 55e33f891bb7..bd83ff5ca2e4 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java @@ -56,19 +56,19 @@ public final class PdbUtil { // grab the first char and put it in the high bits // note that we only want 8 lower bits of it. - temp = (int) s.charAt(0); + temp = s.charAt(0); id = temp << 24; // grab the second char and add it in. - temp = ((int) s.charAt(1)) & 0x00ff; + temp = s.charAt(1) & 0x00ff; id += temp << 16; // grab the second char and add it in. - temp = ((int) s.charAt(2)) & 0x00ff; + temp = s.charAt(2) & 0x00ff; id += temp << 8; // grab the last char and add it in - id += ((int) s.charAt(3)) & 0x00ff; + id += s.charAt(3) & 0x00ff; return id; } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java index b1da02333a61..5e9014604172 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java @@ -96,7 +96,7 @@ public abstract class OfficeDocument private OfficeZip zip = null; /** Collection to keep track of the embedded objects in the document. */ - private Map embeddedObjects = null; + private Map<String, EmbeddedObject> embeddedObjects = null; /** * Default constructor. @@ -290,10 +290,10 @@ public abstract class OfficeDocument * * @return An <code>Iterator</code> of <code>EmbeddedObject</code> objects. */ - public Iterator getEmbeddedObjects() { + public Iterator<EmbeddedObject> getEmbeddedObjects() { if (embeddedObjects == null && manifestDoc != null) { - embeddedObjects = new HashMap(); + embeddedObjects = new HashMap<String, EmbeddedObject>(); // Need to read the manifest file and construct a list of objects NodeList nl = manifestDoc.getElementsByTagName(TAG_MANIFEST_FILE); @@ -363,7 +363,7 @@ public abstract class OfficeDocument } if (embeddedObjects.containsKey(name)) { - return (EmbeddedObject)embeddedObjects.get(name); + return embeddedObjects.get(name); } else { return null; @@ -382,7 +382,7 @@ public abstract class OfficeDocument } if (embeddedObjects == null) { - embeddedObjects = new HashMap(); + embeddedObjects = new HashMap<String, EmbeddedObject>(); } embeddedObjects.put(embObj.getName(), embObj); @@ -529,12 +529,12 @@ public abstract class OfficeDocument NodeList nodeList; Node tmpNode; - Node rootNode = (Node)rootElement; + Node rootNode = rootElement; if (newDoc !=null){ /*content*/ contentDoc = createDOM(TAG_OFFICE_DOCUMENT_CONTENT); rootElement=contentDoc.getDocumentElement(); - rootNode = (Node)rootElement; + rootNode = rootElement; // FIX (HJ): Include office:font-decls in content DOM nodeList= newDoc.getElementsByTagName(TAG_OFFICE_FONT_DECLS); @@ -558,7 +558,7 @@ public abstract class OfficeDocument /*Styles*/ styleDoc = createDOM(TAG_OFFICE_DOCUMENT_STYLES); rootElement=styleDoc.getDocumentElement(); - rootNode = (Node)rootElement; + rootNode = rootElement; // FIX (HJ): Include office:font-decls in styles DOM nodeList= newDoc.getElementsByTagName(TAG_OFFICE_FONT_DECLS); @@ -590,7 +590,7 @@ public abstract class OfficeDocument /*Settings*/ settingsDoc = createDOM(TAG_OFFICE_DOCUMENT_SETTINGS); rootElement=settingsDoc.getDocumentElement(); - rootNode = (Node)rootElement; + rootNode = rootElement; nodeList= newDoc.getElementsByTagName(TAG_OFFICE_SETTINGS); if (nodeList.getLength()>0){ tmpNode = settingsDoc.importNode(nodeList.item(0),true); @@ -599,7 +599,7 @@ public abstract class OfficeDocument /*Meta*/ metaDoc = createDOM(TAG_OFFICE_DOCUMENT_META); rootElement=metaDoc.getDocumentElement(); - rootNode = (Node)rootElement; + rootNode = rootElement; nodeList= newDoc.getElementsByTagName(TAG_OFFICE_META); if (nodeList.getLength()>0){ tmpNode = metaDoc.importNode(nodeList.item(0),true); @@ -671,9 +671,9 @@ public abstract class OfficeDocument Element manifestRoot = manifestDoc.getDocumentElement(); // The EmbeddedObjects come first. - Iterator embObjs = getEmbeddedObjects(); + Iterator<EmbeddedObject> embObjs = getEmbeddedObjects(); while (embObjs.hasNext()) { - EmbeddedObject obj = (EmbeddedObject)embObjs.next(); + EmbeddedObject obj = embObjs.next(); obj.writeManifestData(manifestDoc); obj.write(zip); @@ -780,7 +780,7 @@ public abstract class OfficeDocument NodeList nodeList; Node tmpNode; - Node rootNode = (Node)rootElement; + Node rootNode = rootElement; if (metaDoc !=null){ nodeList= metaDoc.getElementsByTagName(TAG_OFFICE_META); if (nodeList.getLength()>0){ @@ -844,7 +844,7 @@ public abstract class OfficeDocument ByteArrayOutputStream baos = new ByteArrayOutputStream(); - java.lang.reflect.Constructor con; + java.lang.reflect.Constructor<?> con; java.lang.reflect.Method meth; String domImpl = doc.getClass().getName(); @@ -862,7 +862,7 @@ public abstract class OfficeDocument Debug.log(Debug.INFO, "Using JAXP"); - Class jaxpDoc = Class.forName("com.sun.xml.tree.XmlDocument"); + Class<?> jaxpDoc = Class.forName("com.sun.xml.tree.XmlDocument"); // The method is in the XMLDocument class itself, not a helper meth = jaxpDoc.getMethod("write", @@ -874,7 +874,7 @@ public abstract class OfficeDocument { Debug.log(Debug.INFO, "Using Crimson"); - Class crimsonDoc = Class.forName("org.apache.crimson.tree.XmlDocument"); + Class<?> crimsonDoc = Class.forName("org.apache.crimson.tree.XmlDocument"); // The method is in the XMLDocument class itself, not a helper meth = crimsonDoc.getMethod("write", new Class[] { Class.forName("java.io.OutputStream") } ); @@ -887,7 +887,7 @@ public abstract class OfficeDocument Debug.log(Debug.INFO, "Using Xerces"); // Try for Xerces - Class xercesSer = + Class<?> xercesSer = Class.forName("org.apache.xml.serialize.XMLSerializer"); // Get the OutputStream constructor @@ -912,7 +912,7 @@ public abstract class OfficeDocument else if (domImpl.equals("gnu.xml.dom.DomDocument")) { Debug.log(Debug.INFO, "Using GNU"); - Class gnuSer = Class.forName("gnu.xml.dom.ls.DomLSSerializer"); + Class<?> gnuSer = Class.forName("gnu.xml.dom.ls.DomLSSerializer"); // Get the serialize method meth = gnuSer.getMethod("serialize", @@ -1036,7 +1036,7 @@ public abstract class OfficeDocument } - Element root = (Element) doc.createElement(rootName); + Element root = doc.createElement(rootName); doc.appendChild(root); root.setAttribute("xmlns:office", "http://openoffice.org/2000/office"); @@ -1075,7 +1075,7 @@ public abstract class OfficeDocument } - Element root = (Element) doc.createElement(rootName); + Element root = doc.createElement(rootName); doc.appendChild(root); root.setAttribute("xmlns:office", "http://openoffice.org/2000/office"); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeZip.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeZip.java index 4b81d5556c24..cbd9f7ca8ad7 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeZip.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeZip.java @@ -52,7 +52,7 @@ class OfficeZip { private final static int BUFFERSIZE = 1024; - private List entryList = null; + private List<Entry> entryList = null; private int contentIndex = -1; private int styleIndex = -1; @@ -63,7 +63,7 @@ class OfficeZip { /** Default constructor. */ OfficeZip() { - entryList = new LinkedList(); + entryList = new LinkedList<Entry>(); } @@ -205,7 +205,7 @@ class OfficeZip { // Could improve performance by caching the name and index when // iterating through the ZipFile in read(). for (int i = 0; i < entryList.size(); i++) { - Entry e = (Entry)entryList.get(i); + Entry e = entryList.get(i); if (e.zipEntry.getName().equals(name)) { return getEntryBytes(i); @@ -228,7 +228,7 @@ class OfficeZip { */ void setNamedBytes(String name, byte[] bytes) { for (int i = 0; i < entryList.size(); i++) { - Entry e = (Entry)entryList.get(i); + Entry e = entryList.get(i); if (e.zipEntry.getName().equals(name)) { setEntryBytes(i, bytes, name); @@ -259,7 +259,7 @@ class OfficeZip { byte[] bytes = null; if (index > -1) { - Entry entry = (Entry) entryList.get(index); + Entry entry = entryList.get(index); bytes = entry.bytes; } return bytes; @@ -349,7 +349,7 @@ class OfficeZip { // replace existing entry in entryList - Entry entry = (Entry) entryList.get(index); + Entry entry = entryList.get(index); name = entry.zipEntry.getName(); int method = entry.zipEntry.getMethod(); @@ -385,11 +385,11 @@ class OfficeZip { ZipOutputStream zos = new ZipOutputStream(os); - ListIterator iterator = entryList.listIterator(); + ListIterator<Entry> iterator = entryList.listIterator(); while (iterator.hasNext()) { - Entry entry = (Entry) iterator.next(); + Entry entry = iterator.next(); ZipEntry ze = entry.zipEntry; String name = ze.getName(); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java index aefba0864729..8d7761f63ffa 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java @@ -180,7 +180,7 @@ public class ParaStyle extends Style implements Cloneable { }; /** Array of attribute structures for this paragraph <code>Style</code>. */ - protected Class algor[] = { + protected Class<?> algor[] = { horizSize.class, horizSize.class, horizSize.class, diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/StyleCatalog.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/StyleCatalog.java index 2832a44ec37b..818a4f250db9 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/StyleCatalog.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/StyleCatalog.java @@ -42,7 +42,7 @@ import org.w3c.dom.NodeList; */ public class StyleCatalog { - private ArrayList styles; // The actual styles + private ArrayList<Style> styles; // The actual styles /** * Constructor @@ -51,7 +51,7 @@ public class StyleCatalog { * for efficiency purposes. */ public StyleCatalog(int initialEntries) { - styles = new ArrayList(initialEntries); + styles = new ArrayList<Style>(initialEntries); } @@ -90,8 +90,8 @@ public class StyleCatalog { * whether there is a match in the * families array. */ - public void add(Node node, String families[], Class classes[], - Class defaultClass, boolean alwaysCreateDefault) { + public void add(Node node, String families[], Class<?> classes[], + Class<?> defaultClass, boolean alwaysCreateDefault) { if (node == null) return; @@ -117,7 +117,7 @@ public class StyleCatalog { for (int j = 0; j < families.length; j++) { if (families[j].equals(familyName)) { - Class styleClass = classes[j]; + Class<?> styleClass = classes[j]; callConstructor(classes[j], child); found = true; } @@ -138,16 +138,16 @@ public class StyleCatalog { * @param cls The class whose constructor will be called. * @param node The constructed class will be added to this node. */ - private void callConstructor(Class cls, Node node) { - Class params[] = new Class[2]; + private void callConstructor(Class<?> cls, Node node) { + Class<?> params[] = new Class[2]; params[0] = Node.class; params[1] = this.getClass(); try { - Constructor c = cls.getConstructor(params); + Constructor<?> c = cls.getConstructor(params); Object p[] = new Object[2]; p[0] = node; p[1] = this; - styles.add(c.newInstance(p)); + styles.add((Style) c.newInstance(p)); } catch (Exception e) { Debug.log(Debug.ERROR, "Exception when calling constructor", e); } @@ -180,10 +180,10 @@ public class StyleCatalog { * null otherwise */ public Style lookup(String name, String family, String parent, - Class styleClass) { + Class<?> styleClass) { int nStyles = styles.size(); for (int i = 0; i < nStyles; i++) { - Style s = (Style)styles.get(i); + Style s = styles.get(i); if ((name != null) && (s.getName() != null) && (!s.getName().equals(name))) continue; @@ -218,7 +218,7 @@ public class StyleCatalog { int matchCount = 0; int nStyles = styles.size(); for (int j = 0; j < nStyles; j++) { - Style p = ((Style)styles.get(j)).getResolved(); + Style p = styles.get(j).getResolved(); if (p.isSubset(s)) matchCount++; } @@ -226,7 +226,7 @@ public class StyleCatalog { Style[] matchArray = new Style[matchCount]; matchCount = 0; for (int j = 0; j < nStyles; j++) { - Style p = ((Style)styles.get(j)).getResolved(); + Style p = styles.get(j).getResolved(); if (p.isSubset(s)) matchArray[matchCount++] = p; } return matchArray; @@ -269,7 +269,7 @@ public class StyleCatalog { int len = styles.size(); for (int j = 0; j < len; j++) { - Style s = (Style)styles.get(j); + Style s = styles.get(j); Element styleNode = parentDoc.createElement("style:style"); @@ -304,7 +304,7 @@ public class StyleCatalog { TextStyle.dumpHdr(); int nStyles = styles.size(); for (int i = 0; i < nStyles; i++) { - Style s = (Style)styles.get(i); + Style s = styles.get(i); if (s.getClass().equals(TextStyle.class)) ((TextStyle)s).dumpCSV(); } @@ -312,7 +312,7 @@ public class StyleCatalog { ParaStyle.dumpHdr(); int nStyles = styles.size(); for (int i = 0; i < nStyles; i++) { - Style s = (Style)styles.get(i); + Style s = styles.get(i); if (s.getClass().equals(ParaStyle.class)) ((ParaStyle)s).dumpCSV(); } @@ -335,8 +335,8 @@ public class StyleCatalog { * * @return The class that is appropriate for this node. */ - private Class getClass(Node node, String[] families, Class[] classes, - Class defaultClass) { + private Class<?> getClass(Node node, String[] families, Class<?>[] classes, + Class<?> defaultClass) { NamedNodeMap attributes = node.getAttributes(); if (attributes != null) { int len = attributes.getLength(); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java index b8f9341d33c7..fa5bdd51cff4 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java @@ -42,7 +42,7 @@ public class BookSettings implements OfficeConstants { private boolean hasColumnRowHeaders = true; private String activeSheet = new String(); - private ArrayList worksheetSettings = new ArrayList(); + private ArrayList<SheetSettings> worksheetSettings = new ArrayList<SheetSettings>(); /** * Constructor for a <code>BookSettings</code>. Reads document settings @@ -59,7 +59,7 @@ public class BookSettings implements OfficeConstants { * * @param worksheetSettings If it's a row the height, a column the width */ - public BookSettings(ArrayList worksheetSettings) { + public BookSettings(ArrayList<SheetSettings> worksheetSettings) { this.worksheetSettings = worksheetSettings; } @@ -86,7 +86,7 @@ public class BookSettings implements OfficeConstants { * * @return <code>Vector</code> of <code>SheetSettings</code> */ - public ArrayList getSheetSettings() { + public ArrayList<SheetSettings> getSheetSettings() { return worksheetSettings; } @@ -138,10 +138,10 @@ public class BookSettings implements OfficeConstants { public void writeNode(org.w3c.dom.Document settings, Node root) { this.settings = settings; - Element configItemMapNamed = (Element) settings.createElement(TAG_CONFIG_ITEM_MAP_NAMED); + Element configItemMapNamed = settings.createElement(TAG_CONFIG_ITEM_MAP_NAMED); configItemMapNamed.setAttribute(ATTRIBUTE_CONFIG_NAME, "Tables"); - for(Iterator e = worksheetSettings.iterator();e.hasNext();) { - SheetSettings s = (SheetSettings) e.next(); + for(Iterator<SheetSettings> e = worksheetSettings.iterator();e.hasNext();) { + SheetSettings s = e.next(); s.writeNode(settings, configItemMapNamed); } addConfigItem(root, "ActiveTable", "string", activeSheet); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/NameDefinition.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/NameDefinition.java index 6c349eabf45a..c29daf726957 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/NameDefinition.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/NameDefinition.java @@ -143,7 +143,7 @@ public class NameDefinition implements OfficeConstants { if(isRangeType()) { Debug.log(Debug.TRACE, "Found Range Name : " + getName()); - Element namedRangeElement = (Element) doc.createElement(TAG_TABLE_NAMED_RANGE); + Element namedRangeElement = doc.createElement(TAG_TABLE_NAMED_RANGE); namedRangeElement.setAttribute(ATTRIBUTE_TABLE_NAME, getName()); namedRangeElement.setAttribute(ATTRIBUTE_TABLE_BASE_CELL_ADDRESS, getBaseCellAddress()); namedRangeElement.setAttribute(ATTRIBUTE_TABLE_CELL_RANGE_ADDRESS, getDefinition()); @@ -151,7 +151,7 @@ public class NameDefinition implements OfficeConstants { } else if (isExpressionType()) { Debug.log(Debug.TRACE, "Found Expression Name : " + getName()); - Element namedExpressionElement = (Element) doc.createElement(TAG_TABLE_NAMED_EXPRESSION); + Element namedExpressionElement = doc.createElement(TAG_TABLE_NAMED_EXPRESSION); namedExpressionElement.setAttribute(ATTRIBUTE_TABLE_NAME, getName()); namedExpressionElement.setAttribute(ATTRIBUTE_TABLE_BASE_CELL_ADDRESS,getBaseCellAddress()); namedExpressionElement.setAttribute(ATTRIBUTE_TABLE_EXPRESSION, getDefinition()); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java index 546c6b64da90..47779eb514df 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java @@ -251,7 +251,7 @@ public class SheetSettings implements OfficeConstants { public void writeNode(org.w3c.dom.Document settings, Node root) { this.settings = settings; - Element configItemMapEntry = (Element) settings.createElement(TAG_CONFIG_ITEM_MAP_ENTRY); + Element configItemMapEntry = settings.createElement(TAG_CONFIG_ITEM_MAP_ENTRY); configItemMapEntry.setAttribute(ATTRIBUTE_CONFIG_NAME, getSheetName()); addConfigItem(configItemMapEntry, "CursorPositionX", "int", Integer.toString(cursorX)); addConfigItem(configItemMapEntry, "CursorPositionY", "int", Integer.toString(cursorY)); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetDecoder.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetDecoder.java index fdb35ba1cc74..c54ccea7b89b 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetDecoder.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetDecoder.java @@ -49,7 +49,7 @@ public abstract class SpreadsheetDecoder { * * @return The Enumeration */ - public abstract Iterator getNameDefinitions(); + public abstract Iterator<NameDefinition> getNameDefinitions(); /** * Returns an <code>BookSettings</code> @@ -63,7 +63,7 @@ public abstract class SpreadsheetDecoder { * * @return The Enumeration */ - public abstract Iterator getColumnRowInfos(); + public abstract Iterator<ColumnRowInfo> getColumnRowInfos(); /** * Returns the number of populated rows in the current WorkSheet. diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetEncoder.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetEncoder.java index 63c3cd423589..bb2c0af88309 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetEncoder.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetEncoder.java @@ -40,7 +40,7 @@ public abstract class SpreadsheetEncoder { * * @throws IOException If any I/O error occurs. */ - public SpreadsheetEncoder(String name, String password) throws IOException { }; + public SpreadsheetEncoder(String name, String password) throws IOException { } /** @@ -99,7 +99,7 @@ public abstract class SpreadsheetEncoder { * @param columnRows An <code>IntArrayList</code> of column * widths. */ - public abstract void setColumnRows(ArrayList columnRows) throws IOException; + public abstract void setColumnRows(ArrayList<ColumnRowInfo> columnRows) throws IOException; /** * Set the name definition of this spreadsheet diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java index f1119bc761e4..c9941b2a8f9b 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java @@ -202,7 +202,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, for(int i=0;i<fontTable.length;) { // Create an element node for the table - Element tableElement = (Element) doc.createElement(TAG_STYLE_FONT_DECL); + Element tableElement = doc.createElement(TAG_STYLE_FONT_DECL); tableElement.setAttribute(ATTRIBUTE_STYLE_NAME, fontTable[i++]); tableElement.setAttribute(ATTRIBUTE_FO_FONT_FAMILY, fontTable[i++]); @@ -251,14 +251,14 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, } // Add the Defined Name table if there is one - Iterator nameDefinitionTable = decoder.getNameDefinitions(); + Iterator<NameDefinition> nameDefinitionTable = decoder.getNameDefinitions(); if(nameDefinitionTable.hasNext()) { processNameDefinition(node, nameDefinitionTable); } // add settings NodeList settingsList = settings.getElementsByTagName(TAG_OFFICE_SETTINGS); - Node settingsNode = settingsList.item(0);; + Node settingsNode = settingsList.item(0); processSettings(settingsNode); } @@ -276,12 +276,12 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, */ protected void processSettings(Node root) { - Element configItemSetEntry = (Element) settings.createElement(TAG_CONFIG_ITEM_SET); + Element configItemSetEntry = settings.createElement(TAG_CONFIG_ITEM_SET); configItemSetEntry.setAttribute(ATTRIBUTE_CONFIG_NAME, "view-settings"); - Element configItemMapIndexed = (Element) settings.createElement(TAG_CONFIG_ITEM_MAP_INDEXED); + Element configItemMapIndexed = settings.createElement(TAG_CONFIG_ITEM_MAP_INDEXED); configItemMapIndexed.setAttribute(ATTRIBUTE_CONFIG_NAME, "Views"); - Element configItemMapEntry = (Element) settings.createElement(TAG_CONFIG_ITEM_MAP_ENTRY); - BookSettings bs = (BookSettings) decoder.getSettings(); + Element configItemMapEntry = settings.createElement(TAG_CONFIG_ITEM_MAP_ENTRY); + BookSettings bs = decoder.getSettings(); bs.writeNode(settings, configItemMapEntry); configItemMapIndexed.appendChild(configItemMapEntry); @@ -300,15 +300,15 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, * * @throws IOException If any I/O error occurs. */ - protected void processNameDefinition(Node root, Iterator eNameDefinitions) throws IOException { + protected void processNameDefinition(Node root, Iterator<NameDefinition> eNameDefinitions) throws IOException { Debug.log(Debug.TRACE, "<NAMED-EXPRESSIONS>"); - Element namedExpressionsElement = (Element) doc.createElement(TAG_NAMED_EXPRESSIONS); + Element namedExpressionsElement = doc.createElement(TAG_NAMED_EXPRESSIONS); while(eNameDefinitions.hasNext()) { - NameDefinition tableEntry = (NameDefinition) eNameDefinitions.next(); + NameDefinition tableEntry = eNameDefinitions.next(); tableEntry.writeNode(doc, namedExpressionsElement); } @@ -334,7 +334,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, Debug.log(Debug.TRACE, "<TABLE>"); // Create an element node for the table - Element tableElement = (Element) doc.createElement(TAG_TABLE); + Element tableElement = doc.createElement(TAG_TABLE); // Get the sheet name String sheetName = decoder.getSheetName(); @@ -376,14 +376,14 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, */ protected void processColumns(Node root) throws IOException { - for(Iterator e = decoder.getColumnRowInfos();e.hasNext();) { + for(Iterator<ColumnRowInfo> e = decoder.getColumnRowInfos();e.hasNext();) { - ColumnRowInfo ci = (ColumnRowInfo) e.next(); + ColumnRowInfo ci = e.next(); if(ci.isColumn()) { ColumnStyle cStyle = new ColumnStyle("Default",SxcConstants.COLUMN_STYLE_FAMILY, SxcConstants.DEFAULT_STYLE, ci.getSize(), null); - Style result[] = (Style[]) styleCat.getMatching(cStyle); + Style result[] = styleCat.getMatching(cStyle); String styleName; if(result.length==0) { @@ -398,7 +398,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, } // Create an element node for the new row - Element colElement = (Element) doc.createElement(TAG_TABLE_COLUMN); + Element colElement = doc.createElement(TAG_TABLE_COLUMN); colElement.setAttribute(ATTRIBUTE_TABLE_STYLE_NAME, styleName); if(ci.getRepeated()!=1) { String repeatStr = String.valueOf(ci.getRepeated()); @@ -479,17 +479,17 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, col = 1; // Create an element node for the new row - rowElement = (Element) doc.createElement(TAG_TABLE_ROW); + rowElement = doc.createElement(TAG_TABLE_ROW); - for(Iterator e = decoder.getColumnRowInfos();e.hasNext();) { - ColumnRowInfo cri = (ColumnRowInfo) e.next(); + for(Iterator<ColumnRowInfo> e = decoder.getColumnRowInfos();e.hasNext();) { + ColumnRowInfo cri = e.next(); if(cri.isRow() && cri.getRepeated()==newRow-1) { // We have the correct Row BIFFRecord for this row RowStyle rStyle = new RowStyle("Default",SxcConstants.ROW_STYLE_FAMILY, SxcConstants.DEFAULT_STYLE, cri.getSize(), null); - Style result[] = (Style[]) styleCat.getMatching(rStyle); + Style result[] = styleCat.getMatching(rStyle); String styleName; if(result.length==0) { @@ -545,7 +545,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, Format fmt = decoder.getCellFormat(); // Create an element node for the cell - cellElement = (Element) doc.createElement(TAG_TABLE_CELL); + cellElement = doc.createElement(TAG_TABLE_CELL); Node bodyNode = doc.getElementsByTagName(TAG_OFFICE_BODY).item(0); @@ -562,7 +562,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, CellStyle( "Default",SxcConstants.TABLE_CELL_STYLE_FAMILY, SxcConstants.DEFAULT_STYLE, fmt, null); String styleName; - Style result[] = (Style[]) styleCat.getMatching(tStyle); + Style result[] = styleCat.getMatching(tStyle); if(result.length==0) { tStyle.setName("ce" + textStyles++); @@ -584,7 +584,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, rowElement.appendChild(cellElement); // Append the cellContents as a text node - Element textElement = (Element) doc.createElement(TAG_PARAGRAPH); + Element textElement = doc.createElement(TAG_PARAGRAPH); cellElement.appendChild(textElement); textElement.appendChild(doc.createTextNode(cellContents)); @@ -638,7 +638,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, protected void addEmptyRows(int numEmptyRows, Node root, int numEmptyCells) { // Create an element node for the row - Element rowElement = (Element) doc.createElement(TAG_TABLE_ROW); + Element rowElement = doc.createElement(TAG_TABLE_ROW); // TODO - style currently hardcoded - get real value // Set row style-name attribute @@ -681,7 +681,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, protected void addEmptyCells(int numColsSkipped, Node row) { // Create an empty cellElement - Element cellElement = (Element) doc.createElement(TAG_TABLE_CELL); + Element cellElement = doc.createElement(TAG_TABLE_CELL); // TODO - style currently hardcoded - get real value // Set cell style-name attribute diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java index f0a651cbbb55..82ab17fafaca 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java @@ -83,7 +83,7 @@ public abstract class SxcDocumentSerializer implements OfficeConstants, * An array of column widths of the current worksheet. Width is * measured in number of characters. */ - private ArrayList ColumnRowList; + private ArrayList<ColumnRowInfo> ColumnRowList; /** Width, in characters, of the current cell display data. */ private int displayWidth = 0; @@ -183,7 +183,7 @@ public abstract class SxcDocumentSerializer implements OfficeConstants, String families[] = new String[] { SxcConstants.COLUMN_STYLE_FAMILY, SxcConstants.ROW_STYLE_FAMILY, SxcConstants.TABLE_CELL_STYLE_FAMILY }; - Class classes[] = new Class[] { ColumnStyle.class, + Class<?> classes[] = new Class[] { ColumnStyle.class, RowStyle.class, CellStyle.class}; /* @@ -302,7 +302,7 @@ public abstract class SxcDocumentSerializer implements OfficeConstants, Debug.log(Debug.TRACE, "<TABLE>"); - ColumnRowList = new ArrayList(); + ColumnRowList = new ArrayList<ColumnRowInfo>(); // Get table attributes // TODO - extract style from attribute @@ -625,8 +625,8 @@ public abstract class SxcDocumentSerializer implements OfficeConstants, if (fmt.isDefault() && styleName.length()==0) { int index = 1; - for(Iterator e = ColumnRowList.iterator();e.hasNext();) { - ColumnRowInfo cri = (ColumnRowInfo) e.next(); + for(Iterator<ColumnRowInfo> e = ColumnRowList.iterator();e.hasNext();) { + ColumnRowInfo cri = e.next(); if(cri.isColumn()) { if(colID>=index && colID<(index+cri.getRepeated())) { fmt = new Format(cri.getFormat()); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java index 0f383062f7fc..caf135382277 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java @@ -98,7 +98,7 @@ public final class DocumentDeserializerImpl */ public Document deserialize() throws ConvertException, IOException { log("\nFound the XSLT deserializer"); - Iterator enumerate = cd.getDocumentEnumeration(); + Iterator<Object> enumerate = cd.getDocumentEnumeration(); org.w3c.dom.Document domDoc=null; DOMDocument docOut=null; GenericOfficeDocument doc = null; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentSerializerImpl.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentSerializerImpl.java index 36f0df7485ce..8de934082dee 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentSerializerImpl.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentSerializerImpl.java @@ -106,7 +106,7 @@ public final class DocumentSerializerImpl org.w3c.dom.Document styleDoc = sxwDoc.getStyleDOM(); ByteArrayOutputStream baos= new ByteArrayOutputStream(); ConvertData cd = new ConvertData(); - Node offnode = (Node)domDoc.getDocumentElement(); + Node offnode = domDoc.getDocumentElement(); if (!(offnode.getNodeName()).equals("office:document")){ try{ DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); @@ -141,7 +141,7 @@ public final class DocumentSerializerImpl NodeList nodeList; Node tmpNode; - Node rootNode = (Node)rootElement; + Node rootNode = rootElement; if (metaDoc !=null){ nodeList= metaDoc.getElementsByTagName(TAG_OFFICE_META); if (nodeList.getLength()>0){ diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java index e7a5ed991d3c..59d5ef38d165 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java @@ -135,15 +135,15 @@ public final class PluginFactoryImpl extends PluginFactory public String getDeviceFileExtension(){ - Class c = this.getClass(); + Class<? extends PluginFactoryImpl> c = this.getClass(); InputStream is = c.getResourceAsStream("XsltPlugin.properties"); Properties props = new Properties(); String ext= ".txt"; String mimeType = null; ConverterInfo ci = this.getConverterInfo(); - Iterator enumerate = ci.getDeviceMime(); + Iterator<String> enumerate = ci.getDeviceMime(); while (enumerate.hasNext()) { - mimeType= (String) enumerate.next(); + mimeType= enumerate.next(); } try { props.load(is); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java index 2ab19045f613..0d2a3aa67b64 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java @@ -54,7 +54,7 @@ public class CharArrayLCSAlgorithm { // in those 2 sequences diffTable = createDiffTable(orgSeq, modSeq); - ArrayList diffResult = new ArrayList(); + ArrayList<Difference> diffResult = new ArrayList<Difference>(); generateResult(diffTable, orgSeqlen, modSeqlen, diffResult); @@ -154,7 +154,7 @@ public class CharArrayLCSAlgorithm { * and positions filled in. */ private void generateResult(int[][] diffTable, - int i, int j, ArrayList diffVector) { + int i, int j, ArrayList<Difference> diffVector) { // handle the first element if (i == 0 || j == 0) { diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharacterParser.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharacterParser.java index 7e3775526dc1..da22778ad1ab 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharacterParser.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharacterParser.java @@ -46,7 +46,7 @@ public class CharacterParser { private TextNodeIterator textNodes; private int currentPosition = 0; - private List nodeList_ = null; + private List<TextNodeEntry> nodeList_ = null; private char[] charArray; @@ -57,7 +57,7 @@ public class CharacterParser { */ public CharacterParser(Node node) { textNodes = new TextNodeIterator(node); - nodeList_ = new ArrayList(); + nodeList_ = new ArrayList<TextNodeEntry>(); parseNodes(); } @@ -68,7 +68,7 @@ public class CharacterParser { * * @return The <code>Node</code> pointer with the given character position. */ - public List getNodeList() { + public List<TextNodeEntry> getNodeList() { // will go through the nodeList to find the corresponding node return nodeList_; } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java index 3f35dcbfde30..58e511c5f022 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java @@ -50,7 +50,7 @@ public class IteratorLCSAlgorithm implements DiffAlgorithm { printDiffTable(diffTable); } - ArrayList diffResult = new ArrayList(); + ArrayList<Difference> diffResult = new ArrayList<Difference>(); generateResult(diffTable, orgSeqlen, modSeqlen, diffResult); @@ -161,7 +161,7 @@ public class IteratorLCSAlgorithm implements DiffAlgorithm { * and positions fill in. */ private void generateResult(int[][] diffTable, - int i, int j, ArrayList diffVector) { + int i, int j, ArrayList<Difference> diffVector) { // handle the first element if (i == 0 && j == 0) { diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorRowCompare.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorRowCompare.java index 86140d1d7b17..ec93778a78de 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorRowCompare.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorRowCompare.java @@ -76,7 +76,7 @@ public class IteratorRowCompare implements DiffAlgorithm { int orgSeqlen = orgSeq.elementCount(); int modSeqlen = modSeq.elementCount(); - ArrayList diffVector = new ArrayList(); + ArrayList<Difference> diffVector = new ArrayList<Difference>(); // i and j are counters to keep track the current position in the // iterator diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/NodeIterator.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/NodeIterator.java index 971d94864d89..31cc2efca0b0 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/NodeIterator.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/NodeIterator.java @@ -46,7 +46,7 @@ import org.w3c.dom.NodeList; */ public abstract class NodeIterator implements Iterator { - private List nodeList = null; + private List<Node> nodeList = null; private int currentPosition = 0; private Node root; private ConverterCapabilities cc_ = null; @@ -60,7 +60,7 @@ public abstract class NodeIterator implements Iterator { */ public NodeIterator(ConverterCapabilities cc, Node node) { cc_ = cc; - nodeList = new ArrayList(); + nodeList = new ArrayList<Node>(); root = node; markTree(node); } @@ -136,7 +136,7 @@ public abstract class NodeIterator implements Iterator { public void refresh() { - nodeList = new ArrayList(); + nodeList = new ArrayList<Node>(); markTree(root); currentPosition = 0; } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/CharacterBaseParagraphMerge.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/CharacterBaseParagraphMerge.java index c4b1e9a53ccb..37917a1d47b3 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/CharacterBaseParagraphMerge.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/CharacterBaseParagraphMerge.java @@ -78,8 +78,8 @@ public final class CharacterBaseParagraphMerge CharacterParser modParser, Difference[] diffs) { - List orgNodeList = orgParser.getNodeList(); - List modNodeList = modParser.getNodeList(); + List<TextNodeEntry> orgNodeList = orgParser.getNodeList(); + List<TextNodeEntry> modNodeList = modParser.getNodeList(); int diffCount = 0; int modNodeListCnt = 0; int numNode = orgNodeList.size(); @@ -88,7 +88,7 @@ public final class CharacterBaseParagraphMerge int extraChar = 0; int orgDiffCount = diffCount; - TextNodeEntry orgTextNode = (TextNodeEntry)(orgNodeList.get(i)); + TextNodeEntry orgTextNode = (orgNodeList.get(i)); Debug.log(Debug.INFO, "checking node " + (i + 1) + " of " + numNode); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/ConverterInfoList.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/ConverterInfoList.java index ece388c5c2ba..9ff7addbd5b4 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/ConverterInfoList.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/ConverterInfoList.java @@ -35,7 +35,7 @@ public class ConverterInfoList { private static String defaultPropsFile = "ConverterInfoList.properties"; - private ArrayList jars; + private ArrayList<String> jars; private Properties props = null; @@ -59,7 +59,7 @@ public class ConverterInfoList { */ public ConverterInfoList(String propsFile) throws IOException { - Class c = this.getClass(); + Class<? extends ConverterInfoList> c = this.getClass(); InputStream is = c.getResourceAsStream(propsFile); BufferedInputStream bis = new BufferedInputStream(is); props = new Properties(); @@ -68,7 +68,7 @@ public class ConverterInfoList { int i = 1; String jarFileName = new String(); - jars = new ArrayList(); + jars = new ArrayList<String>(); while ((jarFileName = props.getProperty("jarname" + i)) != null) { jars.add(jarFileName); @@ -88,7 +88,7 @@ public class ConverterInfoList { * <code>String</code> describes a plug-in to be * loaded into the registry. */ - public Iterator getJarFileEnum() { + public Iterator<String> getJarFileEnum() { return jars.iterator(); } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java index 0bd127318e25..8fb8d89977fe 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java @@ -30,6 +30,7 @@ import org.openoffice.xmerge.ConvertData; import org.openoffice.xmerge.ConverterFactory; import org.openoffice.xmerge.Document; import org.openoffice.xmerge.DocumentMerger; +import org.openoffice.xmerge.util.registry.ConverterInfo; import org.openoffice.xmerge.util.registry.ConverterInfoMgr; import org.openoffice.xmerge.util.registry.ConverterInfoReader; @@ -51,7 +52,7 @@ public final class Driver { private String mergeFile = null; /** Command-line parmeter. */ - private ArrayList deviceFiles = new ArrayList(); + private ArrayList<String> deviceFiles = new ArrayList<String>(); /** Command-line parmeter shortcuts. */ private String mimeTypes[] = { @@ -78,12 +79,12 @@ public final class Driver { " property file"); } - Iterator jarInfoEnumeration; + Iterator<ConverterInfo> jarInfoEnumeration; ConverterInfoReader cir; - Iterator jarFileEnum = cil.getJarFileEnum(); + Iterator<String> jarFileEnum = cil.getJarFileEnum(); while (jarFileEnum.hasNext()) { - String jarName = (String) jarFileEnum.next(); + String jarName = jarFileEnum.next(); try { cir = new ConverterInfoReader(jarName, false); jarInfoEnumeration = cir.getConverterInfoEnumeration(); @@ -134,9 +135,9 @@ public final class Driver { } try { - Iterator dfEnum = deviceFiles.iterator(); + Iterator<String> dfEnum = deviceFiles.iterator(); while (dfEnum.hasNext()) { - processFile = (String)dfEnum.next(); + processFile = dfEnum.next(); File f = new File(processFile); // Make sure the input file actually exists before using it @@ -165,7 +166,7 @@ public final class Driver { if (dataOut != null ) { if (mergeFile == null) { - Iterator docEnum = dataOut.getDocumentEnumeration(); + Iterator<Object> docEnum = dataOut.getDocumentEnumeration(); while (docEnum.hasNext()) { Document docOut = (Document)docEnum.next(); String fileName = docOut.getFileName(); @@ -185,7 +186,7 @@ public final class Driver { FileInputStream mergeIS = new FileInputStream(mergeFile); Document mergeDoc = myConvert.getOfficeDocument(mergeFile, mergeIS); DocumentMerger merger = myConvert.getDocumentMerger(mergeDoc); - Iterator mergeDocEnum = dataOut.getDocumentEnumeration(); + Iterator<Object> mergeDocEnum = dataOut.getDocumentEnumeration(); Document convertedFile = (Document)mergeDocEnum.next(); merger.merge(convertedFile); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/Debug.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/Debug.java index dcd25b26b931..b43f0033513c 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/Debug.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/Debug.java @@ -62,7 +62,7 @@ public final class Debug { try { - Class c = new Debug().getClass(); + Class<? extends Debug> c = new Debug().getClass(); InputStream is = c.getResourceAsStream("Debug.properties"); Properties props = new Properties(); props.load(is); @@ -316,7 +316,7 @@ public final class Debug { for (int i = 0; i < bytes.length; i++) { - int ch = ((int) bytes[i] & 0xff); + int ch = (bytes[i] & 0xff); String str = Integer.toHexString(ch); if (str.length() < 2) buff.append('0'); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/EndianConverter.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/EndianConverter.java index 93a23fb0800f..5c6ccc5a2f4e 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/EndianConverter.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/EndianConverter.java @@ -162,7 +162,7 @@ public class EndianConverter { ((long)(value[3]&0xFF) << 24) + ((long)(value[2]&0xFF) << 16) + ((long)(value[1]&0xFF) << 8) + - (long)(value[0]&0xFF)); + (value[0]&0xFF)); return Double.longBitsToDouble(lvalue); } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/IntArrayList.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/IntArrayList.java index eff94bf8f901..aa903f2cf348 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/IntArrayList.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/IntArrayList.java @@ -28,14 +28,14 @@ import java.lang.Integer; public class IntArrayList { /** The list to hold our integers. */ - private ArrayList list; + private ArrayList<Integer> list; /** * Constructor. * Creates the list with 0 length. */ public IntArrayList() { - list = new ArrayList(); + list = new ArrayList<Integer>(); } @@ -45,7 +45,7 @@ public class IntArrayList { * @param initialCapacity Initial capacity of the list. */ public IntArrayList(int initialCapacity) { - list = new ArrayList(initialCapacity); + list = new ArrayList<Integer>(initialCapacity); } @@ -122,7 +122,7 @@ public class IntArrayList { * @return The value of the data stored in element index. */ public int get(int index) { - return ((Integer)list.get(index)).intValue(); + return list.get(index).intValue(); } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/OfficeUtil.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/OfficeUtil.java index 2bd53b2ea975..a0f2d8b6bf75 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/OfficeUtil.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/OfficeUtil.java @@ -46,7 +46,7 @@ public class OfficeUtil implements OfficeConstants { * representing the text. */ public static Node[] parseText(String text, Document parentDoc) { - ArrayList nodeVec = new ArrayList(); + ArrayList<Node> nodeVec = new ArrayList<Node>(); /* * Break up the text from the text run into Open @@ -120,7 +120,7 @@ public class OfficeUtil implements OfficeConstants { // Now create and populate an array to return the nodes in. Node nodes[] = new Node[nodeVec.size()]; for (int i = 0; i < nodeVec.size(); i++) - nodes[i] = (Node)nodeVec.get(i); + nodes[i] = nodeVec.get(i); return nodes; } }
\ No newline at end of file diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/TwipsConverter.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/TwipsConverter.java index 3d21c185d7e7..e43e38240b75 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/TwipsConverter.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/TwipsConverter.java @@ -37,7 +37,7 @@ public class TwipsConverter { public static float twips2cm(int value) { float inches = (float) value/1440; - float cm = (float) inches*(float)2.54; + float cm = inches*(float)2.54; return cm; } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java index 259cee0d3401..37b504132f95 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java @@ -54,7 +54,7 @@ public class ConverterInfo { private String piJarName; private String piOfficeMime; - private ArrayList piDeviceMime; + private ArrayList<String> piDeviceMime; private String piDisplayName; private String piDescription; private String piVersion; @@ -88,7 +88,7 @@ public class ConverterInfo { * be loaded. */ public ConverterInfo(String jarName, String officeMime, - ArrayList deviceMime, String displayName, String description, + ArrayList<String> deviceMime, String displayName, String description, String version, String vendor, String impl,String xsltSerial, String xsltDeserial) throws RegistryException { @@ -117,16 +117,16 @@ public class ConverterInfo { URL jarURL = new URL(jarName); URLClassLoader loader = new URLClassLoader(new URL[] { jarURL }, piClassLoader); - Class clas = loader.loadClass(piClassImpl); - Class[] argumentTypes = { org.openoffice.xmerge.util.registry.ConverterInfo.class }; - Constructor construct = clas.getConstructor(argumentTypes); + Class<?> clas = loader.loadClass(piClassImpl); + Class<?>[] argumentTypes = { org.openoffice.xmerge.util.registry.ConverterInfo.class }; + Constructor<?> construct = clas.getConstructor(argumentTypes); Object[] arguments = { this }; piPluginFactory = ( PluginFactory ) construct.newInstance(arguments); // See which interfaces the plug-in PluginFactory supports. // - Class[] cl = piPluginFactory.getClass().getInterfaces(); + Class<?>[] cl = piPluginFactory.getClass().getInterfaces(); for (int i=0; i < cl.length; i++) { if (cl[i].getName().equals("org.openoffice.xmerge.DocumentSerializerFactory")) { @@ -166,7 +166,7 @@ public class ConverterInfo { public ConverterInfo(String jarName, String officeMime, - ArrayList deviceMime, String displayName, String description, + ArrayList<String> deviceMime, String displayName, String description, String version, String vendor, String impl) throws RegistryException { @@ -192,16 +192,16 @@ public class ConverterInfo { URL jarURL = new URL(jarName); URLClassLoader loader = new URLClassLoader(new URL[] { jarURL }, piClassLoader); - Class clas = loader.loadClass(piClassImpl); - Class[] argumentTypes = { org.openoffice.xmerge.util.registry.ConverterInfo.class }; - Constructor construct = clas.getConstructor(argumentTypes); + Class<?> clas = loader.loadClass(piClassImpl); + Class<?>[] argumentTypes = { org.openoffice.xmerge.util.registry.ConverterInfo.class }; + Constructor<?> construct = clas.getConstructor(argumentTypes); Object[] arguments = { this }; piPluginFactory = ( PluginFactory ) construct.newInstance(arguments); // See which interfaces the plug-in PluginFactory supports. // - Class[] cl = piPluginFactory.getClass().getInterfaces(); + Class<?>[] cl = piPluginFactory.getClass().getInterfaces(); for (int i=0; i < cl.length; i++) { if (cl[i].getName().equals("org.openoffice.xmerge.DocumentSerializerFactory")) { @@ -290,7 +290,7 @@ public class ConverterInfo { * @return An <code>Enumeration</code> of <code>String</code> * objects indicating the device mime-type. */ - public Iterator getDeviceMime() { + public Iterator<String> getDeviceMime() { return(piDeviceMime.iterator()); } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java index f6d7689e537f..9f5ff30ec196 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java @@ -32,13 +32,13 @@ import java.io.*; */ public final class ConverterInfoMgr { - private static ArrayList converterInfoList; + private static ArrayList<ConverterInfo> converterInfoList; /** * Constructor */ static { - converterInfoList = new ArrayList(); + converterInfoList = new ArrayList<ConverterInfo>(); } /** @@ -82,9 +82,9 @@ public final class ConverterInfoMgr { // Verify there is no converter with the same Display Name in // the registry. // - Iterator ciEnum = converterInfoList.iterator(); + Iterator<ConverterInfo> ciEnum = converterInfoList.iterator(); while (ciEnum.hasNext()) { - converterInfo = (ConverterInfo)ciEnum.next(); + converterInfo = ciEnum.next(); if (ci.getDisplayName().equals(converterInfo.getDisplayName())) { RegistryException re = new RegistryException( "Converter with specified display name already exists."); @@ -112,10 +112,10 @@ public final class ConverterInfoMgr { * @throws RegistryException If a <code>ConverterInfo</code> in the * <code>Vector</code> is not valid. */ - public static void addPlugIn(Iterator jarEnum) throws RegistryException { + public static void addPlugIn(Iterator<ConverterInfo> jarEnum) throws RegistryException { while (jarEnum.hasNext()) { - ConverterInfo converterInfo = (ConverterInfo)jarEnum.next(); + ConverterInfo converterInfo = jarEnum.next(); addPlugIn(converterInfo); } } @@ -128,7 +128,7 @@ public final class ConverterInfoMgr { * <code>ConverterInfo</code> objects, an empty * <code>Vector</code> if none exist. */ - public static Iterator getConverterInfoEnumeration() { + public static Iterator<ConverterInfo> getConverterInfoEnumeration() { return (converterInfoList.iterator()); } @@ -157,10 +157,10 @@ public final class ConverterInfoMgr { } }*/ - Iterator ciIter = converterInfoList.iterator(); + Iterator<ConverterInfo> ciIter = converterInfoList.iterator(); while (ciIter.hasNext()) { - converterInfo = (ConverterInfo)ciIter.next(); + converterInfo = ciIter.next(); if (jar.equals(converterInfo.getJarName())) { ciIter.remove(); rc = true; @@ -183,10 +183,10 @@ public final class ConverterInfoMgr { ConverterInfo converterInfo; boolean rc = false; - Iterator ciEnum = converterInfoList.iterator(); + Iterator<ConverterInfo> ciEnum = converterInfoList.iterator(); while (ciEnum.hasNext()) { - converterInfo = (ConverterInfo)ciEnum.next(); + converterInfo = ciEnum.next(); if (name.equals(converterInfo.getDisplayName())) { converterInfoList.remove(converterInfo); rc = true; @@ -218,17 +218,17 @@ public final class ConverterInfoMgr { // Loop over elements comparing with deviceFromMime // - Iterator ciEnum = converterInfoList.iterator(); + Iterator<ConverterInfo> ciEnum = converterInfoList.iterator(); while (ciEnum.hasNext()) { - converterInfo = (ConverterInfo)ciEnum.next(); - String toDeviceInfo = (String)converterInfo.getOfficeMime(); - Iterator fromEnum = converterInfo.getDeviceMime(); + converterInfo = ciEnum.next(); + String toDeviceInfo = converterInfo.getOfficeMime(); + Iterator<String> fromEnum = converterInfo.getDeviceMime(); // Loop over the deviceMime types. // while (fromEnum.hasNext()) { - String fromDeviceInfo = (String)fromEnum.next(); + String fromDeviceInfo = fromEnum.next(); if (deviceMime.trim().equals(fromDeviceInfo) && officeMime.trim().equals(toDeviceInfo)) { return (converterInfo); @@ -261,36 +261,36 @@ public final class ConverterInfoMgr { // Loop over elements comparing with deviceFromMime // - Iterator cifEnum = converterInfoList.iterator(); + Iterator<ConverterInfo> cifEnum = converterInfoList.iterator(); while (cifEnum.hasNext()) { - converterInfo[0] = (ConverterInfo)cifEnum.next(); + converterInfo[0] = cifEnum.next(); String fromOfficeInfo = converterInfo[0].getOfficeMime(); - Iterator fromEnum = converterInfo[0].getDeviceMime(); + Iterator<String> fromEnum = converterInfo[0].getDeviceMime(); // Loop over the deviceMime types looking for a deviceFromMime // match. // while (fromEnum.hasNext()) { - String fromDeviceInfo = (String)fromEnum.next(); + String fromDeviceInfo = fromEnum.next(); if (deviceFromMime.trim().equals(fromDeviceInfo)) { // Found a a match for deviceFrom. Now loop over the // elements comparing with deviceToMime // - Iterator citEnum = converterInfoList.iterator(); + Iterator<ConverterInfo> citEnum = converterInfoList.iterator(); while (citEnum.hasNext()) { - converterInfo[1] = (ConverterInfo)citEnum.next(); + converterInfo[1] = citEnum.next(); String toOfficeInfo = converterInfo[1].getOfficeMime(); - Iterator toEnum = converterInfo[1].getDeviceMime(); + Iterator<String> toEnum = converterInfo[1].getDeviceMime(); // Loop over deviceMime types looking for a // deviceToMime match. // while (toEnum.hasNext()) { - String toDeviceInfo = (String)toEnum.next(); + String toDeviceInfo = toEnum.next(); if (deviceToMime.trim().equals(toDeviceInfo) && fromOfficeInfo.equals(toOfficeInfo)) { @@ -365,7 +365,7 @@ public final class ConverterInfoMgr { } if (cir != null) { - Iterator jarInfoEnum = cir.getConverterInfoEnumeration(); + Iterator<ConverterInfo> jarInfoEnum = cir.getConverterInfoEnumeration(); try { ConverterInfoMgr.addPlugIn(jarInfoEnum); } catch (Exception e) { @@ -471,25 +471,25 @@ public final class ConverterInfoMgr { // } else if (c == 'V') { - Iterator ciEnum = ConverterInfoMgr.getConverterInfoEnumeration(); + Iterator<ConverterInfo> ciEnum = ConverterInfoMgr.getConverterInfoEnumeration(); int ciCnt = 0; while (ciEnum.hasNext()) { System.out.println(""); System.out.println(" Displaying converter number " + ciCnt); - ConverterInfo converterInfo = (ConverterInfo)ciEnum.next(); + ConverterInfo converterInfo = ciEnum.next(); System.out.println(" DisplayName : " + converterInfo.getDisplayName()); System.out.println(" JarFile : " + converterInfo.getJarName()); System.out.println(" Description : " + converterInfo.getDescription()); System.out.println(" Version : " + converterInfo.getVersion()); System.out.println(" OfficeMime : " + converterInfo.getOfficeMime()); - Iterator fromEnum = converterInfo.getDeviceMime(); + Iterator<String> fromEnum = converterInfo.getDeviceMime(); int feCnt = 1; while (fromEnum.hasNext()) { System.out.println(" DeviceMime : (#" + feCnt + ") : " + - (String)fromEnum.next()); + fromEnum.next()); feCnt++; } if (feCnt == 1) { diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java index bcf0819bb141..38b4bb9bb86e 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java @@ -50,7 +50,7 @@ public class ConverterInfoReader { private final static String TAG_XSLT_SERIAL = "converter-xslt-serialize"; private String jarfilename; private Document document; - private ArrayList converterInfoList; + private ArrayList<ConverterInfo> converterInfoList; /** @@ -87,7 +87,7 @@ public class ConverterInfoReader { JarFile jarfile; URL url; - converterInfoList = new ArrayList(); + converterInfoList = new ArrayList<ConverterInfo>(); jarfilename = jar; // Get Jar via URL @@ -161,7 +161,7 @@ public class ConverterInfoReader { Node detailNode; String elementTagName; String officeMime = null; - ArrayList deviceMime = new ArrayList(); + ArrayList<String> deviceMime = new ArrayList<String>(); String name = null; String desc = null; String version = null; @@ -260,7 +260,7 @@ public class ConverterInfoReader { * @return An <code>Enumeration</code> of <code>ConverterInfo</code> * objects. */ - public Iterator getConverterInfoEnumeration() { + public Iterator<ConverterInfo> getConverterInfoEnumeration() { return (converterInfoList.iterator()); } } |