{"action":"created","comment":{"url":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/comments/48449845","id":48449845,"diff_hunk":"@@ -0,0 +1,60 @@\n+package de.uka.ipd.sdq.beagle.extensionpointprototype;\n+\n+import de.uka.sdq.beagle.measurement.MeasurementTool;\n+\n+import org.eclipse.core.runtime.CoreException;\n+import org.eclipse.core.runtime.IConfigurationElement;\n+import org.eclipse.core.runtime.IExtensionRegistry;\n+import org.eclipse.core.runtime.Platform;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+/**\n+ * This class handles the creation searching and loading of all available measurement\n+ * tools.\n+ *\n+ * @author Roman Langrehr\n+ */\n+public class MeasurementToolContributionsHandler {\n+\n+\t/**\n+\t * The extension point id for the measurement tools.\n+\t */\n+\tprivate static final String MEASUREMT_TOOL_EXTENSION_POINT_ID = \"de.uka.ipd.sdg.beagle.measurmenttool\";\n+\n+\t/**\n+\t * The property name of the extension point for the measurement tools for the\n+\t * {@link MeasurementTool} implementations.\n+\t */\n+\tprivate static final String MEASUREMT_TOOL_EXTENSION_POINT_CLASS_PROPERTY_NAME = \"MeasurmentToolClass\";\n+\n+\t/**\n+\t * Scans the measurement tool extension point for available measurement tools.\n+\t *\n+\t * @return All available measurement tools.\n+\t */\n+\tpublic List<MeasurementTool> getAvailableMeasurmentTools() {\n+\t\tfinal IExtensionRegistry registry = Platform.getExtensionRegistry();\n+\t\t// final IExtensionPoint point =\n+\t\t// registry.getExtensionPoint(MEASUREMT_TOOL_EXTENSION_POINT_ID);\n+\t\t// if (point == null) {\n+\t\t// return null;\n+\t\t// }\n+\t\t// final IExtension[] extensions = point.getExtensions();\n+\t\tfinal List<MeasurementTool> measurementTools = new ArrayList<>();\n+\t\tfinal IConfigurationElement[] config = registry.getConfigurationElementsFor(MEASUREMT_TOOL_EXTENSION_POINT_ID);\n+\t\ttry {\n+\t\t\tfor (final IConfigurationElement element : config) {\n+\t\t\t\tfinal Object object = element\n+\t\t\t\t\t\t.createExecutableExtension(MEASUREMT_TOOL_EXTENSION_POINT_CLASS_PROPERTY_NAME);\n+\t\t\t\tif (object instanceof MeasurementTool) {\n+\t\t\t\t\tmeasurementTools.add((MeasurementTool) object);\n+\t\t\t\t}","path":"prototypes/Extension Point Prototype/src/de/uka/ipd/sdq/beagle/extensionpointprototype/MeasurementToolContributionsHandler.java","position":53,"original_position":53,"commit_id":"396f5fe56051aa82c2eaa8647498351ea91f3b98","original_commit_id":"396f5fe56051aa82c2eaa8647498351ea91f3b98","user":{"login":"jGleitz","id":4305652,"avatar_url":"https://avatars.githubusercontent.com/u/4305652?v=3","gravatar_id":"","url":"https://api.github.com/users/jGleitz","html_url":"https://github.com/jGleitz","followers_url":"https://api.github.com/users/jGleitz/followers","following_url":"https://api.github.com/users/jGleitz/following{/other_user}","gists_url":"https://api.github.com/users/jGleitz/gists{/gist_id}","starred_url":"https://api.github.com/users/jGleitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jGleitz/subscriptions","organizations_url":"https://api.github.com/users/jGleitz/orgs","repos_url":"https://api.github.com/users/jGleitz/repos","events_url":"https://api.github.com/users/jGleitz/events{/privacy}","received_events_url":"https://api.github.com/users/jGleitz/received_events","type":"User","site_admin":false},"body":"Is it a good idea to just silently ignore “bad” extensions? Maybe an exception would be better, as it can lead the developer to what he did wrong. Extension might then break the whole system, though…","created_at":"2015-12-26T21:06:26Z","updated_at":"2015-12-26T21:06:26Z","html_url":"https://github.com/Beagle-PSE/Beagle/pull/331#discussion_r48449845","pull_request_url":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/331","_links":{"self":{"href":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/comments/48449845"},"html":{"href":"https://github.com/Beagle-PSE/Beagle/pull/331#discussion_r48449845"},"pull_request":{"href":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/331"}}},"pull_request":{"url":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/331","id":54602456,"html_url":"https://github.com/Beagle-PSE/Beagle/pull/331","diff_url":"https://github.com/Beagle-PSE/Beagle/pull/331.diff","patch_url":"https://github.com/Beagle-PSE/Beagle/pull/331.patch","issue_url":"https://api.github.com/repos/Beagle-PSE/Beagle/issues/331","number":331,"state":"open","locked":false,"title":"Extension point prototype","user":{"login":"RomanLangrehr","id":10776736,"avatar_url":"https://avatars.githubusercontent.com/u/10776736?v=3","gravatar_id":"","url":"https://api.github.com/users/RomanLangrehr","html_url":"https://github.com/RomanLangrehr","followers_url":"https://api.github.com/users/RomanLangrehr/followers","following_url":"https://api.github.com/users/RomanLangrehr/following{/other_user}","gists_url":"https://api.github.com/users/RomanLangrehr/gists{/gist_id}","starred_url":"https://api.github.com/users/RomanLangrehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomanLangrehr/subscriptions","organizations_url":"https://api.github.com/users/RomanLangrehr/orgs","repos_url":"https://api.github.com/users/RomanLangrehr/repos","events_url":"https://api.github.com/users/RomanLangrehr/events{/privacy}","received_events_url":"https://api.github.com/users/RomanLangrehr/received_events","type":"User","site_admin":false},"body":"Fixes #274 \r\n\r\nBlocked, as this PR\r\n * has checkstyle warnings (see issues)\r\n * is not buildable with gradle\r\n\r\n(But maybe someone want's to have a look at it, already)\r\n\r\nYou can use this new menu to test the prototype:\r\n![image](https://cloud.githubusercontent.com/assets/10776736/12006625/719a01b8-abde-11e5-861d-2b057e482a49.png)\r\nIt should display the package and class name of all available measurment tools.\r\n\r\nIn this PR there is also one \"mockup measurment tool\" for testing purpose. Please have a look at it, too, as you can see there how to use the extension point.","created_at":"2015-12-26T13:41:19Z","updated_at":"2015-12-26T21:06:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"391c82a8704eecbf22d52306ff9ef4bdf245be4b","assignee":{"login":"RomanLangrehr","id":10776736,"avatar_url":"https://avatars.githubusercontent.com/u/10776736?v=3","gravatar_id":"","url":"https://api.github.com/users/RomanLangrehr","html_url":"https://github.com/RomanLangrehr","followers_url":"https://api.github.com/users/RomanLangrehr/followers","following_url":"https://api.github.com/users/RomanLangrehr/following{/other_user}","gists_url":"https://api.github.com/users/RomanLangrehr/gists{/gist_id}","starred_url":"https://api.github.com/users/RomanLangrehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomanLangrehr/subscriptions","organizations_url":"https://api.github.com/users/RomanLangrehr/orgs","repos_url":"https://api.github.com/users/RomanLangrehr/repos","events_url":"https://api.github.com/users/RomanLangrehr/events{/privacy}","received_events_url":"https://api.github.com/users/RomanLangrehr/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Beagle-PSE/Beagle/milestones/6","html_url":"https://github.com/Beagle-PSE/Beagle/milestones/Prototypes","labels_url":"https://api.github.com/repos/Beagle-PSE/Beagle/milestones/6/labels","id":1466971,"number":6,"title":"Prototypes","description":"For some parts we need prototyps.","creator":{"login":"RomanLangrehr","id":10776736,"avatar_url":"https://avatars.githubusercontent.com/u/10776736?v=3","gravatar_id":"","url":"https://api.github.com/users/RomanLangrehr","html_url":"https://github.com/RomanLangrehr","followers_url":"https://api.github.com/users/RomanLangrehr/followers","following_url":"https://api.github.com/users/RomanLangrehr/following{/other_user}","gists_url":"https://api.github.com/users/RomanLangrehr/gists{/gist_id}","starred_url":"https://api.github.com/users/RomanLangrehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomanLangrehr/subscriptions","organizations_url":"https://api.github.com/users/RomanLangrehr/orgs","repos_url":"https://api.github.com/users/RomanLangrehr/repos","events_url":"https://api.github.com/users/RomanLangrehr/events{/privacy}","received_events_url":"https://api.github.com/users/RomanLangrehr/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":0,"state":"open","created_at":"2015-12-18T16:31:11Z","updated_at":"2015-12-26T13:41:19Z","due_on":"2016-01-08T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/331/commits","review_comments_url":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/331/comments","review_comment_url":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Beagle-PSE/Beagle/issues/331/comments","statuses_url":"https://api.github.com/repos/Beagle-PSE/Beagle/statuses/396f5fe56051aa82c2eaa8647498351ea91f3b98","head":{"label":"RomanLangrehr:extension-point-prototype","ref":"extension-point-prototype","sha":"396f5fe56051aa82c2eaa8647498351ea91f3b98","user":{"login":"RomanLangrehr","id":10776736,"avatar_url":"https://avatars.githubusercontent.com/u/10776736?v=3","gravatar_id":"","url":"https://api.github.com/users/RomanLangrehr","html_url":"https://github.com/RomanLangrehr","followers_url":"https://api.github.com/users/RomanLangrehr/followers","following_url":"https://api.github.com/users/RomanLangrehr/following{/other_user}","gists_url":"https://api.github.com/users/RomanLangrehr/gists{/gist_id}","starred_url":"https://api.github.com/users/RomanLangrehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomanLangrehr/subscriptions","organizations_url":"https://api.github.com/users/RomanLangrehr/orgs","repos_url":"https://api.github.com/users/RomanLangrehr/repos","events_url":"https://api.github.com/users/RomanLangrehr/events{/privacy}","received_events_url":"https://api.github.com/users/RomanLangrehr/received_events","type":"User","site_admin":false},"repo":{"id":45913744,"name":"Beagle","full_name":"RomanLangrehr/Beagle","owner":{"login":"RomanLangrehr","id":10776736,"avatar_url":"https://avatars.githubusercontent.com/u/10776736?v=3","gravatar_id":"","url":"https://api.github.com/users/RomanLangrehr","html_url":"https://github.com/RomanLangrehr","followers_url":"https://api.github.com/users/RomanLangrehr/followers","following_url":"https://api.github.com/users/RomanLangrehr/following{/other_user}","gists_url":"https://api.github.com/users/RomanLangrehr/gists{/gist_id}","starred_url":"https://api.github.com/users/RomanLangrehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomanLangrehr/subscriptions","organizations_url":"https://api.github.com/users/RomanLangrehr/orgs","repos_url":"https://api.github.com/users/RomanLangrehr/repos","events_url":"https://api.github.com/users/RomanLangrehr/events{/privacy}","received_events_url":"https://api.github.com/users/RomanLangrehr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RomanLangrehr/Beagle","description":"","fork":true,"url":"https://api.github.com/repos/RomanLangrehr/Beagle","forks_url":"https://api.github.com/repos/RomanLangrehr/Beagle/forks","keys_url":"https://api.github.com/repos/RomanLangrehr/Beagle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RomanLangrehr/Beagle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RomanLangrehr/Beagle/teams","hooks_url":"https://api.github.com/repos/RomanLangrehr/Beagle/hooks","issue_events_url":"https://api.github.com/repos/RomanLangrehr/Beagle/issues/events{/number}","events_url":"https://api.github.com/repos/RomanLangrehr/Beagle/events","assignees_url":"https://api.github.com/repos/RomanLangrehr/Beagle/assignees{/user}","branches_url":"https://api.github.com/repos/RomanLangrehr/Beagle/branches{/branch}","tags_url":"https://api.github.com/repos/RomanLangrehr/Beagle/tags","blobs_url":"https://api.github.com/repos/RomanLangrehr/Beagle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RomanLangrehr/Beagle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RomanLangrehr/Beagle/git/refs{/sha}","trees_url":"https://api.github.com/repos/RomanLangrehr/Beagle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RomanLangrehr/Beagle/statuses/{sha}","languages_url":"https://api.github.com/repos/RomanLangrehr/Beagle/languages","stargazers_url":"https://api.github.com/repos/RomanLangrehr/Beagle/stargazers","contributors_url":"https://api.github.com/repos/RomanLangrehr/Beagle/contributors","subscribers_url":"https://api.github.com/repos/RomanLangrehr/Beagle/subscribers","subscription_url":"https://api.github.com/repos/RomanLangrehr/Beagle/subscription","commits_url":"https://api.github.com/repos/RomanLangrehr/Beagle/commits{/sha}","git_commits_url":"https://api.github.com/repos/RomanLangrehr/Beagle/git/commits{/sha}","comments_url":"https://api.github.com/repos/RomanLangrehr/Beagle/comments{/number}","issue_comment_url":"https://api.github.com/repos/RomanLangrehr/Beagle/issues/comments{/number}","contents_url":"https://api.github.com/repos/RomanLangrehr/Beagle/contents/{+path}","compare_url":"https://api.github.com/repos/RomanLangrehr/Beagle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RomanLangrehr/Beagle/merges","archive_url":"https://api.github.com/repos/RomanLangrehr/Beagle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RomanLangrehr/Beagle/downloads","issues_url":"https://api.github.com/repos/RomanLangrehr/Beagle/issues{/number}","pulls_url":"https://api.github.com/repos/RomanLangrehr/Beagle/pulls{/number}","milestones_url":"https://api.github.com/repos/RomanLangrehr/Beagle/milestones{/number}","notifications_url":"https://api.github.com/repos/RomanLangrehr/Beagle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RomanLangrehr/Beagle/labels{/name}","releases_url":"https://api.github.com/repos/RomanLangrehr/Beagle/releases{/id}","created_at":"2015-11-10T13:32:44Z","updated_at":"2015-11-25T11:47:39Z","pushed_at":"2015-12-26T14:59:50Z","git_url":"git://github.com/RomanLangrehr/Beagle.git","ssh_url":"git@github.com:RomanLangrehr/Beagle.git","clone_url":"https://github.com/RomanLangrehr/Beagle.git","svn_url":"https://github.com/RomanLangrehr/Beagle","homepage":null,"size":37549,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Beagle-PSE:master","ref":"master","sha":"ac35d0d94f3f7914e335ff343852222da1ad58ba","user":{"login":"Beagle-PSE","id":15782263,"avatar_url":"https://avatars.githubusercontent.com/u/15782263?v=3","gravatar_id":"","url":"https://api.github.com/users/Beagle-PSE","html_url":"https://github.com/Beagle-PSE","followers_url":"https://api.github.com/users/Beagle-PSE/followers","following_url":"https://api.github.com/users/Beagle-PSE/following{/other_user}","gists_url":"https://api.github.com/users/Beagle-PSE/gists{/gist_id}","starred_url":"https://api.github.com/users/Beagle-PSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Beagle-PSE/subscriptions","organizations_url":"https://api.github.com/users/Beagle-PSE/orgs","repos_url":"https://api.github.com/users/Beagle-PSE/repos","events_url":"https://api.github.com/users/Beagle-PSE/events{/privacy}","received_events_url":"https://api.github.com/users/Beagle-PSE/received_events","type":"Organization","site_admin":false},"repo":{"id":45913711,"name":"Beagle","full_name":"Beagle-PSE/Beagle","owner":{"login":"Beagle-PSE","id":15782263,"avatar_url":"https://avatars.githubusercontent.com/u/15782263?v=3","gravatar_id":"","url":"https://api.github.com/users/Beagle-PSE","html_url":"https://github.com/Beagle-PSE","followers_url":"https://api.github.com/users/Beagle-PSE/followers","following_url":"https://api.github.com/users/Beagle-PSE/following{/other_user}","gists_url":"https://api.github.com/users/Beagle-PSE/gists{/gist_id}","starred_url":"https://api.github.com/users/Beagle-PSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Beagle-PSE/subscriptions","organizations_url":"https://api.github.com/users/Beagle-PSE/orgs","repos_url":"https://api.github.com/users/Beagle-PSE/repos","events_url":"https://api.github.com/users/Beagle-PSE/events{/privacy}","received_events_url":"https://api.github.com/users/Beagle-PSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Beagle-PSE/Beagle","description":"","fork":false,"url":"https://api.github.com/repos/Beagle-PSE/Beagle","forks_url":"https://api.github.com/repos/Beagle-PSE/Beagle/forks","keys_url":"https://api.github.com/repos/Beagle-PSE/Beagle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Beagle-PSE/Beagle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Beagle-PSE/Beagle/teams","hooks_url":"https://api.github.com/repos/Beagle-PSE/Beagle/hooks","issue_events_url":"https://api.github.com/repos/Beagle-PSE/Beagle/issues/events{/number}","events_url":"https://api.github.com/repos/Beagle-PSE/Beagle/events","assignees_url":"https://api.github.com/repos/Beagle-PSE/Beagle/assignees{/user}","branches_url":"https://api.github.com/repos/Beagle-PSE/Beagle/branches{/branch}","tags_url":"https://api.github.com/repos/Beagle-PSE/Beagle/tags","blobs_url":"https://api.github.com/repos/Beagle-PSE/Beagle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Beagle-PSE/Beagle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Beagle-PSE/Beagle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Beagle-PSE/Beagle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Beagle-PSE/Beagle/statuses/{sha}","languages_url":"https://api.github.com/repos/Beagle-PSE/Beagle/languages","stargazers_url":"https://api.github.com/repos/Beagle-PSE/Beagle/stargazers","contributors_url":"https://api.github.com/repos/Beagle-PSE/Beagle/contributors","subscribers_url":"https://api.github.com/repos/Beagle-PSE/Beagle/subscribers","subscription_url":"https://api.github.com/repos/Beagle-PSE/Beagle/subscription","commits_url":"https://api.github.com/repos/Beagle-PSE/Beagle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Beagle-PSE/Beagle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Beagle-PSE/Beagle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Beagle-PSE/Beagle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Beagle-PSE/Beagle/contents/{+path}","compare_url":"https://api.github.com/repos/Beagle-PSE/Beagle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Beagle-PSE/Beagle/merges","archive_url":"https://api.github.com/repos/Beagle-PSE/Beagle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Beagle-PSE/Beagle/downloads","issues_url":"https://api.github.com/repos/Beagle-PSE/Beagle/issues{/number}","pulls_url":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls{/number}","milestones_url":"https://api.github.com/repos/Beagle-PSE/Beagle/milestones{/number}","notifications_url":"https://api.github.com/repos/Beagle-PSE/Beagle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Beagle-PSE/Beagle/labels{/name}","releases_url":"https://api.github.com/repos/Beagle-PSE/Beagle/releases{/id}","created_at":"2015-11-10T13:32:13Z","updated_at":"2015-12-24T08:35:23Z","pushed_at":"2015-12-26T15:48:11Z","git_url":"git://github.com/Beagle-PSE/Beagle.git","ssh_url":"git@github.com:Beagle-PSE/Beagle.git","clone_url":"https://github.com/Beagle-PSE/Beagle.git","svn_url":"https://github.com/Beagle-PSE/Beagle","homepage":null,"size":38333,"stargazers_count":1,"watchers_count":1,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":44,"forks":6,"open_issues":44,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/331"},"html":{"href":"https://github.com/Beagle-PSE/Beagle/pull/331"},"issue":{"href":"https://api.github.com/repos/Beagle-PSE/Beagle/issues/331"},"comments":{"href":"https://api.github.com/repos/Beagle-PSE/Beagle/issues/331/comments"},"review_comments":{"href":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/331/comments"},"review_comment":{"href":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Beagle-PSE/Beagle/pulls/331/commits"},"statuses":{"href":"https://api.github.com/repos/Beagle-PSE/Beagle/statuses/396f5fe56051aa82c2eaa8647498351ea91f3b98"}}}}