Index: src/lib/com/izforge/izpack/installer/MultiVolumeInstaller.java =================================================================== --- src/lib/com/izforge/izpack/installer/MultiVolumeInstaller.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/MultiVolumeInstaller.java Fri Feb 22 14:20:30 GMT 2008 @@ -62,7 +62,7 @@ { try { - Class clazz = MultiVolumeInstaller.class; + Class clazz = MultiVolumeInstaller.class; Method target = clazz.getMethod("install", new Class[] { String[].class}); String[] newargs = new String[args.length + 2]; Index: src/lib/com/izforge/izpack/util/os/RegistryHandler.java =================================================================== --- src/lib/com/izforge/izpack/util/os/RegistryHandler.java (revision 2050) +++ src/lib/com/izforge/izpack/util/os/RegistryHandler.java Fri Feb 22 14:20:30 GMT 2008 @@ -50,7 +50,7 @@ public static final String UNINSTALL_ROOT = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"; - public static final Map ROOT_KEY_MAP = new HashMap(); + public static final Map ROOT_KEY_MAP = new HashMap(); protected String uninstallName = null; Index: src/lib/com/izforge/izpack/installer/LayoutHelper.java =================================================================== --- src/lib/com/izforge/izpack/installer/LayoutHelper.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/LayoutHelper.java Fri Feb 22 14:20:30 GMT 2008 @@ -416,7 +416,7 @@ String todo; if (idata instanceof InstallData && ((InstallData) idata).guiPrefs.modifier.containsKey("layoutAnchor")) - todo = (String) ((InstallData) idata).guiPrefs.modifier.get("layoutAnchor"); + todo = ((InstallData) idata).guiPrefs.modifier.get("layoutAnchor"); else todo = idata.getVariable("IzPanel.LayoutType"); if (todo == null) // No command, no work. @@ -465,7 +465,7 @@ { try { - commonDefault = Integer.parseInt((String) id.guiPrefs.modifier.get(ALL_X_GAP)); + commonDefault = Integer.parseInt(id.guiPrefs.modifier.get(ALL_X_GAP)); } catch (NumberFormatException nfe) { @@ -483,7 +483,7 @@ } else { - var = (String) id.guiPrefs.modifier.get(X_GAP_NAME_LOOK_UP[i]); + var = id.guiPrefs.modifier.get(X_GAP_NAME_LOOK_UP[i]); if (var != null) { try @@ -528,7 +528,7 @@ { try { - commonDefault = Integer.parseInt((String) id.guiPrefs.modifier.get(ALL_Y_GAP)); + commonDefault = Integer.parseInt(id.guiPrefs.modifier.get(ALL_Y_GAP)); } catch (NumberFormatException nfe) { @@ -546,7 +546,7 @@ } else { - var = (String) id.guiPrefs.modifier.get(Y_GAP_NAME_LOOK_UP[i]); + var = id.guiPrefs.modifier.get(Y_GAP_NAME_LOOK_UP[i]); if (var != null) { try @@ -678,7 +678,7 @@ String var = null; if (((InstallData) idata).guiPrefs.modifier.containsKey(key)) { - var = (String) ((InstallData) idata).guiPrefs.modifier.get(key); + var = ((InstallData) idata).guiPrefs.modifier.get(key); if (var != null) { try Index: src/lib/com/izforge/izpack/util/Librarian.java =================================================================== --- src/lib/com/izforge/izpack/util/Librarian.java (revision 2050) +++ src/lib/com/izforge/izpack/util/Librarian.java Fri Feb 22 14:20:30 GMT 2008 @@ -98,27 +98,27 @@ * A list that is used to track all libraries that have been loaded. This list is used to ensure * that each library is loaded only once. */ - private Vector trackList = new Vector(); + private Vector trackList = new Vector(); /** * A list of references to clients that use libraries that were extracted from a *.jar file. * This is needed because the clients need to be called for freeing their libraries. */ - private Vector clients = new Vector(); + private Vector clients = new Vector(); /** * A list of library names as they appear in the temporary directory. This is needed to free * each library through the client. The index of each name corresponds to the index of the * respective client in the clients list. */ - private Vector libraryNames = new Vector(); + private Vector libraryNames = new Vector(); /** * A list of fully qualified library names. This is needed to delete the temporary library files * after use. The index of each name corresponds to the index of the respective client in the * clients list. */ - private Vector temporaryFileNames = new Vector(); + private Vector temporaryFileNames = new Vector(); /** The extension to use for native libraries. */ private String extension = ""; @@ -699,8 +699,8 @@ // -------------------------------------------------- // free the library // -------------------------------------------------- - NativeLibraryClient client = (NativeLibraryClient) clients.elementAt(i); - String libraryName = (String) libraryNames.elementAt(i); + NativeLibraryClient client = clients.elementAt(i); + String libraryName = libraryNames.elementAt(i); FreeThread free = new FreeThread(libraryName, client); free.start(); @@ -716,7 +716,7 @@ // -------------------------------------------------- // delete the library // -------------------------------------------------- - String tempFileName = (String) temporaryFileNames.elementAt(i); + String tempFileName = temporaryFileNames.elementAt(i); try { File file = new File(tempFileName); Index: src/lib/com/izforge/izpack/installer/AutomatedInstallData.java =================================================================== --- src/lib/com/izforge/izpack/installer/AutomatedInstallData.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/AutomatedInstallData.java Fri Feb 22 14:20:29 GMT 2008 @@ -31,6 +31,7 @@ import com.izforge.izpack.Info; import com.izforge.izpack.LocaleDatabase; +import com.izforge.izpack.Pack; /** * Encloses information about the install process. This implementation is not thread safe. @@ -82,7 +83,7 @@ public Info info; /** The complete list of packs. */ - public List allPacks; + public List allPacks; /** The available packs. */ public List availablePacks; @@ -91,7 +92,7 @@ public List selectedPacks; /** The panels list. */ - public List panels; + public List panels; /** The panels order. */ public List panelsOrder; @@ -109,7 +110,7 @@ public XMLElement xmlData; /** Custom data. */ - public Map customData; + public Map customData; /** * Maps the variable names to their values @@ -117,7 +118,7 @@ protected Properties variables; /** The attributes used by the panels */ - protected Map attributes; + protected Map attributes; /** This class should be a singleton. Therefore * the one possible object will be stored in this @@ -141,12 +142,12 @@ { availablePacks = new ArrayList(); selectedPacks = new ArrayList(); - panels = new ArrayList(); + panels = new ArrayList(); panelsOrder = new ArrayList(); xmlData = new XMLElement("AutomatedInstallation"); variables = new Properties(); - attributes = new HashMap(); - customData = new HashMap(); + attributes = new HashMap(); + customData = new HashMap(); if( self != null ) throw new RuntimeException("Panic!! second call of the InstallData Ctor!!"); self = this; Index: src/lib/com/izforge/izpack/util/os/Win_Shortcut.java =================================================================== --- src/lib/com/izforge/izpack/util/os/Win_Shortcut.java (revision 2050) +++ src/lib/com/izforge/izpack/util/os/Win_Shortcut.java Fri Feb 22 14:20:30 GMT 2008 @@ -130,7 +130,7 @@ * @see #APPLICATIONS * @see #START_MENU */ - public Vector getProgramGroups(int userType) + public Vector getProgramGroups(int userType) { int logentry = 0; Debug.log( CLASS + myClass + ".getProgramGroups()-" + logentry++ + " '" + Integer.toString(userType) + "'" ); @@ -159,7 +159,7 @@ // in case there is a problem obtaining a path return // an empty vector (there are no preexisting program // groups) - if (linkPath == null) { return (new Vector()); } + if (linkPath == null) { return (new Vector()); } File path = new File(linkPath); File[] file = path.listFiles(); @@ -168,7 +168,7 @@ // build a vector that contains only the names of // the directories. // ---------------------------------------------------- - Vector groups = new Vector(); + Vector groups = new Vector(); if (file != null) { Index: src/lib/com/izforge/izpack/util/VariableSubstitutor.java =================================================================== --- src/lib/com/izforge/izpack/util/VariableSubstitutor.java (revision 2050) +++ src/lib/com/izforge/izpack/util/VariableSubstitutor.java Fri Feb 22 14:20:30 GMT 2008 @@ -87,12 +87,12 @@ public final static String PLAIN = "plain"; /** A mapping of file type names to corresponding integer constants. */ - protected final static Map typeNameToConstantMap; + protected final static Map typeNameToConstantMap; // Initialize the file type map static { - typeNameToConstantMap = new HashMap(); + typeNameToConstantMap = new HashMap(); typeNameToConstantMap.put("plain", new Integer(TYPE_PLAIN)); typeNameToConstantMap.put("javaprop", new Integer(TYPE_JAVA_PROPERTIES)); typeNameToConstantMap.put("java", new Integer(TYPE_JAVA)); @@ -392,7 +392,7 @@ protected int getTypeConstant(String type) { if (type == null) return TYPE_PLAIN; - Integer integer = (Integer) typeNameToConstantMap.get(type); + Integer integer = typeNameToConstantMap.get(type); if (integer == null) throw new IllegalArgumentException("Unknown file type " + type); else Index: src/lib/com/izforge/izpack/GUIPrefs.java =================================================================== --- src/lib/com/izforge/izpack/GUIPrefs.java (revision 2050) +++ src/lib/com/izforge/izpack/GUIPrefs.java Fri Feb 22 14:20:30 GMT 2008 @@ -43,11 +43,11 @@ public int height; /** Specifies the OS Look and Feels mappings. */ - public Map lookAndFeelMapping = new TreeMap(); + public Map lookAndFeelMapping = new TreeMap(); /** Specifies the OS Look and Feels optionnal parameters. */ - public Map lookAndFeelParams = new TreeMap(); + public Map> lookAndFeelParams = new TreeMap>(); /** Specifies the modifier. */ - public Map modifier = new TreeMap(); + public Map modifier = new TreeMap(); } Index: src/lib/com/izforge/izpack/PackFile.java =================================================================== --- src/lib/com/izforge/izpack/PackFile.java (revision 2050) +++ src/lib/com/izforge/izpack/PackFile.java Fri Feb 22 14:20:30 GMT 2008 @@ -21,6 +21,8 @@ package com.izforge.izpack; +import com.izforge.izpack.util.OsConstraint; + import java.io.File; import java.io.FileNotFoundException; import java.io.Serializable; @@ -58,7 +60,7 @@ private String targetPath = null; /** The target operating system constraints of this file */ - private List osConstraints = null; + private List osConstraints = null; /** The length of the file in bytes */ private long length = 0; @@ -92,7 +94,7 @@ * @param override what to do when the file already exists * @throws FileNotFoundException if the specified file does not exist. */ - public PackFile(File baseDir, File src, String target, List osList, int override) + public PackFile(File baseDir, File src, String target, List osList, int override) throws FileNotFoundException { this(src, computeRelativePathFrom(baseDir, src), target, osList, override, null); @@ -109,7 +111,7 @@ * @param additionals additional attributes * @throws FileNotFoundException if the specified file does not exist. */ - public PackFile(File src, String relativeSourcePath, String target, List osList, int override, Map additionals) + public PackFile(File src, String relativeSourcePath, String target, List osList, int override, Map additionals) throws FileNotFoundException { if (!src.exists()) // allows cleaner client co @@ -142,7 +144,7 @@ * @param additionals additional attributes * @throws FileNotFoundException if the specified file does not exist. */ - public PackFile(File baseDir, File src, String target, List osList, int override, Map additionals) + public PackFile(File baseDir, File src, String target, List osList, int override, Map additionals) throws FileNotFoundException { this(src, computeRelativePathFrom(baseDir, src), target, osList, override, additionals); @@ -179,7 +181,7 @@ } /** The target operating system constraints of this file */ - public final List osConstraints() + public final List osConstraints() { return osConstraints; } Index: src/lib/com/izforge/izpack/UpdateCheck.java =================================================================== --- src/lib/com/izforge/izpack/UpdateCheck.java (revision 2050) +++ src/lib/com/izforge/izpack/UpdateCheck.java Fri Feb 22 14:20:30 GMT 2008 @@ -37,12 +37,12 @@ /** * ant-fileset-like list of include patterns, based on INSTALL_PATH if relative */ - public ArrayList includesList = null; + public ArrayList includesList = null; /** * ant-fileset-like list of exclude patterns, based on INSTALL_PATH if relative */ - public ArrayList excludesList = null; + public ArrayList excludesList = null; /** Whether pattern matching is performed case-sensitive */ boolean caseSensitive = true; @@ -58,7 +58,7 @@ * @param includes The patterns to include in the check. * @param excludes The patterns to exclude from the check. */ - public UpdateCheck(ArrayList includes, ArrayList excludes) + public UpdateCheck(ArrayList includes, ArrayList excludes) { this.includesList = includes; this.excludesList = excludes; @@ -71,7 +71,7 @@ * @param excludes The patterns to exclude from the check. * @param casesensitive If "yes", matches are performed case sensitive. */ - public UpdateCheck(ArrayList includes, ArrayList excludes, String casesensitive) + public UpdateCheck(ArrayList includes, ArrayList excludes, String casesensitive) { this.includesList = includes; this.excludesList = excludes; Index: src/lib/com/izforge/izpack/Pack.java =================================================================== --- src/lib/com/izforge/izpack/Pack.java (revision 2050) +++ src/lib/com/izforge/izpack/Pack.java Fri Feb 22 14:20:30 GMT 2008 @@ -27,6 +27,7 @@ import java.util.Set; import com.izforge.izpack.compiler.PackInfo; +import com.izforge.izpack.util.OsConstraint; /** * Represents a Pack. @@ -58,7 +59,7 @@ * different pack collections to be selected, for example: minimal, * default, all. */ - public Set installGroups = new HashSet(); + public Set installGroups = new HashSet(); /** All packs in the same excludeGroup are mutually exclusive. The excludeGroup * is a string and serves are key identifying each group of mutually @@ -76,16 +77,16 @@ public String description; /** The target operation system of this pack */ - public List osConstraints = null; + public List osConstraints = null; /** Condition for this pack **/ private String condition; /** The list of packs this pack depends on */ - public List dependencies = null; + public List dependencies = null; /** Reverse dependencies(childs) */ - public List revDependencies = null; + public List revDependencies = null; /** True if the pack is required. */ public boolean required; @@ -128,7 +129,7 @@ * @param excludegroup associated exclude group * @param uninstall If true, pack must be uninstalled. */ - public Pack(String name, String id, String description, List osConstraints, List dependencies, + public Pack(String name, String id, String description, List osConstraints, List dependencies, boolean required, boolean preselected, boolean loose, String excludegroup, boolean uninstall) { this.name = name; @@ -159,7 +160,7 @@ /** getter method for dependencies * @return the dependencies list*/ - public List getDependencies() + public List getDependencies() { return dependencies; } @@ -173,7 +174,7 @@ */ public void addRevDep(String name0) { - if (revDependencies == null) revDependencies = new ArrayList(); + if (revDependencies == null) revDependencies = new ArrayList(); revDependencies.add(name0); } @@ -189,10 +190,10 @@ String name0; for (int i = 0; i < dependencies.size() - 1; i++) { - name0 = (String) dependencies.get(i); + name0 = dependencies.get(i); text += name0 + ","; } - name0 = (String) dependencies.get(dependencies.size() - 1); + name0 = dependencies.get(dependencies.size() - 1); text += name0; return text; Index: src/lib/com/izforge/izpack/installer/ConditionHistoryTableCellRenderer.java =================================================================== --- src/lib/com/izforge/izpack/installer/ConditionHistoryTableCellRenderer.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/ConditionHistoryTableCellRenderer.java Fri Feb 22 14:20:30 GMT 2008 @@ -39,9 +39,9 @@ public class ConditionHistoryTableCellRenderer extends DefaultTableCellRenderer { private static final long serialVersionUID = 6779914244548965230L; - private Map conditionhistory; + private Map conditionhistory; - public ConditionHistoryTableCellRenderer(Map conditionhistory) { + public ConditionHistoryTableCellRenderer(Map conditionhistory) { this.conditionhistory = conditionhistory; } @@ -73,9 +73,9 @@ } public void clearState() { - for (Iterator iterator = conditionhistory.keySet().iterator(); iterator.hasNext();) + for (Iterator iterator = conditionhistory.keySet().iterator(); iterator.hasNext();) { - ConditionHistory ch = (ConditionHistory) conditionhistory.get(iterator.next()); + ConditionHistory ch = conditionhistory.get(iterator.next()); ch.clearState(); } } Index: src/lib/net/n3/nanoxml/XIncludeXMLBuilder.java =================================================================== --- src/lib/net/n3/nanoxml/XIncludeXMLBuilder.java (revision 2050) +++ src/lib/net/n3/nanoxml/XIncludeXMLBuilder.java Fri Feb 22 14:20:30 GMT 2008 @@ -108,7 +108,7 @@ private void processXInclude(final XMLElement element) { if (INCLUDE_ELEMENT.equals(element.getName())) { - Vector fallbackChildren = element.getChildrenNamed(FALLBACK_ELEMENT); + Vector fallbackChildren = element.getChildrenNamed(FALLBACK_ELEMENT); if (element.getChildrenCount() != fallbackChildren.size() || fallbackChildren.size() > 1) { throw new RuntimeException(new XMLParseException( @@ -168,11 +168,11 @@ * @return a reader for the fallback */ private IXMLReader handleFallback(XMLElement include) { - Vector fallbackChildren = include.getChildrenNamed(FALLBACK_ELEMENT); + Vector fallbackChildren = include.getChildrenNamed(FALLBACK_ELEMENT); if (fallbackChildren.size() == 1) { // process fallback - XMLElement fallback = (XMLElement) fallbackChildren.get(0); + XMLElement fallback = fallbackChildren.get(0); // fallback element can only contain a CDATA so it will not have // its content in un-named children String content = fallback.getContent(); @@ -206,7 +206,7 @@ private void includeXML(final XMLElement element, IXMLReader reader) { try { - Stack stack = getStack(); + Stack stack = getStack(); // set up a new parser to parse the include file. StdXMLParser parser = new StdXMLParser(); parser.setBuilder(XMLBuilderFactory.createXMLBuilder()); @@ -220,7 +220,7 @@ if (stack.isEmpty()) { setRootElement(childroot); } else { - XMLElement parent = (XMLElement) stack.peek(); + XMLElement parent = stack.peek(); // remove the include element from its parent parent.removeChild(element); @@ -262,7 +262,7 @@ "xpointer cannot be used with parse='text'")); } - Stack stack = getStack(); + Stack stack = getStack(); if (stack.isEmpty()) { throw new RuntimeException(new XMLParseException( element.getSystemID(), @@ -271,7 +271,7 @@ } // remove the include element from the parent - XMLElement parent = (XMLElement)stack.peek(); + XMLElement parent = stack.peek(); parent.removeChild(element); StringBuffer buffer = new StringBuffer(); try { Index: src/lib/com/izforge/izpack/XPackFile.java =================================================================== --- src/lib/com/izforge/izpack/XPackFile.java (revision 2050) +++ src/lib/com/izforge/izpack/XPackFile.java Fri Feb 22 14:20:30 GMT 2008 @@ -23,6 +23,7 @@ import java.util.Map; import com.izforge.izpack.PackFile; +import com.izforge.izpack.util.OsConstraint; /** * Extends the packfile by the information at which file position an entry is stored @@ -42,7 +43,7 @@ * @param override * @throws FileNotFoundException */ - public XPackFile(File baseDir, File src, String target, List osList, int override) + public XPackFile(File baseDir, File src, String target, List osList, int override) throws FileNotFoundException { super(baseDir, src, target, osList, override); @@ -57,7 +58,7 @@ * @param additionals * @throws FileNotFoundException */ - public XPackFile(File baseDir, File src, String target, List osList, int override, Map additionals) + public XPackFile(File baseDir, File src, String target, List osList, int override, Map additionals) throws FileNotFoundException { super(baseDir, src, target, osList, override, additionals); Index: src/lib/com/izforge/izpack/util/Log.java =================================================================== --- src/lib/com/izforge/izpack/util/Log.java (revision 2050) +++ src/lib/com/izforge/izpack/util/Log.java Fri Feb 22 14:20:29 GMT 2008 @@ -157,28 +157,28 @@ private AutomatedInstallData installData = null; /** The collection of installation messages */ - private ArrayList messages = new ArrayList(); + private ArrayList messages = new ArrayList(); /** The collection of warning messages */ - private ArrayList warnings = new ArrayList(); + private ArrayList warnings = new ArrayList(); /** The collection of error messages */ - private ArrayList errors = new ArrayList(); + private ArrayList errors = new ArrayList(); /** The collection of debug messages */ - private ArrayList debug = new ArrayList(); + private ArrayList debug = new ArrayList(); /** * The list of channels requested for debug output. A Vector must be used for * this purpose, since this is the only class that explicitly specifies that the * equals() method is used for determining if a particular object is contained. */ - private Vector channels = null; + private Vector channels = null; /** * This map keeps track of all channels that are recorded. It is used for information purposes. */ - private Hashtable recordedChannels = null; + private Hashtable recordedChannels = null; /** This flag signals if debug messages should be recorded */ private boolean debugActive = false; @@ -215,8 +215,8 @@ // ---------------------------------------------------- // get the list of debug channels requested // ---------------------------------------------------- - recordedChannels = new Hashtable(); - channels = new Vector(); + recordedChannels = new Hashtable(); + channels = new Vector(); temp = System.getProperty(CHANNEL_LIST); if ((temp != null) && (temp.toUpperCase().equals("ON"))) { @@ -705,7 +705,7 @@ /*--------------------------------------------------------------------------*/ private String buildMessage(int index) { - Record record = (Record) messages.get(index); + Record record = messages.get(index); StringBuffer message = new StringBuffer(); // ---------------------------------------------------- @@ -739,7 +739,7 @@ /*--------------------------------------------------------------------------*/ private String buildWarning(int index) { - Record record = (Record) warnings.get(index); + Record record = warnings.get(index); StringBuffer message = new StringBuffer(); // ---------------------------------------------------- @@ -783,7 +783,7 @@ /*--------------------------------------------------------------------------*/ private String buildError(int index) { - Record record = (Record) errors.get(index); + Record record = errors.get(index); StringBuffer message = new StringBuffer(); // ---------------------------------------------------- @@ -825,7 +825,7 @@ /*--------------------------------------------------------------------------*/ private String buildDebug(int index) { - Record record = (Record) debug.get(index); + Record record = debug.get(index); return (buildDebug(record)); } @@ -882,7 +882,7 @@ System.out.println("The following debug channels did record messages:"); System.out.println(); - Enumeration list = recordedChannels.keys(); + Enumeration list = recordedChannels.keys(); while (list.hasMoreElements()) { Index: src/lib/com/izforge/izpack/installer/WebRepositoryAccessor.java =================================================================== --- src/lib/com/izforge/izpack/installer/WebRepositoryAccessor.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/WebRepositoryAccessor.java Fri Feb 22 14:20:29 GMT 2008 @@ -57,7 +57,7 @@ private String packsInfo; /** list of PackInfo entries */ - private ArrayList packs; + private ArrayList packs; /** Constant for checking attributes. */ private static boolean YES = true; @@ -91,7 +91,7 @@ * * @return the packs list */ - public ArrayList getOnlinePacks() + public ArrayList getOnlinePacks() { readConfig(); packs = parsePacks(); @@ -166,7 +166,7 @@ * * @return the list of packs */ - private ArrayList parsePacks() + private ArrayList parsePacks() { try { @@ -200,7 +200,7 @@ for (int q = 0; q < root.getChildrenCount(); q++) { XMLElement ch = root.getChildAtIndex(q); - PackInfo pi = (PackInfo) packs.get(q); + PackInfo pi = packs.get(q); Pack p = pi.getPack(); p.nbytes = Long.parseLong(ch.getAttribute("nbytes")); } @@ -259,22 +259,22 @@ } - protected ArrayList loadPacksList(XMLElement data) throws CompilerException + protected ArrayList loadPacksList(XMLElement data) throws CompilerException { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); // Initialisation XMLElement root = requireChildNamed(data, "packs"); // at least one pack is required - Vector packElements = root.getChildrenNamed("pack"); + Vector packElements = root.getChildrenNamed("pack"); if (packElements.isEmpty()) parseError(root, " requires a "); - Iterator packIter = packElements.iterator(); + Iterator packIter = packElements.iterator(); while (packIter.hasNext()) { - XMLElement el = (XMLElement) packIter.next(); + XMLElement el = packIter.next(); // Trivial initialisations String name = requireAttribute(el, "name"); @@ -321,14 +321,14 @@ } // We get the parsables list - Iterator iter = el.getChildrenNamed("parsable").iterator(); + Iterator iter = el.getChildrenNamed("parsable").iterator(); while (iter.hasNext()) { - XMLElement p = (XMLElement) iter.next(); + XMLElement p = iter.next(); String target = requireAttribute(p, "targetfile"); String type = p.getAttribute("type", "plain"); String encoding = p.getAttribute("encoding", null); - List osList = OsConstraint.getOsList(p); // TODO: unverified + List osList = OsConstraint.getOsList(p); // TODO: unverified pack.addParsable(new ParsableFile(target, type, encoding, osList)); } @@ -337,7 +337,7 @@ iter = el.getChildrenNamed("executable").iterator(); while (iter.hasNext()) { - XMLElement e = (XMLElement) iter.next(); + XMLElement e = iter.next(); ExecutableFile executable = new ExecutableFile(); String val; // temp value @@ -374,10 +374,10 @@ XMLElement args = e.getFirstChildNamed("args"); if (null != args) { - Iterator argIterator = args.getChildrenNamed("arg").iterator(); + Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { - XMLElement arg = (XMLElement) argIterator.next(); + XMLElement arg = argIterator.next(); executable.argList.add(requireAttribute(arg, "value")); } } @@ -392,26 +392,26 @@ iter = el.getChildrenNamed("updatecheck").iterator(); while (iter.hasNext()) { - XMLElement f = (XMLElement) iter.next(); + XMLElement f = iter.next(); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes - ArrayList includesList = new ArrayList(); - ArrayList excludesList = new ArrayList(); + ArrayList includesList = new ArrayList(); + ArrayList excludesList = new ArrayList(); // get includes and excludes - Iterator include_it = f.getChildrenNamed("include").iterator(); + Iterator include_it = f.getChildrenNamed("include").iterator(); while (include_it.hasNext()) { - XMLElement inc_el = (XMLElement) include_it.next(); + XMLElement inc_el = include_it.next(); includesList.add(requireAttribute(inc_el, "name")); } - Iterator exclude_it = f.getChildrenNamed("exclude").iterator(); + Iterator exclude_it = f.getChildrenNamed("exclude").iterator(); while (exclude_it.hasNext()) { - XMLElement excl_el = (XMLElement) exclude_it.next(); + XMLElement excl_el = exclude_it.next(); excludesList.add(requireAttribute(excl_el, "name")); } @@ -421,7 +421,7 @@ iter = el.getChildrenNamed("depends").iterator(); while (iter.hasNext()) { - XMLElement dep = (XMLElement) iter.next(); + XMLElement dep = iter.next(); String depName = requireAttribute(dep, "packname"); pack.addDependency(depName); Index: src/lib/com/izforge/izpack/panels/SudoPanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/SudoPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/SudoPanel.java Fri Feb 22 14:20:30 GMT 2008 @@ -154,16 +154,16 @@ Properties vars = new Properties(); vars.put("password", pass); - List oses = new ArrayList(); + List oses = new ArrayList(); oses.add(new OsConstraint("unix", null, null, null)); - ArrayList plist = new ArrayList(); + ArrayList plist = new ArrayList(); ParsableFile pf = new ParsableFile(file.getAbsolutePath(), null, null, oses); plist.add(pf); ScriptParser sp = new ScriptParser(plist, new VariableSubstitutor(vars)); sp.parseFiles(); - ArrayList elist = new ArrayList(); + ArrayList elist = new ArrayList(); ExecutableFile ef = new ExecutableFile(file.getAbsolutePath(), ExecutableFile.POSTINSTALL, ExecutableFile.ABORT, oses, false); elist.add(ef); Index: src/lib/com/izforge/izpack/panels/PacksPanelAutomationHelper.java =================================================================== --- src/lib/com/izforge/izpack/panels/PacksPanelAutomationHelper.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/PacksPanelAutomationHelper.java Fri Feb 22 14:20:30 GMT 2008 @@ -50,7 +50,7 @@ // We add each pack to the panelRoot element for (int i = 0; i < idata.allPacks.size(); i++) { - Pack pack = (Pack) idata.allPacks.get(i); + Pack pack = idata.allPacks.get(i); XMLElement el = new XMLElement("pack"); el.setAttribute("index", Integer.toString(i)); el.setAttribute("name", pack.name); @@ -72,7 +72,7 @@ public boolean runAutomated(AutomatedInstallData idata, XMLElement panelRoot) { // We get the packs markups - Vector pm = panelRoot.getChildrenNamed("pack"); + Vector pm = panelRoot.getChildrenNamed("pack"); boolean result = true; @@ -81,7 +81,7 @@ idata.selectedPacks.clear(); for (int i = 0; i < size; i++) { - XMLElement el = (XMLElement) pm.get(i); + XMLElement el = pm.get(i); Boolean selected = Boolean.TRUE; // No longer needed. if (selected.booleanValue()) Index: src/lib/com/izforge/izpack/installer/AutomatedInstaller.java =================================================================== --- src/lib/com/izforge/izpack/installer/AutomatedInstaller.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/AutomatedInstaller.java Fri Feb 22 14:25:03 GMT 2008 @@ -66,7 +66,7 @@ // there are panels which can be instantiated multiple times // we therefore need to select the right XML section for each // instance - private TreeMap panelInstanceCount; + private TreeMap panelInstanceCount; /** The automated installation data. */ private AutomatedInstallData idata = new AutomatedInstallData(); @@ -104,7 +104,7 @@ // Load custom langpack if exist. addCustomLangpack(this.idata); - this.panelInstanceCount = new TreeMap(); + this.panelInstanceCount = new TreeMap(); } @@ -171,14 +171,14 @@ // Do not "kill" the installation if there is a problem // with custom uninstall data. Therefore log it to Debug, // but do not throw. - Map additionalData = udata.getAdditionalData(); + Map additionalData = udata.getAdditionalData(); if (additionalData != null && !additionalData.isEmpty()) { - Iterator keys = additionalData.keySet().iterator(); - HashSet exist = new HashSet(); + Iterator keys = additionalData.keySet().iterator(); + HashSet exist = new HashSet(); while (keys != null && keys.hasNext()) { - String key = (String) keys.next(); + String key = keys.next(); Object contents = additionalData.get(key); if ("__uninstallLibs__".equals(key)) { @@ -207,7 +207,7 @@ // First we create a new ArrayList which contains only // the full paths for the uninstall listener self; thats // the first entry of each sub ArrayList. - ArrayList subContents = new ArrayList(); + ArrayList subContents = new ArrayList(); // Secound put the class into uninstaller.jar Iterator listenerIter = ((List) contents).iterator(); @@ -222,10 +222,10 @@ // remind it for later. if (customData.listenerName != null) subContents.add(customData.listenerName); - Iterator liClaIter = customData.contents.iterator(); + Iterator liClaIter = customData.contents.iterator(); while (liClaIter.hasNext()) { - String contentPath = (String) liClaIter.next(); + String contentPath = liClaIter.next(); if (exist.contains(contentPath)) continue; exist.add(contentPath); try @@ -338,14 +338,14 @@ String panelClassName = p.className; String automationHelperClassName = praefix + panelClassName + "AutomationHelper"; - Class automationHelperClass = null; + Class automationHelperClass = null; Debug.log( "AutomationHelper:" + automationHelperClassName ); // determine if the panel supports automated install try { - automationHelperClass = Class.forName(automationHelperClassName); + automationHelperClass = (Class) Class.forName(automationHelperClassName); } catch (ClassNotFoundException e) @@ -362,7 +362,7 @@ try { Debug.log( "Instantiate :" + automationHelperClassName ); - automationHelperInstance = (PanelAutomation) automationHelperClass + automationHelperInstance = automationHelperClass .newInstance(); } catch (Exception e) @@ -374,16 +374,16 @@ } // We get the panels root xml markup - Vector panelRoots = this.idata.xmlData.getChildrenNamed(panelClassName); + Vector panelRoots = this.idata.xmlData.getChildrenNamed(panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey(panelClassName)) { // get number of panel instance to process - panelRootNo = ((Integer) this.panelInstanceCount.get(panelClassName)).intValue(); + panelRootNo = (this.panelInstanceCount.get(panelClassName)).intValue(); } - XMLElement panelRoot = (XMLElement) panelRoots.elementAt(panelRootNo); + XMLElement panelRoot = panelRoots.elementAt(panelRootNo); this.panelInstanceCount.put(panelClassName, new Integer(panelRootNo + 1)); Index: src/lib/com/izforge/izpack/util/LibraryRemover.java =================================================================== --- src/lib/com/izforge/izpack/util/LibraryRemover.java (revision 2050) +++ src/lib/com/izforge/izpack/util/LibraryRemover.java Fri Feb 22 14:20:30 GMT 2008 @@ -122,7 +122,7 @@ * @param temporaryFileNames * @throws IOException */ - public static void invoke(List temporaryFileNames) throws IOException + public static void invoke(List temporaryFileNames) throws IOException { LibraryRemover self = new LibraryRemover(1); self.invoke1(temporaryFileNames); @@ -160,7 +160,7 @@ * @param temporaryFileNames list of paths of the files which should be removed * @throws IOException */ - private void invoke1(List temporaryFileNames) throws IOException + private void invoke1(List temporaryFileNames) throws IOException { // Initialize sandbox and log file to be unique, but similarly named while (true) @@ -208,10 +208,10 @@ // We write a file which contains the paths to remove. out = new BufferedOutputStream(new FileOutputStream(specFile)); BufferedWriter specWriter = new BufferedWriter(new OutputStreamWriter(out)); - Iterator iter = temporaryFileNames.iterator(); + Iterator iter = temporaryFileNames.iterator(); while (iter.hasNext()) { - specWriter.write((String) iter.next()); + specWriter.write(iter.next()); if (iter.hasNext()) specWriter.newLine(); } specWriter.flush(); @@ -230,10 +230,10 @@ * @return The files list. * @exception Exception Description of the Exception */ - private ArrayList getFilesList() throws Exception + private ArrayList getFilesList() throws Exception { // Initialisations - TreeSet files = new TreeSet(Collections.reverseOrder()); + TreeSet files = new TreeSet(Collections.reverseOrder()); InputStream in = new FileInputStream(specFile); InputStreamReader inReader = new InputStreamReader(in); BufferedReader reader = new BufferedReader(inReader); @@ -247,7 +247,7 @@ } in.close(); // We return it - return new ArrayList(files); + return new ArrayList(files); } /** @@ -266,14 +266,14 @@ catch (Exception x) {} - ArrayList files = getFilesList(); + ArrayList files = getFilesList(); int size = files.size(); // We destroy the files log("deleteing temporary dlls/shls"); for (int i = 0; i < size; i++) { - File file = (File) files.get(i); + File file = files.get(i); file.delete(); if (file.exists()) log(" deleting of " + file.getCanonicalPath() + " failed!!!"); Index: src/lib/com/izforge/izpack/installer/InstallerFrame.java =================================================================== --- src/lib/com/izforge/izpack/installer/InstallerFrame.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/InstallerFrame.java Fri Feb 22 14:20:30 GMT 2008 @@ -182,12 +182,12 @@ /** * Mapping from "raw" panel number to visible panel number. */ - protected ArrayList visiblePanelMapping; + protected ArrayList visiblePanelMapping; /** * Registered GUICreationListener. */ - protected ArrayList guiListener; + protected ArrayList guiListener; /** * Heading major text. @@ -233,7 +233,7 @@ */ private static final String CUSTOM_ICONS_RESOURCEFILE = "customicons.xml"; - private Map dynamicvariables; + private Map dynamicvariables; private VariableSubstitutor substitutor; @@ -251,8 +251,8 @@ { super(title); substitutor = new VariableSubstitutor(installdata.variables); - guiListener = new ArrayList(); - visiblePanelMapping = new ArrayList(); + guiListener = new ArrayList(); + visiblePanelMapping = new ArrayList(); this.installdata = installdata; this.langpack = installdata.langpack; @@ -282,10 +282,10 @@ private void refreshDynamicVariables() { if (dynamicvariables != null) { - Iterator iter = dynamicvariables.keySet().iterator(); + Iterator iter = dynamicvariables.keySet().iterator(); while (iter.hasNext()) { - String dynvarname = (String) iter.next(); - DynamicVariable dynvar = (DynamicVariable) dynamicvariables.get(dynvarname); + String dynvarname = iter.next(); + DynamicVariable dynvar = dynamicvariables.get(dynvarname); boolean refresh = false; if (dynvar.getConditionid() != null) { if ((rules != null) && rules.isConditionTrue(dynvar.getConditionid())) { @@ -309,7 +309,7 @@ try { InputStream in = InstallerFrame.class.getResourceAsStream("/dynvariables"); ObjectInputStream objIn = new ObjectInputStream(in); - dynamicvariables = (Map) objIn.readObject(); + dynamicvariables = (Map) objIn.readObject(); objIn.close(); } catch (Exception e) { @@ -451,11 +451,11 @@ XMLElement data = (XMLElement) parser.parse(); // We load the icons - Vector children = data.getChildrenNamed("icon"); + Vector children = data.getChildrenNamed("icon"); int size = children.size(); for (int i = 0; i < size; i++) { - icon = (XMLElement) children.get(i); + icon = children.get(i); url = InstallerFrame.class.getResource(icon.getAttribute("res")); img = new ImageIcon(url); icons.put(icon.getAttribute("id"), img); @@ -466,7 +466,7 @@ size = children.size(); for (int i = 0; i < size; i++) { - icon = (XMLElement) children.get(i); + icon = children.get(i); url = InstallerFrame.class.getResource(icon.getAttribute("res")); img = new ImageIcon(url); UIManager.put(icon.getAttribute("id"), img); @@ -503,10 +503,10 @@ XMLElement data = (XMLElement) parser.parse(); // We load the icons - Vector children = data.getChildrenNamed("icon"); + Vector children = data.getChildrenNamed("icon"); int size = children.size(); for (int i = 0; i < size; i++) { - icon = (XMLElement) children.get(i); + icon = children.get(i); url = InstallerFrame.class.getResource(icon.getAttribute("res")); img = new ImageIcon(url); Debug.trace("Icon with id found: " + icon.getAttribute("id")); @@ -517,7 +517,7 @@ children = data.getChildrenNamed("sysicon"); size = children.size(); for (int i = 0; i < size; i++) { - icon = (XMLElement) children.get(i); + icon = children.get(i); url = InstallerFrame.class.getResource(icon.getAttribute("res")); img = new ImageIcon(url); UIManager.put(icon.getAttribute("id"), img); @@ -557,7 +557,7 @@ // We put the first panel installdata.curPanelNumber = 0; - IzPanel panel_0 = (IzPanel) installdata.panels.get(0); + IzPanel panel_0 = installdata.panels.get(0); panelsContainer.add(panel_0); // We add the navigation buttons & labels @@ -598,7 +598,7 @@ debugger = new Debugger(installdata,icons,rules); JPanel debugpanel = debugger.getDebugPanel(); if (installdata.guiPrefs.modifier.containsKey("showDebugWindow")) { - if (Boolean.valueOf((String) installdata.guiPrefs.modifier.get("showDebugWindow")).booleanValue()) { + if (Boolean.valueOf(installdata.guiPrefs.modifier.get("showDebugWindow")).booleanValue()) { JFrame debugframe = new JFrame("Debug information"); debugframe.setContentPane(debugpanel); debugframe.setSize(new Dimension(400,400)); @@ -643,9 +643,9 @@ private void callGUIListener(int what, Object param) { - Iterator iter = guiListener.iterator(); + Iterator iter = guiListener.iterator(); while (iter.hasNext()) - ((GUIListener) iter.next()).guiActionPerformed(what, param); + (iter.next()).guiActionPerformed(what, param); } private ImageIcon loadIcon(String resPrefix, int PanelNo, boolean tryBaseIcon) @@ -821,8 +821,8 @@ isBack = true; } panelsContainer.setVisible(false); - IzPanel panel = (IzPanel) installdata.panels.get(installdata.curPanelNumber); - IzPanel l_panel = (IzPanel) installdata.panels.get(last); + IzPanel panel = installdata.panels.get(installdata.curPanelNumber); + IzPanel l_panel = installdata.panels.get(last); if (Debug.isTRACE()) { debugger.switchPanel(panel.getMetadata(),l_panel.getMetadata()); } @@ -837,7 +837,7 @@ // writing out that script. // l_panel.makeXMLData(installdata.xmlData.getChildAtIndex(last)); // No previos button in the first visible panel - if (((Integer) visiblePanelMapping.get(installdata.curPanelNumber)).intValue() == 0) + if ((visiblePanelMapping.get(installdata.curPanelNumber)).intValue() == 0) { prevButton.setVisible(false); lockPrevButton(); @@ -845,7 +845,7 @@ // panel } // Only the exit button in the last panel. - else if (((Integer) visiblePanelMapping.get(installdata.panels.size())).intValue() == installdata.curPanelNumber) + else if ((visiblePanelMapping.get(installdata.panels.size())).intValue() == installdata.curPanelNumber) { prevButton.setVisible(false); nextButton.setVisible(false); @@ -934,12 +934,12 @@ Panel metadata = panel.getMetadata(); if ((metadata != null) && (!"UNKNOWN".equals(metadata.getPanelid()))) { - loadAndShowImage(((Integer) visiblePanelMapping.get(installdata.curPanelNumber)) + loadAndShowImage((visiblePanelMapping.get(installdata.curPanelNumber)) .intValue(), metadata.getPanelid()); } else { - loadAndShowImage(((Integer) visiblePanelMapping.get(installdata.curPanelNumber)) + loadAndShowImage((visiblePanelMapping.get(installdata.curPanelNumber)) .intValue()); } isBack = false; @@ -1050,14 +1050,14 @@ // Do not "kill" the installation if there is a problem // with custom uninstall data. Therefore log it to Debug, // but do not throw. - Map additionalData = udata.getAdditionalData(); + Map additionalData = udata.getAdditionalData(); if (additionalData != null && !additionalData.isEmpty()) { - Iterator keys = additionalData.keySet().iterator(); - HashSet exist = new HashSet(); + Iterator keys = additionalData.keySet().iterator(); + HashSet exist = new HashSet(); while (keys != null && keys.hasNext()) { - String key = (String) keys.next(); + String key = keys.next(); Object contents = additionalData.get(key); if ("__uninstallLibs__".equals(key)) { @@ -1086,7 +1086,7 @@ // First we create a new ArrayList which contains only // the full paths for the uninstall listener self; thats // the first entry of each sub ArrayList. - ArrayList subContents = new ArrayList(); + ArrayList subContents = new ArrayList(); // Secound put the class into uninstaller.jar Iterator listenerIter = ((List) contents).iterator(); @@ -1101,10 +1101,10 @@ // remind it for later. if (customData.listenerName != null) subContents.add(customData.listenerName); - Iterator liClaIter = customData.contents.iterator(); + Iterator liClaIter = customData.contents.iterator(); while (liClaIter.hasNext()) { - String contentPath = (String) liClaIter.next(); + String contentPath = liClaIter.next(); if (exist.contains(contentPath)) continue; exist.add(contentPath); try @@ -1304,7 +1304,7 @@ */ protected void wipeAborted() { - Iterator it; + Iterator it; // We set interrupt to all running Unpacker and wait 40 sec for maximum. // If interrupt is discarded (return value false), return immediately: @@ -1316,7 +1316,7 @@ if (!it.hasNext()) return; while (it.hasNext()) { - String p = (String) it.next(); + String p = it.next(); File f = new File(p); f.delete(); } @@ -1369,7 +1369,7 @@ // writer.write(root); for (int i = 0; i < installdata.panels.size(); i++) { - IzPanel panel = (IzPanel) installdata.panels.get(i); + IzPanel panel = installdata.panels.get(i); panel.makeXMLData(installdata.xmlData.getChildAtIndex(i)); } writer.write(installdata.xmlData); @@ -1394,7 +1394,7 @@ */ public void setQuitButtonIcon(String iconName) { - String useButtonIcons = (String) installdata.guiPrefs.modifier.get("useButtonIcons"); + String useButtonIcons = installdata.guiPrefs.modifier.get("useButtonIcons"); if (useButtonIcons == null || "yes".equalsIgnoreCase(useButtonIcons)) { @@ -1508,7 +1508,7 @@ public boolean canShow(int panelnumber) { - IzPanel panel = (IzPanel) installdata.panels.get(panelnumber); + IzPanel panel = installdata.panels.get(panelnumber); Panel panelmetadata = panel.getMetadata(); String panelid = panelmetadata.getPanelid(); Debug.trace("Current Panel: " + panelid); @@ -1550,7 +1550,7 @@ // We must trasfer all fields into the variables before // panelconditions try to resolve the rules based on unassigned vars. boolean isValid = - ((IzPanel) installdata.panels.get(last)).isValidated(); + (installdata.panels.get(last)).isValidated(); // if this is not here, validation will // occur mutilple times while skipping panels through the recursion @@ -1688,7 +1688,7 @@ * * @return the gui creation listener list */ - public List getGuiListener() + public List getGuiListener() { return guiListener; } @@ -1716,7 +1716,7 @@ // start Color foreground = null; if (installdata.guiPrefs.modifier.containsKey("headingForegroundColor")){ - foreground = Color.decode((String) installdata.guiPrefs.modifier + foreground = Color.decode(installdata.guiPrefs.modifier .get("headingForegroundColor")); headingLabels[0].setForeground(foreground); } @@ -1724,7 +1724,7 @@ if (installdata.guiPrefs.modifier.containsKey("headingFontSize")) { - float fontSize = Float.parseFloat((String) installdata.guiPrefs.modifier + float fontSize = Float.parseFloat(installdata.guiPrefs.modifier .get("headingFontSize")); if (fontSize > 0.0 && fontSize <= 5.0) { @@ -1747,13 +1747,13 @@ int i; String counterPos = "inHeading"; if (installdata.guiPrefs.modifier.containsKey("headingPanelCounterPos")) - counterPos = (String) installdata.guiPrefs.modifier.get("headingPanelCounterPos"); + counterPos = installdata.guiPrefs.modifier.get("headingPanelCounterPos"); // Do not create counter if it should be in the heading, but no heading should be used. if (leftHeadingPanel == null && "inHeading".equalsIgnoreCase(counterPos)) return; if (installdata.guiPrefs.modifier.containsKey("headingPanelCounter")) { headingCounterComponent = null; - if ("progressbar".equalsIgnoreCase((String) installdata.guiPrefs.modifier + if ("progressbar".equalsIgnoreCase(installdata.guiPrefs.modifier .get("headingPanelCounter"))) { JProgressBar headingProgressBar = new JProgressBar(); @@ -1762,7 +1762,7 @@ headingProgressBar.setValue(0); headingCounterComponent = headingProgressBar; } - else if ("text".equalsIgnoreCase((String) installdata.guiPrefs.modifier + else if ("text".equalsIgnoreCase(installdata.guiPrefs.modifier .get("headingPanelCounter"))) { JLabel headingCountPanels = new JLabel(" "); @@ -1773,7 +1773,7 @@ // start Color foreground = null; if (installdata.guiPrefs.modifier.containsKey("headingForegroundColor")){ - foreground = Color.decode((String) installdata.guiPrefs.modifier + foreground = Color.decode(installdata.guiPrefs.modifier .get("headingForegroundColor")); headingCountPanels.setForeground(foreground); } @@ -1820,7 +1820,7 @@ int borderSize = 8; if (installdata.guiPrefs.modifier.containsKey("headingImageBorderSize")) { - borderSize = Integer.parseInt((String) installdata.guiPrefs.modifier + borderSize = Integer.parseInt(installdata.guiPrefs.modifier .get("headingImageBorderSize")); } imgPanel.setBorder(BorderFactory.createEmptyBorder(borderSize, borderSize, borderSize, borderSize)); @@ -1841,13 +1841,13 @@ // The number of lines can be determined in the config xml file. // The first is the header, additonals are descriptions for the header. if (installdata.guiPrefs.modifier.containsKey("headingLineCount")) - headingLines = Integer.parseInt((String) installdata.guiPrefs.modifier + headingLines = Integer.parseInt(installdata.guiPrefs.modifier .get("headingLineCount")); Color back = null; int i = 0; // It is possible to determine the used background color of the heading panel. if (installdata.guiPrefs.modifier.containsKey("headingBackgroundColor")) - back = Color.decode((String) installdata.guiPrefs.modifier + back = Color.decode(installdata.guiPrefs.modifier .get("headingBackgroundColor")); // Try to create counter if no heading should be used. if (!isHeading(null)) @@ -1902,7 +1902,7 @@ public boolean isHeading(IzPanel caller) { if (!installdata.guiPrefs.modifier.containsKey("useHeadingPanel") - || !((String) installdata.guiPrefs.modifier.get("useHeadingPanel")) + || !(installdata.guiPrefs.modifier.get("useHeadingPanel")) .equalsIgnoreCase("yes")) return (false); if (caller == null) return (true); return (caller.getI18nStringForClass("headline", null) != null); @@ -1914,7 +1914,7 @@ int i; int headingLines = 1; if (installdata.guiPrefs.modifier.containsKey("headingLineCount")) - headingLines = Integer.parseInt((String) installdata.guiPrefs.modifier + headingLines = Integer.parseInt(installdata.guiPrefs.modifier .get("headingLineCount")); if (headingLabels == null) return; @@ -1941,7 +1941,7 @@ // Do not forgett the first headline. headingLabels[0].setText(headline); headingLabels[0].setVisible(true); - int curPanelNo = ((Integer) visiblePanelMapping.get(installdata.curPanelNumber)).intValue(); + int curPanelNo = (visiblePanelMapping.get(installdata.curPanelNumber)).intValue(); if (headingLabels[headingLines] != null) { loadAndShowImage(headingLabels[headingLines], HEADING_ICON_RESOURCE, curPanelNo); @@ -1955,9 +1955,9 @@ { if (headingCounterComponent != null) { - int curPanelNo = ((Integer) visiblePanelMapping.get(installdata.curPanelNumber)) + int curPanelNo = (visiblePanelMapping.get(installdata.curPanelNumber)) .intValue(); - int visPanelsCount = ((Integer) visiblePanelMapping.get(((Integer) visiblePanelMapping + int visPanelsCount = (visiblePanelMapping.get((visiblePanelMapping .get(installdata.panels.size())).intValue())).intValue(); StringBuffer buf = new StringBuffer(); Index: src/lib/com/izforge/izpack/panels/UserInputPanelAutomationHelper.java =================================================================== --- src/lib/com/izforge/izpack/panels/UserInputPanelAutomationHelper.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/UserInputPanelAutomationHelper.java Fri Feb 22 14:20:30 GMT 2008 @@ -58,7 +58,7 @@ // ------------------------------------------------------ // String-String key-value pairs // ------------------------------------------------------ - private Map entries; + private Map entries; /** * Default constructor, used during automated installation. @@ -72,7 +72,7 @@ * * @param entries String-String key-value pairs representing the state of the Panel */ - public UserInputPanelAutomationHelper(Map entries) + public UserInputPanelAutomationHelper(Map entries) { this.entries = entries; } @@ -97,11 +97,11 @@ // ---------------------------------------------------- // add all entries // ---------------------------------------------------- - Iterator keys = this.entries.keySet().iterator(); + Iterator keys = this.entries.keySet().iterator(); while (keys.hasNext()) { - String key = (String) keys.next(); - String value = (String) this.entries.get(key); + String key = keys.next(); + String value = this.entries.get(key); dataElement = new XMLElement(AUTO_KEY_ENTRY); dataElement.setAttribute(AUTO_ATTRIBUTE_KEY, key); @@ -133,7 +133,7 @@ if (userInput == null) { return false; } - Vector userEntries = userInput.getChildrenNamed(AUTO_KEY_ENTRY); + Vector userEntries = userInput.getChildrenNamed(AUTO_KEY_ENTRY); if (userEntries == null) { return false; } @@ -143,7 +143,7 @@ // ---------------------------------------------------- for (int i = 0; i < userEntries.size(); i++) { - dataElement = (XMLElement) userEntries.elementAt(i); + dataElement = userEntries.elementAt(i); variable = dataElement.getAttribute(AUTO_ATTRIBUTE_KEY); value = dataElement.getAttribute(AUTO_ATTRIBUTE_VALUE); Index: src/lib/com/izforge/izpack/installer/Unpacker.java =================================================================== --- src/lib/com/izforge/izpack/installer/Unpacker.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/Unpacker.java Fri Feb 22 14:20:30 GMT 2008 @@ -80,9 +80,9 @@ // // Initialisations FileOutputStream out = null; - ArrayList parsables = new ArrayList(); - ArrayList executables = new ArrayList(); - ArrayList updatechecks = new ArrayList(); + ArrayList parsables = new ArrayList(); + ArrayList executables = new ArrayList(); + ArrayList updatechecks = new ArrayList(); List packs = idata.selectedPacks; int npacks = packs.size(); handler.startAction("Unpacking", npacks); @@ -377,7 +377,7 @@ String arg = null; for (int j = 0; j < ef.argList.size(); j++) { - arg = (String) ef.argList.get(j); + arg = ef.argList.get(j); arg = IoHelper.translatePath(arg, vs); ef.argList.set(j, arg); } Index: src/lib/com/izforge/izpack/panels/HelloPanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/HelloPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/HelloPanel.java Fri Feb 22 14:20:29 GMT 2008 @@ -94,7 +94,7 @@ // to create a paragraph gap which is configurable. add(IzPanelLayout.createParagraphGap()); - ArrayList authors = idata.info.getAuthors(); + ArrayList authors = idata.info.getAuthors(); int size = authors.size(); if (size > 0) { @@ -115,7 +115,7 @@ JLabel label; for (int i = 0; i < size; i++) { - Info.Author a = (Info.Author) authors.get(i); + Info.Author a = authors.get(i); String email = (a.getEmail() != null && a.getEmail().length() > 0) ? (" <" + a.getEmail() + ">") : ""; label = LabelFactory.create(" - " + a.getName() + email, parent.icons Index: src/lib/com/izforge/izpack/event/RegistryInstallerListener.java =================================================================== --- src/lib/com/izforge/izpack/event/RegistryInstallerListener.java (revision 2050) +++ src/lib/com/izforge/izpack/event/RegistryInstallerListener.java Fri Feb 22 14:20:30 GMT 2008 @@ -241,14 +241,14 @@ rh.setValue(keypath, name, value); return; } - Vector values = regEntry.getChildrenNamed(REG_MULTI); + Vector values = regEntry.getChildrenNamed(REG_MULTI); if (values != null && !values.isEmpty()) { // Value type is REG_MULTI_SZ; placeholder possible. - Iterator multiIter = values.iterator(); + Iterator multiIter = values.iterator(); String[] multiString = new String[values.size()]; for (int i = 0; multiIter.hasNext(); ++i) { - XMLElement element = (XMLElement) multiIter.next(); + XMLElement element = multiIter.next(); multiString[i] = specHelper.getRequiredAttribute(element, REG_DATA); multiString[i] = substitutor.substitute(multiString[i], null); } @@ -259,12 +259,12 @@ if (values != null && !values.isEmpty()) { // Value type is REG_BINARY; placeholder possible or not ??? why not // ... - Iterator multiIter = values.iterator(); + Iterator multiIter = values.iterator(); StringBuffer buf = new StringBuffer(); for (int i = 0; multiIter.hasNext(); ++i) { - XMLElement element = (XMLElement) multiIter.next(); + XMLElement element = multiIter.next(); String tmp = specHelper.getRequiredAttribute(element, REG_DATA); buf.append(tmp); if (!tmp.endsWith(",") && multiIter.hasNext()) buf.append(","); @@ -329,7 +329,7 @@ throws Exception { String root1 = substitutor.substitute(root, null); - Integer tmp = (Integer) RegistryHandler.ROOT_KEY_MAP.get(root1); + Integer tmp = RegistryHandler.ROOT_KEY_MAP.get(root1); if (tmp != null) return (tmp.intValue()); getSpecHelper().parseError(regEntry, "Unknown value (" + root1 + ")for registry root."); return 0; Index: src/lib/com/izforge/izpack/ant/ConfigHolder.java =================================================================== --- src/lib/com/izforge/izpack/ant/ConfigHolder.java (revision 2050) +++ src/lib/com/izforge/izpack/ant/ConfigHolder.java Fri Feb 22 14:20:30 GMT 2008 @@ -62,7 +62,7 @@ * @exception BuildException if the string contains an opening @{ without a * closing } */ - static void parseCompileProperties(String value, Vector fragments, Vector propertyRefs) + static void parseCompileProperties(String value, Vector fragments, Vector propertyRefs) throws BuildException { int prev = 0; @@ -144,21 +144,21 @@ public void addText(String rawText) { // Locate the @{x} references - Vector fragments = new Vector(); - Vector propertyRefs = new Vector(); + Vector fragments = new Vector(); + Vector propertyRefs = new Vector(); parseCompileProperties(rawText, fragments, propertyRefs); // Replace the references with the project property value StringBuffer sb = new StringBuffer(); - Enumeration i = fragments.elements(); - Enumeration j = propertyRefs.elements(); + Enumeration i = fragments.elements(); + Enumeration j = propertyRefs.elements(); while (i.hasMoreElements()) { - String fragment = (String) i.nextElement(); + String fragment = i.nextElement(); if (fragment == null) { - String propertyName = (String) j.nextElement(); + String propertyName = j.nextElement(); Object replacement = null; // try to get it from the project Index: src/lib/com/coi/tools/os/win/NativeLibException.java =================================================================== --- src/lib/com/coi/tools/os/win/NativeLibException.java (revision 2050) +++ src/lib/com/coi/tools/os/win/NativeLibException.java Fri Feb 22 14:20:30 GMT 2008 @@ -41,7 +41,7 @@ private static final long serialVersionUID = 3257002172494721080L; /** Map of founded resource bundles which contains the localized error messages. */ - private final static HashMap messageResourceBundles = new HashMap(); + private final static HashMap messageResourceBundles = new HashMap(); /** Internal error as number. */ private int libErr; @@ -56,7 +56,7 @@ private String osErrString; /** Additional arguments. */ - private ArrayList args = new ArrayList(); + private ArrayList args = new ArrayList(); static { @@ -248,7 +248,7 @@ * * @return the internal argument list */ - public ArrayList getArguments() + public ArrayList getArguments() { return (args); } @@ -263,7 +263,7 @@ for (int i = 0; i < args.size(); ++i) { String key = "{" + Integer.toString(i) + "}"; - msg = replaceString(msg, key, (String) args.get(i)); + msg = replaceString(msg, key, args.get(i)); } return (msg); } @@ -277,12 +277,12 @@ private String getMsg(String s) { - Iterator it = messageResourceBundles.values().iterator(); + Iterator it = messageResourceBundles.values().iterator(); while (it.hasNext()) { try { - return (((ResourceBundle) it.next()).getString(s)); + return ((it.next()).getString(s)); } catch (MissingResourceException missingresourceexception) { // do not throw, else look in next bundle. Index: src/lib/com/izforge/izpack/event/ActionBase.java =================================================================== --- src/lib/com/izforge/izpack/event/ActionBase.java (revision 2050) +++ src/lib/com/izforge/izpack/event/ActionBase.java Fri Feb 22 14:20:30 GMT 2008 @@ -147,9 +147,9 @@ public static final String ASKFALSE = "askfalse"; - private static final HashSet installOrders = new HashSet(); + private static final HashSet installOrders = new HashSet(); - private static final HashSet uninstallOrders = new HashSet(); + private static final HashSet uninstallOrders = new HashSet(); protected String uninstallOrder = ActionBase.BEFOREDELETION; Index: src/lib/com/izforge/izpack/util/Housekeeper.java =================================================================== --- src/lib/com/izforge/izpack/util/Housekeeper.java (revision 2050) +++ src/lib/com/izforge/izpack/util/Housekeeper.java Fri Feb 22 14:20:30 GMT 2008 @@ -46,7 +46,7 @@ // ------------------------------------------------------------------------ private static Housekeeper me = null; - private Vector cleanupClients = new Vector(); + private Vector cleanupClients = new Vector(); /*--------------------------------------------------------------------------*/ /** @@ -109,7 +109,7 @@ { try { - ((CleanupClient) cleanupClients.elementAt(i)).cleanUp(); + (cleanupClients.elementAt(i)).cleanUp(); } catch (Throwable exception) { Index: src/lib/com/izforge/izpack/panels/PasswordGroup.java =================================================================== --- src/lib/com/izforge/izpack/panels/PasswordGroup.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/PasswordGroup.java Fri Feb 22 14:20:30 GMT 2008 @@ -45,9 +45,9 @@ // ------------------------------------------------------------------------ // Variable Declarations // ------------------------------------------------------------------------ - private Vector fields = new Vector(); + private Vector fields = new Vector(); - private List validatorContainers = null; + private List validatorContainers = null; // private Validator validator = null; // private boolean hasParams = false; // private Map validatorParams = null; @@ -66,7 +66,7 @@ * @param processor the processor */ /*--------------------------------------------------------------------------*/ - public PasswordGroup(InstallData idata, List validatorContainers, String processor) + public PasswordGroup(InstallData idata, List validatorContainers, String processor) { // ---------------------------------------------------- // attempt to create an instance of the Validator @@ -134,7 +134,7 @@ throw (new IndexOutOfBoundsException()); } - String contents = new String(((JPasswordField) fields.elementAt(index)).getPassword()); + String contents = new String((fields.elementAt(index)).getPassword()); return (contents); } @@ -220,7 +220,7 @@ ValidatorContainer container = null; try { - container = (ValidatorContainer) validatorContainers.get(i); + container = validatorContainers.get(i); } catch (Exception e) { container = null; @@ -251,14 +251,14 @@ return returnValue; } - public Map getValidatorParams() + public Map getValidatorParams() { return getValidatorParams(currentValidator); } - public Map getValidatorParams(int i) + public Map getValidatorParams(int i) { - Map returnValue = null; + Map returnValue = null; try { ValidatorContainer container = getValidatorContainer(i); @@ -301,7 +301,7 @@ if (fields.size() > 0) { - contents = new String(((JPasswordField) fields.elementAt(0)).getPassword()); + contents = new String((fields.elementAt(0)).getPassword()); } return (contents); Index: src/lib/com/izforge/izpack/installer/UninstallData.java =================================================================== --- src/lib/com/izforge/izpack/installer/UninstallData.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/UninstallData.java Fri Feb 22 14:20:30 GMT 2008 @@ -37,7 +37,7 @@ private static UninstallData instance = null; /** The installed files list. */ - private List installedFilesList; + private List installedFilesList; /** The uninstallable files list. */ private List uninstallableFilesList; @@ -52,7 +52,7 @@ private String uninstallerPath; /** Additional uninstall data like uninstaller listener list. */ - private Map additionalData; + private Map additionalData; /** Filesmap which should removed by the root user for another user */ private String rootScript; @@ -60,10 +60,10 @@ /** The constructor. */ private UninstallData() { - installedFilesList = new ArrayList(); + installedFilesList = new ArrayList(); uninstallableFilesList = new ArrayList(); executablesList = new ArrayList(); - additionalData = new HashMap(); + additionalData = new HashMap(); rootScript = ""; } @@ -100,7 +100,7 @@ * * @return The installed files list. */ - public List getInstalledFilesList() + public List getInstalledFilesList() { return installedFilesList; } @@ -180,7 +180,7 @@ * * @return additional uninstall data */ - public Map getAdditionalData() + public Map getAdditionalData() { return additionalData; } Index: src/lib/com/coi/tools/os/win/AccessControlList.java =================================================================== --- src/lib/com/coi/tools/os/win/AccessControlList.java (revision 2050) +++ src/lib/com/coi/tools/os/win/AccessControlList.java Fri Feb 22 14:20:30 GMT 2008 @@ -38,7 +38,7 @@ * Required (serializable) */ private static final long serialVersionUID = -5350586385078554562L; - private ArrayList permissions = new ArrayList(); + private ArrayList permissions = new ArrayList(); /** * Default constructor. @@ -69,7 +69,7 @@ */ public AccessControlEntry getACE(int num) { - return ((AccessControlEntry) (((AccessControlEntry) permissions.get(num)).clone())); + return ((AccessControlEntry) ((permissions.get(num)).clone())); } /** Index: src/lib/com/izforge/izpack/installer/IzPanel.java =================================================================== --- src/lib/com/izforge/izpack/installer/IzPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/IzPanel.java Fri Feb 22 14:20:30 GMT 2008 @@ -858,7 +858,7 @@ String caption; if (parent.isHeading(this) && idata.guiPrefs.modifier.containsKey("useHeadingForSummary") - && ((String) idata.guiPrefs.modifier.get("useHeadingForSummary")) + && (idata.guiPrefs.modifier.get("useHeadingForSummary")) .equalsIgnoreCase("yes")) { caption = getI18nStringForClass("headline", this.getClass().getName()); Index: src/lib/com/izforge/izpack/util/os/unix/UnixUsers.java =================================================================== --- src/lib/com/izforge/izpack/util/os/unix/UnixUsers.java (revision 2050) +++ src/lib/com/izforge/izpack/util/os/unix/UnixUsers.java Fri Feb 22 14:20:30 GMT 2008 @@ -56,9 +56,9 @@ * * @return an UnixUsers arraylist of these users */ - public ArrayList getUsersWithValidShells() + public ArrayList getUsersWithValidShells() { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); for (int idx = 0; idx < size(); idx++) { @@ -78,15 +78,15 @@ * * @return an UnixUsers Arraylist of these users */ - public ArrayList getUsersWithValidShellsAndExistingHomes() + public ArrayList getUsersWithValidShellsAndExistingHomes() { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); - ArrayList usersWithValidShells = getUsersWithValidShells(); + ArrayList usersWithValidShells = getUsersWithValidShells(); for (int idx = 0; idx < usersWithValidShells.size(); idx++) { - UnixUser user = (UnixUser) usersWithValidShells.get(idx); + UnixUser user = usersWithValidShells.get(idx); if ((user.getHome() != null) && new File(user.getHome().trim()).exists()) { @@ -107,11 +107,11 @@ { ArrayList result = new ArrayList(); - ArrayList usersWithValidShellsAndExistingHomes = getUsersWithValidShellsAndExistingHomes(); + ArrayList usersWithValidShellsAndExistingHomes = getUsersWithValidShellsAndExistingHomes(); for (int idx = 0; idx < usersWithValidShellsAndExistingHomes.size(); idx++) { - UnixUser user = (UnixUser) usersWithValidShellsAndExistingHomes.get(idx); + UnixUser user = usersWithValidShellsAndExistingHomes.get(idx); if ((user.getHome() != null) && new File(user.getHome().trim() + File.separator + "Desktop").exists()) @@ -128,9 +128,9 @@ * * @return the Stringlist of ValidUsersDesktopFolders */ - public ArrayList getValidUsersDesktopFolders() + public ArrayList getValidUsersDesktopFolders() { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); ArrayList validUserDesktops = getUsersWithValidShellsExistingHomesAndDesktops(); @@ -171,11 +171,11 @@ * * @param anUsersArrayList an Users ArrayList reded from /etc/passwd */ - private void fromUsersArrayList(ArrayList anUsersArrayList) + private void fromUsersArrayList(ArrayList anUsersArrayList) { for (int idx = 0; idx < anUsersArrayList.size(); idx++) { - add(new UnixUser().fromEtcPasswdLine((String) anUsersArrayList.get(idx))); + add(new UnixUser().fromEtcPasswdLine(anUsersArrayList.get(idx))); } } @@ -184,14 +184,14 @@ * * @return the UserNames extracted from the getEtcPasswdArray() */ - public static ArrayList getEtcPasswdUsersAsArrayList() + public static ArrayList getEtcPasswdUsersAsArrayList() { - ArrayList result = new ArrayList(); - ArrayList etcPasswdArray = UnixHelper.getEtcPasswdArray(); + ArrayList result = new ArrayList(); + ArrayList etcPasswdArray = UnixHelper.getEtcPasswdArray(); for (int idx = 0; idx < etcPasswdArray.size(); idx++) { - String line = (String) etcPasswdArray.get(idx); + String line = etcPasswdArray.get(idx); result.add(line); } @@ -203,7 +203,7 @@ * * @return the UserNames extracted from the getEtcPasswdArray() */ - public static ArrayList getYpPasswdUsersAsArrayList() + public static ArrayList getYpPasswdUsersAsArrayList() { return UnixHelper.getYpPasswdArray(); } @@ -215,13 +215,13 @@ */ public static String getUsersColonString() { - ArrayList usersArrayList = getEtcPasswdUsersAsArrayList(); + ArrayList usersArrayList = getEtcPasswdUsersAsArrayList(); String retValue = ""; for (int user = 0; user < usersArrayList.size(); user++) { - String userline = (String) usersArrayList.get(user); + String userline = usersArrayList.get(user); retValue += (userline.substring(0, userline.indexOf(":")) + ":"); } Index: src/lib/com/izforge/izpack/compiler/IPackager.java =================================================================== --- src/lib/com/izforge/izpack/compiler/IPackager.java (revision 2050) +++ src/lib/com/izforge/izpack/compiler/IPackager.java Fri Feb 22 14:20:30 GMT 2008 @@ -30,6 +30,7 @@ import com.izforge.izpack.GUIPrefs; import com.izforge.izpack.Info; import com.izforge.izpack.Panel; +import com.izforge.izpack.rules.Condition; import com.izforge.izpack.compressor.PackCompressor; /** @@ -110,7 +111,7 @@ /** * Gets the packages list */ - public abstract List getPacksList(); + public abstract List getPacksList(); /** * Adds a language pack. @@ -156,7 +157,7 @@ * nested within another. * @param files to be copied */ - public abstract void addJarContent(URL jarURL, List files); + public abstract void addJarContent(URL jarURL, List files); /** * Marks a native library to be added to the uninstaller. @@ -187,22 +188,22 @@ /** * @return the rules */ - public abstract Map getRules(); + public abstract Map getRules(); /** * @param rules the rules to set */ - public abstract void setRules(Map rules); + public abstract void setRules(Map rules); /** * Returns a map of dynamically refreshed variables * @return the map */ - public abstract Map getDynamicVariables(); + public abstract Map getDynamicVariables(); /** * * @param dynamicvariables */ - public abstract void setDynamicVariables(Map dynamicvariables); + public abstract void setDynamicVariables(Map dynamicvariables); } Index: src/lib/com/izforge/izpack/event/SimpleInstallerListener.java =================================================================== --- src/lib/com/izforge/izpack/event/SimpleInstallerListener.java (revision 2050) +++ src/lib/com/izforge/izpack/event/SimpleInstallerListener.java Fri Feb 22 14:20:30 GMT 2008 @@ -47,7 +47,7 @@ public class SimpleInstallerListener implements InstallerListener { - private static ArrayList progressBarCaller = new ArrayList(); + private static ArrayList progressBarCaller = new ArrayList(); /** The name of the XML file that specifies the panel langpack */ protected static final String LANG_FILE_NAME = "CustomActionsLang.xml"; Index: src/lib/com/izforge/izpack/panels/InstallationGroupPanelAutomationHelper.java =================================================================== --- src/lib/com/izforge/izpack/panels/InstallationGroupPanelAutomationHelper.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/InstallationGroupPanelAutomationHelper.java Fri Feb 22 14:20:30 GMT 2008 @@ -54,10 +54,10 @@ GroupData gd = rows[n]; XMLElement xgroup = new XMLElement("group"); xgroup.setAttribute("name", gd.name); - Iterator names = gd.packNames.iterator(); + Iterator names = gd.packNames.iterator(); while( names.hasNext() ) { - String name = (String) names.next(); + String name = names.next(); Pack pack = (Pack) packsByName.get(name); int index = idata.availablePacks.indexOf(pack); XMLElement xpack = new XMLElement("pack"); @@ -80,22 +80,22 @@ Debug.trace("InstallationGroupPanelAutomationHelper: runAutomated, INSTALL_GROUP: "+installGroup); if( installGroup != null ) { - Vector groups = panelRoot.getChildrenNamed("group"); + Vector groups = panelRoot.getChildrenNamed("group"); for(int i = 0; i < groups.size(); i ++) { - XMLElement group = (XMLElement) groups.get(i); + XMLElement group = groups.get(i); String name = group.getAttribute("name"); Debug.trace("InstallationGroupPanelAutomationHelper: Checking INSTALL_GROUP against: "+name); if( name.equalsIgnoreCase(installGroup) ) { Debug.trace("Found INSTALL_GROUP match for: "+installGroup); idata.selectedPacks.clear(); - Vector packs = group.getChildrenNamed("pack"); + Vector packs = group.getChildrenNamed("pack"); Debug.trace(name+" pack count: "+packs.size()); Debug.trace("Available pack count: "+idata.availablePacks.size()); for(int j = 0; j < packs.size(); j ++) { - XMLElement xpack = (XMLElement) packs.get(j); + XMLElement xpack = packs.get(j); String pname = xpack.getAttribute("name"); String indexStr = xpack.getAttribute("index"); int index = Integer.parseInt(indexStr); Index: src/lib/com/izforge/izpack/event/AntAction.java =================================================================== --- src/lib/com/izforge/izpack/event/AntAction.java (revision 2050) +++ src/lib/com/izforge/izpack/event/AntAction.java Fri Feb 22 14:20:30 GMT 2008 @@ -68,15 +68,15 @@ private Properties properties = null; - private List targets = null; + private List targets = null; - private List uninstallTargets = null; + private List uninstallTargets = null; private String logFile = null; private String buildFile = null; - private List propertyFiles = null; + private List propertyFiles = null; /** * Default constructor @@ -85,9 +85,9 @@ { super(); properties = new Properties(); - targets = new ArrayList(); - uninstallTargets = new ArrayList(); - propertyFiles = new ArrayList(); + targets = new ArrayList(); + uninstallTargets = new ArrayList(); + propertyFiles = new ArrayList(); } /** @@ -145,8 +145,8 @@ // TODO: propertyfiles, logFile antProj.fireBuildStarted(); antProj.init(); - List antcalls = new ArrayList(); - List choosenTargets = (uninstall) ? uninstallTargets : targets; + List antcalls = new ArrayList(); + List choosenTargets = (uninstall) ? uninstallTargets : targets; if (choosenTargets.size() > 0) { Ant antcall = null; @@ -154,7 +154,7 @@ { antcall = (Ant) antProj.createTask("ant"); antcall.setAntfile(getBuildFile()); - antcall.setTarget((String) choosenTargets.get(i)); + antcall.setTarget(choosenTargets.get(i)); antcalls.add(antcall); } } @@ -163,7 +163,7 @@ for (int i = 0; i < antcalls.size(); i++) { - target.addTask((Ant) antcalls.get(i)); + target.addTask(antcalls.get(i)); } antProj.addTarget(target); System.setOut(new PrintStream(new DemuxOutputStream(antProj, false))); @@ -223,7 +223,7 @@ * * @return the property file paths */ - public List getPropertyFiles() + public List getPropertyFiles() { return propertyFiles; } @@ -243,7 +243,7 @@ * * @param propertyFiles list of property file paths to be set */ - public void setPropertyFiles(List propertyFiles) + public void setPropertyFiles(List propertyFiles) { this.propertyFiles = propertyFiles; } @@ -315,7 +315,7 @@ * * @return the targets */ - public List getTargets() + public List getTargets() { return targets; } @@ -325,7 +325,7 @@ * * @param targets list of targets */ - public void setTargets(ArrayList targets) + public void setTargets(ArrayList targets) { this.targets = targets; } @@ -345,7 +345,7 @@ * * @return the uninstaller targets */ - public List getUninstallTargets() + public List getUninstallTargets() { return uninstallTargets; } @@ -355,7 +355,7 @@ * * @param targets list of targets */ - public void setUninstallTargets(ArrayList targets) + public void setUninstallTargets(ArrayList targets) { this.uninstallTargets = targets; } @@ -446,7 +446,7 @@ { for (int i = 0; i < propertyFiles.size(); i++) { - pf = new File((String) propertyFiles.get(i)); + pf = new File(propertyFiles.get(i)); if (pf.exists()) { fis = new FileInputStream(pf); Index: src/lib/com/izforge/izpack/installer/VariableHistory.java =================================================================== --- src/lib/com/izforge/izpack/installer/VariableHistory.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/VariableHistory.java Fri Feb 22 14:20:30 GMT 2008 @@ -32,14 +32,14 @@ public class VariableHistory { private String name; - private List values; + private List values; private boolean newvariable; private boolean changed; public VariableHistory(String variable) { name = variable; - values = new ArrayList(); + values = new ArrayList(); } @@ -75,7 +75,7 @@ } public String[] getValueComment(int index) { - return (String[]) values.get(index); + return values.get(index); } public int getValuesCount() { @@ -84,7 +84,7 @@ public String getLastValue() { if (values.size() > 0) { - String[] valuecomment = (String[]) values.get(values.size() - 1); + String[] valuecomment = values.get(values.size() - 1); return valuecomment[0]; } else { @@ -133,7 +133,7 @@ details.append(""); for (int i = values.size()-1; i >= 0; i--) { - String[] valuecomment = (String[]) values.get(i); + String[] valuecomment = values.get(i); details.append(i+1); details.append(". "); details.append(valuecomment[0]); Index: src/lib/com/izforge/izpack/installer/ScriptParser.java =================================================================== --- src/lib/com/izforge/izpack/installer/ScriptParser.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/ScriptParser.java Fri Feb 22 14:20:29 GMT 2008 @@ -84,7 +84,7 @@ /** The files to parse. */ - private Collection files; + private Collection files; /** The variables substituror. */ private VariableSubstitutor vs; @@ -96,7 +96,7 @@ * @param files the parsable files to process * @param vs the variable substitutor to use */ - public ScriptParser(Collection files, VariableSubstitutor vs) + public ScriptParser(Collection files, VariableSubstitutor vs) { this.files = files; this.vs = vs; @@ -110,14 +110,14 @@ public void parseFiles() throws Exception { // Parses the files - Iterator iter = files.iterator(); + Iterator iter = files.iterator(); while (iter.hasNext()) { // If interrupt is desired, return immediately. if (Unpacker.isInterruptDesired()) return; // Create a temporary file for the parsed data // (Use the same directory so that renaming works later) - ParsableFile pfile = (ParsableFile) iter.next(); + ParsableFile pfile = iter.next(); // check whether the OS matches if (!OsConstraint.oneMatchesCurrentSystem(pfile.osConstraints)) Index: src/lib/com/izforge/izpack/compiler/CompilerConfig.java =================================================================== --- src/lib/com/izforge/izpack/compiler/CompilerConfig.java (revision 2050) +++ src/lib/com/izforge/izpack/compiler/CompilerConfig.java Fri Feb 22 14:20:30 GMT 2008 @@ -128,7 +128,7 @@ /** * List of CompilerListeners which should be called at packaging */ - protected List compilerListeners = new ArrayList(); + protected List compilerListeners = new ArrayList(); /** * Set the IzPack home directory @@ -396,26 +396,26 @@ prefs.height = requireIntAttribute(gp, "height"); // Look and feel mappings - Iterator it = gp.getChildrenNamed("laf").iterator(); + Iterator it = gp.getChildrenNamed("laf").iterator(); while (it.hasNext()) { - XMLElement laf = (XMLElement) it.next(); + XMLElement laf = it.next(); String lafName = requireAttribute(laf, "name"); requireChildNamed(laf, "os"); - Iterator oit = laf.getChildrenNamed("os").iterator(); + Iterator oit = laf.getChildrenNamed("os").iterator(); while (oit.hasNext()) { - XMLElement os = (XMLElement) oit.next(); + XMLElement os = oit.next(); String osName = requireAttribute(os, "family"); prefs.lookAndFeelMapping.put(osName, lafName); } - Iterator pit = laf.getChildrenNamed("param").iterator(); - Map params = new TreeMap(); + Iterator pit = laf.getChildrenNamed("param").iterator(); + Map params = new TreeMap(); while (pit.hasNext()) { - XMLElement param = (XMLElement) pit.next(); + XMLElement param = pit.next(); String name = requireAttribute(param, "name"); String value = requireAttribute(param, "value"); params.put(name, value); @@ -426,7 +426,7 @@ it = gp.getChildrenNamed("modifier").iterator(); while (it.hasNext()) { - XMLElement curentModifier = (XMLElement) it.next(); + XMLElement curentModifier = it.next(); String key = requireAttribute(curentModifier, "key"); String value = requireAttribute(curentModifier, "value"); prefs.modifier.put(key, value); @@ -434,7 +434,7 @@ } // make sure jar contents of each are available in installer // map is easier to read/modify than if tree - HashMap lafMap = new HashMap(); + HashMap lafMap = new HashMap(); lafMap.put("liquid", "liquidlnf.jar"); lafMap.put("kunststoff", "kunststoff.jar"); lafMap.put("metouia", "metouia.jar"); @@ -447,11 +447,11 @@ // the /last/ lnf for an os which is used, so can't add during // initial // loop - Iterator kit = prefs.lookAndFeelMapping.keySet().iterator(); + Iterator kit = prefs.lookAndFeelMapping.keySet().iterator(); while (kit.hasNext()) { - String lafName = (String) prefs.lookAndFeelMapping.get(kit.next()); - String lafJarName = (String) lafMap.get(lafName); + String lafName = prefs.lookAndFeelMapping.get(kit.next()); + String lafJarName = lafMap.get(lafName); if (lafJarName == null) parseError(gp, "Unrecognized Look and Feel: " + lafName); URL lafJarURL = findIzPackResource("lib/" + lafJarName, "Look and Feel Jar file", @@ -471,10 +471,10 @@ protected void addJars(XMLElement data) throws Exception { notifyCompilerListener("addJars", CompilerListener.BEGIN, data); - Iterator iter = data.getChildrenNamed("jar").iterator(); + Iterator iter = data.getChildrenNamed("jar").iterator(); while (iter.hasNext()) { - XMLElement el = (XMLElement) iter.next(); + XMLElement el = iter.next(); String src = requireAttribute(el, "src"); URL url = findProjectResource(src, "Jar file", el); compiler.addJarContent(url); @@ -507,10 +507,10 @@ { boolean needAddOns = false; notifyCompilerListener("addNativeLibraries", CompilerListener.BEGIN, data); - Iterator iter = data.getChildrenNamed("native").iterator(); + Iterator iter = data.getChildrenNamed("native").iterator(); while (iter.hasNext()) { - XMLElement el = (XMLElement) iter.next(); + XMLElement el = iter.next(); String type = requireAttribute(el, "type"); String name = requireAttribute(el, "name"); String path = "bin/native/" + type + "/" + name; @@ -525,11 +525,11 @@ // observed // for the uninstaller. String stage = el.getAttribute("stage"); - List constraints = OsConstraint.getOsList(el); + List constraints = OsConstraint.getOsList(el); if (stage != null && ("both".equalsIgnoreCase(stage) || "uninstall".equalsIgnoreCase(stage))) { - ArrayList al = new ArrayList(); + ArrayList al = new ArrayList(); al.add(name); CustomData cad = new CustomData(null, al, constraints, CustomData.UNINSTALLER_LIB); compiler.addNativeUninstallerLibrary(cad); @@ -588,16 +588,16 @@ XMLElement root = requireChildNamed(data, "packs"); // at least one pack is required - Vector packElements = root.getChildrenNamed("pack"); - Vector refPackElements = root.getChildrenNamed("refpack"); + Vector packElements = root.getChildrenNamed("pack"); + Vector refPackElements = root.getChildrenNamed("refpack"); if (packElements.isEmpty() && refPackElements.isEmpty()) parseError(root, " requires a or "); File baseDir = new File(basedir); - Iterator packIter = packElements.iterator(); + Iterator packIter = packElements.iterator(); while (packIter.hasNext()) { - XMLElement el = (XMLElement) packIter.next(); + XMLElement el = packIter.next(); // Trivial initialisations String name = requireAttribute(el, "name"); @@ -653,14 +653,14 @@ } // We get the parsables list - Iterator iter = el.getChildrenNamed("parsable").iterator(); + Iterator iter = el.getChildrenNamed("parsable").iterator(); while (iter.hasNext()) { - XMLElement p = (XMLElement) iter.next(); + XMLElement p = iter.next(); String target = requireAttribute(p, "targetfile"); String type = p.getAttribute("type", "plain"); String encoding = p.getAttribute("encoding", null); - List osList = OsConstraint.getOsList(p); // TODO: unverified + List osList = OsConstraint.getOsList(p); // TODO: unverified String condition = p.getAttribute("condition"); ParsableFile parsable = new ParsableFile(target, type, encoding, osList); parsable.setCondition(condition); @@ -671,7 +671,7 @@ iter = el.getChildrenNamed("executable").iterator(); while (iter.hasNext()) { - XMLElement e = (XMLElement) iter.next(); + XMLElement e = iter.next(); ExecutableFile executable = new ExecutableFile(); String val; // temp value String condition = e.getAttribute("condition"); @@ -709,10 +709,10 @@ XMLElement args = e.getFirstChildNamed("args"); if (null != args) { - Iterator argIterator = args.getChildrenNamed("arg").iterator(); + Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { - XMLElement arg = (XMLElement) argIterator.next(); + XMLElement arg = argIterator.next(); executable.argList.add(requireAttribute(arg, "value")); } } @@ -727,10 +727,10 @@ iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { - XMLElement f = (XMLElement) iter.next(); + XMLElement f = iter.next(); String src = requireAttribute(f, "src"); String targetdir = requireAttribute(f, "targetdir"); - List osList = OsConstraint.getOsList(f); // TODO: unverified + List osList = OsConstraint.getOsList(f); // TODO: unverified int override = getOverrideValue(f); Map additionals = getAdditionals(f); boolean unpack = src.endsWith(".zip") && "true".equalsIgnoreCase(f.getAttribute("unpack")); @@ -756,10 +756,10 @@ iter = el.getChildrenNamed("singlefile").iterator(); while (iter.hasNext()) { - XMLElement f = (XMLElement) iter.next(); + XMLElement f = iter.next(); String src = requireAttribute(f, "src"); String target = requireAttribute(f, "target"); - List osList = OsConstraint.getOsList(f); // TODO: unverified + List osList = OsConstraint.getOsList(f); // TODO: unverified int override = getOverrideValue(f); Map additionals = getAdditionals(f); String condition = f.getAttribute("condition"); @@ -780,7 +780,7 @@ iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { - XMLElement f = (XMLElement) iter.next(); + XMLElement f = iter.next(); String dir_attr = requireAttribute(f, "dir"); File dir = new File(dir_attr); @@ -791,13 +791,13 @@ boolean casesensitive = validateYesNoAttribute(f, "casesensitive", YES); boolean defexcludes = validateYesNoAttribute(f, "defaultexcludes", YES); String targetdir = requireAttribute(f, "targetdir"); - List osList = OsConstraint.getOsList(f); // TODO: unverified + List osList = OsConstraint.getOsList(f); // TODO: unverified int override = getOverrideValue(f); Map additionals = getAdditionals(f); String condition = f.getAttribute("condition"); // get includes and excludes - Vector xcludesList = null; + Vector xcludesList = null; String[] includes = null; xcludesList = f.getChildrenNamed("include"); if (!xcludesList.isEmpty()) @@ -805,7 +805,7 @@ includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { - XMLElement xclude = (XMLElement) xcludesList.get(j); + XMLElement xclude = xcludesList.get(j); includes[j] = requireAttribute(xclude, "name"); } } @@ -816,7 +816,7 @@ excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { - XMLElement xclude = (XMLElement) xcludesList.get(j); + XMLElement xclude = xcludesList.get(j); excludes[j] = requireAttribute(xclude, "name"); } } @@ -903,26 +903,26 @@ iter = el.getChildrenNamed("updatecheck").iterator(); while (iter.hasNext()) { - XMLElement f = (XMLElement) iter.next(); + XMLElement f = iter.next(); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes - ArrayList includesList = new ArrayList(); - ArrayList excludesList = new ArrayList(); + ArrayList includesList = new ArrayList(); + ArrayList excludesList = new ArrayList(); // get includes and excludes - Iterator include_it = f.getChildrenNamed("include").iterator(); + Iterator include_it = f.getChildrenNamed("include").iterator(); while (include_it.hasNext()) { - XMLElement inc_el = (XMLElement) include_it.next(); + XMLElement inc_el = include_it.next(); includesList.add(requireAttribute(inc_el, "name")); } - Iterator exclude_it = f.getChildrenNamed("exclude").iterator(); + Iterator exclude_it = f.getChildrenNamed("exclude").iterator(); while (exclude_it.hasNext()) { - XMLElement excl_el = (XMLElement) exclude_it.next(); + XMLElement excl_el = exclude_it.next(); excludesList.add(requireAttribute(excl_el, "name")); } @@ -932,7 +932,7 @@ iter = el.getChildrenNamed("depends").iterator(); while (iter.hasNext()) { - XMLElement dep = (XMLElement) iter.next(); + XMLElement dep = iter.next(); String depName = requireAttribute(dep, "packname"); pack.addDependency(depName); @@ -941,10 +941,10 @@ compiler.addPack(pack); } - Iterator refPackIter = refPackElements.iterator(); + Iterator refPackIter = refPackElements.iterator(); while (refPackIter.hasNext()) { - XMLElement el = (XMLElement) refPackIter.next(); + XMLElement el = refPackIter.next(); // get the name of reference xml file String refFileName = requireAttribute(el, "file"); @@ -1056,14 +1056,14 @@ * checks that no pack point to a non existent pack and also that there are no circular * dependencies in the packs. */ - public void checkDependencies(List packs) throws CompilerException + public void checkDependencies(List packs) throws CompilerException { // Because we use package names in the configuration file we assosiate // the names with the objects - Map names = new HashMap(); + Map names = new HashMap(); for (int i = 0; i < packs.size(); i++) { - PackInfo pack = (PackInfo) packs.get(i); + PackInfo pack = packs.get(i); names.put(pack.getPack().name, pack); } int result = dfs(packs, names); @@ -1081,12 +1081,12 @@ * @param packs The graph * @param names The name map */ - private int dfs(List packs, Map names) + private int dfs(List packs, Map names) { - Map edges = new HashMap(); + Map edges = new HashMap(); for (int i = 0; i < packs.size(); i++) { - PackInfo pack = (PackInfo) packs.get(i); + PackInfo pack = packs.get(i); if (pack.colour == PackInfo.WHITE) { if (dfsVisit(pack, names, edges) != 0) return -1; @@ -1099,13 +1099,13 @@ /** * This function checks for the existence of back edges. */ - private int checkBackEdges(Map edges) + private int checkBackEdges(Map edges) { - Set keys = edges.keySet(); - for (Iterator iterator = keys.iterator(); iterator.hasNext();) + Set keys = edges.keySet(); + for (Iterator iterator = keys.iterator(); iterator.hasNext();) { final Object key = iterator.next(); - int color = ((Integer) edges.get(key)).intValue(); + int color = (edges.get(key)).intValue(); if (color == PackInfo.GREY) { return -2; } } return 0; @@ -1129,16 +1129,16 @@ } } - private int dfsVisit(PackInfo u, Map names, Map edges) + private int dfsVisit(PackInfo u, Map names, Map edges) { u.colour = PackInfo.GREY; - List deps = u.getDependencies(); + List deps = u.getDependencies(); if (deps != null) { for (int i = 0; i < deps.size(); i++) { - String name = (String) deps.get(i); - PackInfo v = (PackInfo) names.get(name); + String name = deps.get(i); + PackInfo v = names.get(name); if (v == null) { System.out.println("Failed to find dependency: "+name); @@ -1169,7 +1169,7 @@ * @param additionals Map which contains additional data * @param condition */ - protected void addArchiveContent(File baseDir, File archive, String targetdir, List osList, int override, PackInfo pack, Map additionals, String condition) throws IOException { + protected void addArchiveContent(File baseDir, File archive, String targetdir, List osList, int override, PackInfo pack, Map additionals, String condition) throws IOException { FileInputStream fin = new FileInputStream(archive); ZipInputStream zin = new ZipInputStream(fin); @@ -1207,7 +1207,7 @@ * @param condition * @exception FileNotFoundException if the file does not exist */ - protected void addRecursively(File baseDir, File file, String targetdir, List osList, int override, + protected void addRecursively(File baseDir, File file, String targetdir, List osList, int override, PackInfo pack, Map additionals, String condition) throws IOException { String targetfile = targetdir + "/" + file.getName(); @@ -1239,14 +1239,14 @@ XMLElement root = requireChildNamed(data, "panels"); // at least one panel is required - Vector panels = root.getChildrenNamed("panel"); + Vector panels = root.getChildrenNamed("panel"); if (panels.isEmpty()) parseError(root, " requires a "); // We process each panel markup - Iterator iter = panels.iterator(); + Iterator iter = panels.iterator(); while (iter.hasNext()) { - XMLElement xmlPanel = (XMLElement) iter.next(); + XMLElement xmlPanel = iter.next(); // create the serialized Panel data Panel panel = new Panel(); @@ -1292,10 +1292,10 @@ if (root == null) return; // We process each res markup - Iterator iter = root.getChildrenNamed("res").iterator(); + Iterator iter = root.getChildrenNamed("res").iterator(); while (iter.hasNext()) { - XMLElement res = (XMLElement) iter.next(); + XMLElement res = iter.next(); String id = requireAttribute(res, "id"); String src = requireAttribute(res, "src"); // the parse attribute causes substitution to occur @@ -1411,14 +1411,14 @@ XMLElement root = requireChildNamed(data, "locale"); // at least one langpack is required - Vector locals = root.getChildrenNamed("langpack"); + Vector locals = root.getChildrenNamed("langpack"); if (locals.isEmpty()) parseError(root, " requires a "); // We process each langpack markup - Iterator iter = locals.iterator(); + Iterator iter = locals.iterator(); while (iter.hasNext()) { - XMLElement el = (XMLElement) iter.next(); + XMLElement el = iter.next(); String iso3 = requireAttribute(el, "iso3"); String path; @@ -1467,10 +1467,10 @@ XMLElement authors = root.getFirstChildNamed("authors"); if (authors != null) { - Iterator iter = authors.getChildrenNamed("author").iterator(); + Iterator iter = authors.getChildrenNamed("author").iterator(); while (iter.hasNext()) { - XMLElement author = (XMLElement) iter.next(); + XMLElement author = iter.next(); String name = requireAttribute(author, "name"); String email = requireAttribute(author, "email"); info.addAuthor(new Info.Author(name, email)); @@ -1560,10 +1560,10 @@ Properties variables = compiler.getVariables(); - Iterator iter = root.getChildrenNamed("variable").iterator(); + Iterator iter = root.getChildrenNamed("variable").iterator(); while (iter.hasNext()) { - XMLElement var = (XMLElement) iter.next(); + XMLElement var = iter.next(); String name = requireAttribute(var, "name"); String value = requireAttribute(var, "value"); if (variables.contains(name)) @@ -1580,12 +1580,12 @@ XMLElement root = data.getFirstChildNamed("dynamicvariables"); if (root == null) return; - Map dynamicvariables = compiler.getDynamicVariables(); + Map dynamicvariables = compiler.getDynamicVariables(); - Iterator iter = root.getChildrenNamed("variable").iterator(); + Iterator iter = root.getChildrenNamed("variable").iterator(); while (iter.hasNext()) { - XMLElement var = (XMLElement) iter.next(); + XMLElement var = iter.next(); String name = requireAttribute(var, "name"); String value = requireAttribute(var, "value"); String conditionid = var.getAttribute("condition"); @@ -1610,12 +1610,12 @@ notifyCompilerListener("addConditions", CompilerListener.BEGIN, data); // We get the condition list XMLElement root = data.getFirstChildNamed("conditions"); - Map conditions = compiler.getConditions(); + Map conditions = compiler.getConditions(); if (root != null) { - Iterator iter = root.getChildrenNamed("condition").iterator(); + Iterator iter = root.getChildrenNamed("condition").iterator(); while (iter.hasNext()) { - XMLElement conditionel = (XMLElement) iter.next(); + XMLElement conditionel = iter.next(); Condition condition = RulesEngine.analyzeCondition(conditionel); if (condition != null) { String conditionid = condition.getId(); @@ -1670,10 +1670,10 @@ if (root != null) { // add individual properties - Iterator iter = root.getChildrenNamed("property").iterator(); + Iterator iter = root.getChildrenNamed("property").iterator(); while (iter.hasNext()) { - XMLElement prop = (XMLElement) iter.next(); + XMLElement prop = iter.next(); Property property = new Property(prop, this); property.execute(); } @@ -2305,10 +2305,10 @@ // We get the listeners XMLElement root = data.getFirstChildNamed("listeners"); if (root == null) return; - Iterator iter = root.getChildrenNamed("listener").iterator(); + Iterator iter = root.getChildrenNamed("listener").iterator(); while (iter.hasNext()) { - XMLElement xmlAction = (XMLElement) iter.next(); + XMLElement xmlAction = iter.next(); Object[] listener = getCompilerListenerInstance(xmlAction); if (listener != null) addCompilerListener((CompilerListener) listener[0]); @@ -2325,7 +2325,7 @@ jarPath = compiler.replaceProperties(jarPath); if( jarPath == null ) jarPath = "bin/customActions/" + className + ".jar"; - List constraints = OsConstraint.getOsList(xmlAction); + List constraints = OsConstraint.getOsList(xmlAction); compiler.addCustomListener(types[i], className, jarPath, constraints); } } @@ -2341,11 +2341,11 @@ * @return full qualified paths of the contained files * @throws Exception */ - private List getContainedFilePaths(URL url) throws Exception + private List getContainedFilePaths(URL url) throws Exception { JarInputStream jis = new JarInputStream(url.openStream()); ZipEntry zentry = null; - ArrayList fullNames = new ArrayList(); + ArrayList fullNames = new ArrayList(); while ((zentry = jis.getNextEntry()) != null) { String name = zentry.getName(); @@ -2475,7 +2475,7 @@ if (!CompilerListener.class.isInstance(instance)) parseError(var, "'" + className + "' must be implemented " + CompilerListener.class.toString()); - List constraints = OsConstraint.getOsList(var); + List constraints = OsConstraint.getOsList(var); return (new Object[] { instance, className, constraints}); } @@ -2501,11 +2501,11 @@ private void notifyCompilerListener(String callerName, int state, XMLElement data) throws CompilerException { - Iterator i = compilerListeners.iterator(); + Iterator i = compilerListeners.iterator(); IPackager packager = compiler.getPackager(); while (i != null && i.hasNext()) { - CompilerListener listener = (CompilerListener) i.next(); + CompilerListener listener = i.next(); listener.notify(callerName, state, data, packager); } @@ -2519,13 +2519,13 @@ */ private Map getAdditionals(XMLElement f) throws CompilerException { - Iterator i = compilerListeners.iterator(); + Iterator i = compilerListeners.iterator(); Map retval = null; try { while (i != null && i.hasNext()) { - retval = ((CompilerListener) i.next()).reviseAdditionalDataMap(retval, f); + retval = (i.next()).reviseAdditionalDataMap(retval, f); } } catch (CompilerException ce) Index: src/lib/com/izforge/izpack/panels/PacksPanelBase.java =================================================================== --- src/lib/com/izforge/izpack/panels/PacksPanelBase.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/PacksPanelBase.java Fri Feb 22 14:20:30 GMT 2008 @@ -124,7 +124,7 @@ /** * Map that connects names with pack objects */ - private Map names; + private Map names; /** * The bytes of the current pack. @@ -312,7 +312,7 @@ if (dependencyArea != null) { Pack pack = (Pack) idata.availablePacks.get(i); - List dep = pack.dependencies; + List dep = pack.dependencies; String list = ""; if (dep != null) { @@ -321,8 +321,8 @@ } for (int j = 0; dep != null && j < dep.size(); j++) { - String name = (String) dep.get(j); - list += getI18NPackName((Pack) names.get(name)); + String name = dep.get(j); + list += getI18NPackName(names.get(name)); if (j != dep.size() - 1) list += ", "; } @@ -515,7 +515,7 @@ */ private void computePacks(List packs) { - names = new HashMap(); + names = new HashMap(); dependenciesExist = false; for (int i = 0; i < packs.size(); i++) { Index: src/lib/com/izforge/izpack/compressor/PackCompressorFactory.java =================================================================== --- src/lib/com/izforge/izpack/compressor/PackCompressorFactory.java (revision 2050) +++ src/lib/com/izforge/izpack/compressor/PackCompressorFactory.java Fri Feb 22 14:20:30 GMT 2008 @@ -47,7 +47,7 @@ * The keys are the symbolic names which are used for a particular * compression format. */ - private static HashMap typeMap = new HashMap(); + private static HashMap typeMap = new HashMap(); private static CompilerException ShitHappens = null; static @@ -144,7 +144,7 @@ throw new CompilerException( "No PackCompressor registered for the given symbol " + type + "."); - return((PackCompressor) typeMap.get(type)); + return(typeMap.get(type)); } /** Index: src/lib/com/izforge/izpack/CustomData.java =================================================================== --- src/lib/com/izforge/izpack/CustomData.java (revision 2050) +++ src/lib/com/izforge/izpack/CustomData.java Fri Feb 22 14:20:30 GMT 2008 @@ -21,6 +21,8 @@ package com.izforge.izpack; +import com.izforge.izpack.util.OsConstraint; + import java.io.Serializable; import java.util.List; @@ -54,7 +56,7 @@ * contained files are listed with it complete sub path. If it is a uninstaller native library, * this value is the path in the installer jar. */ - public List contents; + public List contents; /** * Full qualified name of the managed listener. If type is not a listener, this value is @@ -63,7 +65,7 @@ public String listenerName; /** The target operation system of this custom action */ - public List osConstraints = null; + public List osConstraints = null; /** * Type of this custom action data; possible are INSTALLER_LISTENER, UNINSTALLER_LISTENER, @@ -83,7 +85,7 @@ * @param osConstraints target operation system of this custom action * @param type type of this custom data */ - public CustomData(String listenerName, List contents, List osConstraints, int type) + public CustomData(String listenerName, List contents, List osConstraints, int type) { this.listenerName = listenerName; this.contents = contents; Index: src/lib/net/n3/nanoxml/XMLElement.java =================================================================== --- src/lib/net/n3/nanoxml/XMLElement.java (revision 2050) +++ src/lib/net/n3/nanoxml/XMLElement.java Fri Feb 22 14:20:30 GMT 2008 @@ -290,9 +290,9 @@ * * @return the non-null vector of child elements. */ - public Vector getChildrenNamed(String name) + public Vector getChildrenNamed(String name) { - Vector result = new Vector(this.children.size()); + Vector result = new Vector(this.children.size()); Enumeration enumeration = this.children.elements(); while (enumeration.hasMoreElements()) Index: src/lib/com/izforge/izpack/compiler/MultiVolumePackager.java =================================================================== --- src/lib/com/izforge/izpack/compiler/MultiVolumePackager.java (revision 2050) +++ src/lib/com/izforge/izpack/compiler/MultiVolumePackager.java Fri Feb 22 14:25:03 GMT 2008 @@ -194,7 +194,7 @@ ZipInputStream inJarStream = new ZipInputStream(is); // copy anything except the manifest.mf - List excludes = new ArrayList(); + List excludes = new ArrayList(); excludes.add("META-INF.MANIFEST.MF"); copyZipWithoutExcludes(inJarStream, primaryJarStream,excludes); @@ -269,14 +269,14 @@ { sendMsg("Copying " + installerResourceURLMap.size() + " files into installer"); - Iterator i = installerResourceURLMap.keySet().iterator(); + Iterator i = installerResourceURLMap.keySet().iterator(); while (i.hasNext()) { - String name = (String) i.next(); - InputStream in = ((URL) installerResourceURLMap.get(name)).openStream(); + String name = i.next(); + InputStream in = (installerResourceURLMap.get(name)).openStream(); org.apache.tools.zip.ZipEntry newEntry = new org.apache.tools.zip.ZipEntry(name); - long dateTime = FileUtil.getFileDateTime((URL) installerResourceURLMap.get(name)); + long dateTime = FileUtil.getFileDateTime(installerResourceURLMap.get(name)); if (dateTime != -1) newEntry.setTime(dateTime); primaryJarStream.putNextEntry(newEntry); @@ -292,13 +292,13 @@ { sendMsg("Merging " + includedJarURLs.size() + " jars into installer"); - Iterator i = includedJarURLs.iterator(); + Iterator i = includedJarURLs.iterator(); while (i.hasNext()) { - Object[] current = (Object[]) i.next(); + Object[] current = i.next(); InputStream is = ((URL) current[0]).openStream(); ZipInputStream inJarStream = new ZipInputStream(is); - copyZip(inJarStream, primaryJarStream, (List) current[1]); + copyZip(inJarStream, primaryJarStream, (List) current[1]); } } @@ -339,10 +339,10 @@ fout.setFirstvolumefreespacesize(extraspacel); int packNumber = 0; - Iterator packIter = packsList.iterator(); + Iterator packIter = packsList.iterator(); while (packIter.hasNext()) { - PackInfo packInfo = (PackInfo) packIter.next(); + PackInfo packInfo = packIter.next(); Pack pack = packInfo.getPack(); pack.nbytes = 0; @@ -457,10 +457,10 @@ out = new ObjectOutputStream(primaryJarStream); out.writeInt(packsList.size()); - Iterator i = packsList.iterator(); + Iterator i = packsList.iterator(); while (i.hasNext()) { - PackInfo pack = (PackInfo) i.next(); + PackInfo pack = i.next(); out.writeObject(pack.getPack()); } out.flush(); @@ -495,11 +495,11 @@ * * @see #copyStream(InputStream, OutputStream) */ - private void copyZip(ZipInputStream zin, ZipOutputStream out, List files) throws IOException + private void copyZip(ZipInputStream zin, ZipOutputStream out, List files) throws IOException { java.util.zip.ZipEntry zentry; - if (!alreadyWrittenFiles.containsKey(out)) alreadyWrittenFiles.put(out, new HashSet()); - HashSet currentSet = (HashSet) alreadyWrittenFiles.get(out); + if (!alreadyWrittenFiles.containsKey(out)) alreadyWrittenFiles.put(out, new HashSet()); + HashSet currentSet = alreadyWrittenFiles.get(out); while ((zentry = zin.getNextEntry()) != null) { String currentName = zentry.getName(); @@ -507,11 +507,11 @@ testName = testName.replace('\\', '.'); if (files != null) { - Iterator i = files.iterator(); + Iterator i = files.iterator(); boolean founded = false; while (i.hasNext()) { // Make "includes" self to support regex. - String doInclude = (String) i.next(); + String doInclude = i.next(); if (testName.matches(doInclude)) { founded = true; @@ -555,11 +555,11 @@ * * @see #copyStream(InputStream, OutputStream) */ - private void copyZipWithoutExcludes(ZipInputStream zin, ZipOutputStream out, List excludes) throws IOException + private void copyZipWithoutExcludes(ZipInputStream zin, ZipOutputStream out, List excludes) throws IOException { java.util.zip.ZipEntry zentry; - if (!alreadyWrittenFiles.containsKey(out)) alreadyWrittenFiles.put(out, new HashSet()); - HashSet currentSet = (HashSet) alreadyWrittenFiles.get(out); + if (!alreadyWrittenFiles.containsKey(out)) alreadyWrittenFiles.put(out, new HashSet()); + HashSet currentSet = alreadyWrittenFiles.get(out); while ((zentry = zin.getNextEntry()) != null) { String currentName = zentry.getName(); @@ -567,12 +567,12 @@ testName = testName.replace('\\', '.'); if (excludes != null) { - Iterator i = excludes.iterator(); + Iterator i = excludes.iterator(); boolean skip = false; while (i.hasNext()) { // Make "excludes" self to support regex. - String doExclude = (String) i.next(); + String doExclude = i.next(); if (testName.matches(doExclude)) { skip = true; Index: src/lib/com/izforge/izpack/compiler/PackagerBase.java =================================================================== --- src/lib/com/izforge/izpack/compiler/PackagerBase.java (revision 2050) +++ src/lib/com/izforge/izpack/compiler/PackagerBase.java Fri Feb 22 14:20:30 GMT 2008 @@ -24,6 +24,7 @@ import java.io.File; import java.io.IOException; +import java.io.FilterOutputStream; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; @@ -37,6 +38,7 @@ import com.izforge.izpack.GUIPrefs; import com.izforge.izpack.Info; import com.izforge.izpack.Panel; +import com.izforge.izpack.rules.Condition; import com.izforge.izpack.compressor.PackCompressor; import com.izforge.izpack.compressor.PackCompressorFactory; @@ -69,28 +71,28 @@ protected Properties variables = new Properties(); /** The ordered panels informations. */ - protected List panelList = new ArrayList(); + protected List panelList = new ArrayList(); /** The ordered packs informations (as PackInfo objects). */ - protected List packsList = new ArrayList(); + protected List packsList = new ArrayList(); /** The ordered langpack locale names. */ - protected List langpackNameList = new ArrayList(); + protected List langpackNameList = new ArrayList(); /** The ordered custom actions informations. */ - protected List customDataList = new ArrayList(); + protected List customDataList = new ArrayList(); /** The langpack URLs keyed by locale name (e.g. de_CH). */ - protected Map installerResourceURLMap = new HashMap(); + protected Map installerResourceURLMap = new HashMap(); /** the conditions */ - protected Map rules = new HashMap(); + protected Map rules = new HashMap(); /** dynamic variables */ - protected Map dynamicvariables = new HashMap(); + protected Map dynamicvariables = new HashMap(); /** Jar file URLs who's contents will be copied into the installer. */ - protected Set includedJarURLs = new HashSet(); + protected Set includedJarURLs = new HashSet(); /** Each pack is created in a separte jar if webDirURL is non-null. */ protected boolean packJarsSeparate = false; @@ -102,7 +104,7 @@ protected PackCompressor compressor; /** Files which are always written into the container file */ - protected HashMap alreadyWrittenFiles = new HashMap(); + protected HashMap> alreadyWrittenFiles = new HashMap>(); /** * Dispatches a message to the listeners. @@ -158,7 +160,7 @@ /* (non-Javadoc) * @see com.izforge.izpack.compiler.IPackager#addJarContent(java.net.URL, java.util.List) */ - public void addJarContent(URL jarURL, List files) + public void addJarContent(URL jarURL, List files) { Object [] cont = { jarURL, files }; sendMsg("Adding content of jar: " + jarURL.getFile(), PackagerListener.MSG_VERBOSE); @@ -244,7 +246,7 @@ /* (non-Javadoc) * @see com.izforge.izpack.compiler.IPackager#getPacksList() */ - public List getPacksList() + public List getPacksList() { return packsList; } @@ -301,7 +303,7 @@ /** * @return the rules */ - public Map getRules() + public Map getRules() { return this.rules; } @@ -310,7 +312,7 @@ /** * @param rules the rules to set */ - public void setRules(Map rules) + public void setRules(Map rules) { this.rules = rules; } @@ -347,7 +349,7 @@ /** * @return the dynamicvariables */ - public Map getDynamicVariables() + public Map getDynamicVariables() { return this.dynamicvariables; } @@ -356,7 +358,7 @@ /** * @param dynamicvariables the dynamicvariables to set */ - public void setDynamicVariables(Map dynamicvariables) + public void setDynamicVariables(Map dynamicvariables) { this.dynamicvariables = dynamicvariables; } Index: src/lib/com/izforge/izpack/panels/JDKPathPanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/JDKPathPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/JDKPathPanel.java Fri Feb 22 14:20:30 GMT 2008 @@ -70,7 +70,7 @@ private String variableName; - private Set badRegEntries = null; + private Set badRegEntries = null; @@ -203,7 +203,7 @@ String retval = ""; int oldVal = 0; RegistryHandler rh = null; - badRegEntries = new HashSet(); + badRegEntries = new HashSet(); try { // Get the default registry handler. Index: src/lib/com/izforge/izpack/installer/VariableHistoryTableModel.java =================================================================== --- src/lib/com/izforge/izpack/installer/VariableHistoryTableModel.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/VariableHistoryTableModel.java Fri Feb 22 14:20:30 GMT 2008 @@ -36,9 +36,9 @@ private static final long serialVersionUID = 5966543100431588652L; public static final String[] columnheader = {"Name","Value"}; - private Map variablevalues; + private Map variablevalues; - public VariableHistoryTableModel(Map values) { + public VariableHistoryTableModel(Map values) { this.variablevalues = values; } @@ -72,7 +72,7 @@ case 1: String variablename = (String) getValueAt(rowIndex, 0); - VariableHistory vh = (VariableHistory) variablevalues.get(variablename); + VariableHistory vh = variablevalues.get(variablename); return vh; } return null; Index: src/lib/com/izforge/izpack/util/SummaryProcessor.java =================================================================== --- src/lib/com/izforge/izpack/util/SummaryProcessor.java (revision 2050) +++ src/lib/com/izforge/izpack/util/SummaryProcessor.java Fri Feb 22 14:20:30 GMT 2008 @@ -72,12 +72,12 @@ */ public static String getSummary(AutomatedInstallData idata) { - Iterator iter = idata.panels.iterator(); + Iterator iter = idata.panels.iterator(); StringBuffer sb = new StringBuffer(2048); sb.append(HTML_HEADER); while (iter.hasNext()) { - IzPanel panel = (IzPanel) iter.next(); + IzPanel panel = iter.next(); String caption = panel.getSummaryCaption(); String msg = panel.getSummaryBody(); // If no caption or/and message, ignore it. Index: src/lib/net/n3/nanoxml/XMLParserFactory.java =================================================================== --- src/lib/net/n3/nanoxml/XMLParserFactory.java (revision 2050) +++ src/lib/net/n3/nanoxml/XMLParserFactory.java Fri Feb 22 14:27:36 GMT 2008 @@ -105,8 +105,8 @@ public static IXMLParser createXMLParser(String className, IXMLBuilder builder) throws ClassNotFoundException, InstantiationException, IllegalAccessException { - Class cls = Class.forName(className); - IXMLParser parser = (IXMLParser) cls.newInstance(); + Class cls = (Class) Class.forName(className); + IXMLParser parser = cls.newInstance(); parser.setBuilder(builder); parser.setValidator(new NonValidator()); return parser; Index: src/lib/com/izforge/izpack/uninstaller/SelfModifier.java =================================================================== --- src/lib/com/izforge/izpack/uninstaller/SelfModifier.java (revision 2050) +++ src/lib/com/izforge/izpack/uninstaller/SelfModifier.java Fri Feb 22 14:27:13 GMT 2008 @@ -42,9 +42,11 @@ import java.util.Date; import java.util.Enumeration; import java.util.jar.JarFile; +import java.util.jar.JarEntry; import java.util.zip.ZipEntry; import com.izforge.izpack.util.OsVersion; +import com.izforge.izpack.installer.MultiVolumeInstaller; /** * Allows an application to modify the jar file from which it came, including outright deletion. The @@ -376,7 +378,7 @@ sandbox = sandbox.getCanonicalFile(); logFile = logFile.getCanonicalFile(); - jarFile = findJarFile(method.getDeclaringClass()).getCanonicalFile(); + jarFile = findJarFile((Class) method.getDeclaringClass()).getCanonicalFile(); if (jarFile == null) throw new IllegalStateException("SelfModifier must be in a jar file"); log("JarFile: " + jarFile); @@ -432,7 +434,7 @@ * @return null if file was not loaded from a jar file * @throws SecurityException if access to is denied by SecurityManager */ - public static File findJarFile(Class clazz) + public static File findJarFile(Class clazz) { String resource = clazz.getName().replace('.', '/') + ".class"; @@ -473,10 +475,10 @@ try { - Enumeration entries = jar.entries(); + Enumeration entries = jar.entries(); while (entries.hasMoreElements()) { - ZipEntry entry = (ZipEntry) entries.nextElement(); + ZipEntry entry = entries.nextElement(); if (entry.isDirectory()) continue; String pathname = entry.getName(); Index: src/lib/com/izforge/izpack/installer/UnpackerBase.java =================================================================== --- src/lib/com/izforge/izpack/installer/UnpackerBase.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/UnpackerBase.java Fri Feb 22 14:20:30 GMT 2008 @@ -82,7 +82,7 @@ protected boolean result = true; /** The instances of the unpacker objects. */ - protected static HashMap instances = new HashMap(); + protected static HashMap instances = new HashMap(); /** Interrupt flag if global interrupt is desired. */ protected static boolean interruptDesired = false; @@ -283,12 +283,12 @@ * * @return true if the file matched one pattern, false if it did not */ - private boolean fileMatchesOnePattern(String filename, ArrayList patterns) + private boolean fileMatchesOnePattern(String filename, ArrayList patterns) { // first check whether any include matches - for (Iterator inc_it = patterns.iterator(); inc_it.hasNext();) + for (Iterator inc_it = patterns.iterator(); inc_it.hasNext();) { - RE pattern = (RE) inc_it.next(); + RE pattern = inc_it.next(); if (pattern.match(filename)) { return true; } } @@ -302,13 +302,13 @@ * * @return List of org.apache.regexp.RE */ - private List preparePatterns(ArrayList list, RECompiler recompiler) + private List preparePatterns(ArrayList list, RECompiler recompiler) { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); - for (Iterator iter = list.iterator(); iter.hasNext();) + for (Iterator iter = list.iterator(); iter.hasNext();) { - String element = (String) iter.next(); + String element = iter.next(); if ((element != null) && (element.length() > 0)) { @@ -498,7 +498,7 @@ int i; for (i = 0; i < listenerNames.length; ++i) { - retval[i] = (List) idata.customData.get(listenerNames[i]); + retval[i] = idata.customData.get(listenerNames[i]); if (retval[i] == null) // Make a dummy list, then iterator is ever callable. retval[i] = new ArrayList(); @@ -637,7 +637,7 @@ udata.addFile(jar, true); // We copy the uninstallers - HashSet doubles = new HashSet(); + HashSet doubles = new HashSet(); for (int i = 0; i < in.length; ++i) { @@ -702,19 +702,19 @@ /** * @param updatechecks */ - protected void performUpdateChecks(ArrayList updatechecks) + protected void performUpdateChecks(ArrayList updatechecks) { - ArrayList include_patterns = new ArrayList(); - ArrayList exclude_patterns = new ArrayList(); + ArrayList include_patterns = new ArrayList(); + ArrayList exclude_patterns = new ArrayList(); RECompiler recompiler = new RECompiler(); this.absolute_installpath = new File(idata.getInstallPath()).getAbsoluteFile(); // at first, collect all patterns - for (Iterator iter = updatechecks.iterator(); iter.hasNext();) + for (Iterator iter = updatechecks.iterator(); iter.hasNext();) { - UpdateCheck uc = (UpdateCheck) iter.next(); + UpdateCheck uc = iter.next(); if (uc.includesList != null) include_patterns.addAll(preparePatterns(uc.includesList, recompiler)); @@ -730,11 +730,11 @@ // out files to check for deletion // use a treeset for fast access - TreeSet installed_files = new TreeSet(); + TreeSet installed_files = new TreeSet(); - for (Iterator if_it = this.udata.getInstalledFilesList().iterator(); if_it.hasNext();) + for (Iterator if_it = this.udata.getInstalledFilesList().iterator(); if_it.hasNext();) { - String fname = (String) if_it.next(); + String fname = if_it.next(); File f = new File(fname); @@ -750,10 +750,10 @@ // directories to scan // (note: we'll recurse infinitely if there are circular links or // similar nasty things) - Stack scanstack = new Stack(); + Stack scanstack = new Stack(); // contains File objects determined for deletion - ArrayList files_to_delete = new ArrayList(); + ArrayList files_to_delete = new ArrayList(); try { @@ -761,7 +761,7 @@ while (!scanstack.empty()) { - File f = (File) scanstack.pop(); + File f = scanstack.pop(); File[] files = f.listFiles(); @@ -795,9 +795,9 @@ this.handler.emitError("error while performing update checks", e.toString()); } - for (Iterator f_it = files_to_delete.iterator(); f_it.hasNext();) + for (Iterator f_it = files_to_delete.iterator(); f_it.hasNext();) { - File f = (File) f_it.next(); + File f = f_it.next(); if (!f.isDirectory()) // skip directories - they cannot be removed safely yet Index: src/lib/com/izforge/izpack/util/SpecHelper.java =================================================================== --- src/lib/com/izforge/izpack/util/SpecHelper.java (revision 2050) +++ src/lib/com/izforge/izpack/util/SpecHelper.java Fri Feb 22 14:20:30 GMT 2008 @@ -178,14 +178,14 @@ */ public XMLElement getPackForName(String packDestName) { - Vector packs = getSpec().getChildrenNamed(PACK_KEY); - Iterator iter = null; + Vector packs = getSpec().getChildrenNamed(PACK_KEY); + Iterator iter = null; if (packs == null) return (null); iter = packs.iterator(); while (iter.hasNext()) { - XMLElement pack = (XMLElement) iter.next(); + XMLElement pack = iter.next(); String packName = pack.getAttribute(PACK_NAME); if (packName.equals(packDestName)) return (pack); } @@ -243,7 +243,7 @@ * name * @return a Vector of XMLElements of all leafs founded under root */ - public Vector getAllSubChildren(XMLElement root, String[] childdef) + public Vector getAllSubChildren(XMLElement root, String[] childdef) { return (getSubChildren(root, childdef, 0)); } @@ -258,21 +258,21 @@ * @param depth depth to start in childdef * @return a Vector of XMLElements of all leafs founded under root */ - private Vector getSubChildren(XMLElement root, String[] childdef, int depth) + private Vector getSubChildren(XMLElement root, String[] childdef, int depth) { - Vector retval = null; - Vector retval2 = null; - Vector children = root != null ? root.getChildrenNamed(childdef[depth]) : null; + Vector retval = null; + Vector retval2 = null; + Vector children = root != null ? root.getChildrenNamed(childdef[depth]) : null; if (children == null) return (null); if (depth < childdef.length - 1) { - Iterator iter = children.iterator(); + Iterator iter = children.iterator(); while (iter.hasNext()) { - retval2 = getSubChildren((XMLElement) iter.next(), childdef, depth + 1); + retval2 = getSubChildren(iter.next(), childdef, depth + 1); if (retval2 != null) { - if (retval == null) retval = new Vector(); + if (retval == null) retval = new Vector(); retval.addAll(retval2); } } Index: src/lib/com/izforge/izpack/panels/ShortcutPanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/ShortcutPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/ShortcutPanel.java Fri Feb 22 14:20:30 GMT 2008 @@ -318,7 +318,7 @@ // ~ Instance fields ******************************************************************** /** a VectorList of Files wich should be make executable */ - private Vector execFiles = new Vector(); + private Vector execFiles = new Vector(); // ------------------------------------------------------------------------ // Variable Declarations @@ -410,7 +410,7 @@ * valid data only after createShortcuts() has been called. This list is created so that the * files can be added to the uninstaller. */ - private Vector files = new Vector(); + private Vector files = new Vector(); /** * If true it indicates that there are shortcuts to create. The value is set by @@ -439,7 +439,7 @@ public final static String USER_TYPE = "usertype"; /** shortCuts */ - private Vector shortCuts; + private Vector shortCuts; /** internal line counter */ int line; @@ -876,7 +876,7 @@ // ---------------------------------------------------- XMLElement group = null; - Vector groupSpecs = spec.getChildrenNamed(SPEC_KEY_PROGRAM_GROUP); + Vector groupSpecs = spec.getChildrenNamed(SPEC_KEY_PROGRAM_GROUP); String selectedInstallGroup = idata.getVariable("INSTALL_GROUP"); if (selectedInstallGroup!=null){ //The user selected an InstallGroup before. @@ -884,7 +884,7 @@ //search all defined ProgramGroups for the given InstallGroup for (int i = 0; i < groupSpecs.size(); i++) { - XMLElement g = (XMLElement)groupSpecs.get(i); + XMLElement g = groupSpecs.get(i); String instGrp = g.getAttribute(SPEC_ATTRIBUTE_INSTALLGROUP); if (instGrp!=null && selectedInstallGroup.equalsIgnoreCase(instGrp)){ group = g; @@ -927,16 +927,16 @@ // created, containing all details about each shortcut // ---------------------------------------------------- // String temp; - Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); + Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; - shortCuts = new Vector(); + shortCuts = new Vector(); for (int i = 0; i < shortcutSpecs.size(); i++) { // System.out.println( "Processing shortcut: " + i ); - shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); + shortcutSpec = shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) { @@ -1048,7 +1048,7 @@ // the shortcut is not actually required for any of the selected packs // the shortcut // is not actually required for any of the selected packs - Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); + Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { @@ -1334,11 +1334,11 @@ File file = new File(fileName); File base = new File(shortcut.getBasePath()); - Vector intermediates = new Vector(); + Vector intermediates = new Vector(); // String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, ExecutableFile.UNINSTALL, - ExecutableFile.IGNORE, new ArrayList(), false)); + ExecutableFile.IGNORE, new ArrayList(), false)); files.add(fileName); @@ -1354,7 +1354,7 @@ if (file != null) { - Enumeration filesEnum = intermediates.elements(); + Enumeration filesEnum = intermediates.elements(); while (filesEnum.hasMoreElements()) { @@ -1426,7 +1426,7 @@ * that this panel is presented to the user AFTER the PacksPanel. * -------------------------------------------------------------------------- */ - private boolean shortcutRequiredFor(Vector packs) + private boolean shortcutRequiredFor(Vector packs) { String selected; String required; @@ -1439,7 +1439,7 @@ for (int k = 0; k < packs.size(); k++) { - required = ((XMLElement) packs.elementAt(k)).getAttribute( + required = (packs.elementAt(k)).getAttribute( SPEC_ATTRIBUTE_NAME, ""); if (selected.equals(required)) { return (true); } @@ -1578,7 +1578,7 @@ // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- - Vector dirEntries = new Vector(); + Vector dirEntries = new Vector(); File[] entries = groups.listFiles(); @@ -1711,7 +1711,7 @@ * * @return the filled JList */ - private JList addList(Vector Entries, int ListModel, JList aJList, int aGridx, int aGridy, + private JList addList(Vector Entries, int ListModel, JList aJList, int aGridx, int aGridy, int aGridwidth, int aGridheight, int aFill) { if (aJList == null) @@ -1796,7 +1796,7 @@ // ---------------------------------------------------- // list box to list all of the intended shortcut targets // ---------------------------------------------------- - Vector targets = new Vector(); + Vector targets = new Vector(); for (int i = 0; i < shortcuts.size(); i++) { @@ -2051,7 +2051,7 @@ for (int i = 0; i < files.size(); i++) { - uninstallData.addFile((String) files.elementAt(i), true); + uninstallData.addFile(files.elementAt(i), true); } } Index: src/lib/com/izforge/izpack/ParsableFile.java =================================================================== --- src/lib/com/izforge/izpack/ParsableFile.java (revision 2050) +++ src/lib/com/izforge/izpack/ParsableFile.java Fri Feb 22 14:20:30 GMT 2008 @@ -21,6 +21,8 @@ package com.izforge.izpack; +import com.izforge.izpack.util.OsConstraint; + import java.io.Serializable; import java.util.List; @@ -45,7 +47,7 @@ public String encoding = null; /** The list of OS constraints limiting file installation. */ - public List osConstraints = null; + public List osConstraints = null; /** condition for this Parsable */ private String condition = null; @@ -58,7 +60,7 @@ * @param encoding the file encoding (or null for default) * @param osConstraints the OS constraint (or null for any OS) */ - public ParsableFile(String path, String type, String encoding, List osConstraints) + public ParsableFile(String path, String type, String encoding, List osConstraints) { this.path = path; this.type = type; Index: src/lib/com/izforge/izpack/panels/TreePacksPanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/TreePacksPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/TreePacksPanel.java Fri Feb 22 14:20:30 GMT 2008 @@ -114,7 +114,7 @@ /** * Map that connects names with pack objects */ - private Map names; + private Map names; /** * The bytes of the current pack. @@ -141,11 +141,11 @@ */ private static final String LANG_FILE_NAME = "packsLang.xml"; - private HashMap idToPack; + private HashMap idToPack; private HashMap treeData; - private HashMap packToRowNumber; + private HashMap packToRowNumber; - private HashMap idToCheckBoxNode = new HashMap(); + private HashMap idToCheckBoxNode = new HashMap(); //private boolean created = false; // UNUSED private CheckTreeController checkTreeController; @@ -337,7 +337,7 @@ public String getI18NPackName(String packId) { - Pack pack = (Pack) idToPack.get(packId); + Pack pack = idToPack.get(packId); if(pack == null) return packId; // Internationalization code String packName = pack.name; @@ -508,7 +508,7 @@ */ private void computePacks(List packs) { - names = new HashMap(); + names = new HashMap(); dependenciesExist = false; for (int i = 0; i < packs.size(); i++) { @@ -622,7 +622,7 @@ private void createTreeData() { treeData = new HashMap(); - idToPack = new HashMap(); + idToPack = new HashMap(); java.util.Iterator iter = idata.availablePacks.iterator(); while (iter.hasNext()) @@ -654,7 +654,7 @@ VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables()); if (descriptionArea != null) { - Pack pack = (Pack) idToPack.get(id); + Pack pack = idToPack.get(id); String desc = ""; String key = pack.id + ".description"; if (langpack != null && pack.id != null && !"".equals(pack.id)) @@ -679,8 +679,8 @@ { if (dependencyArea != null) { - Pack pack = (Pack) idToPack.get(id); - List dep = pack.dependencies; + Pack pack = idToPack.get(id); + List dep = pack.dependencies; String list = ""; if (dep != null) { @@ -689,8 +689,8 @@ } for (int j = 0; dep != null && j < dep.size(); j++) { - String name = (String) dep.get(j); - list += getI18NPackName((Pack) names.get(name)); + String name = dep.get(j); + list += getI18NPackName(names.get(name)); if (j != dep.size() - 1) list += ", "; } @@ -734,7 +734,7 @@ */ public CheckBoxNode getCbnById(String id) { - return (CheckBoxNode) this.idToCheckBoxNode.get(id); + return this.idToCheckBoxNode.get(id); } /** @@ -765,7 +765,7 @@ { ArrayList links = new ArrayList(); Object kidsObject = treeData.get(parent); - Pack p = (Pack) idToPack.get(parent); + Pack p = idToPack.get(parent); String translated = getI18NPackName(parent); if(kidsObject != null) @@ -816,7 +816,7 @@ }; //initialize helper map to increa performance - packToRowNumber = new HashMap(); + packToRowNumber = new HashMap(); java.util.Iterator rowpack = idata.availablePacks.iterator(); while (rowpack.hasNext()) { @@ -1320,12 +1320,12 @@ public void selectAllDependencies(CheckBoxNode cbn) { Pack pack = cbn.getPack(); - List deps = pack.getDependencies(); + List deps = pack.getDependencies(); if(deps == null) return; - Iterator e = deps.iterator(); + Iterator e = deps.iterator(); while(e.hasNext()) { - String depId = (String)e.next(); + String depId = e.next(); CheckBoxNode depCbn = treePacksPanel.getCbnById(depId); selectAllDependencies(depCbn); if(depCbn.getChildCount()>0) Index: src/lib/com/izforge/izpack/installer/UnpackerFactory.java =================================================================== --- src/lib/com/izforge/izpack/installer/UnpackerFactory.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/UnpackerFactory.java Fri Feb 22 14:27:20 GMT 2008 @@ -44,11 +44,11 @@ IUnpacker unpackerobj = null; try { - Class unpackerclass = Class.forName(unpackerclassname); + Class unpackerclass = (Class) Class.forName(unpackerclassname); Class[] parametertypes = {AutomatedInstallData.class, AbstractUIProgressHandler.class}; - Constructor unpackerconstructor = unpackerclass.getConstructor(parametertypes); + Constructor unpackerconstructor = unpackerclass.getConstructor(parametertypes); Object[] parameter = {installdata,listener}; - unpackerobj = (IUnpacker) unpackerconstructor.newInstance(parameter); + unpackerobj = unpackerconstructor.newInstance(parameter); } catch (NoSuchMethodException e) { Index: src/lib/com/izforge/izpack/installer/MultiVolumeUnpacker.java =================================================================== --- src/lib/com/izforge/izpack/installer/MultiVolumeUnpacker.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/MultiVolumeUnpacker.java Fri Feb 22 14:20:30 GMT 2008 @@ -128,9 +128,9 @@ // // Initialisations FileOutputStream out = null; - ArrayList parsables = new ArrayList(); - ArrayList executables = new ArrayList(); - ArrayList updatechecks = new ArrayList(); + ArrayList parsables = new ArrayList(); + ArrayList executables = new ArrayList(); + ArrayList updatechecks = new ArrayList(); List packs = idata.selectedPacks; int npacks = packs.size(); Debug.trace("Unpacker starting"); @@ -490,7 +490,7 @@ String arg = null; for (int j = 0; j < ef.argList.size(); j++) { - arg = (String) ef.argList.get(j); + arg = ef.argList.get(j); arg = IoHelper.translatePath(arg, vs); ef.argList.set(j, arg); } Index: src/lib/com/izforge/izpack/util/RegularExpressionValidator.java =================================================================== --- src/lib/com/izforge/izpack/util/RegularExpressionValidator.java (revision 2050) +++ src/lib/com/izforge/izpack/util/RegularExpressionValidator.java Fri Feb 22 14:20:30 GMT 2008 @@ -48,8 +48,8 @@ if (client.hasParams()) { - Map paramMap = client.getValidatorParams(); - patternString = (String) paramMap.get(PATTERN_PARAM); + Map paramMap = client.getValidatorParams(); + patternString = paramMap.get(PATTERN_PARAM); } else { Index: src/lib/com/izforge/izpack/panels/UserInputPanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/UserInputPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/UserInputPanel.java Fri Feb 22 14:20:30 GMT 2008 @@ -355,13 +355,13 @@ private boolean haveSpec = false; /** Holds the references to all of the UI elements */ - private Vector uiElements = new Vector(); + private Vector uiElements = new Vector(); /** Holds the references to all radio button groups */ - private Vector buttonGroups = new Vector(); + private Vector buttonGroups = new Vector(); /** Holds the references to all password field groups */ - private Vector passwordGroups = new Vector(); + private Vector passwordGroups = new Vector(); /** * used for temporary storage of references to password groups that have already been read in a @@ -370,10 +370,10 @@ private Vector passwordGroupsRead = new Vector(); /** Used to track search fields. Contains SearchField references. */ - private Vector searchFields = new Vector(); + private Vector searchFields = new Vector(); /** Holds all user inputs for use in automated installation */ - private Vector entries = new Vector(); + private Vector entries = new Vector(); private LocaleDatabase langpack = null; @@ -475,11 +475,11 @@ // for its type, then an appropriate memeber function // is called that will create the correct UI elements. // ---------------------------------------------------- - Vector fields = spec.getChildrenNamed(FIELD_NODE_ID); + Vector fields = spec.getChildrenNamed(FIELD_NODE_ID); for (int i = 0; i < fields.size(); i++) { - XMLElement field = (XMLElement) fields.elementAt(i); + XMLElement field = fields.elementAt(i); String attribute = field.getAttribute(TYPE); String conditionid = field.getAttribute(ATTRIBUTE_CONDITIONID_NAME); if (conditionid != null) @@ -550,8 +550,8 @@ private void addDirectoryField(XMLElement field) { - Vector forPacks = field.getChildrenNamed(SELECTEDPACKS); - Vector forOs = field.getChildrenNamed(OS); + Vector forPacks = field.getChildrenNamed(SELECTEDPACKS); + Vector forOs = field.getChildrenNamed(OS); JLabel label; String set; @@ -647,8 +647,8 @@ private void addFileField(XMLElement field) { - Vector forPacks = field.getChildrenNamed(SELECTEDPACKS); - Vector forOs = field.getChildrenNamed(OS); + Vector forPacks = field.getChildrenNamed(SELECTEDPACKS); + Vector forOs = field.getChildrenNamed(OS); JLabel label; String set; @@ -754,7 +754,7 @@ for (int i = 0; i < uiElements.size(); i++) { - Object[] element = (Object[]) uiElements.get(i); + Object[] element = uiElements.get(i); if (element[POS_VARIABLE] == null) { continue; @@ -856,9 +856,9 @@ } // update UI with current values of associated variables updateUIElements(); - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forUnselectedPacks = spec.getChildrenNamed(UNSELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forUnselectedPacks = spec.getChildrenNamed(UNSELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); if (!itemRequiredFor(forPacks) || !itemRequiredForUnselected(forUnselectedPacks) || !itemRequiredForOs(forOs)) @@ -897,11 +897,11 @@ /*--------------------------------------------------------------------------*/ public void makeXMLData(XMLElement panelRoot) { - Map entryMap = new HashMap(); + Map entryMap = new HashMap(); for (int i = 0; i < entries.size(); i++) { - TextValuePair pair = (TextValuePair) entries.elementAt(i); + TextValuePair pair = entries.elementAt(i); entryMap.put(pair.toString(), pair.getValue()); } @@ -919,10 +919,10 @@ for (int i = 0; i < uiElements.size(); i++) { - uiElement = (Object[]) uiElements.elementAt(i); + uiElement = uiElements.elementAt(i); - if (itemRequiredFor((Vector) uiElement[POS_PACKS]) - && itemRequiredForOs((Vector) uiElement[POS_OS])) + if (itemRequiredFor((Vector) uiElement[POS_PACKS]) + && itemRequiredForOs((Vector) uiElement[POS_OS])) { try { @@ -984,7 +984,7 @@ // ---------------------------------------------------- for (int i = 0; i < uiElements.size(); i++) { - field = (Object[]) uiElements.elementAt(i); + field = uiElements.elementAt(i); if ((field != null) && (((Boolean) field[POS_DISPLAYED]).booleanValue())) { @@ -1132,7 +1132,7 @@ { InputStream input = null; XMLElement data; - Vector specElements; + Vector specElements; String attribute; String panelattribute; String instance = Integer.toString(instanceNumber); @@ -1172,7 +1172,7 @@ specElements = data.getChildrenNamed(NODE_ID); for (int i = 0; i < specElements.size(); i++) { - data = (XMLElement) specElements.elementAt(i); + data = specElements.elementAt(i); attribute = data.getAttribute(INSTANCE_IDENTIFIER); panelattribute = data.getAttribute(PANEL_IDENTIFIER); @@ -1277,8 +1277,8 @@ /*--------------------------------------------------------------------------*/ private void addRuleField(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed(SPEC); String variable = spec.getAttribute(VARIABLE); RuleInputField field = null; @@ -1292,8 +1292,8 @@ boolean hasParams = false; String paramName = null; String paramValue = null; - HashMap validateParamMap = null; - Vector validateParams = null; + HashMap validateParamMap = null; + Vector validateParams = null; String processor = null; int resultFormat = RuleInputField.DISPLAY_FORMAT; @@ -1369,11 +1369,11 @@ { hasParams = true; - if (validateParamMap == null) validateParamMap = new HashMap(); + if (validateParamMap == null) validateParamMap = new HashMap(); - for (Iterator it = validateParams.iterator(); it.hasNext();) + for (Iterator it = validateParams.iterator(); it.hasNext();) { - element = (XMLElement) it.next(); + element = it.next(); paramName = element.getAttribute(RULE_PARAM_NAME); paramValue = element.getAttribute(RULE_PARAM_VALUE); validateParamMap.put(paramName, paramValue); @@ -1469,14 +1469,14 @@ /*--------------------------------------------------------------------------*/ private void addTextField(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed(SPEC); JLabel label; String set; int size; - HashMap validateParamMap = null; - Vector validateParams = null; + HashMap validateParamMap = null; + Vector validateParams = null; String validator = null; String message = null; boolean hasParams = false; @@ -1545,11 +1545,11 @@ { hasParams = true; - if (validateParamMap == null) validateParamMap = new HashMap(); + if (validateParamMap == null) validateParamMap = new HashMap(); - for (Iterator it = validateParams.iterator(); it.hasNext();) + for (Iterator it = validateParams.iterator(); it.hasNext();) { - element = (XMLElement) it.next(); + element = it.next(); String paramName = element.getAttribute(RULE_PARAM_NAME); String paramValue = element.getAttribute(RULE_PARAM_VALUE); validateParamMap.put(paramName, paramValue); @@ -1663,8 +1663,8 @@ /*--------------------------------------------------------------------------*/ private void addComboBox(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed(SPEC); String variable = spec.getAttribute(VARIABLE); TextValuePair listItem = null; @@ -1679,7 +1679,7 @@ { label = new JLabel(getText(element)); - Vector choices = element.getChildrenNamed(COMBO_CHOICE); + Vector choices = element.getChildrenNamed(COMBO_CHOICE); if (choices == null) { return; } // get current value of associated variable @@ -1691,7 +1691,7 @@ } for (int i = 0; i < choices.size(); i++) { - String processorClass = ((XMLElement) choices.elementAt(i)) + String processorClass = (choices.elementAt(i)) .getAttribute("processor"); if (processorClass != null && !"".equals(processorClass)) @@ -1706,7 +1706,7 @@ { t.printStackTrace(); } - String set = ((XMLElement) choices.elementAt(i)).getAttribute(SET); + String set = (choices.elementAt(i)).getAttribute(SET); if (set == null) { set = ""; @@ -1733,8 +1733,8 @@ } else { - String value = ((XMLElement) choices.elementAt(i)).getAttribute(COMBO_VALUE); - listItem = new TextValuePair(getText((XMLElement) choices.elementAt(i)), value); + String value = (choices.elementAt(i)).getAttribute(COMBO_VALUE); + listItem = new TextValuePair(getText(choices.elementAt(i)), value); field.addItem(listItem); if (userinput) { @@ -1750,7 +1750,7 @@ else { // there is no user input - String set = ((XMLElement) choices.elementAt(i)).getAttribute(SET); + String set = (choices.elementAt(i)).getAttribute(SET); if (set != null) { if (set != null && !"".equals(set)) @@ -1862,8 +1862,8 @@ /*--------------------------------------------------------------------------*/ private void addRadioButton(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); String variable = spec.getAttribute(VARIABLE); String value = null; @@ -1889,7 +1889,7 @@ if (element != null) { - Vector choices = element.getChildrenNamed(RADIO_CHOICE); + Vector choices = element.getChildrenNamed(RADIO_CHOICE); if (choices == null) { return; } @@ -1899,15 +1899,15 @@ for (int i = 0; i < choices.size(); i++) { JRadioButton choice = new JRadioButton(); - choice.setText(getText((XMLElement) choices.elementAt(i))); - String causesValidataion = ((XMLElement) choices.elementAt(i)).getAttribute(REVALIDATE); + choice.setText(getText(choices.elementAt(i))); + String causesValidataion = (choices.elementAt(i)).getAttribute(REVALIDATE); if(causesValidataion != null && causesValidataion.equals("yes")) choice.addActionListener(this); - value = (((XMLElement) choices.elementAt(i)).getAttribute(RADIO_VALUE)); + value = ((choices.elementAt(i)).getAttribute(RADIO_VALUE)); group.add(choice); - String set = ((XMLElement) choices.elementAt(i)).getAttribute(SET); + String set = (choices.elementAt(i)).getAttribute(SET); // in order to properly initialize dependent controls // we must set this variable now if(idata.getVariable(variable) == null) @@ -2014,8 +2014,8 @@ /*--------------------------------------------------------------------------*/ private void addPasswordField(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); String variable = spec.getAttribute(VARIABLE); String message = null; String processor = null; @@ -2023,8 +2023,8 @@ PasswordGroup group = null; int size = 0; // For multiple validator support - Vector validatorsElem = null; - List validatorsList = new ArrayList(); + Vector validatorsElem = null; + List validatorsList = new ArrayList(); int vsize = 0; // ---------------------------------------------------- @@ -2044,21 +2044,21 @@ vsize = validatorsElem.size(); for (int i = 0; i < vsize; i++) { - element = (XMLElement) validatorsElem.get(i); + element = validatorsElem.get(i); String validator = element.getAttribute(CLASS); message = getText(element); - HashMap validateParamMap = new HashMap(); + HashMap validateParamMap = new HashMap(); // ---------------------------------------------------------- // check and see if we have any parameters for this validator. // If so, then add them to validateParamMap. // ---------------------------------------------------------- - Vector validateParams = element.getChildrenNamed(RULE_PARAM); + Vector validateParams = element.getChildrenNamed(RULE_PARAM); if (validateParams != null && validateParams.size() > 0) { - Iterator iter = validateParams.iterator(); + Iterator iter = validateParams.iterator(); while (iter.hasNext()) { - element = (XMLElement) iter.next(); + element = iter.next(); String paramName = element.getAttribute(RULE_PARAM_NAME); String paramValue = element.getAttribute(RULE_PARAM_VALUE); // System.out.println("Adding parameter: "+paramName+"="+paramValue); @@ -2084,7 +2084,7 @@ if (element != null) { - Vector inputs = element.getChildrenNamed(PWD_INPUT); + Vector inputs = element.getChildrenNamed(PWD_INPUT); if (inputs == null) { return; } @@ -2094,7 +2094,7 @@ XMLElement fieldSpec; for (int i = 0; i < inputs.size(); i++) { - fieldSpec = (XMLElement) inputs.elementAt(i); + fieldSpec = inputs.elementAt(i); String set = fieldSpec.getAttribute(SET); if (set != null && !"".equals(set)) { @@ -2217,8 +2217,8 @@ /*--------------------------------------------------------------------------*/ private void addCheckBox(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); String label = ""; String set = null; String trueValue = null; @@ -2362,8 +2362,8 @@ /*--------------------------------------------------------------------------*/ private void addSearch(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed(SPEC); String variable = spec.getAttribute(VARIABLE); String filename = null; @@ -2431,13 +2431,13 @@ check_filename = element.getAttribute(SEARCH_CHECKFILENAME); - Vector choices = element.getChildrenNamed(SEARCH_CHOICE); + Vector choices = element.getChildrenNamed(SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size(); i++) { - XMLElement choice_el = (XMLElement) choices.elementAt(i); + XMLElement choice_el = choices.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(choice_el)) continue; @@ -2445,7 +2445,7 @@ combobox.addItem(value); - String set = ((XMLElement) choices.elementAt(i)).getAttribute(SET); + String set = (choices.elementAt(i)).getAttribute(SET); if (set != null) { if (set != null && !"".equals(set)) @@ -2556,7 +2556,7 @@ comboBox = (JComboBox) field[POS_FIELD]; for (int i = 0; i < this.searchFields.size(); ++i) { - SearchField sf = (SearchField) this.searchFields.elementAt(i); + SearchField sf = this.searchFields.elementAt(i); if (sf.belongsTo(comboBox)) { value = sf.getResult(); @@ -2584,8 +2584,8 @@ /*--------------------------------------------------------------------------*/ private void addText(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); addDescription(spec, forPacks, forOs); } @@ -2600,8 +2600,8 @@ /*--------------------------------------------------------------------------*/ private void addSpace(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); JPanel panel = new JPanel(); TwoColumnConstraints constraints = new TwoColumnConstraints(); @@ -2621,8 +2621,8 @@ /*--------------------------------------------------------------------------*/ private void addDivider(XMLElement spec) { - Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); - Vector forOs = spec.getChildrenNamed(OS); + Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); + Vector forOs = spec.getChildrenNamed(OS); JPanel panel = new JPanel(); String alignment = spec.getAttribute(ALIGNMENT); @@ -2657,7 +2657,7 @@ * @param spec a XMLElement containing the specification for the description. */ /*--------------------------------------------------------------------------*/ - private void addDescription(XMLElement spec, Vector forPacks, Vector forOs) + private void addDescription(XMLElement spec, Vector forPacks, Vector forOs) { String description; TwoColumnConstraints constraints = new TwoColumnConstraints(); @@ -2914,13 +2914,13 @@ * @return true if the item is required for the os, otherwise returns * false. */ - public boolean itemRequiredForOs(Vector os) + public boolean itemRequiredForOs(Vector os) { if (os.size() == 0) { return true; } for (int i = 0; i < os.size(); i++) { - String family = ((XMLElement) os.elementAt(i)).getAttribute(FAMILY); + String family = (os.elementAt(i)).getAttribute(FAMILY); boolean match = false; if ("windows".equals(family)) @@ -2963,7 +2963,7 @@ * that this panel is presented to the user AFTER the PacksPanel. * -------------------------------------------------------------------------- */ - private boolean itemRequiredFor(Vector packs) + private boolean itemRequiredFor(Vector packs) { String selected; @@ -2991,7 +2991,7 @@ for (int k = 0; k < packs.size(); k++) { - required = ((XMLElement) packs.elementAt(k)).getAttribute(NAME, ""); + required = (packs.elementAt(k)).getAttribute(NAME, ""); if (selected.equals(required)) { return (true); } } } @@ -3022,7 +3022,7 @@ * that this panel is presented to the user AFTER the PacksPanel. * -------------------------------------------------------------------------- */ - private boolean itemRequiredForUnselected(Vector packs) + private boolean itemRequiredForUnselected(Vector packs) { String selected; @@ -3040,7 +3040,7 @@ for (int k = 0; k < packs.size(); k++) { - required = ((XMLElement) packs.elementAt(k)).getAttribute(NAME, ""); + required = (packs.elementAt(k)).getAttribute(NAME, ""); if (selected.equals(required)) { return (false); } } } @@ -3054,7 +3054,7 @@ * * @return Returns the uiElements. */ - protected Vector getUiElements() + protected Vector getUiElements() { return uiElements; } @@ -3306,7 +3306,7 @@ /** perform autodetection */ public boolean autodetect() { - Vector items = new Vector(); + Vector items = new Vector(); /* * Check if the user has entered data into the ComboBox and add it to the Itemlist @@ -3365,7 +3365,7 @@ } } // Make the enties in the vector unique - items = new Vector(new HashSet(items)); + items = new Vector(new HashSet(items)); // Now clear the combobox and add the items out of the newly // generated vector @@ -3373,7 +3373,7 @@ VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables()); for (int i = 0; i < items.size(); i++) { - this.pathComboBox.addItem(vs.substitute((String) items.get(i), "plain")); + this.pathComboBox.addItem(vs.substitute(items.get(i), "plain")); } // loop through all items @@ -3502,13 +3502,13 @@ /** * Look if there are new variables defined */ - Vector variables = spec.getChildrenNamed(VARIABLE_NODE); + Vector variables = spec.getChildrenNamed(VARIABLE_NODE); RulesEngine rules = parent.getRules(); VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables()); for (int i = 0; i < variables.size(); i++) { - XMLElement variable = (XMLElement) variables.elementAt(i); + XMLElement variable = variables.elementAt(i); String vname = variable.getAttribute(ATTRIBUTE_VARIABLE_NAME); String vvalue = variable.getAttribute(ATTRIBUTE_VARIABLE_VALUE); Index: src/lib/com/izforge/izpack/installer/ProcessPanelWorker.java =================================================================== --- src/lib/com/izforge/izpack/installer/ProcessPanelWorker.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/ProcessPanelWorker.java Fri Feb 22 14:20:30 GMT 2008 @@ -46,7 +46,6 @@ import com.izforge.izpack.Pack; import com.izforge.izpack.rules.Condition; import com.izforge.izpack.rules.RulesEngine; -import com.izforge.izpack.util.AbstractUIHandler; import com.izforge.izpack.util.AbstractUIProcessHandler; import com.izforge.izpack.util.Debug; import com.izforge.izpack.util.IoHelper; @@ -74,7 +73,7 @@ protected AbstractUIProcessHandler handler; - private ArrayList jobs = new ArrayList(); + private ArrayList jobs = new ArrayList(); private boolean result = true; @@ -143,9 +142,9 @@ logfiledir = lfd.getContent(); } - for (Iterator job_it = spec.getChildrenNamed("job").iterator(); job_it.hasNext();) + for (Iterator job_it = spec.getChildrenNamed("job").iterator(); job_it.hasNext();) { - XMLElement job_el = (XMLElement) job_it.next(); + XMLElement job_el = job_it.next(); String conditionid = job_el.getAttribute("conditionid"); if (conditionid != null){ Debug.trace("Condition for job."); @@ -159,25 +158,25 @@ Debug.trace("Condition is fulfilled or not existent."); // ExecuteForPack Patch // Check if processing required for pack - Vector forPacks = job_el.getChildrenNamed("executeForPack"); + Vector forPacks = job_el.getChildrenNamed("executeForPack"); if (!jobRequiredFor(forPacks)) { continue; } // first check OS constraints - skip jobs not suited for this OS - List constraints = OsConstraint.getOsList(job_el); + List constraints = OsConstraint.getOsList(job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { - List ef_list = new ArrayList(); + List ef_list = new ArrayList(); String job_name = job_el.getAttribute("name", ""); - for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator(); ef_it + for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator(); ef_it .hasNext();) { - XMLElement ef = (XMLElement) ef_it.next(); + XMLElement ef = ef_it.next(); String ef_name = ef.getAttribute("name"); @@ -187,11 +186,11 @@ return false; } - List args = new ArrayList(); + List args = new ArrayList(); - for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) + for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { - XMLElement arg_el = (XMLElement) arg_it.next(); + XMLElement arg_el = arg_it.next(); String arg_val = arg_el.getContent(); @@ -201,10 +200,10 @@ ef_list.add(new ExecutableFile(ef_name, args)); } - for (Iterator ef_it = job_el.getChildrenNamed("executeclass").iterator(); ef_it + for (Iterator ef_it = job_el.getChildrenNamed("executeclass").iterator(); ef_it .hasNext();) { - XMLElement ef = (XMLElement) ef_it.next(); + XMLElement ef = ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { @@ -212,10 +211,10 @@ return false; } - List args = new ArrayList(); - for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) + List args = new ArrayList(); + for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { - XMLElement arg_el = (XMLElement) arg_it.next(); + XMLElement arg_el = arg_it.next(); String arg_val = arg_el.getContent(); args.add(arg_val); } @@ -289,9 +288,9 @@ this.handler.startProcessing(this.jobs.size()); - for (Iterator job_it = this.jobs.iterator(); job_it.hasNext();) + for (Iterator job_it = this.jobs.iterator(); job_it.hasNext();) { - ProcessingJob pj = (ProcessingJob) job_it.next(); + ProcessingJob pj = job_it.next(); this.handler.startProcess(pj.name); @@ -339,9 +338,9 @@ public String name; - private List processables; + private List processables; - public ProcessingJob(String name, List processables) + public ProcessingJob(String name, List processables) { this.name = name; this.processables = processables; @@ -349,9 +348,9 @@ public boolean run(AbstractUIProcessHandler handler, VariableSubstitutor vs) { - for (Iterator pr_it = this.processables.iterator(); pr_it.hasNext();) + for (Iterator pr_it = this.processables.iterator(); pr_it.hasNext();) { - Processable pr = (Processable) pr_it.next(); + Processable pr = pr_it.next(); if (!pr.run(handler, vs)) return false; } @@ -366,11 +365,11 @@ private String filename; - private List arguments; + private List arguments; protected AbstractUIProcessHandler handler; - public ExecutableFile(String fn, List args) + public ExecutableFile(String fn, List args) { this.filename = fn; this.arguments = args; @@ -385,9 +384,9 @@ params[0] = vs.substitute(this.filename, "plain"); int i = 1; - for (Iterator arg_it = this.arguments.iterator(); arg_it.hasNext();) + for (Iterator arg_it = this.arguments.iterator(); arg_it.hasNext();) { - params[i++] = vs.substitute((String) arg_it.next(), "plain"); + params[i++] = vs.substitute(arg_it.next(), "plain"); } try @@ -534,11 +533,11 @@ final private String myClassName; - final private List myArguments; + final private List myArguments; protected AbstractUIProcessHandler myHandler; - public ExecutableClass(String className, List args) + public ExecutableClass(String className, List args) { myClassName = className; myArguments = args; @@ -552,8 +551,8 @@ String params[] = new String[myArguments.size()]; int i = 0; - for (Iterator arg_it = myArguments.iterator(); arg_it.hasNext();) - params[i++] = varSubstitutor.substitute((String) arg_it.next(), "plain"); + for (Iterator arg_it = myArguments.iterator(); arg_it.hasNext();) + params[i++] = varSubstitutor.substitute(arg_it.next(), "plain"); try { @@ -637,7 +636,7 @@ * /*-------------------------------------------------------------------------- */ - private boolean jobRequiredFor(Vector packs) + private boolean jobRequiredFor(Vector packs) { String selected; String required; @@ -655,7 +654,7 @@ for (int k = 0; k < packs.size(); k++) { - required = ((XMLElement) packs.elementAt(k)).getAttribute("name", ""); + required = (packs.elementAt(k)).getAttribute("name", ""); // System.out.println ("Attribute name is " + required); if (selected.equals(required)) { Index: src/lib/com/izforge/izpack/panels/ImgPacksPanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/ImgPacksPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/ImgPacksPanel.java Fri Feb 22 14:20:30 GMT 2008 @@ -64,7 +64,7 @@ private static final long serialVersionUID = 3977858492633659444L; /** The images to display. */ - private HashMap images; + private HashMap images; /** The img label. */ private JLabel imgLabel; @@ -119,7 +119,7 @@ imgFound = firstImgPack.packImgId != null; } if (imgFound) { - imgLabel = new JLabel((ImageIcon) images.get(firstImgPack.packImgId)); + imgLabel = new JLabel(images.get(firstImgPack.packImgId)); } else { imgLabel = new JLabel(); } @@ -172,7 +172,7 @@ private void preLoadImages() { int size = idata.availablePacks.size(); - images = new HashMap(size); + images = new HashMap(size); Iterator pack_it = idata.availablePacks.iterator(); while (pack_it.hasNext()) { @@ -202,9 +202,9 @@ int maxHeight = 60; ImageIcon icon; - for (Iterator it = images.values().iterator(); it.hasNext();) + for (Iterator it = images.values().iterator(); it.hasNext();) { - icon = (ImageIcon) it.next(); + icon = it.next(); maxWidth = Math.max(maxWidth, icon.getIconWidth()); maxHeight = Math.max(maxHeight, icon.getIconHeight()); } @@ -232,7 +232,7 @@ } if (i >= 0) { Pack pack = (Pack) idata.availablePacks.get(i); - imgLabel.setIcon((ImageIcon) images.get(pack.packImgId)); + imgLabel.setIcon(images.get(pack.packImgId)); } } Index: src/lib/com/izforge/izpack/uninstaller/Destroyer.java =================================================================== --- src/lib/com/izforge/izpack/uninstaller/Destroyer.java (revision 2050) +++ src/lib/com/izforge/izpack/uninstaller/Destroyer.java Fri Feb 22 14:22:38 GMT 2008 @@ -83,12 +83,12 @@ // We get the list of uninstaller listeners List[] listeners = getListenerLists(); // We get the list of the files to delete - ArrayList executables = getExecutablesList(); + ArrayList executables = getExecutablesList(); FileExecutor executor = new FileExecutor(executables); executor.executeFiles(ExecutableFile.UNINSTALL, this.handler); - ArrayList files = getFilesList(); + ArrayList files = getFilesList(); int size = files.size(); // Custem action listener stuff --- beforeDeletion ---- @@ -99,7 +99,7 @@ // We destroy the files for (int i = 0; i < size; i++) { - File file = (File) files.get(i); + File file = files.get(i); // Custem action listener stuff --- beforeDelete ---- informListeners(listeners[1], UninstallerListener.BEFORE_DELETE, file, handler); @@ -169,10 +169,10 @@ * @return The files list. * @exception Exception Description of the Exception */ - private ArrayList getFilesList() throws Exception + private ArrayList getFilesList() throws Exception { // Initialisations - TreeSet files = new TreeSet(Collections.reverseOrder()); + TreeSet files = new TreeSet(Collections.reverseOrder()); InputStream in = Destroyer.class.getResourceAsStream("/install.log"); InputStreamReader inReader = new InputStreamReader(in); BufferedReader reader = new BufferedReader(inReader); @@ -189,7 +189,7 @@ } // We return it - return new ArrayList(files); + return new ArrayList(files); } /** @@ -197,9 +197,9 @@ * @return The ArrayList of the Executables * @throws Exception */ - private ArrayList getExecutablesList() throws Exception + private ArrayList getExecutablesList() throws Exception { - ArrayList executables = new ArrayList(); + ArrayList executables = new ArrayList(); ObjectInputStream in = new ObjectInputStream(Destroyer.class .getResourceAsStream("/executables")); int num = in.readInt(); @@ -297,8 +297,8 @@ Iterator iter = listeners.iterator(); while (iter != null && iter.hasNext()) { - Class clazz = Class.forName(((String) iter.next())); - UninstallerListener ul = (UninstallerListener) clazz.newInstance(); + Class clazz = (Class) Class.forName(((String) iter.next())); + UninstallerListener ul = clazz.newInstance(); if (ul.isFileListener()) uninstaller[1].add(ul); uninstaller[0].add(ul); } Index: src/lib/com/izforge/izpack/compiler/PackInfo.java =================================================================== --- src/lib/com/izforge/izpack/compiler/PackInfo.java (revision 2050) +++ src/lib/com/izforge/izpack/compiler/PackInfo.java Fri Feb 22 14:20:30 GMT 2008 @@ -34,6 +34,7 @@ import com.izforge.izpack.PackFile; import com.izforge.izpack.ParsableFile; import com.izforge.izpack.UpdateCheck; +import com.izforge.izpack.util.OsConstraint; /** * Temporary holding place for Pack information as the Packager is built. The packager is used by @@ -91,7 +92,7 @@ * Attributes of the Pack **********************************************************************************************/ - public void setDependencies(List dependencies) + public void setDependencies(List dependencies) { pack.dependencies = dependencies; } @@ -105,12 +106,12 @@ pack.excludeGroup = group; } - public void setOsConstraints(List osConstraints) + public void setOsConstraints(List osConstraints) { pack.osConstraints = osConstraints; } - public List getOsConstraints(List osConstraints) + public List getOsConstraints(List osConstraints) { return pack.osConstraints; } @@ -163,7 +164,7 @@ * Get the install group names. * @return Set for the install groups */ - public Set getInstallGroups() + public Set getInstallGroups() { return pack.installGroups; } @@ -206,7 +207,7 @@ * until the {@link Packager#createInstaller} is invoked, thus a FileNotFoundEception will occur * then, if the file is deleted in between. */ - public void addFile(File baseDir, File file, String targetfile, List osList, int override, Map additionals, String condition) + public void addFile(File baseDir, File file, String targetfile, List osList, int override, Map additionals, String condition) throws FileNotFoundException { if (!file.exists()) throw new FileNotFoundException(file.toString()); @@ -282,12 +283,12 @@ { if (pack.dependencies == null) { - pack.dependencies = new ArrayList(); + pack.dependencies = new ArrayList(); } pack.dependencies.add(dependency); } - public List getDependencies() + public List getDependencies() { return pack.dependencies; } Index: src/lib/com/izforge/izpack/panels/ShortcutPanelAutomationHelper.java =================================================================== --- src/lib/com/izforge/izpack/panels/ShortcutPanelAutomationHelper.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/ShortcutPanelAutomationHelper.java Fri Feb 22 14:20:30 GMT 2008 @@ -81,16 +81,16 @@ * A list of ShortcutData> objects. Each object is the complete specification for one * shortcut that must be created. */ - Vector shortcuts = new Vector(); + Vector shortcuts = new Vector(); - Vector execFiles = new Vector(); + Vector execFiles = new Vector(); /** * Holds a list of all the shortcut files that have been created. Note: this variable * contains valid data only after createShortcuts() has been called. This list is created so * that the files can be added to the uninstaller. */ - Vector files = new Vector(); + Vector files = new Vector(); Debug.log(this.getClass().getName() + " Entered runAutomated()"); @@ -127,9 +127,9 @@ return true; } - shortcuts = new Vector(); + shortcuts = new Vector(); - Vector shortcutElements; + Vector shortcutElements; ShortcutData data; XMLElement dataElement; @@ -154,7 +154,7 @@ { Debug.log(this.getClass().getName() + "runAutomated:shortcutElements " + i); data = new ShortcutData(); - dataElement = (XMLElement) shortcutElements.elementAt(i); + dataElement = shortcutElements.elementAt(i); data.name = dataElement.getAttribute(ShortcutPanel.AUTO_ATTRIBUTE_NAME); data.addToGroup = Boolean.valueOf( @@ -222,7 +222,7 @@ // ShortcutData data; for (int i = 0; i < shortcuts.size(); i++) { - data = (ShortcutData) shortcuts.elementAt(i); + data = shortcuts.elementAt(i); try { @@ -283,11 +283,11 @@ File file = new File(fileName); File base = new File(shortcut.getBasePath()); - Vector intermediates = new Vector(); + Vector intermediates = new Vector(); // String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, ExecutableFile.UNINSTALL, - ExecutableFile.IGNORE, new ArrayList(), false)); + ExecutableFile.IGNORE, new ArrayList(), false)); files.add(fileName); @@ -303,7 +303,7 @@ if (file != null) { - Enumeration filesEnum = intermediates.elements(); + Enumeration filesEnum = intermediates.elements(); while (filesEnum.hasMoreElements()) { @@ -353,7 +353,7 @@ for (int i = 0; i < files.size(); i++) { - uninstallData.addFile((String) files.elementAt(i), true); + uninstallData.addFile(files.elementAt(i), true); System.out.print("."); System.out.flush(); } Index: src/lib/com/izforge/izpack/installer/GUIInstaller.java =================================================================== --- src/lib/com/izforge/izpack/installer/GUIInstaller.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/GUIInstaller.java Fri Feb 22 14:24:10 GMT 2008 @@ -64,7 +64,6 @@ import com.izforge.izpack.GUIPrefs; import com.izforge.izpack.LocaleDatabase; -import com.izforge.izpack.ExecutableFile; import com.izforge.izpack.gui.ButtonFactory; import com.izforge.izpack.gui.IzPackMetalTheme; import com.izforge.izpack.gui.LabelFactory; @@ -316,19 +315,19 @@ String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { - laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); + laf = installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") - && "no".equalsIgnoreCase((String) installdata.guiPrefs.modifier + && "no".equalsIgnoreCase(installdata.guiPrefs.modifier .get("useButtonIcons"))) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") - && "no".equalsIgnoreCase((String) installdata.guiPrefs.modifier + && "no".equalsIgnoreCase(installdata.guiPrefs.modifier .get("useLabelIcons"))) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) @@ -366,15 +365,15 @@ // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); - Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); + Class lafClass = (Class) Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; - Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); + Class theme = (Class) Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F - LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); - MetalTheme ktheme = (MetalTheme) theme.newInstance(); + LookAndFeel kunststoff = lafClass.newInstance(); + MetalTheme ktheme = theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); @@ -389,10 +388,10 @@ UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; - Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); + Map params = installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { - String value = (String) params.get("decorate.frames"); + String value = params.get("decorate.frames"); if ("yes".equals(value)) { JFrame.setDefaultLookAndFeelDecorated(true); @@ -400,7 +399,7 @@ } if (params.containsKey("decorate.dialogs")) { - String value = (String) params.get("decorate.dialogs"); + String value = params.get("decorate.dialogs"); if ("yes".equals(value)) { JDialog.setDefaultLookAndFeelDecorated(true); @@ -428,20 +427,20 @@ // JGoodies Looks (http://looks.dev.java.net/) if ("looks".equals(laf)) { - Map variants = new TreeMap(); + Map variants = new TreeMap(); variants.put("windows", "com.jgoodies.looks.windows.WindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.looks.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.looks.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.looks.plastic.Plastic3DLookAndFeel"); - String variant = (String) variants.get("plasticXP"); + String variant = variants.get("plasticXP"); - Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); + Map params = installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { - String param = (String) params.get("variant"); + String param = params.get("variant"); if (variants.containsKey(param)) { - variant = (String) variants.get(param); + variant = variants.get(param); } } @@ -452,7 +451,7 @@ // Substance (http://substance.dev.java.net/) if ("substance".equals(laf)) { - Map variants = new TreeMap(); + Map variants = new TreeMap(); variants.put("default", "org.jvnet.substance.SubstanceLookAndFeel"); // Ugly!!! variants.put("business", "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"); variants.put("business-blue", "org.jvnet.substance.skin.SubstanceBusinessBlueSteelLookAndFeel"); @@ -461,15 +460,15 @@ variants.put("sahara", "org.jvnet.substance.skin.SubstanceSaharaLookAndFeel"); variants.put("moderate", "org.jvnet.substance.skin.SubstanceModerateLookAndFeel"); variants.put("officesilver", "org.jvnet.substance.skin.SubstanceOfficeSilver2007LookAndFeel"); - String variant = (String) variants.get("default"); + String variant = variants.get("default"); - Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); + Map params = installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { - String param = (String) params.get("variant"); + String param = params.get("variant"); if (variants.containsKey(param)) { - variant = (String) variants.get(param); + variant = variants.get(param); } } @@ -513,7 +512,7 @@ protected boolean useFlags() { if (installdata.guiPrefs.modifier.containsKey("useFlags") - && "no".equalsIgnoreCase((String) installdata.guiPrefs.modifier.get("useFlags"))) + && "no".equalsIgnoreCase(installdata.guiPrefs.modifier.get("useFlags"))) return (false); return (true); } @@ -528,7 +527,7 @@ { if (installdata.guiPrefs.modifier.containsKey("langDisplayType")) { - String val = (String) installdata.guiPrefs.modifier.get("langDisplayType"); + String val = installdata.guiPrefs.modifier.get("langDisplayType"); val = val.toLowerCase(); // Verify that the value is valid, else return the default. for (int i = 0; i < LANGUAGE_DISPLAY_TYPES.length; ++i) @@ -556,7 +555,7 @@ private JComboBox comboBox; /** The ISO3 to ISO2 HashMap */ - private HashMap iso3Toiso2 = null; + private HashMap iso3Toiso2 = null; /** iso3Toiso2 expanded ? */ private boolean isoMapExpanded = false; @@ -679,7 +678,7 @@ int i; if (iso3Toiso2 == null) { // Loasd predefined langs into HashMap. - iso3Toiso2 = new HashMap(32); + iso3Toiso2 = new HashMap(32); isoTable = new HashMap(); for (i = 0; i < LANG_CODES.length; ++i) iso3Toiso2.put(LANG_CODES[i][0], LANG_CODES[i][1]); @@ -828,10 +827,10 @@ private static final long serialVersionUID = 3832899961942782769L; /** Icons cache. */ - private TreeMap icons = new TreeMap(); + private TreeMap icons = new TreeMap(); /** Grayed icons cache. */ - private TreeMap grayIcons = new TreeMap(); + private TreeMap grayIcons = new TreeMap(); public FlagRenderer() { @@ -876,9 +875,9 @@ grayIcons.put(iso3, icon); } if (isSelected || index == -1) - setIcon((ImageIcon) icons.get(iso3)); + setIcon(icons.get(iso3)); else - setIcon((ImageIcon) grayIcons.get(iso3)); + setIcon(grayIcons.get(iso3)); // We return return this; Index: src/lib/com/izforge/izpack/panels/ValidatorContainer.java =================================================================== --- src/lib/com/izforge/izpack/panels/ValidatorContainer.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/ValidatorContainer.java Fri Feb 22 14:20:31 GMT 2008 @@ -10,9 +10,9 @@ private Validator validator = null; private String message; private boolean hasParams = false; - private Map validatorParams = null; + private Map validatorParams = null; - public ValidatorContainer(String validator, String message, Map validatorParams) { + public ValidatorContainer(String validator, String message, Map validatorParams) { try { this.validator = (Validator) Class.forName(validator).newInstance(); this.message = message; @@ -44,7 +44,7 @@ * * @return a java.util.Map containing the validator parameters. */ - public Map getValidatorParams() { + public Map getValidatorParams() { return validatorParams; } Index: src/lib/net/n3/nanoxml/StdXMLBuilder.java =================================================================== --- src/lib/net/n3/nanoxml/StdXMLBuilder.java (revision 2050) +++ src/lib/net/n3/nanoxml/StdXMLBuilder.java Fri Feb 22 14:20:30 GMT 2008 @@ -46,7 +46,7 @@ /** * This stack contains the current element and its parents. */ - private Stack stack; + private Stack stack; /** * The root element of the parsed XML tree. @@ -68,7 +68,7 @@ * @return the element that is currently being processed */ protected XMLElement getCurrentElement() { - return (XMLElement) stack.peek(); + return stack.peek(); } /** @@ -76,7 +76,7 @@ * * @return the stack used for processing the elements. */ - protected Stack getStack() { + protected Stack getStack() { return stack; } @@ -111,7 +111,7 @@ */ public void startBuilding(String systemID, int lineNr) { - this.stack = new Stack(); + this.stack = new Stack(); this.root = null; } @@ -149,7 +149,7 @@ } else { - XMLElement top = (XMLElement) this.stack.peek(); + XMLElement top = this.stack.peek(); top.addChild(elt); } @@ -182,7 +182,7 @@ */ public void endElement(String name, String nsPrefix, String nsSystemID) { - XMLElement elt = (XMLElement) this.stack.pop(); + XMLElement elt = this.stack.pop(); if (elt.getChildrenCount() == 1) { @@ -210,7 +210,7 @@ public void addAttribute(String key, String nsPrefix, String nsSystemID, String value, String type) throws Exception { - XMLElement top = (XMLElement) this.stack.peek(); + XMLElement top = this.stack.peek(); if (top.hasAttribute(key)) { throw new XMLParseException(top.getSystemID(), top.getLineNr(), "Duplicate attribute: " + key); } @@ -261,7 +261,7 @@ if (!this.stack.empty()) { - XMLElement top = (XMLElement) this.stack.peek(); + XMLElement top = this.stack.peek(); top.addChild(elt); } } Index: src/lib/com/izforge/izpack/Panel.java =================================================================== --- src/lib/com/izforge/izpack/Panel.java (revision 2050) +++ src/lib/com/izforge/izpack/Panel.java Fri Feb 22 14:20:30 GMT 2008 @@ -20,6 +20,8 @@ */ package com.izforge.izpack; +import com.izforge.izpack.util.OsConstraint; + import java.io.Serializable; import java.util.List; @@ -36,7 +38,7 @@ public String className; /** The target operation system of this panel */ - public List osConstraints = null; + public List osConstraints = null; /** the unique id of this panel */ protected String panelid; @@ -52,11 +54,11 @@ this.className = className; } - public List getOsConstraints() { + public List getOsConstraints() { return this.osConstraints; } - public void setOsConstraints(List osConstraints) { + public void setOsConstraints(List osConstraints) { this.osConstraints = osConstraints; } Index: src/lib/com/izforge/izpack/rules/RulesEngine.java =================================================================== --- src/lib/com/izforge/izpack/rules/RulesEngine.java (revision 2050) +++ src/lib/com/izforge/izpack/rules/RulesEngine.java Fri Feb 22 14:22:18 GMT 2008 @@ -35,11 +35,11 @@ public class RulesEngine { - protected Map panelconditions; + protected Map panelconditions; - protected Map packconditions; + protected Map packconditions; - protected Map optionalpackconditions; + protected Map optionalpackconditions; protected XMLElement conditionsspec; @@ -50,9 +50,9 @@ private RulesEngine() { conditionsmap = new Hashtable(); - this.panelconditions = new Hashtable(); - this.packconditions = new Hashtable(); - this.optionalpackconditions = new Hashtable(); + this.panelconditions = new Hashtable(); + this.packconditions = new Hashtable(); + this.optionalpackconditions = new Hashtable(); } /** @@ -70,9 +70,9 @@ if ((installdata != null) && (installdata.allPacks != null)) { - for (Iterator iterator = installdata.allPacks.iterator(); iterator.hasNext();) + for (Iterator iterator = installdata.allPacks.iterator(); iterator.hasNext();) { - Pack pack = (Pack) iterator.next(); + Pack pack = iterator.next(); if (pack.id != null) { // automatically add packselection condition @@ -183,8 +183,8 @@ ClassLoader loader = RulesEngine.class.getClassLoader(); try { - Class conditionclass = loader.loadClass(conditionclassname); - result = (Condition) conditionclass.newInstance(); + Class conditionclass = (Class) loader.loadClass(conditionclassname); + result = conditionclass.newInstance(); result.readFromXML(condition); result.setId(condid); result.setInstalldata(RulesEngine.installdata); @@ -220,11 +220,11 @@ if (this.conditionsspec.hasChildren()) { // read in the condition specs - Vector childs = this.conditionsspec.getChildrenNamed("condition"); + Vector childs = this.conditionsspec.getChildrenNamed("condition"); for (int i = 0; i < childs.size(); i++) { - XMLElement condition = (XMLElement) childs.get(i); + XMLElement condition = childs.get(i); Condition cond = analyzeCondition(condition); if (cond != null) { @@ -238,19 +238,19 @@ } } - Vector panelconditionels = this.conditionsspec.getChildrenNamed("panelcondition"); + Vector panelconditionels = this.conditionsspec.getChildrenNamed("panelcondition"); for (int i = 0; i < panelconditionels.size(); i++) { - XMLElement panelel = (XMLElement) panelconditionels.get(i); + XMLElement panelel = panelconditionels.get(i); String panelid = panelel.getAttribute("panelid"); String conditionid = panelel.getAttribute("conditionid"); this.panelconditions.put(panelid, conditionid); } - Vector packconditionels = this.conditionsspec.getChildrenNamed("packcondition"); + Vector packconditionels = this.conditionsspec.getChildrenNamed("packcondition"); for (int i = 0; i < packconditionels.size(); i++) { - XMLElement panelel = (XMLElement) packconditionels.get(i); + XMLElement panelel = packconditionels.get(i); String panelid = panelel.getAttribute("packid"); String conditionid = panelel.getAttribute("conditionid"); this.packconditions.put(panelid, conditionid); @@ -417,7 +417,7 @@ return true; } Debug.trace("there is a condition"); - Condition condition = getCondition((String) this.panelconditions.get(panelid)); + Condition condition = getCondition(this.panelconditions.get(panelid)); if (condition != null) { return condition.isTrue(); @@ -446,7 +446,7 @@ return true; } Debug.trace("there is a condition"); - Condition condition = getCondition((String) this.packconditions.get(packid)); + Condition condition = getCondition(this.packconditions.get(packid)); if (condition != null) { return condition.isTrue(); Index: src/lib/net/n3/nanoxml/StdXMLReader.java =================================================================== --- src/lib/net/n3/nanoxml/StdXMLReader.java (revision 2050) +++ src/lib/net/n3/nanoxml/StdXMLReader.java Fri Feb 22 14:20:30 GMT 2008 @@ -55,22 +55,22 @@ /** * The stack of push-back readers. */ - private Stack pbreaders; + private Stack pbreaders; /** * The stack of line-number readers. */ - private Stack linereaders; + private Stack linereaders; /** * The stack of system ids. */ - private Stack systemIds; + private Stack systemIds; /** * The stack of public ids. */ - private Stack publicIds; + private Stack publicIds; /** * The current push-back reader. @@ -153,10 +153,10 @@ Reader reader = this.openStream(publicID, systemIDasURL.toString()); this.currentLineReader = new LineNumberReader(reader); this.currentPbReader = new PushbackReader(this.currentLineReader, 2); - this.pbreaders = new Stack(); - this.linereaders = new Stack(); - this.publicIds = new Stack(); - this.systemIds = new Stack(); + this.pbreaders = new Stack(); + this.linereaders = new Stack(); + this.publicIds = new Stack(); + this.systemIds = new Stack(); this.currentPublicID = publicID; this.currentSystemID = systemIDasURL; } @@ -170,10 +170,10 @@ { this.currentLineReader = new LineNumberReader(reader); this.currentPbReader = new PushbackReader(this.currentLineReader, 2); - this.pbreaders = new Stack(); - this.linereaders = new Stack(); - this.publicIds = new Stack(); - this.systemIds = new Stack(); + this.pbreaders = new Stack(); + this.linereaders = new Stack(); + this.publicIds = new Stack(); + this.systemIds = new Stack(); this.currentPublicID = ""; try @@ -350,10 +350,10 @@ Reader reader = this.stream2reader(stream, charsRead); this.currentLineReader = new LineNumberReader(reader); this.currentPbReader = new PushbackReader(this.currentLineReader, 2); - this.pbreaders = new Stack(); - this.linereaders = new Stack(); - this.publicIds = new Stack(); - this.systemIds = new Stack(); + this.pbreaders = new Stack(); + this.linereaders = new Stack(); + this.publicIds = new Stack(); + this.systemIds = new Stack(); this.currentPublicID = ""; try @@ -384,10 +384,10 @@ if (this.pbreaders.empty()) { throw new IOException("Unexpected EOF"); } this.currentPbReader.close(); - this.currentPbReader = (PushbackReader) this.pbreaders.pop(); - this.currentLineReader = (LineNumberReader) this.linereaders.pop(); - this.currentSystemID = (URL) this.systemIds.pop(); - this.currentPublicID = (String) this.publicIds.pop(); + this.currentPbReader = this.pbreaders.pop(); + this.currentLineReader = this.linereaders.pop(); + this.currentSystemID = this.systemIds.pop(); + this.currentPublicID = this.publicIds.pop(); ch = this.currentPbReader.read(); } @@ -442,10 +442,10 @@ if (this.pbreaders.empty()) { return true; } this.currentPbReader.close(); - this.currentPbReader = (PushbackReader) this.pbreaders.pop(); - this.currentLineReader = (LineNumberReader) this.linereaders.pop(); - this.currentSystemID = (URL) this.systemIds.pop(); - this.currentPublicID = (String) this.publicIds.pop(); + this.currentPbReader = this.pbreaders.pop(); + this.currentLineReader = this.linereaders.pop(); + this.currentSystemID = this.systemIds.pop(); + this.currentPublicID = this.publicIds.pop(); ch = this.currentPbReader.read(); } Index: src/lib/com/izforge/izpack/panels/RuleInputField.java =================================================================== --- src/lib/com/izforge/izpack/panels/RuleInputField.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/RuleInputField.java Fri Feb 22 14:20:30 GMT 2008 @@ -29,6 +29,7 @@ import java.util.Map; import java.util.StringTokenizer; import java.util.Vector; +import java.io.Serializable; import javax.swing.JComponent; import javax.swing.JLabel; @@ -118,7 +119,7 @@ /** Used internally to identify the default setting for the return format. */ private static int DEFAULT = DISPLAY_FORMAT; - private Vector items = new Vector(); + private Vector items = new Vector(); /** * This Vector holds a reference to each input field, in the order in which they @@ -128,7 +129,7 @@ private boolean hasParams = false; - private Map validatorParams; + private Map validatorParams; private RuleTextField activeField; @@ -190,7 +191,7 @@ */ /*--------------------------------------------------------------------------*/ public RuleInputField(String format, String preset, String separator, String validator, - Map validatorParams, String processor, int resultFormat, Toolkit toolkit, + Map validatorParams, String processor, int resultFormat, Toolkit toolkit, InstallData idata) { this(format, preset, separator, validator, processor, resultFormat, toolkit, idata); @@ -319,7 +320,7 @@ /*--------------------------------------------------------------------------*/ // javadoc inherited - public Map getValidatorParams() + public Map getValidatorParams() { return validatorParams; } Index: src/lib/com/izforge/izpack/panels/CompilePanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/CompilePanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/CompilePanel.java Fri Feb 22 14:20:30 GMT 2008 @@ -186,7 +186,7 @@ gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; // gridBagConstraints.weighty = 0.1; - Iterator it = this.worker.getAvailableCompilers().iterator(); + Iterator it = this.worker.getAvailableCompilers().iterator(); while (it.hasNext()) compilerComboBox.addItem(it.next()); @@ -480,7 +480,7 @@ { // get compilers again (because they might contain variables from former // panels) - Iterator it = this.worker.getAvailableCompilers().iterator(); + Iterator it = this.worker.getAvailableCompilers().iterator(); compilerComboBox.removeAllItems(); Index: src/lib/com/izforge/izpack/installer/ConditionHistory.java =================================================================== --- src/lib/com/izforge/izpack/installer/ConditionHistory.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/ConditionHistory.java Fri Feb 22 14:20:30 GMT 2008 @@ -34,7 +34,7 @@ public class ConditionHistory { private Condition condition; - private List values; + private List values; private boolean newcondition; private boolean changedcondition; @@ -42,7 +42,7 @@ public ConditionHistory(Condition condition) { this.condition = condition; - values = new ArrayList(); + values = new ArrayList(); newcondition = true; changedcondition = true; } @@ -65,7 +65,7 @@ public boolean getLastValue() { if (values.size() > 0) { - return ((Boolean)((Object[]) values.get(values.size() - 1))[0]).booleanValue(); + return ((Boolean)(values.get(values.size() - 1))[0]).booleanValue(); } else { return false; @@ -110,7 +110,7 @@ details.append(""); for (int i = values.size()-1; i >= 0; i--) { - Object[] condcomment = (Object[]) values.get(i); + Object[] condcomment = values.get(i); details.append(i+1); details.append(". "); details.append(((Boolean)condcomment[0]).toString()); Index: src/lib/com/izforge/izpack/panels/PacksModel.java =================================================================== --- src/lib/com/izforge/izpack/panels/PacksModel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/PacksModel.java Fri Feb 22 14:20:29 GMT 2008 @@ -74,10 +74,10 @@ private int[] checkValues; // Map to hold the object name relationship - Map namesObj; + Map namesObj; // Map to hold the object name relationship - Map namesPos; + Map namesPos; // reference to the RulesEngine for validating conditions private RulesEngine rules; @@ -153,7 +153,7 @@ } private void removeAlreadyInstalledPacks(List selectedpacks) { - List removepacks = new ArrayList(); + List removepacks = new ArrayList(); for (Iterator iterator = selectedpacks.iterator(); iterator.hasNext();) { @@ -170,9 +170,9 @@ removepacks.add(selectedpack); } } - for (Iterator iterator = removepacks.iterator(); iterator.hasNext();) + for (Iterator iterator = removepacks.iterator(); iterator.hasNext();) { - Pack removepack = (Pack) iterator.next(); + Pack removepack = iterator.next(); selectedpacks.remove(removepack); } } @@ -237,7 +237,7 @@ private void reverseDeps() { // name to pack map - namesObj = new HashMap(); + namesObj = new HashMap(); for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); @@ -247,11 +247,11 @@ for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); - List deps = pack.dependencies; + List deps = pack.dependencies; for (int j = 0; deps != null && j < deps.size(); j++) { - String name = (String) deps.get(j); - Pack parent = (Pack) namesObj.get(name); + String name = deps.get(j); + Pack parent = namesObj.get(name); parent.addRevDep(pack.name); } } @@ -261,7 +261,7 @@ private void initvalues() { // name to pack position map - namesPos = new HashMap(); + namesPos = new HashMap(); for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); @@ -281,10 +281,10 @@ Pack pack = (Pack) packs.get(i); if (checkValues[i] == 0) { - List deps = pack.revDependencies; + List deps = pack.revDependencies; for (int j = 0; deps != null && j < deps.size(); j++) { - String name = (String) deps.get(j); + String name = deps.get(j); int pos = getPos(name); checkValues[pos] = -2; } @@ -325,10 +325,10 @@ final int pos = getPos(name); checkValues[pos] = -1; - List deps = ((Pack) packs.get(pos)).dependencies; + List deps = ((Pack) packs.get(pos)).dependencies; for (int i = 0; deps != null && i < deps.size(); i++) { - String s = (String) deps.get(i); + String s = deps.get(i); propRequirement(s); } @@ -342,7 +342,7 @@ */ private int getPos(String name) { - return ((Integer) namesPos.get(name)).intValue(); + return (namesPos.get(name)).intValue(); } /* @@ -646,13 +646,13 @@ { wipe = true; } - List deps = u.revDependencies; + List deps = u.revDependencies; if (deps != null) { for (int i = 0; i < deps.size(); i++) { - String name = (String) deps.get(i); - Pack v = (Pack) namesObj.get(name); + String name = deps.get(i); + Pack v = namesObj.get(name); if (wipe) { status[getPos(v.name)] = 1; Index: src/lib/com/izforge/izpack/uninstaller/Uninstaller.java =================================================================== --- src/lib/com/izforge/izpack/uninstaller/Uninstaller.java (revision 2050) +++ src/lib/com/izforge/izpack/uninstaller/Uninstaller.java Fri Feb 22 14:20:29 GMT 2008 @@ -42,7 +42,7 @@ if (cmduninstall) System.out.println("Command line uninstaller.\n"); try { - Class clazz = Uninstaller.class; + Class clazz = Uninstaller.class; Method target; if (cmduninstall) target = clazz.getMethod("cmduninstall", new Class[]{String[].class}); Index: src/lib/com/izforge/izpack/panels/DataCheckPanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/DataCheckPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/DataCheckPanel.java Fri Feb 22 14:23:20 GMT 2008 @@ -108,7 +108,7 @@ * @param packList * @return String */ - private String getPackNames(List packList) + private String getPackNames(List packList) { int i; String pStatus; @@ -116,7 +116,7 @@ Pack iPack; for (i = 0; i < packList.size(); i++) { - iPack = (Pack) packList.get(i); + iPack = packList.get(i); if (iData.selectedPacks.indexOf(iPack) != -1) pStatus = "Selected"; else @@ -140,9 +140,9 @@ System.out.println("InstallData Variables:"); Properties varList = iData.getVariables(); String[] alphaName = new String[varList.size()]; - Enumeration varNames = varList.propertyNames(); + Enumeration varNames = (Enumeration) varList.propertyNames(); while (varNames.hasMoreElements()) - alphaName[i++] = (String) varNames.nextElement(); + alphaName[i++] = varNames.nextElement(); java.util.Arrays.sort(alphaName); for (i = 0; i < alphaName.length; i++) sInfo = sInfo + "\tName: " + alphaName[i] + ", Value: " + varList.getProperty(alphaName[i]) + "\n"; Index: src/lib/com/izforge/izpack/compiler/Packager.java =================================================================== --- src/lib/com/izforge/izpack/compiler/Packager.java (revision 2050) +++ src/lib/com/izforge/izpack/compiler/Packager.java Fri Feb 22 14:20:30 GMT 2008 @@ -165,14 +165,14 @@ { sendMsg("Copying " + installerResourceURLMap.size() + " files into installer"); - Iterator i = installerResourceURLMap.keySet().iterator(); + Iterator i = installerResourceURLMap.keySet().iterator(); while (i.hasNext()) { - String name = (String) i.next(); - InputStream in = ((URL) installerResourceURLMap.get(name)).openStream(); + String name = i.next(); + InputStream in = (installerResourceURLMap.get(name)).openStream(); org.apache.tools.zip.ZipEntry newEntry = new org.apache.tools.zip.ZipEntry(name); - long dateTime = FileUtil.getFileDateTime((URL) installerResourceURLMap.get(name)); + long dateTime = FileUtil.getFileDateTime(installerResourceURLMap.get(name)); if (dateTime != -1) newEntry.setTime(dateTime); primaryJarStream.putNextEntry(newEntry); @@ -188,13 +188,13 @@ { sendMsg("Merging " + includedJarURLs.size() + " jars into installer"); - Iterator i = includedJarURLs.iterator(); + Iterator i = includedJarURLs.iterator(); while (i.hasNext()) { - Object [] current = (Object []) i.next(); + Object [] current = i.next(); InputStream is = ((URL) current[0]).openStream(); ZipInputStream inJarStream = new ZipInputStream(is); - copyZip(inJarStream, primaryJarStream, (List) current[1]); + copyZip(inJarStream, primaryJarStream, (List) current[1]); } } @@ -207,19 +207,19 @@ sendMsg("Writing " + num + " Pack" + (num > 1 ? "s" : "") + " into installer"); // Map to remember pack number and bytes offsets of back references - Map storedFiles = new HashMap(); + Map storedFiles = new HashMap(); // First write the serialized files and file metadata data for each pack // while counting bytes. int packNumber = 0; - Iterator packIter = packsList.iterator(); + Iterator packIter = packsList.iterator(); XMLElement root = new XMLElement("packs"); while (packIter.hasNext()) { - PackInfo packInfo = (PackInfo) packIter.next(); + PackInfo packInfo = packIter.next(); Pack pack = packInfo.getPack(); pack.nbytes = 0; if ((pack.id == null) || (pack.id.length() == 0)) { @@ -274,7 +274,7 @@ // use a back reference if file was in previous pack, and in // same jar - Object[] info = (Object[]) storedFiles.get(file); + Object[] info = storedFiles.get(file); if (info != null && !packJarsSeparate) { pf.setPreviousPackFileRef((String) info[0], (Long)info[1]); @@ -355,10 +355,10 @@ ObjectOutputStream out = new ObjectOutputStream(primaryJarStream); out.writeInt(packsList.size()); - Iterator i = packsList.iterator(); + Iterator i = packsList.iterator(); while (i.hasNext()) { - PackInfo pack = (PackInfo) i.next(); + PackInfo pack = i.next(); out.writeObject(pack.getPack()); } out.flush(); @@ -406,13 +406,13 @@ * */ private void copyZip(ZipInputStream zin, org.apache.tools.zip.ZipOutputStream out, - List files) + List files) throws IOException { java.util.zip.ZipEntry zentry; if( ! alreadyWrittenFiles.containsKey( out )) - alreadyWrittenFiles.put(out, new HashSet()); - HashSet currentSet = (HashSet) alreadyWrittenFiles.get(out); + alreadyWrittenFiles.put(out, new HashSet()); + HashSet currentSet = alreadyWrittenFiles.get(out); while ((zentry = zin.getNextEntry()) != null) { String currentName = zentry.getName(); @@ -420,11 +420,11 @@ testName = testName.replace('\\', '.'); if( files != null ) { - Iterator i = files.iterator(); + Iterator i = files.iterator(); boolean founded = false; while( i.hasNext()) { // Make "includes" self to support regex. - String doInclude = (String) i.next(); + String doInclude = i.next(); if( testName.matches( doInclude ) ) { founded = true; Index: src/lib/com/izforge/izpack/installer/InstallerBase.java =================================================================== --- src/lib/com/izforge/izpack/installer/InstallerBase.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/InstallerBase.java Fri Feb 22 14:20:30 GMT 2008 @@ -108,7 +108,7 @@ objIn = new ObjectInputStream(in); size = objIn.readInt(); ArrayList availablePacks = new ArrayList(); - ArrayList allPacks = new ArrayList(); + ArrayList allPacks = new ArrayList(); for (i = 0; i < size; i++) { Pack pk = (Pack) objIn.readObject(); Index: src/lib/net/n3/nanoxml/XMLEntityResolver.java =================================================================== --- src/lib/net/n3/nanoxml/XMLEntityResolver.java (revision 2050) +++ src/lib/net/n3/nanoxml/XMLEntityResolver.java Fri Feb 22 14:27:00 GMT 2008 @@ -44,14 +44,14 @@ /** * The entities. */ - private Hashtable entities; + private Hashtable entities; /** * Initializes the resolver. */ public XMLEntityResolver() { - this.entities = new Hashtable(); + this.entities = new Hashtable(); this.entities.put("amp", "&#38;"); this.entities.put("quot", "&#34;"); this.entities.put("apos", "&#39;"); Index: src/lib/com/izforge/izpack/util/PasswordKeystoreValidator.java =================================================================== --- src/lib/com/izforge/izpack/util/PasswordKeystoreValidator.java (revision 2050) +++ src/lib/com/izforge/izpack/util/PasswordKeystoreValidator.java Fri Feb 22 14:20:30 GMT 2008 @@ -66,18 +66,18 @@ String skipValidation = null; String alias = null; String aliasPassword = null; - Map params = getParams(client); + Map params = getParams(client); try { if (params!=null) { // Don't try and open the keystore if skipValidation is true - skipValidation = (String)params.get("skipValidation"); + skipValidation = params.get("skipValidation"); System.out.println("skipValidation = "+skipValidation); if (skipValidation!=null && skipValidation.equalsIgnoreCase("true")) { System.out.println("Not validating keystore"); return true; } // See if keystore password is passed in or is passed through the validator - keystorePassword = (String)params.get("keystorePassword"); + keystorePassword = params.get("keystorePassword"); if (keystorePassword==null) { keystorePassword = getPassword(client); System.out.println("keystorePassword parameter null, using validator password for keystore"); @@ -86,7 +86,7 @@ System.out.println("keystorePassword parameter empty, using validator password for keystore"); } // See if alias (key) password is passed in or is passed through the validator - aliasPassword = (String)params.get("aliasPassword"); + aliasPassword = params.get("aliasPassword"); if (aliasPassword==null) { aliasPassword = getPassword(client); System.out.println("aliasPassword parameter null, using validator password for key"); @@ -95,7 +95,7 @@ System.out.println("aliasPassword parameter empty, using validator password for key"); } // Get keystore type from parameters or use default - keystoreType = (String)params.get("keystoreType"); + keystoreType = params.get("keystoreType"); if (keystoreFile==null) { keystoreType = "JKS"; System.out.println("keystoreType parameter null, using default of JKS"); @@ -104,7 +104,7 @@ System.out.println("keystoreType parameter empty, using default of JKS"); } // Get keystore location from params - keystoreFile = (String)params.get("keystoreFile"); + keystoreFile = params.get("keystoreFile"); if (keystoreFile!=null) { System.out.println("Attempting to open keystore: "+keystoreFile); KeyStore ks = getKeyStore(keystoreFile, keystoreType, keystorePassword.toCharArray()); @@ -112,7 +112,7 @@ returnValue = true; System.out.println("keystore password validated"); // check alias if provided - alias = (String)params.get("keystoreAlias"); + alias = params.get("keystoreAlias"); if (alias!=null) { returnValue = ks.containsAlias(alias); if (returnValue) { @@ -141,21 +141,21 @@ return (returnValue); } - private Map getParams(ProcessingClient client) { - Map returnValue = null; + private Map getParams(ProcessingClient client) { + Map returnValue = null; PasswordGroup group = null; InstallData idata = getIdata(client); VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables()); try { group = (PasswordGroup)client; if (group.hasParams()) { - Map params = group.getValidatorParams(); - returnValue = new HashMap(); - Iterator keys = params.keySet().iterator(); + Map params = group.getValidatorParams(); + returnValue = new HashMap(); + Iterator keys = params.keySet().iterator(); while (keys.hasNext()) { - String key = (String)keys.next(); + String key = keys.next(); // Feed parameter values through vs - String value = vs.substitute((String)params.get(key), null); + String value = vs.substitute(params.get(key), null); // System.out.println("Adding local parameter: "+key+"="+value); returnValue.put(key, value); } Index: src/lib/com/izforge/izpack/util/FileExecutor.java =================================================================== --- src/lib/com/izforge/izpack/util/FileExecutor.java (revision 2050) +++ src/lib/com/izforge/izpack/util/FileExecutor.java Fri Feb 22 14:20:30 GMT 2008 @@ -79,7 +79,7 @@ * * @param files the executable files to process */ - public FileExecutor(Collection files) + public FileExecutor(Collection files) { this.files = files; } @@ -246,10 +246,10 @@ String permissions = "a+x"; // loop through all executables - Iterator efileIterator = this.files.iterator(); + Iterator efileIterator = this.files.iterator(); while (exitStatus == 0 && efileIterator.hasNext()) { - ExecutableFile efile = (ExecutableFile) efileIterator.next(); + ExecutableFile efile = efileIterator.next(); boolean deleteAfterwards = !efile.keepFile; File file = new File(efile.path); Debug.trace("handling executable file " + efile); @@ -276,7 +276,7 @@ if ((exitStatus == 0) && ((currentStage == ExecutableFile.POSTINSTALL && efile.executionStage == ExecutableFile.POSTINSTALL) || (currentStage == ExecutableFile.UNINSTALL && efile.executionStage == ExecutableFile.UNINSTALL))) { - List paramList = new ArrayList(); + List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); @@ -307,7 +307,7 @@ String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) - params[i] = (String) paramList.get(i); + params[i] = paramList.get(i); exitStatus = executeCommand(params, output); @@ -368,7 +368,7 @@ private String buildClassPath(String targetFile) throws Exception { StringBuffer classPath = new StringBuffer(); - List jars = new ArrayList(); + List jars = new ArrayList(); String rawClassPath = targetFile.replace(':', File.pathSeparatorChar).replace(';', File.pathSeparatorChar); String[] rawJars = rawClassPath.split("" + File.pathSeparatorChar); for (int i = 0; i < rawJars.length; i++) @@ -397,7 +397,7 @@ } } - Iterator iter = jars.iterator(); + Iterator iter = jars.iterator(); if (iter.hasNext()) { classPath.append(iter.next()); @@ -411,5 +411,5 @@ } /** The files to execute. */ - private Collection files; + private Collection files; } Index: src/lib/com/izforge/izpack/installer/VariableHistoryTableCellRenderer.java =================================================================== --- src/lib/com/izforge/izpack/installer/VariableHistoryTableCellRenderer.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/VariableHistoryTableCellRenderer.java Fri Feb 22 14:20:30 GMT 2008 @@ -39,9 +39,9 @@ public class VariableHistoryTableCellRenderer extends DefaultTableCellRenderer { private static final long serialVersionUID = 6779914244548965230L; - private Map variablehistory; + private Map variablehistory; - public VariableHistoryTableCellRenderer(Map variablehistory) { + public VariableHistoryTableCellRenderer(Map variablehistory) { this.variablehistory = variablehistory; } @@ -73,9 +73,9 @@ } public void clearState() { - for (Iterator iterator = variablehistory.keySet().iterator(); iterator.hasNext();) + for (Iterator iterator = variablehistory.keySet().iterator(); iterator.hasNext();) { - VariableHistory vh = (VariableHistory) variablehistory.get(iterator.next()); + VariableHistory vh = variablehistory.get(iterator.next()); vh.clearState(); } } Index: src/lib/com/izforge/izpack/event/AntActionUninstallerListener.java =================================================================== --- src/lib/com/izforge/izpack/event/AntActionUninstallerListener.java (revision 2050) +++ src/lib/com/izforge/izpack/event/AntActionUninstallerListener.java Fri Feb 22 14:20:30 GMT 2008 @@ -44,7 +44,7 @@ { /** Ant actions to be performed after deletion */ - private List antActions = null; + private List antActions = null; /** * Default constructor @@ -76,8 +76,8 @@ List allActions = (List) objIn.readObject(); objIn.close(); in.close(); - ArrayList befDel = new ArrayList(); - antActions = new ArrayList(); + ArrayList befDel = new ArrayList(); + antActions = new ArrayList(); Iterator iter = allActions.iterator(); // There are two possible orders; before and after deletion. // Now we assign the actions to two different lists, the @@ -98,14 +98,14 @@ // install dir. File tmpFile = IoHelper.copyToTempFile(action.getBuildFile(), ".xml"); action.setBuildFile(tmpFile.getCanonicalPath()); - List props = action.getPropertyFiles(); + List props = action.getPropertyFiles(); if (props != null) { - Iterator iter2 = props.iterator(); - ArrayList newProps = new ArrayList(); + Iterator iter2 = props.iterator(); + ArrayList newProps = new ArrayList(); while (iter2.hasNext()) { - String propName = (String) iter2.next(); + String propName = iter2.next(); File propFile = IoHelper.copyToTempFile(propName, ".properties"); newProps.add(propFile.getCanonicalPath()); } @@ -119,7 +119,7 @@ { for (int i = 0; i < befDel.size(); i++) { - AntAction act = (AntAction) befDel.get(i); + AntAction act = befDel.get(i); act.performUninstallAction(); } } @@ -138,7 +138,7 @@ { // There are actions of the order "afterdeletion". for (int i = 0; i < antActions.size(); i++) { - AntAction act = (AntAction) antActions.get(i); + AntAction act = antActions.get(i); act.performUninstallAction(); } Index: src/lib/com/izforge/izpack/util/os/unix/UnixHelper.java =================================================================== --- src/lib/com/izforge/izpack/util/os/unix/UnixHelper.java (revision 2050) +++ src/lib/com/izforge/izpack/util/os/unix/UnixHelper.java Fri Feb 22 14:20:30 GMT 2008 @@ -52,9 +52,9 @@ * * @return the /etc/passwd as String ArrayList */ - public static ArrayList getEtcPasswdArray() + public static ArrayList getEtcPasswdArray() { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); String line = ""; BufferedReader reader = null; @@ -95,9 +95,9 @@ * * @return the /etc/passwd as String ArrayList */ - public static ArrayList getYpPasswdArray() + public static ArrayList getYpPasswdArray() { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); String line = ""; BufferedReader reader = null; Index: src/lib/com/izforge/izpack/util/MultiLineLabel.java =================================================================== --- src/lib/com/izforge/izpack/util/MultiLineLabel.java (revision 2050) +++ src/lib/com/izforge/izpack/util/MultiLineLabel.java Fri Feb 22 14:20:30 GMT 2008 @@ -92,7 +92,7 @@ private static final char NEW_LINE = '\n'; - protected Vector line = new Vector();// text lines to display + protected Vector line = new Vector();// text lines to display protected String labelText; // text lines to display @@ -434,7 +434,7 @@ for (int i = 0; i < numLines; i++) { - this.lineWidth[i] = fm.stringWidth((String) this.line.elementAt(i)); + this.lineWidth[i] = fm.stringWidth(this.line.elementAt(i)); if (this.lineWidth[i] > this.maxWidth) { this.maxWidth = this.lineWidth[i]; @@ -476,7 +476,7 @@ default: x = (d.width - lineWidth[i]) / 2; } - graphics.drawString((String) line.elementAt(i), x, y); + graphics.drawString(line.elementAt(i), x, y); } } Index: src/lib/net/n3/nanoxml/NonValidator.java =================================================================== --- src/lib/net/n3/nanoxml/NonValidator.java (revision 2050) +++ src/lib/net/n3/nanoxml/NonValidator.java Fri Feb 22 14:20:30 GMT 2008 @@ -63,20 +63,20 @@ /** * Contains the default values for attributes for the different element types. */ - protected Hashtable attributeDefaultValues; + protected Hashtable attributeDefaultValues; /** * The stack of elements to be processed. */ - protected Stack currentElements; + protected Stack currentElements; /** * Creates the "validator". */ public NonValidator() { - this.attributeDefaultValues = new Hashtable(); - this.currentElements = new Stack(); + this.attributeDefaultValues = new Hashtable(); + this.currentElements = new Stack(); this.parameterEntityResolver = new XMLEntityResolver(); this.peLevel = 0; } @@ -482,7 +482,7 @@ public void elementStarted(String name, String nsPrefix, String nsSystemId, String systemId, int lineNr) { - Properties attribs = (Properties) this.attributeDefaultValues.get(name); + Properties attribs = this.attributeDefaultValues.get(name); if (attribs == null) { @@ -526,7 +526,7 @@ public void elementAttributesProcessed(String name, String nsPrefix, String nsSystemId, Properties extraAttributes, String systemId, int lineNr) { - Properties props = (Properties) this.currentElements.pop(); + Properties props = this.currentElements.pop(); Enumeration enumeration = props.keys(); while (enumeration.hasMoreElements()) @@ -549,7 +549,7 @@ public void attributeAdded(String key, String nsPrefix, String nsSystemId, String value, String systemId, int lineNr) { - Properties props = (Properties) this.currentElements.peek(); + Properties props = this.currentElements.peek(); if (props.containsKey(key)) { Index: src/lib/com/izforge/izpack/util/OsConstraint.java =================================================================== --- src/lib/com/izforge/izpack/util/OsConstraint.java (revision 2050) +++ src/lib/com/izforge/izpack/util/OsConstraint.java Fri Feb 22 14:20:30 GMT 2008 @@ -185,16 +185,16 @@ * @param element parent XMLElement * @return List of OsConstraint (or empty List if no constraints found) */ - public static List getOsList(XMLElement element) + public static List getOsList(XMLElement element) { // get os info on this executable - ArrayList osList = new ArrayList(); - Iterator osIterator = element.getChildrenNamed("os").iterator(); + ArrayList osList = new ArrayList(); + Iterator osIterator = element.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { - XMLElement os = (XMLElement) osIterator.next(); + XMLElement os = osIterator.next(); osList.add(new OsConstraint(os.getAttribute("family", @@ -234,14 +234,14 @@ * @return true if one of the OsConstraints matched the current system or constraint_list is * null (no constraints), false if none of the OsConstraints matched */ - public static boolean oneMatchesCurrentSystem(List constraint_list) + public static boolean oneMatchesCurrentSystem(List constraint_list) { if (constraint_list == null) { return true; } // end if - Iterator constraint_it = constraint_list.iterator(); + Iterator constraint_it = constraint_list.iterator(); // no constraints at all - matches! if (!constraint_it.hasNext()) @@ -251,7 +251,7 @@ while (constraint_it.hasNext()) { - OsConstraint osc = (OsConstraint) constraint_it.next(); + OsConstraint osc = constraint_it.next(); Debug.trace("checking if os constraints " + osc + " match current OS"); Index: src/lib/com/izforge/izpack/installer/Debugger.java =================================================================== --- src/lib/com/izforge/izpack/installer/Debugger.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/Debugger.java Fri Feb 22 14:20:29 GMT 2008 @@ -65,8 +65,8 @@ private JTextPane debugtxt; private IconsDatabase icons; - private Map variableshistory; - private Map conditionhistory; + private Map variableshistory; + private Map conditionhistory; private JTable variablestable; private VariableHistoryTableModel variablesmodel; @@ -79,8 +79,8 @@ this.rules = rules; lasttimevariables = (Properties) idata.variables.clone(); this.icons = icons; - this.variableshistory = new HashMap(); - this.conditionhistory = new HashMap(); + this.variableshistory = new HashMap(); + this.conditionhistory = new HashMap(); this.init(); } @@ -133,7 +133,7 @@ conditionhistory.put(conditionid, ch); } else { - ch = (ConditionHistory) conditionhistory.get(conditionid); + ch = conditionhistory.get(conditionid); } ch.addValue(this.rules.isConditionTrue(currentcondition), comment); } @@ -162,7 +162,7 @@ } else { if (!currentvalue.equals(oldvalue)) { - VariableHistory vh = (VariableHistory) variableshistory.get(key); + VariableHistory vh = variableshistory.get(key); vh.addValue(currentvalue, "changed value after panel " + lastpanelmetadata.getPanelid()); changes = true; changedvariables.put(key, currentvalue); @@ -178,7 +178,7 @@ private void modifyVariableManually(String varnametxt, String varvaluetxt) { lasttimevariables = (Properties) idata.variables.clone(); - VariableHistory vh = (VariableHistory) variableshistory.get(varnametxt); + VariableHistory vh = variableshistory.get(varnametxt); if (vh != null) { vh.addValue(varvaluetxt, "modified manually"); } @@ -237,7 +237,7 @@ varname.setText(selectedvariable); } else { - VariableHistory vh = (VariableHistory) variableshistory.get(selectedvariable); + VariableHistory vh = variableshistory.get(selectedvariable); JFrame variabledetails = new JFrame("Details"); @@ -303,7 +303,7 @@ if (e.getClickCount() == 2) { - ConditionHistory ch = (ConditionHistory) conditionhistory.get(selectedcondition); + ConditionHistory ch = conditionhistory.get(selectedcondition); JFrame variabledetails = new JFrame("Details"); Index: src/lib/com/izforge/izpack/panels/ProcessingClient.java =================================================================== --- src/lib/com/izforge/izpack/panels/ProcessingClient.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/ProcessingClient.java Fri Feb 22 14:20:30 GMT 2008 @@ -86,7 +86,7 @@ * @return a java.util.Map containing the validator parameters. */ /*--------------------------------------------------------------------------*/ - public Map getValidatorParams(); + public Map getValidatorParams(); } /*---------------------------------------------------------------------------*/ Index: src/lib/com/izforge/izpack/installer/CompileWorker.java =================================================================== --- src/lib/com/izforge/izpack/installer/CompileWorker.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/CompileWorker.java Fri Feb 22 14:20:30 GMT 2008 @@ -67,7 +67,7 @@ { /** Compilation jobs */ - private ArrayList jobs; + private ArrayList jobs; /** Name of resource for specifying compilation parameters. */ private static final String SPEC_RESOURCE_NAME = "CompilePanel.Spec.xml"; @@ -86,13 +86,13 @@ private XMLElement compilerSpec; - private ArrayList compilerList; + private ArrayList compilerList; private String compilerToUse; private XMLElement compilerArgumentsSpec; - private ArrayList compilerArgumentsList; + private ArrayList compilerArgumentsList; private String compilerArgumentsToUse; @@ -119,7 +119,7 @@ * * @return ArrayList of String */ - public ArrayList getAvailableCompilers() + public ArrayList getAvailableCompilers() { readChoices(this.compilerSpec, this.compilerList); return this.compilerList; @@ -152,7 +152,7 @@ * * @return ArrayList of String */ - public ArrayList getAvailableArguments() + public ArrayList getAvailableArguments() { readChoices(this.compilerArgumentsSpec, this.compilerArgumentsList); return this.compilerArgumentsList; @@ -207,7 +207,7 @@ { if (!collectJobs()) { - List args = new ArrayList(); + List args = new ArrayList(); args.add ("nothing to do"); this.result = new CompileResult(this.idata.langpack @@ -258,8 +258,8 @@ if (!this.spec.hasChildren()) return false; - this.compilerArgumentsList = new ArrayList(); - this.compilerList = new ArrayList(); + this.compilerArgumentsList = new ArrayList(); + this.compilerList = new ArrayList(); // read information XMLElement global = this.spec.getFirstChildNamed("global"); @@ -305,25 +305,25 @@ } // helper function - private void readChoices(XMLElement element, ArrayList choiceList) + private void readChoices(XMLElement element, ArrayList choiceList) { - Vector choices = element.getChildrenNamed("choice"); + Vector choices = element.getChildrenNamed("choice"); if (choices == null) return; choiceList.clear(); - Iterator choice_it = choices.iterator(); + Iterator choice_it = choices.iterator(); while (choice_it.hasNext()) { - XMLElement choice = (XMLElement) choice_it.next(); + XMLElement choice = choice_it.next(); String value = choice.getAttribute("value"); if (value != null) { - List osconstraints = OsConstraint.getOsList(choice); + List osconstraints = OsConstraint.getOsList(choice); if (OsConstraint.oneMatchesCurrentSystem(osconstraints)) { @@ -365,7 +365,7 @@ // list of classpath entries ArrayList classpath = new ArrayList(); - this.jobs = new ArrayList(); + this.jobs = new ArrayList(); // we throw away the toplevel compilation job // (all jobs are collected in this.jobs) @@ -377,7 +377,7 @@ /** perform the actual compilation */ private CompileResult compileJobs() { - ArrayList args = new ArrayList(); + ArrayList args = new ArrayList(); StringTokenizer tokenizer = new StringTokenizer(this.compilerArgumentsToUse); while (tokenizer.hasMoreTokens()) @@ -385,14 +385,14 @@ args.add(tokenizer.nextToken()); } - Iterator job_it = this.jobs.iterator(); + Iterator job_it = this.jobs.iterator(); this.handler.startAction("Compilation", this.jobs.size()); // check whether compiler is valid (but only if there are jobs) if (job_it.hasNext()) { - CompilationJob first_job = (CompilationJob) this.jobs.get(0); + CompilationJob first_job = this.jobs.get(0); CompileResult check_result = first_job.checkCompiler(this.compilerToUse, args); if (!check_result.isContinue()) { return check_result; } @@ -403,7 +403,7 @@ while (job_it.hasNext()) { - CompilationJob job = (CompilationJob) job_it.next(); + CompilationJob job = job_it.next(); this.handler.nextStep(job.getName(), job.getSize(), job_no++); @@ -421,7 +421,7 @@ { Enumeration toplevel_tags = node.enumerateChildren(); ArrayList ourclasspath = (ArrayList) classpath.clone(); - ArrayList files = new ArrayList(); + ArrayList files = new ArrayList(); while (toplevel_tags.hasMoreElements()) { @@ -546,11 +546,11 @@ * * @return list of files found (might be empty) */ - private ArrayList scanDirectory(File path) + private ArrayList scanDirectory(File path) { Debug.trace("scanning directory " + path.getAbsolutePath()); - ArrayList scan_result = new ArrayList(); + ArrayList scan_result = new ArrayList(); if (!path.isDirectory()) return scan_result; @@ -584,7 +584,7 @@ private String name; - private ArrayList files; + private ArrayList files; private ArrayList classpath; @@ -605,7 +605,7 @@ * @param classpath The class path to use. */ public CompilationJob(CompileHandler listener, AutomatedInstallData idata, String name, - ArrayList files, ArrayList classpath) + ArrayList files, ArrayList classpath) { this.listener = listener; this.idata = idata; @@ -644,19 +644,19 @@ * @param arguments The compiler arguments to use. * @return The result. */ - public CompileResult perform(String compiler, ArrayList arguments) + public CompileResult perform(String compiler, ArrayList arguments) { Debug.trace("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler - LinkedList args = new LinkedList(arguments); + LinkedList args = new LinkedList(arguments); { - Iterator arg_it = args.iterator(); + Iterator arg_it = args.iterator(); while (arg_it.hasNext()) - cmdline_len += ((String) arg_it.next()).length() + 1; + cmdline_len += (arg_it.next()).length() + 1; } boolean isEclipseCompiler = compiler.equalsIgnoreCase(ECLIPSE_COMPILER_NAME); @@ -703,11 +703,11 @@ int last_fileno = 0; // now iterate over all files of this job - Iterator file_it = this.files.iterator(); + Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { - File f = (File) file_it.next(); + File f = file_it.next(); String fpath = f.getAbsolutePath(); @@ -749,10 +749,10 @@ // verify that all files have been compiled successfully // I found that sometimes, no error code is returned // although compilation failed. - Iterator arg_it = args.listIterator(common_args_no); + Iterator arg_it = args.listIterator(common_args_no); while (arg_it.hasNext()) { - File java_file = new File((String) arg_it.next()); + File java_file = new File(arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf('.'); @@ -808,10 +808,10 @@ // verify that all files have been compiled successfully // I found that sometimes, no error code is returned // although compilation failed. - Iterator arg_it = args.listIterator(common_args_no); + Iterator arg_it = args.listIterator(common_args_no); while (arg_it.hasNext()) { - File java_file = new File((String) arg_it.next()); + File java_file = new File(arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf('.'); @@ -848,7 +848,7 @@ * @param output The output from the compiler ([0] = stdout, [1] = stderr) * @return The result of the compilation. */ - private int runCompiler(FileExecutor executor, String[] output, List cmdline) + private int runCompiler(FileExecutor executor, String[] output, List cmdline) { if (cmdline.get(0).equals (ECLIPSE_COMPILER_NAME)) return runEclipseCompiler(output, cmdline); @@ -856,11 +856,11 @@ return executor.executeCommand((String[])cmdline.toArray(new String[cmdline.size()]), output); } - private int runEclipseCompiler (String[] output, List cmdline) + private int runEclipseCompiler (String[] output, List cmdline) { try { - List final_cmdline = new LinkedList (cmdline); + List final_cmdline = new LinkedList(cmdline); // remove compiler name from argument list final_cmdline.remove(0); @@ -988,7 +988,7 @@ * @param arguments additional arguments to pass to the compiler * @return false on error */ - public CompileResult checkCompiler(String compiler, ArrayList arguments) + public CompileResult checkCompiler(String compiler, ArrayList arguments) { // don't do further checks for eclipse compiler - it would exit if (compiler.equalsIgnoreCase(ECLIPSE_COMPILER_NAME)) @@ -1001,7 +1001,7 @@ Debug.trace("checking whether \"" + compiler + " -help\" works"); { - List args = new ArrayList(); + List args = new ArrayList(); args.add (compiler); args.add ("-help"); @@ -1020,7 +1020,7 @@ Debug.trace("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler - LinkedList args = new LinkedList(arguments); + LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add(0, "-help"); Index: src/lib/com/izforge/izpack/panels/TextInputField.java =================================================================== --- src/lib/com/izforge/izpack/panels/TextInputField.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/TextInputField.java Fri Feb 22 14:20:30 GMT 2008 @@ -47,7 +47,7 @@ /** * Validator parameters. */ - private Map validatorParams; + private Map validatorParams; /** * Holds an instance of the Validator if one was specified and available @@ -77,7 +77,7 @@ * @param validatorParams validator parameters. */ /*--------------------------------------------------------------------------*/ - public TextInputField(String set, int size, String validator, Map validatorParams) { + public TextInputField(String set, int size, String validator, Map validatorParams) { this(set, size, validator); this.validatorParams = validatorParams; this.hasParams = true; @@ -135,7 +135,7 @@ * * @return a java.util.Map containing the validator parameters. */ - public Map getValidatorParams() + public Map getValidatorParams() { return validatorParams; } Index: src/lib/com/izforge/izpack/installer/CompileResult.java =================================================================== --- src/lib/com/izforge/izpack/installer/CompileResult.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/CompileResult.java Fri Feb 22 14:20:30 GMT 2008 @@ -68,7 +68,7 @@ private String message = null; /** the command line */ - private List cmdline = null; + private List cmdline = null; /** the stdout of the command */ private String stdout = null; @@ -105,7 +105,7 @@ * @param stdout standard output of failed command * @param stderr standard error of failed command */ - public CompileResult(String message, List cmdline, String stdout, String stderr) + public CompileResult(String message, List cmdline, String stdout, String stderr) { this.message = message; this.status = FAILED; @@ -188,10 +188,10 @@ public String getCmdline() { StringBuffer sb = new StringBuffer(); - for (Iterator cmdIt = this.cmdline.iterator(); cmdIt.hasNext();) + for (Iterator cmdIt = this.cmdline.iterator(); cmdIt.hasNext();) { if (sb.length() > 0) sb.append(' '); - sb.append((String)cmdIt.next()); + sb.append(cmdIt.next()); } return sb.toString(); } Index: src/lib/com/izforge/izpack/util/Console.java =================================================================== --- src/lib/com/izforge/izpack/util/Console.java (revision 2050) +++ src/lib/com/izforge/izpack/util/Console.java Fri Feb 22 14:20:30 GMT 2008 @@ -36,6 +36,7 @@ import java.io.PipedOutputStream; import java.io.PrintStream; import java.io.PrintWriter; +import java.util.Vector; import javax.swing.JFrame; import javax.swing.JScrollPane; @@ -371,7 +372,7 @@ private PipedInputStream in; - private java.util.Vector history; + private Vector history; private int historyIndex = -1; @@ -386,7 +387,7 @@ public ConsoleTextArea() { super(); - history = new java.util.Vector(); + history = new java.util.Vector(); console1 = new ConsoleWriter(this); ConsoleWriter console2 = new ConsoleWriter(this); out = new PrintStream(console1); @@ -497,7 +498,7 @@ } if (historyIndex >= 0) { - String str = (String) history.elementAt(historyIndex); + String str = history.elementAt(historyIndex); int len = getDocument().getLength(); replaceRange(str, outputMark, len); int caretPos = outputMark + str.length(); @@ -527,7 +528,7 @@ int len = getDocument().getLength(); if (historyIndex < history.size()) { - String str = (String) history.elementAt(historyIndex); + String str = history.elementAt(historyIndex); replaceRange(str, outputMark, len); caretPos = outputMark + str.length(); } Index: src/lib/com/izforge/izpack/util/PasswordEqualityValidator.java =================================================================== --- src/lib/com/izforge/izpack/util/PasswordEqualityValidator.java (revision 2050) +++ src/lib/com/izforge/izpack/util/PasswordEqualityValidator.java Fri Feb 22 14:20:29 GMT 2008 @@ -46,7 +46,7 @@ */ public boolean validate(ProcessingClient client) { boolean returnValue = false; - Map params = getParams(client); + Map params = getParams(client); try { returnValue = fieldsMatch(client); if (returnValue) { @@ -61,9 +61,9 @@ return (returnValue); } - private Map getParams(ProcessingClient client) { + private Map getParams(ProcessingClient client) { PasswordGroup group = null; - Map params = null; + Map params = null; try { group = (PasswordGroup)client; if (group.hasParams()) { Index: src/lib/com/izforge/izpack/panels/InstallationGroupPanel.java =================================================================== --- src/lib/com/izforge/izpack/panels/InstallationGroupPanel.java (revision 2050) +++ src/lib/com/izforge/izpack/panels/InstallationGroupPanel.java Fri Feb 22 14:20:30 GMT 2008 @@ -78,7 +78,7 @@ private static final long serialVersionUID = 1L; /** HashMap of the InstallData.availablePacks */ - private HashMap packsByName; + private HashMap packsByName; private TableModel groupTableModel; private JTextPane descriptionField; private JScrollPane groupScrollPane; @@ -100,8 +100,8 @@ { // Set/restore availablePacks from allPacks; consider OS constraints idata.availablePacks = new ArrayList(); - for (Iterator i = idata.allPacks.iterator(); i.hasNext(); ) { - Pack p = (Pack)i.next(); + for (Iterator i = idata.allPacks.iterator(); i.hasNext(); ) { + Pack p = i.next(); if (OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) idata.availablePacks.add(p); } @@ -310,7 +310,7 @@ } } } - protected void addDependents(Pack p, HashMap packsByName, GroupData data) + protected void addDependents(Pack p, HashMap packsByName, GroupData data) { data.packNames.add(p.name); data.size += p.nbytes; @@ -318,15 +318,15 @@ if( p.dependencies == null || p.dependencies.size() == 0 ) return; - Iterator iter = p.dependencies.iterator(); + Iterator iter = p.dependencies.iterator(); Debug.trace(p.name+" dependencies: "+p.dependencies); while( iter.hasNext() ) { - String dependent = (String) iter.next(); + String dependent = iter.next(); if(!data.packNames.contains(dependent)) { Debug.trace("Need dependent: "+dependent); - Pack dependentPack = (Pack) packsByName.get(dependent); + Pack dependentPack = packsByName.get(dependent); addDependents(dependentPack, packsByName, data); } } @@ -346,18 +346,18 @@ /* First create a packsByName of all packs and identify the unique install group names. */ - packsByName = new HashMap(); + packsByName = new HashMap(); HashMap installGroups = new HashMap(); for (int n = 0; n < idata.availablePacks.size(); n++) { Pack p = (Pack) idata.availablePacks.get(n); packsByName.put(p.name, p); - Set groups = p.installGroups; - Iterator iter = groups.iterator(); + Set groups = p.installGroups; + Iterator iter = groups.iterator(); Debug.trace("Pack: "+p.name+", installGroups: "+groups); while (iter.hasNext()) { - String group = (String) iter.next(); + String group = iter.next(); GroupData data = (GroupData) installGroups.get(group); if (data == null) { @@ -382,7 +382,7 @@ while( iter.hasNext() ) { Pack p = (Pack) iter.next(); - Set groups = p.installGroups; + Set groups = p.installGroups; if( groups.size() == 0 || groups.contains(data.name)) { // The pack may have already been added while traversing dependencies @@ -591,7 +591,7 @@ String description; String sortKey; long size; - HashSet packNames = new HashSet(); + HashSet packNames = new HashSet(); GroupData(String name, String description, String sortKey) { Index: src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java =================================================================== --- src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java (revision 2050) +++ src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java Fri Feb 22 14:20:30 GMT 2008 @@ -278,9 +278,9 @@ * * @see com.izforge.izpack.util.os.Shortcut#getProgramGroups(int) */ - public Vector getProgramGroups(int userType) + public Vector getProgramGroups(int userType) { - Vector groups = new Vector(); + Vector groups = new Vector(); File kdeShareApplnk = getKdeShareApplnkFolder(userType); Index: src/lib/com/izforge/izpack/ExecutableFile.java =================================================================== --- src/lib/com/izforge/izpack/ExecutableFile.java (revision 2050) +++ src/lib/com/izforge/izpack/ExecutableFile.java Fri Feb 22 14:20:30 GMT 2008 @@ -21,6 +21,8 @@ package com.izforge.izpack; +import com.izforge.izpack.util.OsConstraint; + import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -74,10 +76,10 @@ public int onFailure; /** List of arguments */ - public List argList = null; + public List argList = null; /** List of operating systems to run on */ - public List osList = null; + public List osList = null; /** * Indicates the file should be kept after executing. Default is false for backward @@ -96,8 +98,8 @@ mainClass = null; type = BIN; onFailure = ASK; - osList = new ArrayList(); - argList = new ArrayList(); + osList = new ArrayList(); + argList = new ArrayList(); keepFile = false; } @@ -109,7 +111,7 @@ * @param onFailure what to do if execution fails * @param osList list of operating systems to run on */ - public ExecutableFile(String path, int executionStage, int onFailure, java.util.List osList, + public ExecutableFile(String path, int executionStage, int onFailure, List osList, boolean keepFile) { this.path = path; @@ -120,7 +122,7 @@ } public ExecutableFile(String path, int type, String mainClass, int executionStage, - int onFailure, java.util.List argList, java.util.List osList, boolean keepFile) + int onFailure, List argList, List osList, boolean keepFile) { this.path = path; this.mainClass = mainClass; Index: src/lib/com/izforge/izpack/event/AntActionInstallerListener.java =================================================================== --- src/lib/com/izforge/izpack/event/AntActionInstallerListener.java (revision 2050) +++ src/lib/com/izforge/izpack/event/AntActionInstallerListener.java Fri Feb 22 14:20:30 GMT 2008 @@ -60,9 +60,9 @@ /** Name of the specification file */ public static final String SPEC_FILE_NAME = "AntActionsSpec.xml"; - private HashMap actions = null; + private HashMap>> actions = null; - private ArrayList uninstActions = null; + private ArrayList uninstActions = null; /** * Default constructor @@ -70,8 +70,8 @@ public AntActionInstallerListener() { super(true); - actions = new HashMap(); - uninstActions = new ArrayList(); + actions = new HashMap>>(); + uninstActions = new ArrayList(); } /** @@ -79,7 +79,7 @@ * * @return the actions map */ - public HashMap getActions() + public HashMap>> getActions() { return (actions); } @@ -111,27 +111,27 @@ if (pack == null) continue; // Prepare the action cache - HashMap packActions = new HashMap(); - packActions.put(ActionBase.BEFOREPACK, new ArrayList()); - packActions.put(ActionBase.AFTERPACK, new ArrayList()); - packActions.put(ActionBase.BEFOREPACKS, new ArrayList()); - packActions.put(ActionBase.AFTERPACKS, new ArrayList()); + HashMap> packActions = new HashMap>(); + packActions.put(ActionBase.BEFOREPACK, new ArrayList()); + packActions.put(ActionBase.AFTERPACK, new ArrayList()); + packActions.put(ActionBase.BEFOREPACKS, new ArrayList()); + packActions.put(ActionBase.AFTERPACKS, new ArrayList()); // Get all entries for antcalls. - Vector antCallEntries = pack.getChildrenNamed(AntAction.ANTCALL); + Vector antCallEntries = pack.getChildrenNamed(AntAction.ANTCALL); if (antCallEntries != null && antCallEntries.size() >= 1) { - Iterator entriesIter = antCallEntries.iterator(); + Iterator entriesIter = antCallEntries.iterator(); while (entriesIter != null && entriesIter.hasNext()) { - AntAction act = readAntCall((XMLElement) entriesIter.next()); + AntAction act = readAntCall(entriesIter.next()); if (act != null) { - ((ArrayList) packActions.get(act.getOrder())).add(act); + (packActions.get(act.getOrder())).add(act); } } // Set for progress bar interaction. - if (((ArrayList) packActions.get(ActionBase.AFTERPACKS)).size() > 0) + if ((packActions.get(ActionBase.AFTERPACKS)).size() > 0) this.setProgressBarCaller(); } @@ -201,7 +201,7 @@ while (iter.hasNext()) { String currentPack = ((Pack) iter.next()).name; - ArrayList actList = getActions(currentPack, order); + ArrayList actList = getActions(currentPack, order); if (actList != null) retval += actList.size(); } return (retval); @@ -215,14 +215,14 @@ * @return a list which contains all defined actions for the given pack and order */ // ------------------------------------------------------- - protected ArrayList getActions(String packName, String order) + protected ArrayList getActions(String packName, String order) { if (actions == null) return null; - HashMap packActions = (HashMap) actions.get(packName); + HashMap> packActions = actions.get(packName); if (packActions == null || packActions.size() == 0) return null; - return (ArrayList) packActions.get(order); + return packActions.get(order); } /** @@ -235,13 +235,13 @@ private void performAllActions(String packName, String order, AbstractUIProgressHandler handler) throws InstallerException { - ArrayList actList = getActions(packName, order); + ArrayList actList = getActions(packName, order); if (actList == null || actList.size() == 0) return; Debug.trace("******* Executing all " + order + " actions of " + packName + " ..."); for (int i = 0; i < actList.size(); i++) { - AntAction act = (AntAction) actList.get(i); + AntAction act = actList.get(i); // Inform progress bar if needed. Works only // on AFTER_PACKS if (informProgressBar() && handler != null @@ -298,10 +298,10 @@ if (msgId != null && msgId.length() > 0) act.setMessageID(msgId); // read propertyfiles - Iterator iter = el.getChildrenNamed(ActionBase.PROPERTYFILE).iterator(); + Iterator iter = el.getChildrenNamed(ActionBase.PROPERTYFILE).iterator(); while (iter.hasNext()) { - XMLElement propEl = (XMLElement) iter.next(); + XMLElement propEl = iter.next(); act.addPropertyFile(spec.getRequiredAttribute(propEl, ActionBase.PATH)); } @@ -309,7 +309,7 @@ iter = el.getChildrenNamed(ActionBase.PROPERTY).iterator(); while (iter.hasNext()) { - XMLElement propEl = (XMLElement) iter.next(); + XMLElement propEl = iter.next(); act.setProperty(spec.getRequiredAttribute(propEl, ActionBase.NAME), spec .getRequiredAttribute(propEl, ActionBase.VALUE)); } @@ -318,7 +318,7 @@ iter = el.getChildrenNamed(ActionBase.TARGET).iterator(); while (iter.hasNext()) { - XMLElement targEl = (XMLElement) iter.next(); + XMLElement targEl = iter.next(); act.addTarget(spec.getRequiredAttribute(targEl, ActionBase.NAME)); } @@ -326,7 +326,7 @@ iter = el.getChildrenNamed(ActionBase.UNINSTALL_TARGET).iterator(); while (iter.hasNext()) { - XMLElement utargEl = (XMLElement) iter.next(); + XMLElement utargEl = iter.next(); act.addUninstallTarget(spec.getRequiredAttribute(utargEl, ActionBase.NAME)); } Index: src/lib/com/izforge/izpack/util/os/Shortcut.java =================================================================== --- src/lib/com/izforge/izpack/util/os/Shortcut.java (revision 2050) +++ src/lib/com/izforge/izpack/util/os/Shortcut.java Fri Feb 22 14:20:30 GMT 2008 @@ -123,7 +123,7 @@ * @see #APPLICATIONS * @see #START_MENU */ - public Vector getProgramGroups(int userType) + public Vector getProgramGroups(int userType) { return (null); } Index: src/lib/com/izforge/izpack/compressor/PackCompressorBase.java =================================================================== --- src/lib/com/izforge/izpack/compressor/PackCompressorBase.java (revision 2050) +++ src/lib/com/izforge/izpack/compressor/PackCompressorBase.java Fri Feb 22 14:25:03 GMT 2008 @@ -63,7 +63,7 @@ protected Class [] paramsClasses = null; private Compiler compiler; - private Constructor constructor; + private Constructor constructor; private int level = -1; /** * @@ -162,10 +162,10 @@ { if( getEncoderClassName() == null) return; - Class encoder = null; + Class encoder = null; if( getContainerPaths() == null ) { // May be class files are in the compiler.jar. - encoder = Class.forName(className); + encoder = (Class) Class.forName(className); } if( encoder == null) { @@ -228,7 +228,7 @@ // compile will fail at using it via an Ant task. URLClassLoader ucl = new URLClassLoader(uRLs, PackCompressor.class .getClassLoader()); - encoder = ucl.loadClass(className); + encoder = (Class) ucl.loadClass(className); } } Index: src/lib/com/izforge/izpack/Info.java =================================================================== --- src/lib/com/izforge/izpack/Info.java (revision 2050) +++ src/lib/com/izforge/izpack/Info.java Fri Feb 22 14:20:30 GMT 2008 @@ -41,7 +41,7 @@ private String installationSubPath = null; /** The application authors */ - private ArrayList authors = new ArrayList(); + private ArrayList authors = new ArrayList(); /** The application URL */ private String appURL = null; @@ -131,7 +131,7 @@ * * @return The authors list. */ - public ArrayList getAuthors() + public ArrayList getAuthors() { return authors; } Index: src/lib/com/izforge/izpack/compiler/Compiler.java =================================================================== --- src/lib/com/izforge/izpack/compiler/Compiler.java (revision 2050) +++ src/lib/com/izforge/izpack/compiler/Compiler.java Fri Feb 22 14:20:30 GMT 2008 @@ -44,9 +44,11 @@ import com.izforge.izpack.Info; import com.izforge.izpack.Pack; import com.izforge.izpack.Panel; +import com.izforge.izpack.rules.Condition; import com.izforge.izpack.compressor.PackCompressor; import com.izforge.izpack.util.Debug; import com.izforge.izpack.util.VariableSubstitutor; +import com.izforge.izpack.util.OsConstraint; /** * The IzPack compiler class. This is now a java bean style class that can be @@ -400,7 +402,7 @@ * nested within another. * @param files to be copied */ - public void addJarContent(URL content, List files) + public void addJarContent(URL content, List files) { packager.addJarContent(content, files); } @@ -496,16 +498,16 @@ * @param packs list of packs which should be checked * @throws CompilerException */ - public void checkExcludes(List packs) throws CompilerException + public void checkExcludes(List packs) throws CompilerException { for(int q=0; q representing the packs in the installation * @throws CompilerException */ - public void checkDependencies(List packs) throws CompilerException + public void checkDependencies(List packs) throws CompilerException { // Because we use package names in the configuration file we assosiate // the names with the objects - Map names = new HashMap(); + Map names = new HashMap(); for (int i = 0; i < packs.size(); i++) { - PackInfo pack = (PackInfo) packs.get(i); + PackInfo pack = packs.get(i); names.put(pack.getPack().name, pack); } int result = dfs(packs, names); @@ -556,12 +558,12 @@ * @param names The name map * @return -2 if back edges exist, else 0 */ - private int dfs(List packs, Map names) + private int dfs(List packs, Map names) { - Map edges = new HashMap(); + Map edges = new HashMap(); for (int i = 0; i < packs.size(); i++) { - PackInfo pack = (PackInfo) packs.get(i); + PackInfo pack = packs.get(i); if (pack.colour == PackInfo.WHITE) { if (dfsVisit(pack, names, edges) != 0) return -1; @@ -576,13 +578,13 @@ * @param edges map to be checked * @return -2 if back edges exist, else 0 */ - private int checkBackEdges(Map edges) + private int checkBackEdges(Map edges) { - Set keys = edges.keySet(); - for (Iterator iterator = keys.iterator(); iterator.hasNext();) + Set keys = edges.keySet(); + for (Iterator iterator = keys.iterator(); iterator.hasNext();) { final Object key = iterator.next(); - int color = ((Integer) edges.get(key)).intValue(); + int color = (edges.get(key)).intValue(); if (color == PackInfo.GREY) { return -2; } } return 0; @@ -606,16 +608,16 @@ } } - private int dfsVisit(PackInfo u, Map names, Map edges) + private int dfsVisit(PackInfo u, Map names, Map edges) { u.colour = PackInfo.GREY; - List deps = u.getDependencies(); + List deps = u.getDependencies(); if (deps != null) { for (int i = 0; i < deps.size(); i++) { - String name = (String) deps.get(i); - PackInfo v = (PackInfo) names.get(name); + String name = deps.get(i); + PackInfo v = names.get(name); if (v == null) { System.out.println("Failed to find dependency: "+name); @@ -724,11 +726,11 @@ * @param constraints The list of constraints. * @throws Exception Thrown in case an error occurs. */ - public void addCustomListener(int type, String className, String jarPath, List constraints) throws Exception + public void addCustomListener(int type, String className, String jarPath, List constraints) throws Exception { jarPath = replaceProperties(jarPath); URL url = findIzPackResource(jarPath, "CustomAction jar file"); - List filePaths = getContainedFilePaths(url); + List filePaths = getContainedFilePaths(url); String fullClassName = getFullClassName(url, className); if (fullClassName == null) { @@ -747,11 +749,11 @@ * @return full qualified paths of the contained files * @throws Exception */ - private List getContainedFilePaths(URL url) throws Exception + private List getContainedFilePaths(URL url) throws Exception { JarInputStream jis = new JarInputStream(url.openStream()); ZipEntry zentry = null; - ArrayList fullNames = new ArrayList(); + ArrayList fullNames = new ArrayList(); while ((zentry = jis.getNextEntry()) != null) { String name = zentry.getName(); @@ -869,7 +871,7 @@ /** * @return the conditions */ - public Map getConditions() + public Map getConditions() { return this.packager.getRules(); } @@ -878,18 +880,18 @@ /** * @param conditions the conditions to set */ - public void setConditions(Map conditions) + public void setConditions(Map conditions) { this.packager.setRules(conditions); } - public Map getDynamicVariables() + public Map getDynamicVariables() { return this.packager.getDynamicVariables(); } - public void setDynamicVariables(Map dynamicvariables) + public void setDynamicVariables(Map dynamicvariables) { this.packager.setDynamicVariables(dynamicvariables); } Index: src/lib/com/izforge/izpack/installer/ConditionHistoryTableModel.java =================================================================== --- src/lib/com/izforge/izpack/installer/ConditionHistoryTableModel.java (revision 2050) +++ src/lib/com/izforge/izpack/installer/ConditionHistoryTableModel.java Fri Feb 22 14:20:30 GMT 2008 @@ -36,9 +36,9 @@ private static final long serialVersionUID = 5966543100431588652L; public static final String[] columnheader = {"Id","Value"}; - private Map conditionvalues; + private Map conditionvalues; - public ConditionHistoryTableModel(Map values) { + public ConditionHistoryTableModel(Map values) { this.conditionvalues = values; } @@ -72,7 +72,7 @@ case 1: String conditionid = (String) getValueAt(rowIndex, 0); - ConditionHistory ch = (ConditionHistory) conditionvalues.get(conditionid); + ConditionHistory ch = conditionvalues.get(conditionid); return ch; } return null;