{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/22581","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/22581/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/22581/comments","events_url":"https://api.github.com/repos/apache/spark/issues/22581/events","html_url":"https://github.com/apache/spark/pull/22581","id":364829184,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4OTIxMTU5","number":22581,"title":"[SPARK-25565][BUILD] Add scalastyle rule to check add Locale.ROOT to .toLowerCase and .toUpperCase for internal calls","user":{"login":"HyukjinKwon","id":6477701,"node_id":"MDQ6VXNlcjY0Nzc3MDE=","avatar_url":"https://avatars0.githubusercontent.com/u/6477701?v=4","gravatar_id":"","url":"https://api.github.com/users/HyukjinKwon","html_url":"https://github.com/HyukjinKwon","followers_url":"https://api.github.com/users/HyukjinKwon/followers","following_url":"https://api.github.com/users/HyukjinKwon/following{/other_user}","gists_url":"https://api.github.com/users/HyukjinKwon/gists{/gist_id}","starred_url":"https://api.github.com/users/HyukjinKwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HyukjinKwon/subscriptions","organizations_url":"https://api.github.com/users/HyukjinKwon/orgs","repos_url":"https://api.github.com/users/HyukjinKwon/repos","events_url":"https://api.github.com/users/HyukjinKwon/events{/privacy}","received_events_url":"https://api.github.com/users/HyukjinKwon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-28T10:20:17Z","updated_at":"2018-09-28T17:57:39Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/22581","html_url":"https://github.com/apache/spark/pull/22581","diff_url":"https://github.com/apache/spark/pull/22581.diff","patch_url":"https://github.com/apache/spark/pull/22581.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nThis PR adds a rule to force `.toLowerCase(Locale.ROOT)` or `toUpperCase(Locale.ROOT)`.\r\n\r\nIt produces an error as below:\r\n\r\n```\r\n[error]       Are you sure that you want to use toUpperCase or toLowerCase without the root locale? In most cases, you\r\n[error]       should use toUpperCase(Locale.ROOT) or toLowerCase(Locale.ROOT) instead.\r\n[error]       If you must use toUpperCase or toLowerCase without the root locale, wrap the code block with\r\n[error]       // scalastyle:off caselocale\r\n[error]       .toUpperCase\r\n[error]       .toLowerCase\r\n[error]       // scalastyle:on caselocale\r\n```\r\n\r\nThis PR excludes the cases above for SQL code path for external calls like table name, column name and etc.\r\n\r\nFor test suites, or when it's clear there's no locale problem like Turkish locale problem, it uses `Locale.ROOT`.\r\n\r\nOne minor problem is, `UTF8String` has both methods, `toLowerCase` and `toUpperCase`, and the new rule detects them as well. They are ignored.\r\n\r\n## How was this patch tested?\r\n\r\nManually tested, and Jenkins tests.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/425517318","html_url":"https://github.com/apache/spark/pull/22581#issuecomment-425517318","issue_url":"https://api.github.com/repos/apache/spark/issues/22581","id":425517318,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTUxNzMxOA==","user":{"login":"AmplabJenkins","id":4031291,"node_id":"MDQ6VXNlcjQwMzEyOTE=","avatar_url":"https://avatars3.githubusercontent.com/u/4031291?v=4","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2018-09-28T17:57:39Z","updated_at":"2018-09-28T17:57:39Z","author_association":"NONE","body":"Merged build finished. Test PASSed."}}
{"actor":{"display_login":"AmplabJenkins"}}