[izpack-changes] izpack-src/src/lib/com/izforge/izpack/panels CompilePanel.java,1.13,1.14 FinishPanel.java,1.24,1.25 HTMLInfoPanel.java,1.17,1.18 HTMLLicencePanel.java,1.19,1.20 HelloPanel.java,1.19,1.20 ImgPacksPanel.java,1.25,1.26 InfoPanel.java,1.17,1.18 InstallPanel.java,1.26,1.27 InstallPanelAutomationHelper.java,1.9,1.10 JDKPathPanel.java,1.14,1.15 LicencePanel.java,1.19,1.20 PacksModel.java,1.9,1.10 PacksPanelAutomationHelper.java,1.10,1.11 PacksPanelBase.java,1.9,1.10 PathInputPanel.java,1.11,1.12 ProcessPanel.java,1.7,1.8 ProcessPanelAutomationHelper.java,1.4,1.5 RuleInputField.java,1.17,1.18 RuleTextField.java,1.11,1.12 SelectPrinterPanel.java,1.2,1.3 ShortcutData.java,1.16,1.17 ShortcutPanel.java,1.41,1.42 SimpleFinishPanel.java,1.9,1.10 UserInputPanel.java,1.43,1.44 XInfoPanel.java,1.22,1.23

jponge nobody at sheep.berlios.de
Tue Mar 21 19:14:55 CET 2006


Update of /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels
In directory sheep:/tmp/cvs-serv3622/src/lib/com/izforge/izpack/panels

Modified Files:
	CompilePanel.java FinishPanel.java HTMLInfoPanel.java 
	HTMLLicencePanel.java HelloPanel.java ImgPacksPanel.java 
	InfoPanel.java InstallPanel.java 
	InstallPanelAutomationHelper.java JDKPathPanel.java 
	LicencePanel.java PacksModel.java 
	PacksPanelAutomationHelper.java PacksPanelBase.java 
	PathInputPanel.java ProcessPanel.java 
	ProcessPanelAutomationHelper.java RuleInputField.java 
	RuleTextField.java SelectPrinterPanel.java ShortcutData.java 
	ShortcutPanel.java SimpleFinishPanel.java UserInputPanel.java 
	XInfoPanel.java 
Log Message:
Some fixes adviced by IntelliJ IDEA 5.1 code inspector.

Index: CompilePanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/CompilePanel.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- CompilePanel.java	12 Mar 2006 16:32:25 -0000	1.13
+++ CompilePanel.java	21 Mar 2006 18:14:46 -0000	1.14
@@ -478,7 +478,7 @@
 
         // We clip the panel
         Dimension dim = parent.getPanelsContainerSize();
-        dim.width = dim.width - (dim.width / 4);
+        dim.width -= (dim.width / 4);
         dim.height = 150;
         setMinimumSize(dim);
         setMaximumSize(dim);

Index: FinishPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/FinishPanel.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- FinishPanel.java	12 Mar 2006 16:32:25 -0000	1.24
+++ FinishPanel.java	21 Mar 2006 18:14:46 -0000	1.25
@@ -53,9 +53,6 @@
 
     private static final long serialVersionUID = 3257282535107998009L;
 
-    /** The layout. */
-    private BoxLayout layout;
-
     /** The automated installers generation button. */
     private JButton autoButton;
 
@@ -87,7 +84,7 @@
 
         // We initialize our 'real' layout
         centerPanel = new JPanel();
-        layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
+        BoxLayout layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
         centerPanel.setLayout(layout);
         superLayout.addLayoutComponent(centerPanel, gbConstraints);
         add(centerPanel);

Index: HTMLInfoPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/HTMLInfoPanel.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- HTMLInfoPanel.java	12 Mar 2006 16:32:25 -0000	1.17
+++ HTMLInfoPanel.java	21 Mar 2006 18:14:47 -0000	1.18
@@ -46,15 +46,6 @@
 
     private static final long serialVersionUID = 3257008769514025270L;
 
-    /** The layout. */
-    private GridBagLayout layout;
-
-    /** The layout constraints. */
-    private GridBagConstraints gbConstraints;
-
-    /** The info label. */
-    private JLabel infoLabel;
-
     /** The text area. */
     private JEditorPane textArea;
 
@@ -69,13 +60,13 @@
         super(parent, idata);
 
         // We initialize our layout
-        layout = new GridBagLayout();
-        gbConstraints = new GridBagConstraints();
+        GridBagLayout layout = new GridBagLayout();
+        GridBagConstraints gbConstraints = new GridBagConstraints();
         setLayout(layout);
 
         // We add the components
 
-        infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
+        JLabel infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
                 .getImageIcon("edit"), JLabel.TRAILING);
         parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0);
         gbConstraints.insets = new Insets(5, 5, 5, 5);

