{"action":"created","comment":{"url":"https://api.github.com/repos/molgenis/molgenis/pulls/comments/31796035","id":31796035,"diff_hunk":"@@ -0,0 +1,67 @@\n+package org.molgenis.data.meta;\n+\n+import org.molgenis.data.AttributeMetaData;\n+import org.molgenis.data.EntityMetaData;\n+import org.molgenis.data.MolgenisDataException;\n+import org.molgenis.fieldtypes.CompoundField;\n+\n+public class MetaValidationUtils\n+{\n+\tpublic static final int MAX_ATTRIBUTE_LENGTH = 30;\n+\n+\t/**\n+\t * Validates names of entities, packages and attributes. Rules: only [a-zA-Z0-9_] are allowed, name must start with\n+\t * a letter\n+\t */\n+\tpublic static void validateName(String name)\n+\t{\n+\t\tif (name.length() > MAX_ATTRIBUTE_LENGTH)\n+\t\t{\n+\t\t\tthrow new MolgenisDataException(\"Attribute name [\" + name + \"] is too long: maximum length is \"\n+\t\t\t\t\t+ MAX_ATTRIBUTE_LENGTH + \" characters.\");\n+\t\t}\n+\n+\t\tif (!name.matches(\"[a-zA-Z0-9_#]+\"))\n+\t\t{\n+\t\t\tthrow new MolgenisDataException(\"Invalid characters in: [\" + name\n+\t\t\t\t\t+ \"] Only letters (a-z, A-Z), digits (0-9) and underscores (_) are allowed.\");\n+\t\t}\n+\n+\t\tif (Character.isDigit(name.charAt(0)))\n+\t\t{\n+\t\t\tthrow new MolgenisDataException(\"Invalid name: [\" + name + \"] Names must start with a letter.\");","path":"molgenis-data/src/main/java/org/molgenis/data/meta/MetaValidationUtils.java","position":32,"original_position":32,"commit_id":"43113f8af4caa02a69a5c0309448eeed8a3a46ac","original_commit_id":"43113f8af4caa02a69a5c0309448eeed8a3a46ac","user":{"login":"dennishendriksen","id":2477186,"avatar_url":"https://avatars.githubusercontent.com/u/2477186?v=3","gravatar_id":"","url":"https://api.github.com/users/dennishendriksen","html_url":"https://github.com/dennishendriksen","followers_url":"https://api.github.com/users/dennishendriksen/followers","following_url":"https://api.github.com/users/dennishendriksen/following{/other_user}","gists_url":"https://api.github.com/users/dennishendriksen/gists{/gist_id}","starred_url":"https://api.github.com/users/dennishendriksen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennishendriksen/subscriptions","organizations_url":"https://api.github.com/users/dennishendriksen/orgs","repos_url":"https://api.github.com/users/dennishendriksen/repos","events_url":"https://api.github.com/users/dennishendriksen/events{/privacy}","received_events_url":"https://api.github.com/users/dennishendriksen/received_events","type":"User","site_admin":false},"body":"Missing hash in exception message.","created_at":"2015-06-05T08:40:53Z","updated_at":"2015-06-05T08:40:53Z","html_url":"https://github.com/molgenis/molgenis/pull/3124#discussion_r31796035","pull_request_url":"https://api.github.com/repos/molgenis/molgenis/pulls/3124","_links":{"self":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/comments/31796035"},"html":{"href":"https://github.com/molgenis/molgenis/pull/3124#discussion_r31796035"},"pull_request":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/3124"}}},"pull_request":{"url":"https://api.github.com/repos/molgenis/molgenis/pulls/3124","id":36932162,"html_url":"https://github.com/molgenis/molgenis/pull/3124","diff_url":"https://github.com/molgenis/molgenis/pull/3124.diff","patch_url":"https://github.com/molgenis/molgenis/pull/3124.patch","issue_url":"https://api.github.com/repos/molgenis/molgenis/issues/3124","number":3124,"state":"open","locked":false,"title":"Package/entity/attribute names now validated","user":{"login":"tommydeboer","id":5362890,"avatar_url":"https://avatars.githubusercontent.com/u/5362890?v=3","gravatar_id":"","url":"https://api.github.com/users/tommydeboer","html_url":"https://github.com/tommydeboer","followers_url":"https://api.github.com/users/tommydeboer/followers","following_url":"https://api.github.com/users/tommydeboer/following{/other_user}","gists_url":"https://api.github.com/users/tommydeboer/gists{/gist_id}","starred_url":"https://api.github.com/users/tommydeboer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tommydeboer/subscriptions","organizations_url":"https://api.github.com/users/tommydeboer/orgs","repos_url":"https://api.github.com/users/tommydeboer/repos","events_url":"https://api.github.com/users/tommydeboer/events{/privacy}","received_events_url":"https://api.github.com/users/tommydeboer/received_events","type":"User","site_admin":false},"body":"- Allowed chars: [a-zA-Z0-9_#]\r\n- Max length: 30\r\n- Can't start with a digit","created_at":"2015-06-04T13:08:57Z","updated_at":"2015-06-05T08:40:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f09c1205824a98d6bd193f21b57f0ded324d3433","assignee":{"login":"dennishendriksen","id":2477186,"avatar_url":"https://avatars.githubusercontent.com/u/2477186?v=3","gravatar_id":"","url":"https://api.github.com/users/dennishendriksen","html_url":"https://github.com/dennishendriksen","followers_url":"https://api.github.com/users/dennishendriksen/followers","following_url":"https://api.github.com/users/dennishendriksen/following{/other_user}","gists_url":"https://api.github.com/users/dennishendriksen/gists{/gist_id}","starred_url":"https://api.github.com/users/dennishendriksen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennishendriksen/subscriptions","organizations_url":"https://api.github.com/users/dennishendriksen/orgs","repos_url":"https://api.github.com/users/dennishendriksen/repos","events_url":"https://api.github.com/users/dennishendriksen/events{/privacy}","received_events_url":"https://api.github.com/users/dennishendriksen/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/molgenis/molgenis/pulls/3124/commits","review_comments_url":"https://api.github.com/repos/molgenis/molgenis/pulls/3124/comments","review_comment_url":"https://api.github.com/repos/molgenis/molgenis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/molgenis/molgenis/issues/3124/comments","statuses_url":"https://api.github.com/repos/molgenis/molgenis/statuses/43113f8af4caa02a69a5c0309448eeed8a3a46ac","head":{"label":"tommydeboer:feature/nameValidation","ref":"feature/nameValidation","sha":"43113f8af4caa02a69a5c0309448eeed8a3a46ac","user":{"login":"tommydeboer","id":5362890,"avatar_url":"https://avatars.githubusercontent.com/u/5362890?v=3","gravatar_id":"","url":"https://api.github.com/users/tommydeboer","html_url":"https://github.com/tommydeboer","followers_url":"https://api.github.com/users/tommydeboer/followers","following_url":"https://api.github.com/users/tommydeboer/following{/other_user}","gists_url":"https://api.github.com/users/tommydeboer/gists{/gist_id}","starred_url":"https://api.github.com/users/tommydeboer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tommydeboer/subscriptions","organizations_url":"https://api.github.com/users/tommydeboer/orgs","repos_url":"https://api.github.com/users/tommydeboer/repos","events_url":"https://api.github.com/users/tommydeboer/events{/privacy}","received_events_url":"https://api.github.com/users/tommydeboer/received_events","type":"User","site_admin":false},"repo":{"id":18511804,"name":"molgenis","full_name":"tommydeboer/molgenis","owner":{"login":"tommydeboer","id":5362890,"avatar_url":"https://avatars.githubusercontent.com/u/5362890?v=3","gravatar_id":"","url":"https://api.github.com/users/tommydeboer","html_url":"https://github.com/tommydeboer","followers_url":"https://api.github.com/users/tommydeboer/followers","following_url":"https://api.github.com/users/tommydeboer/following{/other_user}","gists_url":"https://api.github.com/users/tommydeboer/gists{/gist_id}","starred_url":"https://api.github.com/users/tommydeboer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tommydeboer/subscriptions","organizations_url":"https://api.github.com/users/tommydeboer/orgs","repos_url":"https://api.github.com/users/tommydeboer/repos","events_url":"https://api.github.com/users/tommydeboer/events{/privacy}","received_events_url":"https://api.github.com/users/tommydeboer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tommydeboer/molgenis","description":"MOLGENIS is a collaborative open source project on a mission to generate great software infrastructure for life science research. ","fork":true,"url":"https://api.github.com/repos/tommydeboer/molgenis","forks_url":"https://api.github.com/repos/tommydeboer/molgenis/forks","keys_url":"https://api.github.com/repos/tommydeboer/molgenis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tommydeboer/molgenis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tommydeboer/molgenis/teams","hooks_url":"https://api.github.com/repos/tommydeboer/molgenis/hooks","issue_events_url":"https://api.github.com/repos/tommydeboer/molgenis/issues/events{/number}","events_url":"https://api.github.com/repos/tommydeboer/molgenis/events","assignees_url":"https://api.github.com/repos/tommydeboer/molgenis/assignees{/user}","branches_url":"https://api.github.com/repos/tommydeboer/molgenis/branches{/branch}","tags_url":"https://api.github.com/repos/tommydeboer/molgenis/tags","blobs_url":"https://api.github.com/repos/tommydeboer/molgenis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tommydeboer/molgenis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tommydeboer/molgenis/git/refs{/sha}","trees_url":"https://api.github.com/repos/tommydeboer/molgenis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tommydeboer/molgenis/statuses/{sha}","languages_url":"https://api.github.com/repos/tommydeboer/molgenis/languages","stargazers_url":"https://api.github.com/repos/tommydeboer/molgenis/stargazers","contributors_url":"https://api.github.com/repos/tommydeboer/molgenis/contributors","subscribers_url":"https://api.github.com/repos/tommydeboer/molgenis/subscribers","subscription_url":"https://api.github.com/repos/tommydeboer/molgenis/subscription","commits_url":"https://api.github.com/repos/tommydeboer/molgenis/commits{/sha}","git_commits_url":"https://api.github.com/repos/tommydeboer/molgenis/git/commits{/sha}","comments_url":"https://api.github.com/repos/tommydeboer/molgenis/comments{/number}","issue_comment_url":"https://api.github.com/repos/tommydeboer/molgenis/issues/comments{/number}","contents_url":"https://api.github.com/repos/tommydeboer/molgenis/contents/{+path}","compare_url":"https://api.github.com/repos/tommydeboer/molgenis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tommydeboer/molgenis/merges","archive_url":"https://api.github.com/repos/tommydeboer/molgenis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tommydeboer/molgenis/downloads","issues_url":"https://api.github.com/repos/tommydeboer/molgenis/issues{/number}","pulls_url":"https://api.github.com/repos/tommydeboer/molgenis/pulls{/number}","milestones_url":"https://api.github.com/repos/tommydeboer/molgenis/milestones{/number}","notifications_url":"https://api.github.com/repos/tommydeboer/molgenis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tommydeboer/molgenis/labels{/name}","releases_url":"https://api.github.com/repos/tommydeboer/molgenis/releases{/id}","created_at":"2014-04-07T09:18:01Z","updated_at":"2015-05-07T09:20:41Z","pushed_at":"2015-06-04T13:44:57Z","git_url":"git://github.com/tommydeboer/molgenis.git","ssh_url":"git@github.com:tommydeboer/molgenis.git","clone_url":"https://github.com/tommydeboer/molgenis.git","svn_url":"https://github.com/tommydeboer/molgenis","homepage":"","size":72247,"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":"molgenis:feature/nameValidation","ref":"feature/nameValidation","sha":"078c3005cb3a42b781cf317680e8412512bea81f","user":{"login":"molgenis","id":1688158,"avatar_url":"https://avatars.githubusercontent.com/u/1688158?v=3","gravatar_id":"","url":"https://api.github.com/users/molgenis","html_url":"https://github.com/molgenis","followers_url":"https://api.github.com/users/molgenis/followers","following_url":"https://api.github.com/users/molgenis/following{/other_user}","gists_url":"https://api.github.com/users/molgenis/gists{/gist_id}","starred_url":"https://api.github.com/users/molgenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molgenis/subscriptions","organizations_url":"https://api.github.com/users/molgenis/orgs","repos_url":"https://api.github.com/users/molgenis/repos","events_url":"https://api.github.com/users/molgenis/events{/privacy}","received_events_url":"https://api.github.com/users/molgenis/received_events","type":"Organization","site_admin":false},"repo":{"id":8010626,"name":"molgenis","full_name":"molgenis/molgenis","owner":{"login":"molgenis","id":1688158,"avatar_url":"https://avatars.githubusercontent.com/u/1688158?v=3","gravatar_id":"","url":"https://api.github.com/users/molgenis","html_url":"https://github.com/molgenis","followers_url":"https://api.github.com/users/molgenis/followers","following_url":"https://api.github.com/users/molgenis/following{/other_user}","gists_url":"https://api.github.com/users/molgenis/gists{/gist_id}","starred_url":"https://api.github.com/users/molgenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molgenis/subscriptions","organizations_url":"https://api.github.com/users/molgenis/orgs","repos_url":"https://api.github.com/users/molgenis/repos","events_url":"https://api.github.com/users/molgenis/events{/privacy}","received_events_url":"https://api.github.com/users/molgenis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/molgenis/molgenis","description":"MOLGENIS - for scientific data: management, exploration, integration and analysis","fork":false,"url":"https://api.github.com/repos/molgenis/molgenis","forks_url":"https://api.github.com/repos/molgenis/molgenis/forks","keys_url":"https://api.github.com/repos/molgenis/molgenis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/molgenis/molgenis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/molgenis/molgenis/teams","hooks_url":"https://api.github.com/repos/molgenis/molgenis/hooks","issue_events_url":"https://api.github.com/repos/molgenis/molgenis/issues/events{/number}","events_url":"https://api.github.com/repos/molgenis/molgenis/events","assignees_url":"https://api.github.com/repos/molgenis/molgenis/assignees{/user}","branches_url":"https://api.github.com/repos/molgenis/molgenis/branches{/branch}","tags_url":"https://api.github.com/repos/molgenis/molgenis/tags","blobs_url":"https://api.github.com/repos/molgenis/molgenis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/molgenis/molgenis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/molgenis/molgenis/git/refs{/sha}","trees_url":"https://api.github.com/repos/molgenis/molgenis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/molgenis/molgenis/statuses/{sha}","languages_url":"https://api.github.com/repos/molgenis/molgenis/languages","stargazers_url":"https://api.github.com/repos/molgenis/molgenis/stargazers","contributors_url":"https://api.github.com/repos/molgenis/molgenis/contributors","subscribers_url":"https://api.github.com/repos/molgenis/molgenis/subscribers","subscription_url":"https://api.github.com/repos/molgenis/molgenis/subscription","commits_url":"https://api.github.com/repos/molgenis/molgenis/commits{/sha}","git_commits_url":"https://api.github.com/repos/molgenis/molgenis/git/commits{/sha}","comments_url":"https://api.github.com/repos/molgenis/molgenis/comments{/number}","issue_comment_url":"https://api.github.com/repos/molgenis/molgenis/issues/comments{/number}","contents_url":"https://api.github.com/repos/molgenis/molgenis/contents/{+path}","compare_url":"https://api.github.com/repos/molgenis/molgenis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/molgenis/molgenis/merges","archive_url":"https://api.github.com/repos/molgenis/molgenis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/molgenis/molgenis/downloads","issues_url":"https://api.github.com/repos/molgenis/molgenis/issues{/number}","pulls_url":"https://api.github.com/repos/molgenis/molgenis/pulls{/number}","milestones_url":"https://api.github.com/repos/molgenis/molgenis/milestones{/number}","notifications_url":"https://api.github.com/repos/molgenis/molgenis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/molgenis/molgenis/labels{/name}","releases_url":"https://api.github.com/repos/molgenis/molgenis/releases{/id}","created_at":"2013-02-04T16:02:36Z","updated_at":"2015-05-13T13:46:13Z","pushed_at":"2015-06-04T14:20:30Z","git_url":"git://github.com/molgenis/molgenis.git","ssh_url":"git@github.com:molgenis/molgenis.git","clone_url":"https://github.com/molgenis/molgenis.git","svn_url":"https://github.com/molgenis/molgenis","homepage":"","size":88612,"stargazers_count":15,"watchers_count":15,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":120,"forks":41,"open_issues":120,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/3124"},"html":{"href":"https://github.com/molgenis/molgenis/pull/3124"},"issue":{"href":"https://api.github.com/repos/molgenis/molgenis/issues/3124"},"comments":{"href":"https://api.github.com/repos/molgenis/molgenis/issues/3124/comments"},"review_comments":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/3124/comments"},"review_comment":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/3124/commits"},"statuses":{"href":"https://api.github.com/repos/molgenis/molgenis/statuses/43113f8af4caa02a69a5c0309448eeed8a3a46ac"}}}}