{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/32102450","id":32102450,"diff_hunk":"@@ -781,11 +780,24 @@ class DataStream[T](javaStream: JavaStream[T]) {\n     if (fun == null) {\n       throw new NullPointerException(\"Sink function must not be null.\")\n     }\n+    val cleanFun = clean(fun)\n     val sinkFunction = new SinkFunction[T] {\n-      val cleanFun = clean(fun)\n       def invoke(in: T) = cleanFun(in)\n     }\n     this.addSink(sinkFunction)\n   }\n \n+  /**\n+   * Returns a \"closure-cleaned\" version of the given function. Cleans only if closure cleaning\n+   * is not disabled in the {@link org.apache.flink.api.common.ExecutionConfig}\n+   */\n+  private[flink] def clean[F <: AnyRef](f: F): F = {","path":"flink-staging/flink-streaming/flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/DataStream.scala","position":126,"original_position":126,"commit_id":"07ad8dfb0d766a40fb27611f9c8c9a155c48c6c8","original_commit_id":"07ad8dfb0d766a40fb27611f9c8c9a155c48c6c8","user":{"login":"mbalassi","id":5990983,"avatar_url":"https://avatars.githubusercontent.com/u/5990983?v=3","gravatar_id":"","url":"https://api.github.com/users/mbalassi","html_url":"https://github.com/mbalassi","followers_url":"https://api.github.com/users/mbalassi/followers","following_url":"https://api.github.com/users/mbalassi/following{/other_user}","gists_url":"https://api.github.com/users/mbalassi/gists{/gist_id}","starred_url":"https://api.github.com/users/mbalassi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbalassi/subscriptions","organizations_url":"https://api.github.com/users/mbalassi/orgs","repos_url":"https://api.github.com/users/mbalassi/repos","events_url":"https://api.github.com/users/mbalassi/events{/privacy}","received_events_url":"https://api.github.com/users/mbalassi/received_events","type":"User","site_admin":false},"body":"Why do we need multiple clean functions? I think scala visibility solves that. :)","created_at":"2015-06-10T09:47:39Z","updated_at":"2015-06-10T09:47:39Z","html_url":"https://github.com/apache/flink/pull/813#discussion_r32102450","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/813","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/32102450"},"html":{"href":"https://github.com/apache/flink/pull/813#discussion_r32102450"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/813"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/813","id":37329081,"html_url":"https://github.com/apache/flink/pull/813","diff_url":"https://github.com/apache/flink/pull/813.diff","patch_url":"https://github.com/apache/flink/pull/813.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/813","number":813,"state":"open","locked":false,"title":"[FLINK-2191] Fix inconsistent use of closure cleaner in Scala Streaming","user":{"login":"aljoscha","id":68551,"avatar_url":"https://avatars.githubusercontent.com/u/68551?v=3","gravatar_id":"","url":"https://api.github.com/users/aljoscha","html_url":"https://github.com/aljoscha","followers_url":"https://api.github.com/users/aljoscha/followers","following_url":"https://api.github.com/users/aljoscha/following{/other_user}","gists_url":"https://api.github.com/users/aljoscha/gists{/gist_id}","starred_url":"https://api.github.com/users/aljoscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aljoscha/subscriptions","organizations_url":"https://api.github.com/users/aljoscha/orgs","repos_url":"https://api.github.com/users/aljoscha/repos","events_url":"https://api.github.com/users/aljoscha/events{/privacy}","received_events_url":"https://api.github.com/users/aljoscha/received_events","type":"User","site_admin":false},"body":"The closure cleaner still cannot be disabled for the Timestamp extractor\r\nin Time and for the delta function in Delta (windowing helpers).","created_at":"2015-06-10T06:53:29Z","updated_at":"2015-06-10T09:47:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4211b7c26b61503b90d4ab9fe2ee4e1a2d22a853","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/813/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/813/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/813/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/07ad8dfb0d766a40fb27611f9c8c9a155c48c6c8","head":{"label":"aljoscha:closure-cleaner-fix","ref":"closure-cleaner-fix","sha":"07ad8dfb0d766a40fb27611f9c8c9a155c48c6c8","user":{"login":"aljoscha","id":68551,"avatar_url":"https://avatars.githubusercontent.com/u/68551?v=3","gravatar_id":"","url":"https://api.github.com/users/aljoscha","html_url":"https://github.com/aljoscha","followers_url":"https://api.github.com/users/aljoscha/followers","following_url":"https://api.github.com/users/aljoscha/following{/other_user}","gists_url":"https://api.github.com/users/aljoscha/gists{/gist_id}","starred_url":"https://api.github.com/users/aljoscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aljoscha/subscriptions","organizations_url":"https://api.github.com/users/aljoscha/orgs","repos_url":"https://api.github.com/users/aljoscha/repos","events_url":"https://api.github.com/users/aljoscha/events{/privacy}","received_events_url":"https://api.github.com/users/aljoscha/received_events","type":"User","site_admin":false},"repo":{"id":22066189,"name":"flink","full_name":"aljoscha/flink","owner":{"login":"aljoscha","id":68551,"avatar_url":"https://avatars.githubusercontent.com/u/68551?v=3","gravatar_id":"","url":"https://api.github.com/users/aljoscha","html_url":"https://github.com/aljoscha","followers_url":"https://api.github.com/users/aljoscha/followers","following_url":"https://api.github.com/users/aljoscha/following{/other_user}","gists_url":"https://api.github.com/users/aljoscha/gists{/gist_id}","starred_url":"https://api.github.com/users/aljoscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aljoscha/subscriptions","organizations_url":"https://api.github.com/users/aljoscha/orgs","repos_url":"https://api.github.com/users/aljoscha/repos","events_url":"https://api.github.com/users/aljoscha/events{/privacy}","received_events_url":"https://api.github.com/users/aljoscha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aljoscha/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/aljoscha/flink","forks_url":"https://api.github.com/repos/aljoscha/flink/forks","keys_url":"https://api.github.com/repos/aljoscha/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aljoscha/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aljoscha/flink/teams","hooks_url":"https://api.github.com/repos/aljoscha/flink/hooks","issue_events_url":"https://api.github.com/repos/aljoscha/flink/issues/events{/number}","events_url":"https://api.github.com/repos/aljoscha/flink/events","assignees_url":"https://api.github.com/repos/aljoscha/flink/assignees{/user}","branches_url":"https://api.github.com/repos/aljoscha/flink/branches{/branch}","tags_url":"https://api.github.com/repos/aljoscha/flink/tags","blobs_url":"https://api.github.com/repos/aljoscha/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aljoscha/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aljoscha/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/aljoscha/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aljoscha/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/aljoscha/flink/languages","stargazers_url":"https://api.github.com/repos/aljoscha/flink/stargazers","contributors_url":"https://api.github.com/repos/aljoscha/flink/contributors","subscribers_url":"https://api.github.com/repos/aljoscha/flink/subscribers","subscription_url":"https://api.github.com/repos/aljoscha/flink/subscription","commits_url":"https://api.github.com/repos/aljoscha/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/aljoscha/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/aljoscha/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/aljoscha/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/aljoscha/flink/contents/{+path}","compare_url":"https://api.github.com/repos/aljoscha/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aljoscha/flink/merges","archive_url":"https://api.github.com/repos/aljoscha/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aljoscha/flink/downloads","issues_url":"https://api.github.com/repos/aljoscha/flink/issues{/number}","pulls_url":"https://api.github.com/repos/aljoscha/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/aljoscha/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/aljoscha/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aljoscha/flink/labels{/name}","releases_url":"https://api.github.com/repos/aljoscha/flink/releases{/id}","created_at":"2014-07-21T13:51:54Z","updated_at":"2015-04-29T15:29:18Z","pushed_at":"2015-06-10T09:00:30Z","git_url":"git://github.com/aljoscha/flink.git","ssh_url":"git@github.com:aljoscha/flink.git","clone_url":"https://github.com/aljoscha/flink.git","svn_url":"https://github.com/aljoscha/flink","homepage":null,"size":50580,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"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":"apache:master","ref":"master","sha":"1481647d5a23bf4be9ecef9c435d3926f776c46a","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20587599,"name":"flink","full_name":"apache/flink","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/flink","description":"Mirror of Apache Flink","fork":false,"url":"https://api.github.com/repos/apache/flink","forks_url":"https://api.github.com/repos/apache/flink/forks","keys_url":"https://api.github.com/repos/apache/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/flink/teams","hooks_url":"https://api.github.com/repos/apache/flink/hooks","issue_events_url":"https://api.github.com/repos/apache/flink/issues/events{/number}","events_url":"https://api.github.com/repos/apache/flink/events","assignees_url":"https://api.github.com/repos/apache/flink/assignees{/user}","branches_url":"https://api.github.com/repos/apache/flink/branches{/branch}","tags_url":"https://api.github.com/repos/apache/flink/tags","blobs_url":"https://api.github.com/repos/apache/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/flink/languages","stargazers_url":"https://api.github.com/repos/apache/flink/stargazers","contributors_url":"https://api.github.com/repos/apache/flink/contributors","subscribers_url":"https://api.github.com/repos/apache/flink/subscribers","subscription_url":"https://api.github.com/repos/apache/flink/subscription","commits_url":"https://api.github.com/repos/apache/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/flink/contents/{+path}","compare_url":"https://api.github.com/repos/apache/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/flink/merges","archive_url":"https://api.github.com/repos/apache/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/flink/downloads","issues_url":"https://api.github.com/repos/apache/flink/issues{/number}","pulls_url":"https://api.github.com/repos/apache/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/flink/labels{/name}","releases_url":"https://api.github.com/repos/apache/flink/releases{/id}","created_at":"2014-06-07T07:00:10Z","updated_at":"2015-06-09T06:53:13Z","pushed_at":"2015-06-10T09:42:30Z","git_url":"git://github.com/apache/flink.git","ssh_url":"git@github.com:apache/flink.git","clone_url":"https://github.com/apache/flink.git","svn_url":"https://github.com/apache/flink","homepage":null,"size":2507256,"stargazers_count":445,"watchers_count":445,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":282,"mirror_url":"git://git.apache.org/incubator-flink.git","open_issues_count":55,"forks":282,"open_issues":55,"watchers":445,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/813"},"html":{"href":"https://github.com/apache/flink/pull/813"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/813"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/813/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/813/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/813/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/07ad8dfb0d766a40fb27611f9c8c9a155c48c6c8"}}}}