Index: HTMLLicencePanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/HTMLLicencePanel.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- HTMLLicencePanel.java	12 Mar 2006 16:32:25 -0000	1.19
+++ HTMLLicencePanel.java	21 Mar 2006 18:14:47 -0000	1.20
@@ -53,20 +53,12 @@
      */
     private static final long serialVersionUID = 3256728385458746416L;
 
-    /** The layout. */
-    private GridBagLayout layout;
-
-    /** The layout constraints. */
-    private GridBagConstraints gbConstraints;
-
-    /** The info label. */
-    private JLabel infoLabel;
-
     /** The text area. */
     private JEditorPane textArea;
 
     /** The radio buttons. */
-    private JRadioButton yesRadio, noRadio;
+    private JRadioButton yesRadio;
+    private JRadioButton noRadio;
 
     /**
      * The constructor.
@@ -79,8 +71,8 @@
         super(parent, idata);
 
         // We initialize our layout
-        layout = new GridBagLayout();
-        gbConstraints = new GridBagConstraints();
+        GridBagLayout layout = new GridBagLayout();
+        GridBagConstraints gbConstraints = new GridBagConstraints();
         setLayout(layout);
 
         // We load the licence
@@ -88,7 +80,7 @@
 
         // We put our components
 
-        infoLabel = LabelFactory.create(parent.langpack.getString("LicencePanel.info"),
+        JLabel infoLabel = LabelFactory.create(parent.langpack.getString("LicencePanel.info"),
                 parent.icons.getImageIcon("history"), JLabel.TRAILING);
         parent.buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0);
         gbConstraints.insets = new Insets(5, 5, 5, 5);

Index: HelloPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/HelloPanel.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- HelloPanel.java	12 Mar 2006 16:32:25 -0000	1.19
+++ HelloPanel.java	21 Mar 2006 18:14:47 -0000	1.20
@@ -50,18 +50,6 @@
      */
     private static final long serialVersionUID = 3257848774955905587L;
 
-    /** The layout. */
-    private BoxLayout layout;
-
-    /** The welcome label. */
-    private JLabel welcomeLabel;
-
-    /** The application authors label. */
-    private JLabel appAuthorsLabel;
-
-    /** The application URL label. */
-    private JLabel appURLLabel;
-
     /**
      * The constructor.
      * 
@@ -82,7 +70,7 @@
 
         // We initialize our 'real' layout
         JPanel centerPanel = new JPanel();
-        layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
+        BoxLayout layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
         centerPanel.setLayout(layout);
         superLayout.addLayoutComponent(centerPanel, gbConstraints);
         add(centerPanel);
@@ -94,7 +82,7 @@
 
         str = parent.langpack.getString("HelloPanel.welcome1") + idata.info.getAppName() + " "
                 + idata.info.getAppVersion() + parent.langpack.getString("HelloPanel.welcome2");
-        welcomeLabel = LabelFactory.create(str, parent.icons.getImageIcon("host"), JLabel.TRAILING);
+        JLabel welcomeLabel = LabelFactory.create(str, parent.icons.getImageIcon("host"), JLabel.TRAILING);
         centerPanel.add(welcomeLabel);
 
         centerPanel.add(Box.createVerticalStrut(20));
@@ -104,7 +92,7 @@
         if (size > 0)
         {
             str = parent.langpack.getString("HelloPanel.authors");
-            appAuthorsLabel = LabelFactory.create(str, parent.icons.getImageIcon("information"),
+            JLabel appAuthorsLabel = LabelFactory.create(str, parent.icons.getImageIcon("information"),
                     JLabel.TRAILING);
             centerPanel.add(appAuthorsLabel);
 
@@ -124,7 +112,7 @@
         if (idata.info.getAppURL() != null)
         {
             str = parent.langpack.getString("HelloPanel.url") + idata.info.getAppURL();
-            appURLLabel = LabelFactory.create(str, parent.icons.getImageIcon("bookmark"),
+            JLabel appURLLabel = LabelFactory.create(str, parent.icons.getImageIcon("bookmark"),
                     JLabel.TRAILING);
             centerPanel.add(appURLLabel);
         }

Index: ImgPacksPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/ImgPacksPanel.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- ImgPacksPanel.java	12 Mar 2006 16:32:25 -0000	1.25
+++ ImgPacksPanel.java	21 Mar 2006 18:14:47 -0000	1.26
@@ -65,18 +65,9 @@
     /** The images to display. */
     private ArrayList images;
 
-    /** The description scroll. */
-    private JScrollPane descriptionScroller;
-
     /** The img label. */
     private JLabel imgLabel;
 
