From 1d29be976dd9d99d172030525a37c807751bbf61 Mon Sep 17 00:00:00 2001 From: j502647092 Date: Sun, 8 Nov 2015 00:55:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=BA=90=E6=95=B0=E6=8D=AE=E6=97=B6=E5=8F=91=E7=8E=B0?= =?UTF-8?q?=E7=9A=84=E8=BF=AD=E4=BB=A3=E9=94=99=E8=AF=AF...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../java/cn/citycraft/Yum/manager/RepositoryManager.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index febe935..b92a99a 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ http://ci.citycraft.cn:8080 - 修复更新仓库时产生的NPE错误... + 修复一个更新源数据时发现的迭代错误... UTF-8 diff --git a/src/main/java/cn/citycraft/Yum/manager/RepositoryManager.java b/src/main/java/cn/citycraft/Yum/manager/RepositoryManager.java index 517fc12..52d1d7c 100644 --- a/src/main/java/cn/citycraft/Yum/manager/RepositoryManager.java +++ b/src/main/java/cn/citycraft/Yum/manager/RepositoryManager.java @@ -220,7 +220,8 @@ public class RepositoryManager { if (updateRepositories(sender, string)) { sender.sendMessage("§6源: §e" + string + " §a更新成功!"); } else { - sender.sendMessage("§6源: §e" + string + " §c更新失败!"); + sender.sendMessage("§6源: §e" + string + " §c未找到任何仓库信息 已删除!"); + keys.remove(); } } return true; @@ -232,13 +233,11 @@ public class RepositoryManager { } final String json = getHtml(urlstring); if (json == null || json.isEmpty()) { - sender.sendMessage("§6源: §e" + urlstring + " §c未找到任何仓库信息 已删除!"); - repos.remove(urlstring); return false; } final List lrepo = jsonToRepositories(json); if (lrepo == null || lrepo.isEmpty()) { - return false; + return true; } for (final Repository repository : lrepo) { addPackage(sender, repository.url);