{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/che/issues/1038","repository_url":"https://api.github.com/repos/eclipse/che","labels_url":"https://api.github.com/repos/eclipse/che/issues/1038/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/che/issues/1038/comments","events_url":"https://api.github.com/repos/eclipse/che/issues/1038/events","html_url":"https://github.com/eclipse/che/pull/1038","id":148124274,"number":1038,"title":"Reducing qantity of if-checks","user":{"login":"alexVengrovsk","id":8675954,"avatar_url":"https://avatars.githubusercontent.com/u/8675954?v=3","gravatar_id":"","url":"https://api.github.com/users/alexVengrovsk","html_url":"https://github.com/alexVengrovsk","followers_url":"https://api.github.com/users/alexVengrovsk/followers","following_url":"https://api.github.com/users/alexVengrovsk/following{/other_user}","gists_url":"https://api.github.com/users/alexVengrovsk/gists{/gist_id}","starred_url":"https://api.github.com/users/alexVengrovsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexVengrovsk/subscriptions","organizations_url":"https://api.github.com/users/alexVengrovsk/orgs","repos_url":"https://api.github.com/users/alexVengrovsk/repos","events_url":"https://api.github.com/users/alexVengrovsk/events{/privacy}","received_events_url":"https://api.github.com/users/alexVengrovsk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-04-13T17:10:07Z","updated_at":"2016-04-14T07:29:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eclipse/che/pulls/1038","html_url":"https://github.com/eclipse/che/pull/1038","diff_url":"https://github.com/eclipse/che/pull/1038.diff","patch_url":"https://github.com/eclipse/che/pull/1038.patch"},"body":"Signed-off-by: <alextrentton@gmail.com>\r\n\r\nIf-check in the `getResourceBasedNode()` method can be simplified. This change allows to exclude one check and protect method from `NullPointerException`. But this method still can throw this exception in line \r\n`Object o = selection.get(0);`\r\nI wasn't shure is it expected behaviour, so, didn't chenge anything there.\r\n\r\nIn the `parseMessage()` method it is posible to exclude the last if-check, because method `indexOf()` will return index or -1 if there is no searching sequence in the String. \r\n \r\nOne more question - both changed classes have identical methods with identical bodies: `getResourceBasedNode()`, `isResourceAndStorableNode()`, `parseMessage()`. Maybe, it would be better to create some utility class (for example - `UploadUtil`) with this methods and to use this class for both `UploadFilePresenter` and `UploadFolderFromZipPresenter`? \r\nThe same story about methods `addFile()` (from `UploadFileViewImpl`) and `addFileUploadForm()` (from `UploadFolderFromZipViewImpl`)."},"comment":{"url":"https://api.github.com/repos/eclipse/che/issues/comments/209804313","html_url":"https://github.com/eclipse/che/pull/1038#issuecomment-209804313","issue_url":"https://api.github.com/repos/eclipse/che/issues/1038","id":209804313,"user":{"login":"vparfonov","id":1636592,"avatar_url":"https://avatars.githubusercontent.com/u/1636592?v=3","gravatar_id":"","url":"https://api.github.com/users/vparfonov","html_url":"https://github.com/vparfonov","followers_url":"https://api.github.com/users/vparfonov/followers","following_url":"https://api.github.com/users/vparfonov/following{/other_user}","gists_url":"https://api.github.com/users/vparfonov/gists{/gist_id}","starred_url":"https://api.github.com/users/vparfonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vparfonov/subscriptions","organizations_url":"https://api.github.com/users/vparfonov/orgs","repos_url":"https://api.github.com/users/vparfonov/repos","events_url":"https://api.github.com/users/vparfonov/events{/privacy}","received_events_url":"https://api.github.com/users/vparfonov/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T07:29:26Z","updated_at":"2016-04-14T07:29:26Z","body":"@alexVengrovsk superclass "}}