]> source.dussan.org Git - gitblit.git/commitdiff
[findbugs] Change scope of variable in HistoryPanel
authorJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 02:52:52 +0000 (22:52 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 03:08:07 +0000 (23:08 -0400)
src/main/java/com/gitblit/wicket/panels/HistoryPanel.java

index b5ed38a17909d7d1d926fcf1d8944e42ccf364d7..21f38388ea94d30298fe3c123d97c7e79616808e 100644 (file)
@@ -78,7 +78,6 @@ public class HistoryPanel extends BasePanel {
 \r
                RevCommit commit = JGitUtils.getCommit(r, objectId);\r
                PathModel matchingPath = null;\r
-               List<PathChangeModel> paths;\r
                Map<String, SubmoduleModel> submodules = new HashMap<String, SubmoduleModel>();\r
 \r
                if (commit == null) {\r
@@ -86,12 +85,11 @@ public class HistoryPanel extends BasePanel {
                        String msg = MessageFormat.format("Failed to find history of **{0}** *{1}*",\r
                                        path, objectId);\r
                        log.error(msg + " " + repositoryName);\r
-                       paths = new ArrayList<PathChangeModel>();\r
                        add(new Label("commitHeader", MarkdownUtils.transformMarkdown(msg)).setEscapeModelStrings(false));\r
                        add(new Label("breadcrumbs"));\r
                } else {\r
                        // commit found\r
-                       paths = JGitUtils.getFilesInCommit(r, commit);\r
+                       List<PathChangeModel> paths = JGitUtils.getFilesInCommit(r, commit);\r
                        add(new CommitHeaderPanel("commitHeader", repositoryName, commit));\r
                        add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, path, objectId));\r
                        for (SubmoduleModel model : JGitUtils.getSubmodules(r, commit.getTree())) {\r