-    /** The layout. */
-    private GridBagLayout layout;
-
-    /** The layout constraints. */
-    private GridBagConstraints gbConstraints;
-
     /**
      * The constructor.
      * 
@@ -96,8 +87,8 @@
     protected void createNormalLayout()
     {
         preLoadImages();
-        layout = new GridBagLayout();
-        gbConstraints = new GridBagConstraints();
+        GridBagLayout layout = new GridBagLayout();
+        GridBagConstraints gbConstraints = new GridBagConstraints();
         setLayout(layout);
 
         // Create constraint for first component as standard constraint.
@@ -143,7 +134,7 @@
         }
 
         // Create the description area with a scroller.
-        descriptionScroller = new JScrollPane();
+        JScrollPane descriptionScroller = new JScrollPane();
         descriptionScroller.setPreferredSize(new Dimension(200, 60));
         descriptionScroller.setBorder(BorderFactory.createEmptyBorder());
 
@@ -188,7 +179,8 @@
      */
     private Dimension getPreferredSizeFromImages()
     {
-        int maxWidth = 80, maxHeight = 60;
+        int maxWidth = 80;
+        int maxHeight = 60;
         ImageIcon icon;
 
         for (Iterator it = images.iterator(); it.hasNext();)

Index: InfoPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/InfoPanel.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- InfoPanel.java	12 Mar 2006 16:32:25 -0000	1.17
+++ InfoPanel.java	21 Mar 2006 18:14:47 -0000	1.18
@@ -43,21 +43,6 @@
 
     private static final long serialVersionUID = 3833748780590905399L;
 
-    /** The layout. */
-    private GridBagLayout layout;
-
-    /** The layout constraints. */
-    private GridBagConstraints gbConstraints;
-
-    /** The info label. */
-    private JLabel infoLabel;
-
-    /** The text area. */
-    private JTextArea textArea;
-
-    /** The scrolling container. */
-    private JScrollPane scroller;
-
     /** The info string. */
     private String info;
 
@@ -72,8 +57,8 @@
         super(parent, idata);
 
         // We initialize our layout
-        layout = new GridBagLayout();
-        gbConstraints = new GridBagConstraints();
+        GridBagLayout layout = new GridBagLayout();
+        GridBagConstraints gbConstraints = new GridBagConstraints();
         setLayout(layout);
 
         // We load the text
@@ -81,7 +66,7 @@
 
         // We add the components
 
-        infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
+        JLabel infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
                 .getImageIcon("edit"), JLabel.TRAILING);
         parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.1);
         gbConstraints.insets = new Insets(5, 5, 5, 5);
@@ -90,10 +75,10 @@
         layout.addLayoutComponent(infoLabel, gbConstraints);
         add(infoLabel);
 
-        textArea = new JTextArea(info);
+        JTextArea textArea = new JTextArea(info);
         textArea.setCaretPosition(0);
         textArea.setEditable(false);
-        scroller = new JScrollPane(textArea);
+        JScrollPane scroller = new JScrollPane(textArea);
         parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9);
         gbConstraints.fill = GridBagConstraints.BOTH;
         gbConstraints.anchor = GridBagConstraints.CENTER;

Index: InstallPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/InstallPanel.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- InstallPanel.java	12 Mar 2006 16:32:25 -0000	1.26
+++ InstallPanel.java	21 Mar 2006 18:14:47 -0000	1.27
@@ -45,12 +45,6 @@
 
     private static final long serialVersionUID = 3257282547959410992L;
 
-    /** The layout. */
-    private GridBagLayout layout;
-
-    /** The layout constraints. */
-    private GridBagConstraints gbConstraints;
-
     /** The tip label. */
     protected JLabel tipLabel;
 
@@ -83,8 +77,8 @@
         super(parent, idata);
 
         // We initialize our layout
-        layout = new GridBagLayout();
-        gbConstraints = new GridBagConstraints();
+        GridBagLayout layout = new GridBagLayout();
+        GridBagConstraints gbConstraints = new GridBagConstraints();
         setLayout(layout);
 
         int row = 1;
