{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/41439830","id":41439830,"diff_hunk":"@@ -286,4 +291,35 @@ private static void tryConfigDotXml(JenkinsRule.WebClient wc, int status, String\n         p.renameTo(\"different-name\");\n     }\n \n+    @Issue(\"JENKINS-30502\")\n+    @Test public void testRenameTrimsSpace() throws Exception {\n+        tryRename(\"myJob\", \" foo\", \"foo\");","path":"test/src/test/java/hudson/model/JobTest.java","position":35,"original_position":35,"commit_id":"e7790b9fa608d34d93ed8ab281d736759041f817","original_commit_id":"e7790b9fa608d34d93ed8ab281d736759041f817","user":{"login":"lanwen","id":1964214,"avatar_url":"https://avatars.githubusercontent.com/u/1964214?v=3","gravatar_id":"","url":"https://api.github.com/users/lanwen","html_url":"https://github.com/lanwen","followers_url":"https://api.github.com/users/lanwen/followers","following_url":"https://api.github.com/users/lanwen/following{/other_user}","gists_url":"https://api.github.com/users/lanwen/gists{/gist_id}","starred_url":"https://api.github.com/users/lanwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanwen/subscriptions","organizations_url":"https://api.github.com/users/lanwen/orgs","repos_url":"https://api.github.com/users/lanwen/repos","events_url":"https://api.github.com/users/lanwen/events{/privacy}","received_events_url":"https://api.github.com/users/lanwen/received_events","type":"User","site_admin":false},"body":"please use Parametrization instead of actually 2 cases in one method, or split it to separate methods, as of when fails first sentence, the second will never be run.","created_at":"2015-10-07T20:09:28Z","updated_at":"2015-10-07T20:09:28Z","html_url":"https://github.com/jenkinsci/jenkins/pull/1855#discussion_r41439830","pull_request_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1855","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/41439830"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/1855#discussion_r41439830"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1855"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1855","id":46826144,"html_url":"https://github.com/jenkinsci/jenkins/pull/1855","diff_url":"https://github.com/jenkinsci/jenkins/pull/1855.diff","patch_url":"https://github.com/jenkinsci/jenkins/pull/1855.patch","issue_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1855","number":1855,"state":"open","locked":false,"title":"[FIXED JENKINS-30502] trim job name upon rename","user":{"login":"csimons","id":1210661,"avatar_url":"https://avatars.githubusercontent.com/u/1210661?v=3","gravatar_id":"","url":"https://api.github.com/users/csimons","html_url":"https://github.com/csimons","followers_url":"https://api.github.com/users/csimons/followers","following_url":"https://api.github.com/users/csimons/following{/other_user}","gists_url":"https://api.github.com/users/csimons/gists{/gist_id}","starred_url":"https://api.github.com/users/csimons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csimons/subscriptions","organizations_url":"https://api.github.com/users/csimons/orgs","repos_url":"https://api.github.com/users/csimons/repos","events_url":"https://api.github.com/users/csimons/events{/privacy}","received_events_url":"https://api.github.com/users/csimons/received_events","type":"User","site_admin":false},"body":"If a job is renamed to a string with trailing whitespace, exceptions are thrown as the application attempts to rename the job directory in the file system, and the job can be neither deleted nor renamed again through the UI. This problem occurs only when renaming a job, and not when initially creating a job, because job names are trimmed when first created.  This change trims the job name for rename operations as well, so that the name-setting behavior is consistent across create/update operations and inadvertent leading/trailing whitespace is removed before it can cause problems.","created_at":"2015-10-05T20:00:24Z","updated_at":"2015-10-07T20:09:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c9cee59dded7b14134d0203388b7cb3619c83f2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1855/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1855/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1855/comments","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/e7790b9fa608d34d93ed8ab281d736759041f817","head":{"label":"csimons:fix-rename-trailing-whitespace","ref":"fix-rename-trailing-whitespace","sha":"e7790b9fa608d34d93ed8ab281d736759041f817","user":{"login":"csimons","id":1210661,"avatar_url":"https://avatars.githubusercontent.com/u/1210661?v=3","gravatar_id":"","url":"https://api.github.com/users/csimons","html_url":"https://github.com/csimons","followers_url":"https://api.github.com/users/csimons/followers","following_url":"https://api.github.com/users/csimons/following{/other_user}","gists_url":"https://api.github.com/users/csimons/gists{/gist_id}","starred_url":"https://api.github.com/users/csimons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csimons/subscriptions","organizations_url":"https://api.github.com/users/csimons/orgs","repos_url":"https://api.github.com/users/csimons/repos","events_url":"https://api.github.com/users/csimons/events{/privacy}","received_events_url":"https://api.github.com/users/csimons/received_events","type":"User","site_admin":false},"repo":{"id":43336177,"name":"jenkins","full_name":"csimons/jenkins","owner":{"login":"csimons","id":1210661,"avatar_url":"https://avatars.githubusercontent.com/u/1210661?v=3","gravatar_id":"","url":"https://api.github.com/users/csimons","html_url":"https://github.com/csimons","followers_url":"https://api.github.com/users/csimons/followers","following_url":"https://api.github.com/users/csimons/following{/other_user}","gists_url":"https://api.github.com/users/csimons/gists{/gist_id}","starred_url":"https://api.github.com/users/csimons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csimons/subscriptions","organizations_url":"https://api.github.com/users/csimons/orgs","repos_url":"https://api.github.com/users/csimons/repos","events_url":"https://api.github.com/users/csimons/events{/privacy}","received_events_url":"https://api.github.com/users/csimons/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/csimons/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/csimons/jenkins","forks_url":"https://api.github.com/repos/csimons/jenkins/forks","keys_url":"https://api.github.com/repos/csimons/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csimons/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csimons/jenkins/teams","hooks_url":"https://api.github.com/repos/csimons/jenkins/hooks","issue_events_url":"https://api.github.com/repos/csimons/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/csimons/jenkins/events","assignees_url":"https://api.github.com/repos/csimons/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/csimons/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/csimons/jenkins/tags","blobs_url":"https://api.github.com/repos/csimons/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csimons/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csimons/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/csimons/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csimons/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/csimons/jenkins/languages","stargazers_url":"https://api.github.com/repos/csimons/jenkins/stargazers","contributors_url":"https://api.github.com/repos/csimons/jenkins/contributors","subscribers_url":"https://api.github.com/repos/csimons/jenkins/subscribers","subscription_url":"https://api.github.com/repos/csimons/jenkins/subscription","commits_url":"https://api.github.com/repos/csimons/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/csimons/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/csimons/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/csimons/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/csimons/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/csimons/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csimons/jenkins/merges","archive_url":"https://api.github.com/repos/csimons/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csimons/jenkins/downloads","issues_url":"https://api.github.com/repos/csimons/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/csimons/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/csimons/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/csimons/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csimons/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/csimons/jenkins/releases{/id}","created_at":"2015-09-29T00:59:01Z","updated_at":"2015-09-29T00:59:29Z","pushed_at":"2015-10-07T19:41:23Z","git_url":"git://github.com/csimons/jenkins.git","ssh_url":"git@github.com:csimons/jenkins.git","clone_url":"https://github.com/csimons/jenkins.git","svn_url":"https://github.com/csimons/jenkins","homepage":"http://jenkins-ci.org/","size":88981,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"e4811a1d55e8950b8794962defde0f0e31c55ce0","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":1103607,"name":"jenkins","full_name":"jenkinsci/jenkins","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/jenkinsci/jenkins","forks_url":"https://api.github.com/repos/jenkinsci/jenkins/forks","keys_url":"https://api.github.com/repos/jenkinsci/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/jenkins/teams","hooks_url":"https://api.github.com/repos/jenkinsci/jenkins/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/jenkins/events","assignees_url":"https://api.github.com/repos/jenkinsci/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/jenkins/tags","blobs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/jenkins/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/jenkins/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/jenkins/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/jenkins/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/jenkins/subscription","commits_url":"https://api.github.com/repos/jenkinsci/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/jenkins/merges","archive_url":"https://api.github.com/repos/jenkinsci/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/jenkins/downloads","issues_url":"https://api.github.com/repos/jenkinsci/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/jenkins/releases{/id}","created_at":"2010-11-22T21:21:23Z","updated_at":"2015-10-07T17:56:57Z","pushed_at":"2015-10-07T19:49:39Z","git_url":"git://github.com/jenkinsci/jenkins.git","ssh_url":"git@github.com:jenkinsci/jenkins.git","clone_url":"https://github.com/jenkinsci/jenkins.git","svn_url":"https://github.com/jenkinsci/jenkins","homepage":"http://jenkins-ci.org/","size":456794,"stargazers_count":4618,"watchers_count":4618,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2053,"mirror_url":null,"open_issues_count":117,"forks":2053,"open_issues":117,"watchers":4618,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1855"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/1855"},"issue":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/1855"},"comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/1855/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1855/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1855/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/jenkins/statuses/e7790b9fa608d34d93ed8ab281d736759041f817"}}}}