{"action":"created","comment":{"url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments/66784643","id":66784643,"diff_hunk":"@@ -145,44 +151,76 @@ public void done(IJobChangeEvent event) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\tIStatus result = deploymentListenerJob.getResult();\n-\t\tif (result == null) {//timed out!\n+\t\tif (result == null) {// timed out!\n \t\t\tthrow new CoreException(deploymentListenerJob.getTimeOutStatus());\n \t\t} else if (!result.isOK()) {\n \t\t\tthrow new CoreException(result);\n \t\t}\n-\t\t\n+\n \t}\n \n-\tprivate void updateDeploymentConfigValues(IDeploymentConfig deploymentConfig,\n-\t\t\tDebuggingContext debugContext) {\n+\tprivate void updateDeploymentConfigValues(IDeploymentConfig deploymentConfig, DebuggingContext debugContext) {\n \t\tCollection<IContainer> originalContainers = deploymentConfig.getContainers();\n \t\tif (originalContainers != null && !originalContainers.isEmpty() && debugContext.isDebugEnabled()) {\n \t\t\tCollection<IContainer> containers = new ArrayList<>(originalContainers);\n \t\t\tIContainer container = containers.iterator().next();\n \t\t\tSet<IPort> ports = new HashSet<>(container.getPorts());\n-\t\t\t\n-\t\t\tIPort existing = ports.stream().filter(p -> p.getContainerPort() == debugContext.getDebugPort())\n-\t\t\t\t\t\t\t\t\t\t.findFirst().orElse(null);\n-\t\t\tboolean added = false;\n-\t\t\tif (existing == null) {\n-\t\t\t\tPortSpecAdapter newPort = new PortSpecAdapter(\"debug\", \"TCP\", debugContext.getDebugPort());\n-\t\t\t\tadded = ports.add(newPort);\n-\t\t\t} else {\n-\t\t\t\tPortSpecAdapter newPort = new PortSpecAdapter(existing.getName(), existing.getProtocol(), debugContext.getDebugPort());\n-\t\t\t\tif (!existing.equals(newPort)) {\n-\t\t\t\t\tports.remove(existing);\n-\t\t\t\t\tadded = ports.add(newPort);\n-\t\t\t\t}\n-\t\t\t}\n-\t\t\tif (added) {\n-\t\t\t\tcontainer.setPorts(ports); \n+\n+\t\t\tif (updateDebugPort(debugContext, ports) | updateJMXPort(debugContext, ports)) {\n+\t\t\t\tcontainer.setPorts(ports);\n \t\t\t\tdeploymentConfig.setContainers(containers);\n \t\t\t}\n \t\t}\n-\t\t//TODO the list of env var to set in debug mode should probably be defined in the server settings instead\n+\t\t// TODO the list of env var to set in debug mode should probably be\n+\t\t// defined in the server settings instead\n \t\tdeploymentConfig.setEnvironmentVariable(DEBUG_PORT_KEY, String.valueOf(debugContext.getDebugPort()));\n-\t\tdeploymentConfig.setEnvironmentVariable(DEV_MODE_KEY, String.valueOf(debugContext.isDebugEnabled()));//for node\n-\t\tdeploymentConfig.setEnvironmentVariable(DEBUG_KEY, String.valueOf(debugContext.isDebugEnabled()));//for eap\n+\t\tdeploymentConfig.setEnvironmentVariable(DEV_MODE_KEY, String.valueOf(debugContext.isDebugEnabled()));// for\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// node\n+\t\tdeploymentConfig.setEnvironmentVariable(DEBUG_KEY, String.valueOf(debugContext.isDebugEnabled()));// for\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// eap\n+\t\tif (debugContext.isDebugEnabled()) {\n+\t\t\tif (debugContext.getAdminUsername() == null) {\n+\t\t\t\tdebugContext.setAdminUsername(\"adminuser\"+new Random().nextInt(Integer.MAX_VALUE));\n+\t\t\t}\n+\t\t\tif (debugContext.getAdminPassword() == null) {\n+\t\t\t\tdebugContext.setAdminPassword(\"adminpw$\"+new Random().nextInt(Integer.MAX_VALUE));\n+\t\t\t}\n+\t\t\tdeploymentConfig.setEnvironmentVariable(ADMIN_USERNAME_KEY, debugContext.getAdminUsername());\n+\t\t\tdeploymentConfig.setEnvironmentVariable(ADMIN_PASSSWD_KEY, debugContext.getAdminPassword());\n+\t\t}\n+\t}\n+\n+\tprivate boolean updateJMXPort(DebuggingContext debugContext, Set<IPort> ports) {\n+\t\tIPort existing = ports.stream().filter(p->p.getName().equals(\"remotingjmx\")).findFirst().orElse(null);\n+\t\tPortSpecAdapter newPort = new PortSpecAdapter(\"remotingjmx\", \"TCP\", 9999);\n+\t\tif (existing == null) {\n+\t\t\tports.add(newPort);\n+\t\t\treturn true;\n+\t\t} else {\n+\t\t\tif (existing.equals(newPort)) {\n+\t\t\t\treturn false;\n+\t\t\t}\n+\t\t\tports.remove(existing);\n+\t\t\tports.add(newPort);\n+\t\t\treturn true;\n+\t\t}\n+\t}\n+\n+\tprivate boolean updateDebugPort(DebuggingContext debugContext, Set<IPort> ports) {\n+\t\tIPort existing = ports.stream().filter(p -> p.getContainerPort() == debugContext.getDebugPort()).findFirst()\n+\t\t\t\t.orElse(null);\n+\t\tif (existing == null) {\n+\t\t\treturn ports.add(new PortSpecAdapter(\"debug\", \"TCP\", debugContext.getDebugPort()));","path":"plugins/org.jboss.tools.openshift.core/src/org/jboss/tools/openshift/internal/core/server/debug/OpenShiftDebugUtils.java","position":192,"original_position":192,"commit_id":"477795d7bd4bfff7ac8afbc940f43f10698dc57c","original_commit_id":"477795d7bd4bfff7ac8afbc940f43f10698dc57c","user":{"login":"adietish","id":25126,"avatar_url":"https://avatars.githubusercontent.com/u/25126?v=3","gravatar_id":"","url":"https://api.github.com/users/adietish","html_url":"https://github.com/adietish","followers_url":"https://api.github.com/users/adietish/followers","following_url":"https://api.github.com/users/adietish/following{/other_user}","gists_url":"https://api.github.com/users/adietish/gists{/gist_id}","starred_url":"https://api.github.com/users/adietish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adietish/subscriptions","organizations_url":"https://api.github.com/users/adietish/orgs","repos_url":"https://api.github.com/users/adietish/repos","events_url":"https://api.github.com/users/adietish/events{/privacy}","received_events_url":"https://api.github.com/users/adietish/received_events","type":"User","site_admin":false},"body":"constant?","created_at":"2016-06-13T12:43:30Z","updated_at":"2016-06-13T12:43:30Z","html_url":"https://github.com/jbosstools/jbosstools-openshift/pull/1175#discussion_r66784643","pull_request_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/1175","_links":{"self":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments/66784643"},"html":{"href":"https://github.com/jbosstools/jbosstools-openshift/pull/1175#discussion_r66784643"},"pull_request":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/1175"}}},"pull_request":{"url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/1175","id":71034877,"html_url":"https://github.com/jbosstools/jbosstools-openshift/pull/1175","diff_url":"https://github.com/jbosstools/jbosstools-openshift/pull/1175.diff","patch_url":"https://github.com/jbosstools/jbosstools-openshift/pull/1175.patch","issue_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/1175","number":1175,"state":"open","locked":false,"title":"Jbide 21857: Hot class reload doesn't work on OpenShift","user":{"login":"tsmaeder","id":13163770,"avatar_url":"https://avatars.githubusercontent.com/u/13163770?v=3","gravatar_id":"","url":"https://api.github.com/users/tsmaeder","html_url":"https://github.com/tsmaeder","followers_url":"https://api.github.com/users/tsmaeder/followers","following_url":"https://api.github.com/users/tsmaeder/following{/other_user}","gists_url":"https://api.github.com/users/tsmaeder/gists{/gist_id}","starred_url":"https://api.github.com/users/tsmaeder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsmaeder/subscriptions","organizations_url":"https://api.github.com/users/tsmaeder/orgs","repos_url":"https://api.github.com/users/tsmaeder/repos","events_url":"https://api.github.com/users/tsmaeder/events{/privacy}","received_events_url":"https://api.github.com/users/tsmaeder/received_events","type":"User","site_admin":false},"body":"Currently, this fix only works with the EAP 6.4 Openshift image. If approved, we can add more client libraries","created_at":"2016-05-23T10:02:56Z","updated_at":"2016-06-13T12:43:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a290ffe6ec059adca08578ead44c7560fd2c3f80","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/1175/commits","review_comments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/1175/comments","review_comment_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/1175/comments","statuses_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/statuses/477795d7bd4bfff7ac8afbc940f43f10698dc57c","head":{"label":"tsmaeder:JBIDE-21857","ref":"JBIDE-21857","sha":"477795d7bd4bfff7ac8afbc940f43f10698dc57c","user":{"login":"tsmaeder","id":13163770,"avatar_url":"https://avatars.githubusercontent.com/u/13163770?v=3","gravatar_id":"","url":"https://api.github.com/users/tsmaeder","html_url":"https://github.com/tsmaeder","followers_url":"https://api.github.com/users/tsmaeder/followers","following_url":"https://api.github.com/users/tsmaeder/following{/other_user}","gists_url":"https://api.github.com/users/tsmaeder/gists{/gist_id}","starred_url":"https://api.github.com/users/tsmaeder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsmaeder/subscriptions","organizations_url":"https://api.github.com/users/tsmaeder/orgs","repos_url":"https://api.github.com/users/tsmaeder/repos","events_url":"https://api.github.com/users/tsmaeder/events{/privacy}","received_events_url":"https://api.github.com/users/tsmaeder/received_events","type":"User","site_admin":false},"repo":{"id":55152278,"name":"jbosstools-openshift","full_name":"tsmaeder/jbosstools-openshift","owner":{"login":"tsmaeder","id":13163770,"avatar_url":"https://avatars.githubusercontent.com/u/13163770?v=3","gravatar_id":"","url":"https://api.github.com/users/tsmaeder","html_url":"https://github.com/tsmaeder","followers_url":"https://api.github.com/users/tsmaeder/followers","following_url":"https://api.github.com/users/tsmaeder/following{/other_user}","gists_url":"https://api.github.com/users/tsmaeder/gists{/gist_id}","starred_url":"https://api.github.com/users/tsmaeder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsmaeder/subscriptions","organizations_url":"https://api.github.com/users/tsmaeder/orgs","repos_url":"https://api.github.com/users/tsmaeder/repos","events_url":"https://api.github.com/users/tsmaeder/events{/privacy}","received_events_url":"https://api.github.com/users/tsmaeder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tsmaeder/jbosstools-openshift","description":"JBoss Tools :: OpenShift { openshift }","fork":true,"url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift","forks_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/forks","keys_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/teams","hooks_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/hooks","issue_events_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/issues/events{/number}","events_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/events","assignees_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/assignees{/user}","branches_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/branches{/branch}","tags_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/tags","blobs_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/git/refs{/sha}","trees_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/statuses/{sha}","languages_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/languages","stargazers_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/stargazers","contributors_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/contributors","subscribers_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/subscribers","subscription_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/subscription","commits_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/commits{/sha}","git_commits_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/git/commits{/sha}","comments_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/comments{/number}","issue_comment_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/issues/comments{/number}","contents_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/contents/{+path}","compare_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/merges","archive_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/downloads","issues_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/issues{/number}","pulls_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/pulls{/number}","milestones_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/milestones{/number}","notifications_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/labels{/name}","releases_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/releases{/id}","deployments_url":"https://api.github.com/repos/tsmaeder/jbosstools-openshift/deployments","created_at":"2016-03-31T13:21:06Z","updated_at":"2016-03-31T13:21:09Z","pushed_at":"2016-06-10T07:52:35Z","git_url":"git://github.com/tsmaeder/jbosstools-openshift.git","ssh_url":"git@github.com:tsmaeder/jbosstools-openshift.git","clone_url":"https://github.com/tsmaeder/jbosstools-openshift.git","svn_url":"https://github.com/tsmaeder/jbosstools-openshift","homepage":"","size":18547,"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":"jbosstools:master","ref":"master","sha":"38a835e4d64dfe64928345af74c3b5f2f6e2a79b","user":{"login":"jbosstools","id":619871,"avatar_url":"https://avatars.githubusercontent.com/u/619871?v=3","gravatar_id":"","url":"https://api.github.com/users/jbosstools","html_url":"https://github.com/jbosstools","followers_url":"https://api.github.com/users/jbosstools/followers","following_url":"https://api.github.com/users/jbosstools/following{/other_user}","gists_url":"https://api.github.com/users/jbosstools/gists{/gist_id}","starred_url":"https://api.github.com/users/jbosstools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbosstools/subscriptions","organizations_url":"https://api.github.com/users/jbosstools/orgs","repos_url":"https://api.github.com/users/jbosstools/repos","events_url":"https://api.github.com/users/jbosstools/events{/privacy}","received_events_url":"https://api.github.com/users/jbosstools/received_events","type":"Organization","site_admin":false},"repo":{"id":6308288,"name":"jbosstools-openshift","full_name":"jbosstools/jbosstools-openshift","owner":{"login":"jbosstools","id":619871,"avatar_url":"https://avatars.githubusercontent.com/u/619871?v=3","gravatar_id":"","url":"https://api.github.com/users/jbosstools","html_url":"https://github.com/jbosstools","followers_url":"https://api.github.com/users/jbosstools/followers","following_url":"https://api.github.com/users/jbosstools/following{/other_user}","gists_url":"https://api.github.com/users/jbosstools/gists{/gist_id}","starred_url":"https://api.github.com/users/jbosstools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbosstools/subscriptions","organizations_url":"https://api.github.com/users/jbosstools/orgs","repos_url":"https://api.github.com/users/jbosstools/repos","events_url":"https://api.github.com/users/jbosstools/events{/privacy}","received_events_url":"https://api.github.com/users/jbosstools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jbosstools/jbosstools-openshift","description":"JBoss Tools :: OpenShift { openshift }","fork":false,"url":"https://api.github.com/repos/jbosstools/jbosstools-openshift","forks_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/forks","keys_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/teams","hooks_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/hooks","issue_events_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/events{/number}","events_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/events","assignees_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/assignees{/user}","branches_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/branches{/branch}","tags_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/tags","blobs_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/statuses/{sha}","languages_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/languages","stargazers_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/stargazers","contributors_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/contributors","subscribers_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/subscribers","subscription_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/subscription","commits_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/contents/{+path}","compare_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/merges","archive_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/downloads","issues_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues{/number}","pulls_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls{/number}","milestones_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/milestones{/number}","notifications_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/labels{/name}","releases_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/releases{/id}","deployments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/deployments","created_at":"2012-10-20T11:23:01Z","updated_at":"2016-01-11T16:23:14Z","pushed_at":"2016-06-10T23:02:22Z","git_url":"git://github.com/jbosstools/jbosstools-openshift.git","ssh_url":"git@github.com:jbosstools/jbosstools-openshift.git","clone_url":"https://github.com/jbosstools/jbosstools-openshift.git","svn_url":"https://github.com/jbosstools/jbosstools-openshift","homepage":"","size":19867,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":10,"forks":41,"open_issues":10,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/1175"},"html":{"href":"https://github.com/jbosstools/jbosstools-openshift/pull/1175"},"issue":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/1175"},"comments":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/1175/comments"},"review_comments":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/1175/comments"},"review_comment":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/1175/commits"},"statuses":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/statuses/477795d7bd4bfff7ac8afbc940f43f10698dc57c"}}}}
{"actor":{"display_login":"adietish"}}