@@ -263,7 +257,7 @@
     {
         // We clip the panel
         Dimension dim = parent.getPanelsContainerSize();
-        dim.width = dim.width - (dim.width / 4);
+        dim.width -= (dim.width / 4);
         dim.height = 150;
         setMinimumSize(dim);
         setMaximumSize(dim);

Index: InstallPanelAutomationHelper.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/InstallPanelAutomationHelper.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- InstallPanelAutomationHelper.java	12 Mar 2006 16:32:26 -0000	1.9
+++ InstallPanelAutomationHelper.java	21 Mar 2006 18:14:47 -0000	1.10
@@ -38,9 +38,6 @@
         AbstractUIProgressHandler
 {
 
-    // state var for thread sync.
-    private boolean done = false;
-
     private int noOfPacks = 0;
 
     /**
@@ -63,7 +60,7 @@
     {
         Unpacker unpacker = new Unpacker(idata, this);
         unpacker.start();
-        done = false;
+        boolean done = false;
         while (!done && unpacker.isAlive())
         {
             try
@@ -96,7 +93,7 @@
     public void stopAction()
     {
         System.out.println("[ Unpacking finished. ]");
-        done = true;
+        boolean done = true;
     }
 
     /**

Index: JDKPathPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/JDKPathPanel.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- JDKPathPanel.java	12 Mar 2006 16:32:26 -0000	1.14
+++ JDKPathPanel.java	21 Mar 2006 18:14:47 -0000	1.15
@@ -128,7 +128,7 @@
         pathSelectionPanel.setPath(chosenPath);
         String var = idata.getVariable("JDKPathPanel.skipIfValid");
         // Should we skip this panel?
-        if (chosenPath.length() > 0 && var != null && var.equalsIgnoreCase("yes"))
+        if (chosenPath.length() > 0 && var != null && "yes".equalsIgnoreCase(var))
         {
             idata.setVariable(getVariableName(), chosenPath);
             parent.skipPanel();
@@ -136,7 +136,7 @@
 
     }
 
-    private final boolean verifyVersion()
+    private boolean verifyVersion()
     {
         String min = getMinVersion();
         String max = getMaxVersion();
@@ -164,7 +164,7 @@
         return (true);
     }
 
-    private final boolean compareVersions(String in, String template, boolean isMin,
+    private boolean compareVersions(String in, String template, boolean isMin,
             int assumedPlace, int halfRange, String useNotIdentifier)
     {
         StringTokenizer st = new StringTokenizer(in, " \t\n\r\f\"");

Index: LicencePanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/LicencePanel.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- LicencePanel.java	12 Mar 2006 16:32:26 -0000	1.19
+++ LicencePanel.java	21 Mar 2006 18:14:47 -0000	1.20
@@ -56,14 +56,9 @@
     /** The license text. */
     private String licence;
 
-    /** The text area. */
-    private JTextArea textArea;
-
     /** The radio buttons. */
-    private JRadioButton yesRadio, noRadio;
-
-    /** The scrolling container. */
-    private JScrollPane scroller;
+    private JRadioButton yesRadio;
+    private JRadioButton noRadio;
 
     /**
      * The constructor.
@@ -89,13 +84,13 @@
 
         add(Box.createRigidArea(new Dimension(0, 3)));
 
-        textArea = new JTextArea(licence);
+        JTextArea textArea = new JTextArea(licence);
         textArea.setMargin(new Insets(2, 2, 2, 2));
         textArea.setCaretPosition(0);
         textArea.setEditable(false);
         textArea.setLineWrap(true);
         textArea.setWrapStyleWord(true);
-        scroller = new JScrollPane(textArea);
+        JScrollPane scroller = new JScrollPane(textArea);
         scroller.setAlignmentX(LEFT_ALIGNMENT);
         add(scroller);
 

Index: PacksModel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/PacksModel.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- PacksModel.java	12 Mar 2006 16:32:26 -0000	1.9
+++ PacksModel.java	21 Mar 2006 18:14:47 -0000	1.10
@@ -136,7 +136,7 @@
         for (int i = 0; i < packs.size(); i++)
         {
             Pack pack = (Pack) packs.get(i);
-            if (pack.required == true) propRequirement(pack.name);
+            if (pack.required) propRequirement(pack.name);
         }
     }
 
@@ -205,14 +205,7 @@
         {
             return false;
         }
-        else if (columnIndex == 0)
-        {
-            return true;
-        }
-        else
-        {
-            return false;
-        }
+        else return columnIndex == 0;
     }
 
     /*

Index: PacksPanelAutomationHelper.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/PacksPanelAutomationHelper.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- PacksPanelAutomationHelper.java	12 Mar 2006 16:32:26 -0000	1.10
+++ PacksPanelAutomationHelper.java	21 Mar 2006 18:14:47 -0000	1.11
@@ -52,7 +52,7 @@
         {
             Pack pack = (Pack) idata.availablePacks.get(i);
             XMLElement el = new XMLElement("pack");
-            el.setAttribute("index", new Integer(i).toString());
+            el.setAttribute("index", Integer.toString(i));
             el.setAttribute("name", pack.name);
             Boolean selected = Boolean.valueOf(idata.selectedPacks.contains(pack));
             el.setAttribute("selected", selected.toString());
@@ -80,7 +80,7 @@
         for (int i = 0; i < size; i++)
         {
             XMLElement el = (XMLElement) pm.get(i);
-            Boolean selected = new Boolean(true); // No longer needed.
+            Boolean selected = Boolean.TRUE; // No longer needed.
 
             if (selected.booleanValue())
             {

Index: PacksPanelBase.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/PacksPanelBase.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- PacksPanelBase.java	12 Mar 2006 16:32:26 -0000	1.9
+++ PacksPanelBase.java	21 Mar 2006 18:14:47 -0000	1.10
@@ -255,11 +255,11 @@
             Pack pack = (Pack) idata.availablePacks.get(i);
             String desc = "";
             String key = pack.id + ".description";
-            if (langpack != null && pack.id != null && !pack.id.equals(""))
+            if (langpack != null && pack.id != null && !"".equals(pack.id))
             {
                 desc = langpack.getString(key);
             }
-            if (desc.equals("") || key.equals(desc))
+            if ("".equals(desc) || key.equals(desc))
             {
                 desc = pack.description;
             }
@@ -278,11 +278,11 @@
                 Pack childPack = (Pack) names.get(name);
                 String childName = "";
                 String key = childPack.id;
-                if (langpack != null && childPack.id != null && !childPack.id.equals(""))
+                if (langpack != null && childPack.id != null && !"".equals(childPack.id))
                 {
                     childName = langpack.getString(key);
                 }
-                if (childName.equals("") || key.equals(childName))
+                if ("".equals(childName) || key.equals(childName))
                 {
                     childName = childPack.name;
                 }
@@ -531,7 +531,7 @@
             }
             first = false;
             Pack pack = (Pack) iter.next();
-            if (langpack != null && pack.id != null && !pack.id.equals(""))
+            if (langpack != null && pack.id != null && !"".equals(pack.id))
             {
                 retval.append(langpack.getString(pack.id));
             }

Index: PathInputPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/PathInputPanel.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- PathInputPanel.java	12 Mar 2006 16:32:26 -0000	1.11
+++ PathInputPanel.java	21 Mar 2006 18:14:47 -0000	1.12
@@ -353,7 +353,7 @@
             {
                 line = line.trim();
                 // use the first non-blank line
-                if (!line.equals("")) break;
+                if (!"".equals(line)) break;
             }
             defaultInstallDir = line;
             VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables());

Index: ProcessPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/ProcessPanel.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ProcessPanel.java	12 Mar 2006 16:32:26 -0000	1.7
+++ ProcessPanel.java	21 Mar 2006 18:14:47 -0000	1.8
@@ -81,8 +81,6 @@
     /** Where the output is displayed */
     private JTextArea outputPane;
 
-    private JScrollPane outputScrollPane;
-
     /**
      * The constructor.
      * 
@@ -124,8 +122,8 @@
 
         this.outputPane = new JTextArea();
         this.outputPane.setEditable(false);
-        this.outputScrollPane = new JScrollPane(this.outputPane);
-        subpanel.add(this.outputScrollPane);
+        JScrollPane outputScrollPane = new JScrollPane(this.outputPane);
+        subpanel.add(outputScrollPane);
 
         add(subpanel, BorderLayout.CENTER);
     }
@@ -208,7 +206,7 @@
     {
         // We clip the panel
         Dimension dim = parent.getPanelsContainerSize();
-        dim.width = dim.width - (dim.width / 4);
+        dim.width -= (dim.width / 4);
         dim.height = 150;
         setMinimumSize(dim);
         setMaximumSize(dim);

Index: ProcessPanelAutomationHelper.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/ProcessPanelAutomationHelper.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ProcessPanelAutomationHelper.java	12 Mar 2006 16:32:26 -0000	1.4
+++ ProcessPanelAutomationHelper.java	21 Mar 2006 18:14:47 -0000	1.5
@@ -41,8 +41,6 @@
         AbstractUIProcessHandler
 {
 
-    private ProcessPanelWorker worker = null;
-
     private int noOfJobs = 0;
 
     private int currentJob = 0;
@@ -68,9 +66,9 @@
     {
         try
         {
-            this.worker = new ProcessPanelWorker(idata, this);
+            ProcessPanelWorker worker = new ProcessPanelWorker(idata, this);
 
-            this.worker.run();
+            worker.run();
         }
         catch (IOException e)
         {

Index: RuleInputField.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/RuleInputField.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- RuleInputField.java	12 Mar 2006 16:32:26 -0000	1.17
+++ RuleInputField.java	21 Mar 2006 18:14:47 -0000	1.18
@@ -556,7 +556,7 @@
                         val = val.substring(0, val.indexOf(":"));
                     }
 
-                    if (!className.equals("") && !process)
+                    if (!"".equals(className) && !process)
                     {
                         process = true;
                     }
@@ -595,7 +595,7 @@
                             val = val.substring(0, val.indexOf(":"));
                         }
 
-                        if (!className.equals(""))
+                        if (!"".equals(className))
                         {
                             Processor p = (Processor) Class.forName(className).newInstance();
                             presult = p.process(this);
@@ -606,7 +606,6 @@
                 }
                 catch (Throwable exception)
                 {
-                    ;
                 }
             }
         }
@@ -793,23 +792,23 @@
                 // test the first token for a valid type identifier
                 // if it's valid assign the token to the type.
                 // ------------------------------------------------
-                if (token.equals("N"))
+                if ("N".equals(token))
                 {
                     type = RuleTextField.N;
                 }
-                else if (token.equals("H"))
+                else if ("H".equals(token))
                 {
                     type = RuleTextField.H;
                 }
-                else if (token.equals("A"))
+                else if ("A".equals(token))
                 {
                     type = RuleTextField.A;
                 }
-                else if (token.equals("O"))
+                else if ("O".equals(token))
                 {
                     type = RuleTextField.O;
                 }
-                else if (token.equals("AN"))
+                else if ("AN".equals(token))
                 {
                     type = RuleTextField.AN;
                 }
@@ -845,7 +844,7 @@
                 }
                 catch (Throwable exception)
                 {
-                    if (token.equals("U"))
+                    if ("U".equals(token))
                     {
                         unlimitedEdit = true;
                     }

Index: RuleTextField.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/RuleTextField.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- RuleTextField.java	12 Mar 2006 16:32:26 -0000	1.11
+++ RuleTextField.java	21 Mar 2006 18:14:48 -0000	1.12
@@ -72,10 +72,8 @@
 
     private Toolkit toolkit;
 
-    private Rule rule;
-
     public RuleTextField(int digits, int editLength, int type, boolean unlimitedEdit,
-            Toolkit toolkit)
+                         Toolkit toolkit)
     {
         super(digits + 1);
 
@@ -83,14 +81,14 @@
         this.toolkit = toolkit;
         this.editLength = editLength;
         this.unlimitedEdit = unlimitedEdit;
-        rule = new Rule();
+        Rule rule = new Rule();
         rule.setRuleType(type, editLength, unlimitedEdit);
         setDocument(rule);
     }
 
     protected Document createDefaultModel()
     {
-        rule = new Rule();
+        Rule rule = new Rule();
         return (rule);
     }
 

Index: SelectPrinterPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/SelectPrinterPanel.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- SelectPrinterPanel.java	6 Jan 2006 18:23:23 -0000	1.2
+++ SelectPrinterPanel.java	21 Mar 2006 18:14:48 -0000	1.3
@@ -58,20 +58,11 @@
      */
     private static final long serialVersionUID = 3257848774955905587L;
 
-    /** The layout. */
-    private BoxLayout layout;
-
-    /** The select label. */
-    private JLabel selectLabel;
-
     /** The ComboBox to list the printers. */
-	 private JComboBox cbPrinters;
-
-    /** List of print services. */
-	 private PrintService[] pServices;
+     private JComboBox cbPrinters;
 
     /** Install data variables. */
-	 private InstallData iData;
+     private InstallData iData;
 
     /**
      * The constructor.
@@ -95,13 +86,13 @@
 
         // We initialize our 'real' layout
         JPanel centerPanel = new JPanel();
-        layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
+        BoxLayout layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
         centerPanel.setLayout(layout);
         superLayout.addLayoutComponent(centerPanel, gbConstraints);
         add(centerPanel);
 
         cbPrinters = new JComboBox();
-    	pServices = PrintServiceLookup.lookupPrintServices(null, null);
+    	PrintService[] pServices = PrintServiceLookup.lookupPrintServices(null, null);
     	iData.setVariable("SELECTED_PRINTER", pServices[0].getName());
     	for (int i = 0; i < pServices.length; i++)
     	{
@@ -115,7 +106,7 @@
         centerPanel.add(Box.createVerticalStrut(10));
         
         str = parent.langpack.getString("PrinterSelectPanel.select_printer");
-        selectLabel = LabelFactory.create(str, JLabel.LEADING);
+        JLabel selectLabel = LabelFactory.create(str, JLabel.LEADING);
         selectLabel.setAlignmentX(JLabel.LEADING);
         centerPanel.add(selectLabel);
 
@@ -130,7 +121,6 @@
     {
     	String sPrinter = (String) cbPrinters.getSelectedItem();
     	iData.setVariable("SELECTED_PRINTER", sPrinter);
-    	return;
     }
 
     /**

Index: ShortcutData.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/ShortcutData.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- ShortcutData.java	12 Mar 2006 16:32:26 -0000	1.16
+++ ShortcutData.java	21 Mar 2006 18:14:48 -0000	1.17
@@ -105,7 +105,7 @@
         result.deskTopEntryLinux_URL = cloneString(deskTopEntryLinux_URL);
         result.deskTopEntryLinux_Encoding = cloneString(deskTopEntryLinux_Encoding);
         result.deskTopEntryLinux_X_KDE_SubstituteUID = cloneString(deskTopEntryLinux_X_KDE_SubstituteUID);
-        result.createForAll = new Boolean(createForAll.booleanValue());
+        result.createForAll = Boolean.valueOf(createForAll.booleanValue());
         return (result);
     }
 
@@ -128,7 +128,7 @@
         }
         else
         {
-            return (new String(original));
+            return (original);
         }
     }
 }

Index: ShortcutPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/ShortcutPanel.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- ShortcutPanel.java	12 Mar 2006 16:32:26 -0000	1.41
+++ ShortcutPanel.java	21 Mar 2006 18:14:48 -0000	1.42
@@ -310,15 +310,9 @@
     // Variable Declarations
     // ------------------------------------------------------------------------
 
-    /** UI element to label the list of existing program groups */
-    private JLabel listLabel;
-
     /** UI element to present the list of existing program groups for selection */
     private JList groupList;
 
-    /** UI element for listing the intended shortcut targets */
-    private JList targetList;
-
     /**
      * UI element to present the default name for the program group and to support editing of this
      * name.
@@ -364,19 +358,6 @@
     /** The name chosen by the user for the program group, */
     private String groupName;
 
-    /**
-     * The location for placign the program group. This is the same as the location (type) of a
-     * shortcut, only that it applies to the program group. Note that there are only two locations
-     * that make sense as location for a program group: <br>
-     * 
-     * <ul>
-     * <li>applications</li>
-     * <li>start manu</li>
-     * </ul>
-     *  
-     */
-    private int groupLocation;
-
     /** The parsed result from reading the XML specification from the file */
     private XMLElement spec;
 
@@ -427,8 +408,6 @@
      */
     private boolean firstTime = true;
 
-    private File itsProgramFolder;
-
     private int itsUserType;
 
     static boolean create;
@@ -784,6 +763,7 @@
             location = SPEC_VALUE_APPLICATIONS;
         }
 
+        int groupLocation;
         if (location.equals(SPEC_VALUE_APPLICATIONS))
         {
             groupLocation = Shortcut.APPLICATIONS;
@@ -832,7 +812,7 @@
             data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute(
                     SPEC_ATTRIBUTE_KDE_SUBST_UID, "");
 
-            data.createForAll = new Boolean(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false"));
+            data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false"));
             //** EndOf LINUX **//
             temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, ""));
             data.target = substitutor.substitute(temp, null);
@@ -1064,7 +1044,6 @@
             }
             catch (Throwable exception)
             {
-                continue;
             }
         }
 
