Skip to content

Commit

Permalink
Merge pull request #353 from codenvy/CLDIDE-2593
Browse files Browse the repository at this point in the history
CLDIDE-2593: makes changes related to bugs found by SAP Fortify tool
  • Loading branch information
akorneta committed Nov 4, 2015
2 parents dd6b321 + aadc44d commit 4df7a97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,20 @@ protected void onFailure(Throwable exception) {
protected ResourceBasedNode<?> getResourceBasedNode() {
List<?> selection = projectExplorer.getSelection().getAllElements();
//we should be sure that user selected single element to work with it
if (selection != null && selection.isEmpty() || selection.size() > 1) {
return null;
}
if (selection != null && selection.size() > 1) {

Object o = selection.get(0);
Object o = selection.get(0);

if (o instanceof ResourceBasedNode<?>) {
ResourceBasedNode<?> node = (ResourceBasedNode<?>)o;
//it may be file node, so we should take parent node
if (node.isLeaf() && isResourceAndStorableNode(node.getParent())) {
return (ResourceBasedNode<?>)node.getParent();
}
if (o instanceof ResourceBasedNode<?>) {
ResourceBasedNode<?> node = (ResourceBasedNode<?>)o;
//it may be file node, so we should take parent node
if (node.isLeaf() && isResourceAndStorableNode(node.getParent())) {
return (ResourceBasedNode<?>)node.getParent();
}

return isResourceAndStorableNode(node) ? node : null;
return isResourceAndStorableNode(node) ? node : null;
}
}

return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ public GitUser getUser() throws GitException {
"git.committer.\\w+");
name = preferences.get("git.committer.name");
email = preferences.get("git.committer.email");
} catch (ServerException e) {
//ignored
} catch (ServerException ignored) {
}

gitUser.setName(isNullOrEmpty(name) ? "Anonymous" : name);
Expand Down

0 comments on commit 4df7a97

Please sign in to comment.