diff --git a/代码/workspace_robo4/robocode.tests.robots/src/main/java/tested/robots/ConstructorHttpAttack.java b/代码/workspace_robo4/robocode.tests.robots/src/main/java/tested/robots/ConstructorHttpAttack.java index c124fea..7f2ddd1 100644 --- a/代码/workspace_robo4/robocode.tests.robots/src/main/java/tested/robots/ConstructorHttpAttack.java +++ b/代码/workspace_robo4/robocode.tests.robots/src/main/java/tested/robots/ConstructorHttpAttack.java @@ -34,7 +34,7 @@ public class ConstructorHttpAttack extends AdvancedRobot { is.read(); } } catch (IOException e) { - e.printStackTrace(out); + LOGGER.log("context", e); } } } diff --git a/代码/workspace_robo4/robocode.ui.editor/src/main/java/net/sf/robocode/ui/editor/EditorPane.java b/代码/workspace_robo4/robocode.ui.editor/src/main/java/net/sf/robocode/ui/editor/EditorPane.java index 3171f23..65bd863 100644 --- a/代码/workspace_robo4/robocode.ui.editor/src/main/java/net/sf/robocode/ui/editor/EditorPane.java +++ b/代码/workspace_robo4/robocode.ui.editor/src/main/java/net/sf/robocode/ui/editor/EditorPane.java @@ -358,7 +358,7 @@ public class EditorPane extends JTextPane { return; } } catch (BadLocationException e) { - e.printStackTrace(); + LOGGER.log("context", e); } } } @@ -367,7 +367,7 @@ public class EditorPane extends JTextPane { try { getDocument().remove(offset, len); } catch (BadLocationException e) { - e.printStackTrace(); + LOGGER.log("context", e); } } } diff --git a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/TeamCreator.java b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/TeamCreator.java index b3e10d6..d7b7ddc 100644 --- a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/TeamCreator.java +++ b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/TeamCreator.java @@ -34,7 +34,7 @@ public class TeamCreator extends JDialog implements WizardListener { private final int minRobots = 2; private final int maxRobots = 10; - private final EventHandler eventHandler = new EventHandler(); + private final transient EventHandler eventHandler = new EventHandler(); class EventHandler implements ActionListener { public void actionPerformed(ActionEvent e) { diff --git a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/WizardCardPanel.java b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/WizardCardPanel.java index 3744916..b8b2f45 100644 --- a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/WizardCardPanel.java +++ b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/WizardCardPanel.java @@ -25,7 +25,7 @@ public class WizardCardPanel extends JPanel implements Wizard { private CardLayout cardLayout = null; private int currentIndex = 0; private final WizardListener listener; - private final EventHandler eventHandler = new EventHandler(); + private final transient EventHandler eventHandler = new EventHandler(); public class EventHandler implements ContainerListener { public void componentRemoved(ContainerEvent e) {} diff --git a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/WizardTabbedPane.java b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/WizardTabbedPane.java index 51958a9..f86a36e 100644 --- a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/WizardTabbedPane.java +++ b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/dialog/WizardTabbedPane.java @@ -24,7 +24,7 @@ public class WizardTabbedPane extends JTabbedPane implements Wizard { private WizardController wizardController; private int currentIndex = 0; private final WizardListener listener; - private final EventHandler eventHandler = new EventHandler(); + private final transient EventHandler eventHandler = new EventHandler(); public class EventHandler implements ContainerListener, ChangeListener { public void componentRemoved(ContainerEvent e) {} diff --git a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/gfx/ColorUtil.java b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/gfx/ColorUtil.java index 6100b82..cd5ca35 100644 --- a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/gfx/ColorUtil.java +++ b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/gfx/ColorUtil.java @@ -81,7 +81,7 @@ class ColorUtil { float H, S; - if (delta == 0) { // This is a gray, no chroma... + if (!delta) { // This is a gray, no chroma... H = 0; S = 0; } else { // Chromatic data... diff --git a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/packager/FilenamePanel.java b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/packager/FilenamePanel.java index 4a9aceb..08cd05e 100644 --- a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/packager/FilenamePanel.java +++ b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/packager/FilenamePanel.java @@ -167,9 +167,9 @@ public class FilenamePanel extends WizardPanel { // Immediately reasserts the exception by interrupting the caller thread itself Thread.currentThread().interrupt(); - e.printStackTrace(); + LOGGER.log("context", e); } catch (InvocationTargetException e) { - e.printStackTrace(); + LOGGER.log("context", e); } } diff --git a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/packager/PackagerOptionsPanel.java b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/packager/PackagerOptionsPanel.java index c8ad5cb..a6b7da3 100644 --- a/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/packager/PackagerOptionsPanel.java +++ b/代码/workspace_robo4/robocode.ui/src/main/java/net/sf/robocode/ui/packager/PackagerOptionsPanel.java @@ -275,10 +275,7 @@ public class PackagerOptionsPanel extends WizardPanel { e.getWindow().dispose(); } - @Override - public void windowClosed(WindowEvent e) { - System.exit(0); - } + }); try { @@ -287,9 +284,9 @@ public class PackagerOptionsPanel extends WizardPanel { // Immediately reasserts the exception by interrupting the caller thread itself Thread.currentThread().interrupt(); - e.printStackTrace(); + LOGGER.log("context", e); } catch (InvocationTargetException e) { - e.printStackTrace(); + LOGGER.log("context", e); } }