@@ -1176,19 +1155,19 @@
     {
         String value = element.getAttribute(name, "").toUpperCase();
 
-        if (value.equals("YES"))
+        if ("YES".equals(value))
         {
             return (true);
         }
-        else if (value.equals("TRUE"))
+        else if ("TRUE".equals(value))
         {
             return (true);
         }
-        else if (value.equals("ON"))
+        else if ("ON".equals(value))
         {
             return (true);
         }
-        else if (value.equals("1")) { return (true); }
+        else if ("1".equals(value)) { return (true); }
 
         return (false);
     }
@@ -1225,7 +1204,7 @@
     /*--------------------------------------------------------------------------*/
     private void buildUI(File groups)
     {
-        itsProgramFolder = groups;        
+        File itsProgramFolder = groups;
          
         constraints.gridx = 0;
         constraints.gridy = 0;
@@ -1280,8 +1259,8 @@
           layout.addLayoutComponent(allowDesktopShortcut, constraints);
           add(allowDesktopShortcut);
         }
-        
-        listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"),
+
+        JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"),
                 JLabel.LEADING);
         
         constraints.gridx = 0;
@@ -1471,7 +1450,7 @@
             targets.add(((ShortcutData) shortcuts.elementAt(i)).target);
         }
 
-        targetList = new JList(targets);
+        JList targetList = new JList(targets);
 
         JScrollPane scrollPane = new JScrollPane(targetList);
 

