diff options
author | Matthias Sohn | 2014-11-07 23:34:50 +0000 |
---|---|---|
committer | Robin Stocker | 2014-11-22 16:03:04 +0000 |
commit | ee348ba587579578f59df735f9ae8b768407c6db (patch) | |
tree | 0b290badc5c1a1e9b56a3561bd5e1d03b409e022 | |
parent | 12260e28f1741367a12a111840e86eae41c6d7e4 (diff) | |
download | egit-ee348ba587579578f59df735f9ae8b768407c6db.tar.gz egit-ee348ba587579578f59df735f9ae8b768407c6db.tar.xz egit-ee348ba587579578f59df735f9ae8b768407c6db.zip |
[repoView] Fix ClassCastException on add to index on folder
The following steps lead to a ClassCastException
- select a folder in git repositories view which contains some dirty
file
- click "Add to index" on this folder in the repositories view
Bug: 447611
Change-Id: Ic902775b12c65177131e7f5d10291bb6a5cd83f8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/AddToIndexCommand.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/AddToIndexCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/AddToIndexCommand.java index 710a206212..991d0c779a 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/AddToIndexCommand.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/AddToIndexCommand.java @@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.egit.ui.Activator; import org.eclipse.egit.ui.internal.UIText; -import org.eclipse.egit.ui.internal.repository.tree.FileNode; +import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode; import org.eclipse.jgit.api.AddCommand; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; @@ -27,10 +27,11 @@ import org.eclipse.jgit.lib.Repository; * Implements an action to add a file to the Git index * */ -public class AddToIndexCommand extends RepositoriesViewCommandHandler<FileNode> { +public class AddToIndexCommand extends + RepositoriesViewCommandHandler<RepositoryTreeNode> { public Object execute(ExecutionEvent event) throws ExecutionException { - List<FileNode> selectedNodes = getSelectedNodes(event); + List<? extends RepositoryTreeNode> selectedNodes = getSelectedNodes(event); if (selectedNodes.isEmpty() || selectedNodes.get(0).getRepository() == null) return null; |