{"action":"created","comment":{"url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/comments/24532449","id":24532449,"diff_hunk":"@@ -150,6 +147,68 @@ public static PathAddress pathAddress(PathAddress parent, PathElement... element\n         return pathAddress(list);\n     }\n \n+    public static PathAddress parseAddress(String address) throws IllegalArgumentException {\n+        PathAddress parsedAddress = PathAddress.EMPTY_ADDRESS;\n+        if (address == null || address.trim().isEmpty()) {\n+            return parsedAddress;\n+        }\n+        String trimmedAddress = address.trim();\n+        if (trimmedAddress.charAt(0) != '/' || !Character.isAlphabetic(trimmedAddress.charAt(1))) {\n+            throw new IllegalArgumentException();\n+        }\n+        char[] characters = address.toCharArray();\n+        boolean escaped = false;\n+        StringBuilder keyBuffer = new StringBuilder();\n+        StringBuilder valueBuffer = new StringBuilder();\n+        StringBuilder currentBuffer = keyBuffer;\n+        for (int i = 1; i < characters.length; i++) {\n+            switch (characters[i]) {\n+                case '/':\n+                    if (escaped) {\n+                        escaped = false;\n+                        currentBuffer.append(characters[i]);\n+                    } else {\n+                        parsedAddress = addpathAddressElement(parsedAddress, keyBuffer, valueBuffer);\n+                        keyBuffer = new StringBuilder();\n+                        valueBuffer = new StringBuilder();\n+                        currentBuffer = keyBuffer;\n+                    }\n+                    break;\n+                case '\\\\':\n+                    if (escaped) {\n+                        escaped = false;\n+                        currentBuffer.append(characters[i]);\n+                    } else {\n+                        escaped = true;\n+                    }\n+                    break;\n+                case '=':\n+                    if (escaped) {\n+                        escaped = false;\n+                        currentBuffer.append(characters[i]);\n+                    } else {\n+                        currentBuffer = valueBuffer;\n+                    }\n+                    break;\n+                default:\n+                    currentBuffer.append(characters[i]);\n+                    break;\n+            }\n+        }\n+        parsedAddress = addpathAddressElement(parsedAddress, keyBuffer, valueBuffer);\n+        return parsedAddress;\n+    }\n+\n+    private static PathAddress addpathAddressElement(PathAddress parsedAddress, StringBuilder keyBuffer, StringBuilder valueBuffer) {\n+        if (keyBuffer.length() > 0) {\n+            if (valueBuffer.length() > 0) {\n+                return parsedAddress.append(PathElement.pathElement(keyBuffer.toString(), valueBuffer.toString()));\n+            }\n+            return parsedAddress.append(PathElement.pathElement(keyBuffer.toString()));","path":"controller/src/main/java/org/jboss/as/controller/PathAddress.java","position":85,"original_position":85,"commit_id":"4ddfb2ba8bdab9a2875bfcbe6572b76d9b4d422e","original_commit_id":"4ddfb2ba8bdab9a2875bfcbe6572b76d9b4d422e","user":{"login":"bstansberry","id":299242,"avatar_url":"https://avatars.githubusercontent.com/u/299242?v=3","gravatar_id":"","url":"https://api.github.com/users/bstansberry","html_url":"https://github.com/bstansberry","followers_url":"https://api.github.com/users/bstansberry/followers","following_url":"https://api.github.com/users/bstansberry/following{/other_user}","gists_url":"https://api.github.com/users/bstansberry/gists{/gist_id}","starred_url":"https://api.github.com/users/bstansberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bstansberry/subscriptions","organizations_url":"https://api.github.com/users/bstansberry/orgs","repos_url":"https://api.github.com/users/bstansberry/repos","events_url":"https://api.github.com/users/bstansberry/events{/privacy}","received_events_url":"https://api.github.com/users/bstansberry/received_events","type":"User","site_admin":false},"body":"I don't think we should allow this. PathElement.pathElement(String) is a convenient mechanism for server side developers, but an incompletely specified String is not valid as an end user API. If they want a wildcard, they need to use key=*.","created_at":"2015-02-11T20:56:26Z","updated_at":"2015-02-11T20:56:26Z","html_url":"https://github.com/wildfly/wildfly-core/pull/482#discussion_r24532449","pull_request_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/482","_links":{"self":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/comments/24532449"},"html":{"href":"https://github.com/wildfly/wildfly-core/pull/482#discussion_r24532449"},"pull_request":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/482"}}},"pull_request":{"url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/482","id":29101816,"html_url":"https://github.com/wildfly/wildfly-core/pull/482","diff_url":"https://github.com/wildfly/wildfly-core/pull/482.diff","patch_url":"https://github.com/wildfly/wildfly-core/pull/482.patch","issue_url":"https://api.github.com/repos/wildfly/wildfly-core/issues/482","number":482,"state":"open","locked":false,"title":"[WFCORE-537] : Add path support into the management API.","user":{"login":"ehsavoie","id":73053,"avatar_url":"https://avatars.githubusercontent.com/u/73053?v=3","gravatar_id":"","url":"https://api.github.com/users/ehsavoie","html_url":"https://github.com/ehsavoie","followers_url":"https://api.github.com/users/ehsavoie/followers","following_url":"https://api.github.com/users/ehsavoie/following{/other_user}","gists_url":"https://api.github.com/users/ehsavoie/gists{/gist_id}","starred_url":"https://api.github.com/users/ehsavoie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehsavoie/subscriptions","organizations_url":"https://api.github.com/users/ehsavoie/orgs","repos_url":"https://api.github.com/users/ehsavoie/repos","events_url":"https://api.github.com/users/ehsavoie/events{/privacy}","received_events_url":"https://api.github.com/users/ehsavoie/received_events","type":"User","site_admin":false},"body":"Allow the use of String to pass an operation address.\r\n\r\nJira: https://issues.jboss.org/browse/WFCORE-537","created_at":"2015-02-11T15:51:33Z","updated_at":"2015-02-11T20:56:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9930a7102c61cfea52d2165074fab3e7f20e633a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/482/commits","review_comments_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/482/comments","review_comment_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/comments/{number}","comments_url":"https://api.github.com/repos/wildfly/wildfly-core/issues/482/comments","statuses_url":"https://api.github.com/repos/wildfly/wildfly-core/statuses/4ddfb2ba8bdab9a2875bfcbe6572b76d9b4d422e","head":{"label":"ehsavoie:WFCORE-537","ref":"WFCORE-537","sha":"4ddfb2ba8bdab9a2875bfcbe6572b76d9b4d422e","user":{"login":"ehsavoie","id":73053,"avatar_url":"https://avatars.githubusercontent.com/u/73053?v=3","gravatar_id":"","url":"https://api.github.com/users/ehsavoie","html_url":"https://github.com/ehsavoie","followers_url":"https://api.github.com/users/ehsavoie/followers","following_url":"https://api.github.com/users/ehsavoie/following{/other_user}","gists_url":"https://api.github.com/users/ehsavoie/gists{/gist_id}","starred_url":"https://api.github.com/users/ehsavoie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehsavoie/subscriptions","organizations_url":"https://api.github.com/users/ehsavoie/orgs","repos_url":"https://api.github.com/users/ehsavoie/repos","events_url":"https://api.github.com/users/ehsavoie/events{/privacy}","received_events_url":"https://api.github.com/users/ehsavoie/received_events","type":"User","site_admin":false},"repo":{"id":21896147,"name":"wildfly-core","full_name":"ehsavoie/wildfly-core","owner":{"login":"ehsavoie","id":73053,"avatar_url":"https://avatars.githubusercontent.com/u/73053?v=3","gravatar_id":"","url":"https://api.github.com/users/ehsavoie","html_url":"https://github.com/ehsavoie","followers_url":"https://api.github.com/users/ehsavoie/followers","following_url":"https://api.github.com/users/ehsavoie/following{/other_user}","gists_url":"https://api.github.com/users/ehsavoie/gists{/gist_id}","starred_url":"https://api.github.com/users/ehsavoie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehsavoie/subscriptions","organizations_url":"https://api.github.com/users/ehsavoie/orgs","repos_url":"https://api.github.com/users/ehsavoie/repos","events_url":"https://api.github.com/users/ehsavoie/events{/privacy}","received_events_url":"https://api.github.com/users/ehsavoie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ehsavoie/wildfly-core","description":"The core runtime that is used by the Wildfly application server","fork":true,"url":"https://api.github.com/repos/ehsavoie/wildfly-core","forks_url":"https://api.github.com/repos/ehsavoie/wildfly-core/forks","keys_url":"https://api.github.com/repos/ehsavoie/wildfly-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ehsavoie/wildfly-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ehsavoie/wildfly-core/teams","hooks_url":"https://api.github.com/repos/ehsavoie/wildfly-core/hooks","issue_events_url":"https://api.github.com/repos/ehsavoie/wildfly-core/issues/events{/number}","events_url":"https://api.github.com/repos/ehsavoie/wildfly-core/events","assignees_url":"https://api.github.com/repos/ehsavoie/wildfly-core/assignees{/user}","branches_url":"https://api.github.com/repos/ehsavoie/wildfly-core/branches{/branch}","tags_url":"https://api.github.com/repos/ehsavoie/wildfly-core/tags","blobs_url":"https://api.github.com/repos/ehsavoie/wildfly-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ehsavoie/wildfly-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ehsavoie/wildfly-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/ehsavoie/wildfly-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ehsavoie/wildfly-core/statuses/{sha}","languages_url":"https://api.github.com/repos/ehsavoie/wildfly-core/languages","stargazers_url":"https://api.github.com/repos/ehsavoie/wildfly-core/stargazers","contributors_url":"https://api.github.com/repos/ehsavoie/wildfly-core/contributors","subscribers_url":"https://api.github.com/repos/ehsavoie/wildfly-core/subscribers","subscription_url":"https://api.github.com/repos/ehsavoie/wildfly-core/subscription","commits_url":"https://api.github.com/repos/ehsavoie/wildfly-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/ehsavoie/wildfly-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/ehsavoie/wildfly-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/ehsavoie/wildfly-core/issues/comments/{number}","contents_url":"https://api.github.com/repos/ehsavoie/wildfly-core/contents/{+path}","compare_url":"https://api.github.com/repos/ehsavoie/wildfly-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ehsavoie/wildfly-core/merges","archive_url":"https://api.github.com/repos/ehsavoie/wildfly-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ehsavoie/wildfly-core/downloads","issues_url":"https://api.github.com/repos/ehsavoie/wildfly-core/issues{/number}","pulls_url":"https://api.github.com/repos/ehsavoie/wildfly-core/pulls{/number}","milestones_url":"https://api.github.com/repos/ehsavoie/wildfly-core/milestones{/number}","notifications_url":"https://api.github.com/repos/ehsavoie/wildfly-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ehsavoie/wildfly-core/labels{/name}","releases_url":"https://api.github.com/repos/ehsavoie/wildfly-core/releases{/id}","created_at":"2014-07-16T10:20:50Z","updated_at":"2014-08-07T07:28:12Z","pushed_at":"2015-02-11T16:56:35Z","git_url":"git://github.com/ehsavoie/wildfly-core.git","ssh_url":"git@github.com:ehsavoie/wildfly-core.git","clone_url":"https://github.com/ehsavoie/wildfly-core.git","svn_url":"https://github.com/ehsavoie/wildfly-core","homepage":null,"size":37198,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"wildfly:master","ref":"master","sha":"33659a34163d708cb6d62d9cb7392500750e61cc","user":{"login":"wildfly","id":3066274,"avatar_url":"https://avatars.githubusercontent.com/u/3066274?v=3","gravatar_id":"","url":"https://api.github.com/users/wildfly","html_url":"https://github.com/wildfly","followers_url":"https://api.github.com/users/wildfly/followers","following_url":"https://api.github.com/users/wildfly/following{/other_user}","gists_url":"https://api.github.com/users/wildfly/gists{/gist_id}","starred_url":"https://api.github.com/users/wildfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildfly/subscriptions","organizations_url":"https://api.github.com/users/wildfly/orgs","repos_url":"https://api.github.com/users/wildfly/repos","events_url":"https://api.github.com/users/wildfly/events{/privacy}","received_events_url":"https://api.github.com/users/wildfly/received_events","type":"Organization","site_admin":false},"repo":{"id":21394954,"name":"wildfly-core","full_name":"wildfly/wildfly-core","owner":{"login":"wildfly","id":3066274,"avatar_url":"https://avatars.githubusercontent.com/u/3066274?v=3","gravatar_id":"","url":"https://api.github.com/users/wildfly","html_url":"https://github.com/wildfly","followers_url":"https://api.github.com/users/wildfly/followers","following_url":"https://api.github.com/users/wildfly/following{/other_user}","gists_url":"https://api.github.com/users/wildfly/gists{/gist_id}","starred_url":"https://api.github.com/users/wildfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildfly/subscriptions","organizations_url":"https://api.github.com/users/wildfly/orgs","repos_url":"https://api.github.com/users/wildfly/repos","events_url":"https://api.github.com/users/wildfly/events{/privacy}","received_events_url":"https://api.github.com/users/wildfly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wildfly/wildfly-core","description":"The core runtime that is used by the Wildfly application server","fork":false,"url":"https://api.github.com/repos/wildfly/wildfly-core","forks_url":"https://api.github.com/repos/wildfly/wildfly-core/forks","keys_url":"https://api.github.com/repos/wildfly/wildfly-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wildfly/wildfly-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wildfly/wildfly-core/teams","hooks_url":"https://api.github.com/repos/wildfly/wildfly-core/hooks","issue_events_url":"https://api.github.com/repos/wildfly/wildfly-core/issues/events{/number}","events_url":"https://api.github.com/repos/wildfly/wildfly-core/events","assignees_url":"https://api.github.com/repos/wildfly/wildfly-core/assignees{/user}","branches_url":"https://api.github.com/repos/wildfly/wildfly-core/branches{/branch}","tags_url":"https://api.github.com/repos/wildfly/wildfly-core/tags","blobs_url":"https://api.github.com/repos/wildfly/wildfly-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wildfly/wildfly-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wildfly/wildfly-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/wildfly/wildfly-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wildfly/wildfly-core/statuses/{sha}","languages_url":"https://api.github.com/repos/wildfly/wildfly-core/languages","stargazers_url":"https://api.github.com/repos/wildfly/wildfly-core/stargazers","contributors_url":"https://api.github.com/repos/wildfly/wildfly-core/contributors","subscribers_url":"https://api.github.com/repos/wildfly/wildfly-core/subscribers","subscription_url":"https://api.github.com/repos/wildfly/wildfly-core/subscription","commits_url":"https://api.github.com/repos/wildfly/wildfly-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/wildfly/wildfly-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/wildfly/wildfly-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/wildfly/wildfly-core/issues/comments/{number}","contents_url":"https://api.github.com/repos/wildfly/wildfly-core/contents/{+path}","compare_url":"https://api.github.com/repos/wildfly/wildfly-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wildfly/wildfly-core/merges","archive_url":"https://api.github.com/repos/wildfly/wildfly-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wildfly/wildfly-core/downloads","issues_url":"https://api.github.com/repos/wildfly/wildfly-core/issues{/number}","pulls_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls{/number}","milestones_url":"https://api.github.com/repos/wildfly/wildfly-core/milestones{/number}","notifications_url":"https://api.github.com/repos/wildfly/wildfly-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wildfly/wildfly-core/labels{/name}","releases_url":"https://api.github.com/repos/wildfly/wildfly-core/releases{/id}","created_at":"2014-07-01T16:33:34Z","updated_at":"2015-02-10T19:28:26Z","pushed_at":"2015-02-10T19:28:26Z","git_url":"git://github.com/wildfly/wildfly-core.git","ssh_url":"git@github.com:wildfly/wildfly-core.git","clone_url":"https://github.com/wildfly/wildfly-core.git","svn_url":"https://github.com/wildfly/wildfly-core","homepage":null,"size":41853,"stargazers_count":10,"watchers_count":10,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":12,"forks":94,"open_issues":12,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/482"},"html":{"href":"https://github.com/wildfly/wildfly-core/pull/482"},"issue":{"href":"https://api.github.com/repos/wildfly/wildfly-core/issues/482"},"comments":{"href":"https://api.github.com/repos/wildfly/wildfly-core/issues/482/comments"},"review_comments":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/482/comments"},"review_comment":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/482/commits"},"statuses":{"href":"https://api.github.com/repos/wildfly/wildfly-core/statuses/4ddfb2ba8bdab9a2875bfcbe6572b76d9b4d422e"}}}}