Index: SimpleFinishPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/SimpleFinishPanel.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- SimpleFinishPanel.java	12 Mar 2006 16:32:26 -0000	1.9
+++ SimpleFinishPanel.java	21 Mar 2006 18:14:48 -0000	1.10
@@ -48,9 +48,6 @@
      */
     private static final long serialVersionUID = 3689911781942572085L;
 
-    /** The layout. */
-    private BoxLayout layout;
-
     /** The center panel. */
     protected JPanel centerPanel;
 
@@ -79,7 +76,7 @@
 
         // We initialize our 'real' layout
         centerPanel = new JPanel();
-        layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
+        BoxLayout layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
         centerPanel.setLayout(layout);
         superLayout.addLayoutComponent(centerPanel, gbConstraints);
         add(centerPanel);

Index: UserInputPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/UserInputPanel.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- UserInputPanel.java	12 Mar 2006 16:32:26 -0000	1.43
+++ UserInputPanel.java	21 Mar 2006 18:14:48 -0000	1.44
@@ -344,8 +344,6 @@
     /** Holds all user inputs for use in automated installation */
     private Vector entries = new Vector();
 
-    private TwoColumnLayout layout;
-
     private LocaleDatabase langpack = null;
 
     /*--------------------------------------------------------------------------*/
