From ba97cf4450ca65cc5d8d4b9d3209f193dd473460 Mon Sep 17 00:00:00 2001 From: zhoudaxia <1018795633@qq.cin> Date: Fri, 2 Sep 2016 00:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A5=E9=87=8D=E4=BB=A3=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/tested/robots/ConstructorHttpAttack.java | 2 +- .../main/java/net/sf/robocode/ui/editor/EditorPane.java | 4 ++-- .../main/java/net/sf/robocode/ui/dialog/TeamCreator.java | 2 +- .../java/net/sf/robocode/ui/dialog/WizardCardPanel.java | 2 +- .../java/net/sf/robocode/ui/dialog/WizardTabbedPane.java | 2 +- .../src/main/java/net/sf/robocode/ui/gfx/ColorUtil.java | 2 +- .../java/net/sf/robocode/ui/packager/FilenamePanel.java | 4 ++-- .../net/sf/robocode/ui/packager/PackagerOptionsPanel.java | 9 +++------ 8 files changed, 12 insertions(+), 15 deletions(-) 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); } }