From 92e6225590ffd0801d6db833fb92ec2d7b62e9a9 Mon Sep 17 00:00:00 2001 From: zhoudaxia <1018795633@qq.cin> Date: Fri, 26 Aug 2016 16:20:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=A7=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=98=BB=E6=96=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/net/sf/robocode/recording/RecordManager.java | 2 +- .../src/main/java/net/sf/robocode/host/RobotStatics.java | 3 +++ .../src/main/java/net/sf/robocode/version/VersionManager.java | 2 +- .../src/main/java/net/sf/robocode/installer/AutoExtract.java | 2 -- .../java/net/sf/robocode/repository/items/RepositoryItem.java | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/代码/workspace_robo4/robocode.battle/src/main/java/net/sf/robocode/recording/RecordManager.java b/代码/workspace_robo4/robocode.battle/src/main/java/net/sf/robocode/recording/RecordManager.java index 82afc32..5e4188d 100644 --- a/代码/workspace_robo4/robocode.battle/src/main/java/net/sf/robocode/recording/RecordManager.java +++ b/代码/workspace_robo4/robocode.battle/src/main/java/net/sf/robocode/recording/RecordManager.java @@ -379,7 +379,7 @@ public class RecordManager implements IRecordManager { fos.flush(); } } - if (isxml) { + if (isxml&&xwr!=null) { xwr.endElement(); // turns xwr.endElement(); // record osw.flush(); diff --git a/代码/workspace_robo4/robocode.core/src/main/java/net/sf/robocode/host/RobotStatics.java b/代码/workspace_robo4/robocode.core/src/main/java/net/sf/robocode/host/RobotStatics.java index 3f1367a..e851360 100644 --- a/代码/workspace_robo4/robocode.core/src/main/java/net/sf/robocode/host/RobotStatics.java +++ b/代码/workspace_robo4/robocode.core/src/main/java/net/sf/robocode/host/RobotStatics.java @@ -309,10 +309,13 @@ public final class RobotStatics implements IRobotStatics, Serializable { int index = serializer.deserializeInt(buffer); int contestantIndex = serializer.deserializeInt(buffer); + if(teammates!=null) return new RobotStatics(robocodeVersion, isJuniorRobot, isInteractiveRobot, isPaintRobot, isAdvancedRobot, isTeamRobot, isTeamLeader, isDroid, isSentryRobot, name, shortName, veryShortName, fullClassName, shortClassName, battleRules, teammates.toArray(new String[teammates.size()]), teamName, index, contestantIndex); + else + ; } } diff --git a/代码/workspace_robo4/robocode.core/src/main/java/net/sf/robocode/version/VersionManager.java b/代码/workspace_robo4/robocode.core/src/main/java/net/sf/robocode/version/VersionManager.java index 774b557..d36ce37 100644 --- a/代码/workspace_robo4/robocode.core/src/main/java/net/sf/robocode/version/VersionManager.java +++ b/代码/workspace_robo4/robocode.core/src/main/java/net/sf/robocode/version/VersionManager.java @@ -160,7 +160,7 @@ public final class VersionManager implements IVersionManager { version = versionFileLineToVersion(versionString); } catch (Exception ignore) {} } - if (version.equals(UNKNOWN_VERSION)) { + if (version!=null&&version.equals(UNKNOWN_VERSION)) { logWarning("Getting version from file"); return getVersionFromFile(); } diff --git a/代码/workspace_robo4/robocode.installer/src/main/java/net/sf/robocode/installer/AutoExtract.java b/代码/workspace_robo4/robocode.installer/src/main/java/net/sf/robocode/installer/AutoExtract.java index dcb9816..247c69b 100644 --- a/代码/workspace_robo4/robocode.installer/src/main/java/net/sf/robocode/installer/AutoExtract.java +++ b/代码/workspace_robo4/robocode.installer/src/main/java/net/sf/robocode/installer/AutoExtract.java @@ -609,9 +609,7 @@ public class AutoExtract implements ActionListener { } catch (IOException e) { e.printStackTrace(); } finally { - if (out != null) { out.close(); - } if (file != null) { if (!file.delete()) { System.err.println("Could not delete the file: " + file); diff --git a/代码/workspace_robo4/robocode.repository/src/main/java/net/sf/robocode/repository/items/RepositoryItem.java b/代码/workspace_robo4/robocode.repository/src/main/java/net/sf/robocode/repository/items/RepositoryItem.java index d8e9592..f120e58 100644 --- a/代码/workspace_robo4/robocode.repository/src/main/java/net/sf/robocode/repository/items/RepositoryItem.java +++ b/代码/workspace_robo4/robocode.repository/src/main/java/net/sf/robocode/repository/items/RepositoryItem.java @@ -72,6 +72,7 @@ public abstract class RepositoryItem implements IRepositoryItem, Serializable { if (itemUrl == null && other.itemUrl != null) { return false; } + if (itemUrl != null) return itemUrl.equals(other.itemUrl); } }