@@ -377,7 +375,7 @@
 
         // ----------------------------------------------------
         // ----------------------------------------------------
-        layout = new TwoColumnLayout(10, 5, 30, 25, TwoColumnLayout.LEFT);
+        TwoColumnLayout layout = new TwoColumnLayout(10, 5, 30, 25, TwoColumnLayout.LEFT);
         setLayout(layout);
 
         // ----------------------------------------------------
@@ -573,7 +571,7 @@
                 try
                 {
                     if (uiElement[POS_DISPLAYED] == null
-                            || uiElement[POS_DISPLAYED].toString().equals("false"))
+                            || "false".equals(uiElement[POS_DISPLAYED].toString()))
                     {
                         add((JComponent) uiElement[POS_FIELD], uiElement[POS_CONSTRAINTS]);
                     }
@@ -593,7 +591,7 @@
                 try
                 {
                     if (uiElement[POS_DISPLAYED] != null
-                            && uiElement[POS_DISPLAYED].toString().equals("true"))
+                            && "true".equals(uiElement[POS_DISPLAYED].toString()))
                     {
                         remove((JComponent) uiElement[POS_FIELD]);
                     }
@@ -780,11 +778,11 @@
 
             if (bold)
             {
-                style = style + Font.BOLD;
+                style += Font.BOLD;
             }
             if (italic)
             {
-                style = style + Font.ITALIC;
+                style += Font.ITALIC;
             }
 
             font = font.deriveFont(style, (size * multiplier));
