From fb35ac972e438ed2a59d57ccbfb57be22eaaff52 Mon Sep 17 00:00:00 2001 From: George Kankava Date: Wed, 2 Mar 2016 16:11:10 +0400 Subject: [PATCH] Multiple code improvements - squid:S1068, squid:S1905 --- .../project/knowledge/control/protect/ConfigControl.java | 4 ---- .../project/knowledge/control/protect/GroupControl.java | 6 ------ .../project/knowledge/control/protect/KnowledgeControl.java | 6 +++--- .../project/knowledge/control/protect/StockControl.java | 4 ---- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/support/project/knowledge/control/protect/ConfigControl.java b/src/main/java/org/support/project/knowledge/control/protect/ConfigControl.java index 8fd5a2ac5..24a53f043 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/ConfigControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/ConfigControl.java @@ -1,7 +1,5 @@ package org.support.project.knowledge.control.protect; -import org.support.project.common.log.Log; -import org.support.project.common.log.LogFactory; import org.support.project.di.DI; import org.support.project.di.Instance; import org.support.project.knowledge.control.Control; @@ -10,8 +8,6 @@ @DI(instance=Instance.Prototype) public class ConfigControl extends Control { - /** ログ */ - private static Log LOG = LogFactory.getLog(ConfigControl.class); @Get public Boundary index() { diff --git a/src/main/java/org/support/project/knowledge/control/protect/GroupControl.java b/src/main/java/org/support/project/knowledge/control/protect/GroupControl.java index 6f5d88868..4b5d33a08 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/GroupControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/GroupControl.java @@ -6,15 +6,11 @@ import org.support.project.common.bean.ValidateError; import org.support.project.common.exception.ParseException; -import org.support.project.common.log.Log; -import org.support.project.common.log.LogFactory; import org.support.project.common.util.RandomUtil; import org.support.project.common.util.StringUtils; import org.support.project.di.DI; import org.support.project.di.Instance; import org.support.project.knowledge.control.Control; -import org.support.project.knowledge.dao.TagsDao; -import org.support.project.knowledge.entity.TagsEntity; import org.support.project.knowledge.logic.GroupLogic; import org.support.project.knowledge.vo.GroupUser; import org.support.project.web.bean.LabelValue; @@ -33,8 +29,6 @@ @DI(instance=Instance.Prototype) public class GroupControl extends Control { - /** ログ */ - private static Log LOG = LogFactory.getLog(GroupControl.class); public static final int PAGE_LIMIT = 10; diff --git a/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java b/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java index 22fd3b4a6..fd36a3d01 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java @@ -405,7 +405,7 @@ public Boundary comment() throws Exception { List files = fileLogic.selectOnFileNos(fileNos, getRequest().getContextPath()); Iterator iterator = files.iterator(); while (iterator.hasNext()) { - UploadFile uploadFile = (UploadFile) iterator.next(); + UploadFile uploadFile = iterator.next(); if (uploadFile.getKnowlegeId() != null) { // 新規登録なのに、添付ファイルが既にナレッジに紐づいている(おかしい) iterator.remove(); @@ -517,7 +517,7 @@ public Boundary update_comment() throws Exception { List files = fileLogic.selectOnFileNos(fileNos, getRequest().getContextPath()); Iterator iterator = files.iterator(); while (iterator.hasNext()) { - UploadFile uploadFile = (UploadFile) iterator.next(); + UploadFile uploadFile = iterator.next(); if (uploadFile.getKnowlegeId() != null) { // 新規登録なのに、添付ファイルが既にナレッジに紐づいている(おかしい) iterator.remove(); @@ -629,7 +629,7 @@ public Boundary stock() throws IOException, InvalidParamException { Stock stock = new Stock(); Iterator keys = map.keySet().iterator(); while (keys.hasNext()) { - String key = (String) keys.next(); + String key = keys.next(); Object value = map.get(key); if (LOG.isTraceEnabled()) { LOG.trace(key + " = " + value + " (" + value.getClass().getName() + ")"); diff --git a/src/main/java/org/support/project/knowledge/control/protect/StockControl.java b/src/main/java/org/support/project/knowledge/control/protect/StockControl.java index 22bbccc28..5c4493fc9 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/StockControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/StockControl.java @@ -6,8 +6,6 @@ import net.arnx.jsonic.JSONException; import org.support.project.common.bean.ValidateError; -import org.support.project.common.log.Log; -import org.support.project.common.log.LogFactory; import org.support.project.di.DI; import org.support.project.di.Instance; import org.support.project.knowledge.control.Control; @@ -24,8 +22,6 @@ @DI(instance=Instance.Prototype) public class StockControl extends Control { - /** ログ */ - private static Log LOG = LogFactory.getLog(StockControl.class); private static final int LIST_LIMIT = 20;