GitHub PullRequestReviewCommentEvent at 2014-07-31 06:08:40
Repository: k
Actor: yilongli
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/kframework/k/pulls/comments/15627375","id":15627375,"diff_hunk":"@@ -347,67 +347,58 @@ public ASTNode transform(BuiltinMap builtinMap) {\n                 builder.put(key, value);\n             }\n         }\n+        /* special case for maps composed only of entries */\n+        if (builtinMap.isConcreteCollection()) {\n+            return changed ? builder.build() : builtinMap;\n+        }\n \n-        // at this point, if changed is false, the BuiltinMap being built is still empty\n-        if (builtinMap.hasFrame()) {\n-            Variable oldFrame = builtinMap.frame();\n-            Term transformedFrame = (Term) oldFrame.accept(this);\n-            if (transformedFrame != oldFrame) {\n-                if (!changed) {\n-                    // the only change is the frame\n-                    changed = true;\n-                    builder.setEntriesAs(builtinMap);\n-                }\n-                builder.concat(transformedFrame);\n-            } else {\n-                builder.setFrame(oldFrame);\n-            }\n-        } else {\n-            // do nothing; if changed == true then all entries are already\n-            // copied; if changed == false then we will simply return the\n-            // original map later\n+        if (!changed) {\n+            builder.putAll(builtinMap.getEntries());\n         }\n \n+        for (KItem kItem : builtinMap.collectionPatterns()) {\n+            Term term = (Term) kItem.accept(this);\n+            changed = changed || (term != kItem);\n+            builder.concatenate(term);\n+        }\n+        for (Variable variable : builtinMap.collectionVariables()) {\n+            Term term = (Term) variable.accept(this);\n+            changed = changed || (term != variable);\n+            builder.concatenate(term);\n+        }\n+        for (Term term : builtinMap.collectionFunctions()) {\n+            Term transformedTerm = (Term) term.accept(this);\n+            changed = changed || (transformedTerm != term);\n+            builder.concatenate(transformedTerm);\n+        }\n         return changed ? builder.build() : builtinMap;\n     }\n \n     @Override\n     public ASTNode transform(BuiltinSet builtinSet) {\n-        BuiltinSet transformedSet = null;\n-        if (builtinSet.hasFrame()) {\n-            Term frame = (Term) builtinSet.frame().accept(this);\n-            if (frame != builtinSet.frame()) {\n-                transformedSet = BuiltinSet.of(Collections.<Term>emptySet(), frame);\n-            }\n-        }\n-\n-        for(Term entry : builtinSet.elements()) {\n-            Term key = (Term) entry.accept(this);\n-\n-            if (transformedSet == null && (key != entry)) {\n-                if (builtinSet.hasFrame()) {\n-                    transformedSet = new BuiltinSet(builtinSet.frame());\n-                } else {\n-                    transformedSet = new BuiltinSet();\n-                }\n-                for(Term copyEntry : builtinSet.elements()) {\n-                    if (copyEntry.equals(entry)) {\n-                        break;\n-                    }\n-                    transformedSet.add(copyEntry);\n-                }\n-            }\n-\n-            if (transformedSet != null) {\n-                transformedSet.add(key);\n-            }\n-        }\n-\n-        if (transformedSet != null) {\n-            return transformedSet;\n-        } else {\n-            return builtinSet;\n+        boolean changed = false;\n+        BuiltinSet.Builder builder = BuiltinSet.builder();\n+        for(Term element : builtinSet.elements()) {\n+            Term transformedElement = (Term) element.accept(this);\n+            builder.add(transformedElement);\n+            changed = changed || (transformedElement != element);\n+        }\n+        for (KItem kItem : builtinSet.collectionPatterns()) {","path":"src/javasources/KTool/src/org/kframework/backend/java/symbolic/CopyOnWriteTransformer.java","position":110,"original_position":110,"commit_id":"ac695529aad110b540377327418ab38051d6c7d3","original_commit_id":"ac695529aad110b540377327418ab38051d6c7d3","user":{"login":"yilongli","id":4922997,"avatar_url":"https://avatars.githubusercontent.com/u/4922997?v=1","gravatar_id":"b154ba7baf95a7bbdd486d13d09c579c","url":"https://api.github.com/users/yilongli","html_url":"https://github.com/yilongli","followers_url":"https://api.github.com/users/yilongli/followers","following_url":"https://api.github.com/users/yilongli/following{/other_user}","gists_url":"https://api.github.com/users/yilongli/gists{/gist_id}","starred_url":"https://api.github.com/users/yilongli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yilongli/subscriptions","organizations_url":"https://api.github.com/users/yilongli/orgs","repos_url":"https://api.github.com/users/yilongli/repos","events_url":"https://api.github.com/users/yilongli/events{/privacy}","received_events_url":"https://api.github.com/users/yilongli/received_events","type":"User","site_admin":false},"body":"return all three collections in one method?","created_at":"2014-07-31T06:08:40Z","updated_at":"2014-07-31T06:08:40Z","html_url":"https://github.com/kframework/k/pull/764#discussion_r15627375","pull_request_url":"https://api.github.com/repos/kframework/k/pulls/764","_links":{"self":{"href":"https://api.github.com/repos/kframework/k/pulls/comments/15627375"},"html":{"href":"https://github.com/kframework/k/pull/764#discussion_r15627375"},"pull_request":{"href":"https://api.github.com/repos/kframework/k/pulls/764"}}},"pull_request":{"url":"https://api.github.com/repos/kframework/k/pulls/764","id":19056026,"html_url":"https://github.com/kframework/k/pull/764","diff_url":"https://github.com/kframework/k/pull/764.diff","patch_url":"https://github.com/kframework/k/pull/764.patch","issue_url":"https://api.github.com/repos/kframework/k/issues/764","number":764,"state":"open","title":"commit of verification long standing branch","user":{"login":"andreistefanescu","id":5104433,"avatar_url":"https://avatars.githubusercontent.com/u/5104433?v=1","gravatar_id":"81a1bd827b4d5637b1a51e8eeb327777","url":"https://api.github.com/users/andreistefanescu","html_url":"https://github.com/andreistefanescu","followers_url":"https://api.github.com/users/andreistefanescu/followers","following_url":"https://api.github.com/users/andreistefanescu/following{/other_user}","gists_url":"https://api.github.com/users/andreistefanescu/gists{/gist_id}","starred_url":"https://api.github.com/users/andreistefanescu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreistefanescu/subscriptions","organizations_url":"https://api.github.com/users/andreistefanescu/orgs","repos_url":"https://api.github.com/users/andreistefanescu/repos","events_url":"https://api.github.com/users/andreistefanescu/events{/privacy}","received_events_url":"https://api.github.com/users/andreistefanescu/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-07-29T21:30:35Z","updated_at":"2014-07-31T06:08:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e34e5a2519cd5e7364bc49b5c5c97500ff1f7a48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kframework/k/pulls/764/commits","review_comments_url":"https://api.github.com/repos/kframework/k/pulls/764/comments","review_comment_url":"https://api.github.com/repos/kframework/k/pulls/comments/{number}","comments_url":"https://api.github.com/repos/kframework/k/issues/764/comments","statuses_url":"https://api.github.com/repos/kframework/k/statuses/ac695529aad110b540377327418ab38051d6c7d3","head":{"label":"andreistefanescu:final_commit","ref":"final_commit","sha":"ac695529aad110b540377327418ab38051d6c7d3","user":{"login":"andreistefanescu","id":5104433,"avatar_url":"https://avatars.githubusercontent.com/u/5104433?v=1","gravatar_id":"81a1bd827b4d5637b1a51e8eeb327777","url":"https://api.github.com/users/andreistefanescu","html_url":"https://github.com/andreistefanescu","followers_url":"https://api.github.com/users/andreistefanescu/followers","following_url":"https://api.github.com/users/andreistefanescu/following{/other_user}","gists_url":"https://api.github.com/users/andreistefanescu/gists{/gist_id}","starred_url":"https://api.github.com/users/andreistefanescu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreistefanescu/subscriptions","organizations_url":"https://api.github.com/users/andreistefanescu/orgs","repos_url":"https://api.github.com/users/andreistefanescu/repos","events_url":"https://api.github.com/users/andreistefanescu/events{/privacy}","received_events_url":"https://api.github.com/users/andreistefanescu/received_events","type":"User","site_admin":false},"repo":{"id":17534047,"name":"k","full_name":"andreistefanescu/k","owner":{"login":"andreistefanescu","id":5104433,"avatar_url":"https://avatars.githubusercontent.com/u/5104433?v=1","gravatar_id":"81a1bd827b4d5637b1a51e8eeb327777","url":"https://api.github.com/users/andreistefanescu","html_url":"https://github.com/andreistefanescu","followers_url":"https://api.github.com/users/andreistefanescu/followers","following_url":"https://api.github.com/users/andreistefanescu/following{/other_user}","gists_url":"https://api.github.com/users/andreistefanescu/gists{/gist_id}","starred_url":"https://api.github.com/users/andreistefanescu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreistefanescu/subscriptions","organizations_url":"https://api.github.com/users/andreistefanescu/orgs","repos_url":"https://api.github.com/users/andreistefanescu/repos","events_url":"https://api.github.com/users/andreistefanescu/events{/privacy}","received_events_url":"https://api.github.com/users/andreistefanescu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andreistefanescu/k","description":"The K tools","fork":true,"url":"https://api.github.com/repos/andreistefanescu/k","forks_url":"https://api.github.com/repos/andreistefanescu/k/forks","keys_url":"https://api.github.com/repos/andreistefanescu/k/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andreistefanescu/k/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andreistefanescu/k/teams","hooks_url":"https://api.github.com/repos/andreistefanescu/k/hooks","issue_events_url":"https://api.github.com/repos/andreistefanescu/k/issues/events{/number}","events_url":"https://api.github.com/repos/andreistefanescu/k/events","assignees_url":"https://api.github.com/repos/andreistefanescu/k/assignees{/user}","branches_url":"https://api.github.com/repos/andreistefanescu/k/branches{/branch}","tags_url":"https://api.github.com/repos/andreistefanescu/k/tags","blobs_url":"https://api.github.com/repos/andreistefanescu/k/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andreistefanescu/k/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andreistefanescu/k/git/refs{/sha}","trees_url":"https://api.github.com/repos/andreistefanescu/k/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andreistefanescu/k/statuses/{sha}","languages_url":"https://api.github.com/repos/andreistefanescu/k/languages","stargazers_url":"https://api.github.com/repos/andreistefanescu/k/stargazers","contributors_url":"https://api.github.com/repos/andreistefanescu/k/contributors","subscribers_url":"https://api.github.com/repos/andreistefanescu/k/subscribers","subscription_url":"https://api.github.com/repos/andreistefanescu/k/subscription","commits_url":"https://api.github.com/repos/andreistefanescu/k/commits{/sha}","git_commits_url":"https://api.github.com/repos/andreistefanescu/k/git/commits{/sha}","comments_url":"https://api.github.com/repos/andreistefanescu/k/comments{/number}","issue_comment_url":"https://api.github.com/repos/andreistefanescu/k/issues/comments/{number}","contents_url":"https://api.github.com/repos/andreistefanescu/k/contents/{+path}","compare_url":"https://api.github.com/repos/andreistefanescu/k/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andreistefanescu/k/merges","archive_url":"https://api.github.com/repos/andreistefanescu/k/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andreistefanescu/k/downloads","issues_url":"https://api.github.com/repos/andreistefanescu/k/issues{/number}","pulls_url":"https://api.github.com/repos/andreistefanescu/k/pulls{/number}","milestones_url":"https://api.github.com/repos/andreistefanescu/k/milestones{/number}","notifications_url":"https://api.github.com/repos/andreistefanescu/k/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andreistefanescu/k/labels{/name}","releases_url":"https://api.github.com/repos/andreistefanescu/k/releases{/id}","created_at":"2014-03-08T03:09:41Z","updated_at":"2014-06-23T21:15:13Z","pushed_at":"2014-07-30T23:45:07Z","git_url":"git://github.com/andreistefanescu/k.git","ssh_url":"git@github.com:andreistefanescu/k.git","clone_url":"https://github.com/andreistefanescu/k.git","svn_url":"https://github.com/andreistefanescu/k","homepage":"kframework.org","size":221544,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kframework:unified-builtins2","ref":"unified-builtins2","sha":"f38c866b08ff28aa34101964d1a84e2adfa94d46","user":{"login":"kframework","id":5104335,"avatar_url":"https://avatars.githubusercontent.com/u/5104335?v=1","gravatar_id":"3a4759b94458021fe8943c1a6e1c3f6f","url":"https://api.github.com/users/kframework","html_url":"https://github.com/kframework","followers_url":"https://api.github.com/users/kframework/followers","following_url":"https://api.github.com/users/kframework/following{/other_user}","gists_url":"https://api.github.com/users/kframework/gists{/gist_id}","starred_url":"https://api.github.com/users/kframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kframework/subscriptions","organizations_url":"https://api.github.com/users/kframework/orgs","repos_url":"https://api.github.com/users/kframework/repos","events_url":"https://api.github.com/users/kframework/events{/privacy}","received_events_url":"https://api.github.com/users/kframework/received_events","type":"Organization","site_admin":false},"repo":{"id":11711223,"name":"k","full_name":"kframework/k","owner":{"login":"kframework","id":5104335,"avatar_url":"https://avatars.githubusercontent.com/u/5104335?v=1","gravatar_id":"3a4759b94458021fe8943c1a6e1c3f6f","url":"https://api.github.com/users/kframework","html_url":"https://github.com/kframework","followers_url":"https://api.github.com/users/kframework/followers","following_url":"https://api.github.com/users/kframework/following{/other_user}","gists_url":"https://api.github.com/users/kframework/gists{/gist_id}","starred_url":"https://api.github.com/users/kframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kframework/subscriptions","organizations_url":"https://api.github.com/users/kframework/orgs","repos_url":"https://api.github.com/users/kframework/repos","events_url":"https://api.github.com/users/kframework/events{/privacy}","received_events_url":"https://api.github.com/users/kframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kframework/k","description":"The K tools","fork":false,"url":"https://api.github.com/repos/kframework/k","forks_url":"https://api.github.com/repos/kframework/k/forks","keys_url":"https://api.github.com/repos/kframework/k/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kframework/k/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kframework/k/teams","hooks_url":"https://api.github.com/repos/kframework/k/hooks","issue_events_url":"https://api.github.com/repos/kframework/k/issues/events{/number}","events_url":"https://api.github.com/repos/kframework/k/events","assignees_url":"https://api.github.com/repos/kframework/k/assignees{/user}","branches_url":"https://api.github.com/repos/kframework/k/branches{/branch}","tags_url":"https://api.github.com/repos/kframework/k/tags","blobs_url":"https://api.github.com/repos/kframework/k/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kframework/k/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kframework/k/git/refs{/sha}","trees_url":"https://api.github.com/repos/kframework/k/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kframework/k/statuses/{sha}","languages_url":"https://api.github.com/repos/kframework/k/languages","stargazers_url":"https://api.github.com/repos/kframework/k/stargazers","contributors_url":"https://api.github.com/repos/kframework/k/contributors","subscribers_url":"https://api.github.com/repos/kframework/k/subscribers","subscription_url":"https://api.github.com/repos/kframework/k/subscription","commits_url":"https://api.github.com/repos/kframework/k/commits{/sha}","git_commits_url":"https://api.github.com/repos/kframework/k/git/commits{/sha}","comments_url":"https://api.github.com/repos/kframework/k/comments{/number}","issue_comment_url":"https://api.github.com/repos/kframework/k/issues/comments/{number}","contents_url":"https://api.github.com/repos/kframework/k/contents/{+path}","compare_url":"https://api.github.com/repos/kframework/k/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kframework/k/merges","archive_url":"https://api.github.com/repos/kframework/k/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kframework/k/downloads","issues_url":"https://api.github.com/repos/kframework/k/issues{/number}","pulls_url":"https://api.github.com/repos/kframework/k/pulls{/number}","milestones_url":"https://api.github.com/repos/kframework/k/milestones{/number}","notifications_url":"https://api.github.com/repos/kframework/k/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kframework/k/labels{/name}","releases_url":"https://api.github.com/repos/kframework/k/releases{/id}","created_at":"2013-07-27T21:22:53Z","updated_at":"2014-07-07T14:40:13Z","pushed_at":"2014-07-30T19:44:25Z","git_url":"git://github.com/kframework/k.git","ssh_url":"git@github.com:kframework/k.git","clone_url":"https://github.com/kframework/k.git","svn_url":"https://github.com/kframework/k","homepage":"kframework.org","size":296681,"stargazers_count":35,"watchers_count":35,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":40,"mirror_url":null,"open_issues_count":267,"forks":40,"open_issues":267,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kframework/k/pulls/764"},"html":{"href":"https://github.com/kframework/k/pull/764"},"issue":{"href":"https://api.github.com/repos/kframework/k/issues/764"},"comments":{"href":"https://api.github.com/repos/kframework/k/issues/764/comments"},"review_comments":{"href":"https://api.github.com/repos/kframework/k/pulls/764/comments"},"review_comment":{"href":"https://api.github.com/repos/kframework/k/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/kframework/k/pulls/764/commits"},"statuses":{"href":"https://api.github.com/repos/kframework/k/statuses/ac695529aad110b540377327418ab38051d6c7d3"}}}}