@@ -982,7 +980,7 @@
             try
             {
                 message = langpack.getString((String) field[POS_MESSAGE]);
-                if (message.equals(""))
+                if ("".equals(message))
                 {
                     message = (String) field[POS_MESSAGE];
                 }
@@ -2268,19 +2266,22 @@
             String family = ((XMLElement) os.elementAt(i)).getAttribute(FAMILY);
             boolean match = false;
 
-            if (family.equals("windows"))
+            if ("windows".equals(family))
             {
                 match = OsVersion.IS_WINDOWS;
             }
-            else if (family.equals("mac"))
+            else if ("mac".equals(family))
             {
                 match = OsVersion.IS_OSX;
             }
-            else if (family.equals("unix"))
+            else if ("unix".equals(family))
             {
                 match = OsVersion.IS_UNIX;
             }
-            return match;
+            if (match)
+            {
+                return true;
+            }
         }
         return false;
     }
@@ -2699,9 +2700,8 @@
             }
 
             // if the user entered something else, it's not listed as an item
-            if (this.pathMatches((String) this.pathComboBox.getSelectedItem())) { return true; }
+            return this.pathMatches((String) this.pathComboBox.getSelectedItem());
 
-            return false;
         }
 
         /*--------------------------------------------------------------------------*/

Index: XInfoPanel.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/panels/XInfoPanel.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- XInfoPanel.java	12 Mar 2006 16:32:26 -0000	1.22
+++ XInfoPanel.java	21 Mar 2006 18:14:48 -0000	1.23
@@ -49,15 +49,6 @@
      */
     private static final long serialVersionUID = 3257009856274970416L;
 
-    /** The layout. */
-    private GridBagLayout layout;
-
-    /** The layout constraints. */
-    private GridBagConstraints gbConstraints;
-
-    /** The info label. */
-    private JLabel infoLabel;
-
     /** The text area. */
     private JTextArea textArea;
 
@@ -75,13 +66,13 @@
         super(parent, idata);
 
         // We initialize our layout
-        layout = new GridBagLayout();
-        gbConstraints = new GridBagConstraints();
+        GridBagLayout layout = new GridBagLayout();
+        GridBagConstraints gbConstraints = new GridBagConstraints();
         setLayout(layout);
 
         // We add the components
 
-        infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
+        JLabel infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
                 .getImageIcon("edit"), JLabel.TRAILING);
         parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0);
         gbConstraints.insets = new Insets(5, 5, 5, 5);




More information about the izpack-changes mailing list