{"action":"created","comment":{"url":"https://api.github.com/repos/mulesoft/mule/pulls/comments/121217637","pull_request_review_id":43255983,"id":121217637,"diff_hunk":"@@ -0,0 +1,55 @@\n+/*\n+ * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com\n+ * The software in this package is published under the terms of the CPAL v1.0\n+ * license, a copy of which has been included with this distribution in the\n+ * LICENSE.txt file.\n+ */\n+package org.mule.runtime.module.extension.internal.loader.enricher;\n+\n+import static java.lang.Boolean.FALSE;\n+import static java.lang.String.valueOf;\n+import org.mule.metadata.api.model.BooleanType;\n+import org.mule.metadata.api.visitor.MetadataTypeVisitor;\n+import org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration;\n+import org.mule.runtime.api.meta.model.declaration.fluent.ParameterDeclaration;\n+import org.mule.runtime.api.meta.model.declaration.fluent.ParameterGroupDeclaration;\n+import org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration;\n+import org.mule.runtime.api.meta.model.declaration.fluent.util.DeclarationWalker;\n+import org.mule.runtime.extension.api.annotation.param.ConfigOverride;\n+import org.mule.runtime.extension.api.loader.DeclarationEnricher;\n+import org.mule.runtime.extension.api.loader.ExtensionLoadingContext;\n+\n+/**\n+ * {@link DeclarationEnricher} implementation that walks through all the {@link BooleanType} parameters and sets them as optional.\n+ * It also enriches those parameters with a default value of \"false\" if they don't have one.\n+ *\n+ * If the parameter was annotated with {@link ConfigOverride}, no default value will be set because it will\n+ * interfere with {@link ConfigOverride}'s purpose.\n+ *\n+ * @since 4.0\n+ */\n+public class BooleanParameterDeclarationEnricher extends AbstractAnnotatedDeclarationEnricher {\n+\n+  @Override\n+  public void enrich(ExtensionLoadingContext extensionLoadingContext) {\n+    ExtensionDeclaration extensionDeclaration = extensionLoadingContext.getExtensionDeclarer().getDeclaration();\n+    new DeclarationWalker() {\n+\n+      @Override\n+      protected void onParameter(ParameterizedDeclaration owner, ParameterGroupDeclaration parameterGroup,\n+                                 ParameterDeclaration declaration) {\n+        declaration.getType().accept(new MetadataTypeVisitor() {\n+\n+          @Override\n+          public void visitBoolean(BooleanType booleanType) {\n+            declaration.setRequired(false);\n+            if (declaration.getDefaultValue() == null && !declaration.isConfigOverride()) {\n+              declaration.setDefaultValue(valueOf(FALSE));","path":"modules/extensions-support/src/main/java/org/mule/runtime/module/extension/internal/loader/enricher/BooleanParameterDeclarationEnricher.java","position":47,"original_position":47,"commit_id":"5ea89e6a62d9899b8b69c5cf6901a2e3602deddd","original_commit_id":"5ea89e6a62d9899b8b69c5cf6901a2e3602deddd","user":{"login":"marianogonzalez","id":1272771,"avatar_url":"https://avatars3.githubusercontent.com/u/1272771?v=3","gravatar_id":"","url":"https://api.github.com/users/marianogonzalez","html_url":"https://github.com/marianogonzalez","followers_url":"https://api.github.com/users/marianogonzalez/followers","following_url":"https://api.github.com/users/marianogonzalez/following{/other_user}","gists_url":"https://api.github.com/users/marianogonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/marianogonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marianogonzalez/subscriptions","organizations_url":"https://api.github.com/users/marianogonzalez/orgs","repos_url":"https://api.github.com/users/marianogonzalez/repos","events_url":"https://api.github.com/users/marianogonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/marianogonzalez/received_events","type":"User","site_admin":false},"body":"just use plain old \"false\". As a String you're adding an unnecessary transformation","created_at":"2017-06-09T20:37:09Z","updated_at":"2017-06-09T20:37:13Z","html_url":"https://github.com/mulesoft/mule/pull/4971#discussion_r121217637","pull_request_url":"https://api.github.com/repos/mulesoft/mule/pulls/4971","_links":{"self":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/comments/121217637"},"html":{"href":"https://github.com/mulesoft/mule/pull/4971#discussion_r121217637"},"pull_request":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/4971"}}},"pull_request":{"url":"https://api.github.com/repos/mulesoft/mule/pulls/4971","id":124666499,"html_url":"https://github.com/mulesoft/mule/pull/4971","diff_url":"https://github.com/mulesoft/mule/pull/4971.diff","patch_url":"https://github.com/mulesoft/mule/pull/4971.patch","issue_url":"https://api.github.com/repos/mulesoft/mule/issues/4971","number":4971,"state":"closed","locked":false,"title":"MULE-11799: Prevent triple state booleans","user":{"login":"pablomusumeci","id":5360549,"avatar_url":"https://avatars3.githubusercontent.com/u/5360549?v=3","gravatar_id":"","url":"https://api.github.com/users/pablomusumeci","html_url":"https://github.com/pablomusumeci","followers_url":"https://api.github.com/users/pablomusumeci/followers","following_url":"https://api.github.com/users/pablomusumeci/following{/other_user}","gists_url":"https://api.github.com/users/pablomusumeci/gists{/gist_id}","starred_url":"https://api.github.com/users/pablomusumeci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pablomusumeci/subscriptions","organizations_url":"https://api.github.com/users/pablomusumeci/orgs","repos_url":"https://api.github.com/users/pablomusumeci/repos","events_url":"https://api.github.com/users/pablomusumeci/events{/privacy}","received_events_url":"https://api.github.com/users/pablomusumeci/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-08T14:36:53Z","updated_at":"2017-06-09T20:37:13Z","closed_at":"2017-06-09T18:24:22Z","merged_at":"2017-06-09T18:24:22Z","merge_commit_sha":"503a91c060a24fe00769e4f93512e3c52e17d1c0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mulesoft/mule/pulls/4971/commits","review_comments_url":"https://api.github.com/repos/mulesoft/mule/pulls/4971/comments","review_comment_url":"https://api.github.com/repos/mulesoft/mule/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mulesoft/mule/issues/4971/comments","statuses_url":"https://api.github.com/repos/mulesoft/mule/statuses/5ea89e6a62d9899b8b69c5cf6901a2e3602deddd","head":{"label":"mulesoft:MULE-11799","ref":"MULE-11799","sha":"5ea89e6a62d9899b8b69c5cf6901a2e3602deddd","user":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars2.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"repo":{"id":7058562,"name":"mule","full_name":"mulesoft/mule","owner":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars2.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mulesoft/mule","description":"Mule Community Edition","fork":false,"url":"https://api.github.com/repos/mulesoft/mule","forks_url":"https://api.github.com/repos/mulesoft/mule/forks","keys_url":"https://api.github.com/repos/mulesoft/mule/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mulesoft/mule/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mulesoft/mule/teams","hooks_url":"https://api.github.com/repos/mulesoft/mule/hooks","issue_events_url":"https://api.github.com/repos/mulesoft/mule/issues/events{/number}","events_url":"https://api.github.com/repos/mulesoft/mule/events","assignees_url":"https://api.github.com/repos/mulesoft/mule/assignees{/user}","branches_url":"https://api.github.com/repos/mulesoft/mule/branches{/branch}","tags_url":"https://api.github.com/repos/mulesoft/mule/tags","blobs_url":"https://api.github.com/repos/mulesoft/mule/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mulesoft/mule/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mulesoft/mule/git/refs{/sha}","trees_url":"https://api.github.com/repos/mulesoft/mule/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mulesoft/mule/statuses/{sha}","languages_url":"https://api.github.com/repos/mulesoft/mule/languages","stargazers_url":"https://api.github.com/repos/mulesoft/mule/stargazers","contributors_url":"https://api.github.com/repos/mulesoft/mule/contributors","subscribers_url":"https://api.github.com/repos/mulesoft/mule/subscribers","subscription_url":"https://api.github.com/repos/mulesoft/mule/subscription","commits_url":"https://api.github.com/repos/mulesoft/mule/commits{/sha}","git_commits_url":"https://api.github.com/repos/mulesoft/mule/git/commits{/sha}","comments_url":"https://api.github.com/repos/mulesoft/mule/comments{/number}","issue_comment_url":"https://api.github.com/repos/mulesoft/mule/issues/comments{/number}","contents_url":"https://api.github.com/repos/mulesoft/mule/contents/{+path}","compare_url":"https://api.github.com/repos/mulesoft/mule/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mulesoft/mule/merges","archive_url":"https://api.github.com/repos/mulesoft/mule/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mulesoft/mule/downloads","issues_url":"https://api.github.com/repos/mulesoft/mule/issues{/number}","pulls_url":"https://api.github.com/repos/mulesoft/mule/pulls{/number}","milestones_url":"https://api.github.com/repos/mulesoft/mule/milestones{/number}","notifications_url":"https://api.github.com/repos/mulesoft/mule/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mulesoft/mule/labels{/name}","releases_url":"https://api.github.com/repos/mulesoft/mule/releases{/id}","deployments_url":"https://api.github.com/repos/mulesoft/mule/deployments","created_at":"2012-12-07T19:23:06Z","updated_at":"2017-06-09T16:39:51Z","pushed_at":"2017-06-09T20:35:51Z","git_url":"git://github.com/mulesoft/mule.git","ssh_url":"git@github.com:mulesoft/mule.git","clone_url":"https://github.com/mulesoft/mule.git","svn_url":"https://github.com/mulesoft/mule","homepage":null,"size":254473,"stargazers_count":449,"watchers_count":449,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":442,"mirror_url":null,"open_issues_count":23,"forks":442,"open_issues":23,"watchers":449,"default_branch":"mule-4.x"}},"base":{"label":"mulesoft:mule-4.x","ref":"mule-4.x","sha":"5c73ace24f446c3ca2bbdd301ca8471845a4ebee","user":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars2.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"repo":{"id":7058562,"name":"mule","full_name":"mulesoft/mule","owner":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars2.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mulesoft/mule","description":"Mule Community Edition","fork":false,"url":"https://api.github.com/repos/mulesoft/mule","forks_url":"https://api.github.com/repos/mulesoft/mule/forks","keys_url":"https://api.github.com/repos/mulesoft/mule/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mulesoft/mule/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mulesoft/mule/teams","hooks_url":"https://api.github.com/repos/mulesoft/mule/hooks","issue_events_url":"https://api.github.com/repos/mulesoft/mule/issues/events{/number}","events_url":"https://api.github.com/repos/mulesoft/mule/events","assignees_url":"https://api.github.com/repos/mulesoft/mule/assignees{/user}","branches_url":"https://api.github.com/repos/mulesoft/mule/branches{/branch}","tags_url":"https://api.github.com/repos/mulesoft/mule/tags","blobs_url":"https://api.github.com/repos/mulesoft/mule/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mulesoft/mule/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mulesoft/mule/git/refs{/sha}","trees_url":"https://api.github.com/repos/mulesoft/mule/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mulesoft/mule/statuses/{sha}","languages_url":"https://api.github.com/repos/mulesoft/mule/languages","stargazers_url":"https://api.github.com/repos/mulesoft/mule/stargazers","contributors_url":"https://api.github.com/repos/mulesoft/mule/contributors","subscribers_url":"https://api.github.com/repos/mulesoft/mule/subscribers","subscription_url":"https://api.github.com/repos/mulesoft/mule/subscription","commits_url":"https://api.github.com/repos/mulesoft/mule/commits{/sha}","git_commits_url":"https://api.github.com/repos/mulesoft/mule/git/commits{/sha}","comments_url":"https://api.github.com/repos/mulesoft/mule/comments{/number}","issue_comment_url":"https://api.github.com/repos/mulesoft/mule/issues/comments{/number}","contents_url":"https://api.github.com/repos/mulesoft/mule/contents/{+path}","compare_url":"https://api.github.com/repos/mulesoft/mule/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mulesoft/mule/merges","archive_url":"https://api.github.com/repos/mulesoft/mule/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mulesoft/mule/downloads","issues_url":"https://api.github.com/repos/mulesoft/mule/issues{/number}","pulls_url":"https://api.github.com/repos/mulesoft/mule/pulls{/number}","milestones_url":"https://api.github.com/repos/mulesoft/mule/milestones{/number}","notifications_url":"https://api.github.com/repos/mulesoft/mule/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mulesoft/mule/labels{/name}","releases_url":"https://api.github.com/repos/mulesoft/mule/releases{/id}","deployments_url":"https://api.github.com/repos/mulesoft/mule/deployments","created_at":"2012-12-07T19:23:06Z","updated_at":"2017-06-09T16:39:51Z","pushed_at":"2017-06-09T20:35:51Z","git_url":"git://github.com/mulesoft/mule.git","ssh_url":"git@github.com:mulesoft/mule.git","clone_url":"https://github.com/mulesoft/mule.git","svn_url":"https://github.com/mulesoft/mule","homepage":null,"size":254473,"stargazers_count":449,"watchers_count":449,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":442,"mirror_url":null,"open_issues_count":23,"forks":442,"open_issues":23,"watchers":449,"default_branch":"mule-4.x"}},"_links":{"self":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/4971"},"html":{"href":"https://github.com/mulesoft/mule/pull/4971"},"issue":{"href":"https://api.github.com/repos/mulesoft/mule/issues/4971"},"comments":{"href":"https://api.github.com/repos/mulesoft/mule/issues/4971/comments"},"review_comments":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/4971/comments"},"review_comment":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/4971/commits"},"statuses":{"href":"https://api.github.com/repos/mulesoft/mule/statuses/5ea89e6a62d9899b8b69c5cf6901a2e3602deddd"}}}}
{"actor":{"display_login":"marianogonzalez"}}