{"action":"created","comment":{"url":"https://api.github.com/repos/realm/realm-java/pulls/comments/45578000","id":45578000,"diff_hunk":"@@ -0,0 +1,279 @@\n+/*\n+ * Copyright 2015 Realm Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package io.realm;\n+\n+import java.util.Arrays;\n+import java.util.EnumMap;\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import io.realm.internal.ColumnIndices;\n+import io.realm.internal.RealmProxyMediator;\n+import io.realm.internal.SharedGroup;\n+import io.realm.internal.log.RealmLog;\n+\n+/**\n+ * To cache {@link Realm}, {@link DynamicRealm} instances and related resources.\n+ * Every thread will share the same {@link Realm} and {@link DynamicRealm} instances which are referred to the same\n+ * {@link RealmConfiguration}.\n+ * One {@link RealmCache} is created for each {@link RealmConfiguration}.\n+ */\n+class RealmCache {\n+\n+    interface Callback {\n+        void onResult(int count);\n+    }\n+\n+    private static class RefAndCount {\n+        // The Realm instance in this thread.\n+        private final ThreadLocal<BaseRealm> localRealm = new ThreadLocal<BaseRealm>();\n+        // How many references to this Realm instance in this thread.\n+        private final ThreadLocal<Integer> localCount = new ThreadLocal<Integer>();\n+        // How many threads have instances refer to this configuration.\n+        private int globalCount = 0;\n+    }\n+    private enum RealmCacheType {\n+        TYPED_REALM,\n+        DYNAMIC_REALM;\n+\n+        static RealmCacheType valueOf(Class<? extends BaseRealm> cls) {\n+            if (cls == Realm.class) {\n+                return TYPED_REALM;\n+            } else if (cls == DynamicRealm.class) {\n+                return DYNAMIC_REALM;\n+            }\n+\n+            throw new IllegalArgumentException(WRONG_REALM_CLASS_MESSAGE);\n+        }\n+    }\n+    // Separated references and counters for typed Realm and dynamic Realm.\n+    private final EnumMap<RealmCacheType, RefAndCount> refAndCountMap;\n+\n+    private RealmConfiguration configuration;\n+    // Column indices are cached to speed up opening typed Realm. If a Realm instance is created in one thread, creating\n+    // Realm instances in other threads doesn't have to initialize the column indices again.\n+    private ColumnIndices typedColumnIndices;\n+\n+    // Realm path will be used as the key to store different RealmCaches. Different Realm configurations with same path\n+    // are not allowed and an exception will be thrown when trying to add it to the cache map.\n+    private static Map<String, RealmCache> cachesMap = new HashMap<String, RealmCache>();\n+\n+    private static final String DIFFERENT_KEY_MESSAGE = \"Wrong key used to decrypt Realm.\";\n+    private static final String WRONG_REALM_CLASS_MESSAGE = \"The type of Realm class must be Realm or DynamicRealm.\";\n+\n+    private RealmCache(RealmConfiguration config) {\n+        configuration = config;\n+        refAndCountMap = new EnumMap<RealmCacheType, RefAndCount>(RealmCacheType.class);\n+        for (RealmCacheType type : RealmCacheType.values()) {\n+            refAndCountMap.put(type, new RefAndCount());\n+        }\n+    }\n+\n+    /**\n+     * Creates a new Realm instance or get an existing instance for current thread.\n+     *\n+     * @param configuration {@link RealmConfiguration} will be used to create or get the instance.\n+     * @param realmClass class of {@link Realm} or {@link DynamicRealm} to be created in or gotten from the cache.\n+     * @return the {@link Realm} or {@link DynamicRealm} instance.\n+     */\n+    @SuppressWarnings(\"unchecked\")\n+    static synchronized <E extends BaseRealm> E createRealmOrGetFromCache(RealmConfiguration configuration,\n+                                                        Class<E> realmClass) {\n+        boolean isCacheInMap = true;\n+        RealmCache cache = cachesMap.get(configuration.getPath());\n+        if (cache == null) {\n+            // Create a new cache\n+            cache = new RealmCache(configuration);\n+            // The new cache should be added to the map later.\n+            isCacheInMap = false;\n+        } else {\n+            // Throw the exception if validation failed.\n+            cache.validateConfiguration(configuration);\n+        }\n+\n+        RefAndCount refAndCount = cache.refAndCountMap.get(RealmCacheType.valueOf(realmClass));\n+\n+        if (refAndCount.localRealm.get() == null) {\n+            // Create a new local Realm instance\n+            BaseRealm realm;\n+\n+            if (realmClass == Realm.class) {\n+                // RealmMigrationNeededException might be thrown here.\n+                realm = Realm.createInstance(configuration, cache.typedColumnIndices);\n+            } else if (realmClass == DynamicRealm.class) {\n+                realm = DynamicRealm.createInstance(configuration);\n+            } else {\n+                throw new IllegalArgumentException(WRONG_REALM_CLASS_MESSAGE);\n+            }\n+\n+            // The Realm instance has been created without exceptions. Cache and reference count can be updated now.\n+\n+            // The cache is not in the map yet. Add it to the map after the Realm instance created successfully.\n+            if (!isCacheInMap) {\n+                cachesMap.put(configuration.getPath(), cache);\n+            }\n+            refAndCount.localRealm.set(realm);\n+            refAndCount.localCount.set(0);\n+        }\n+\n+        Integer refCount = refAndCount.localCount.get();\n+        if (refCount == 0) {\n+            if (realmClass == Realm.class && refAndCount.globalCount == 0) {\n+                cache.typedColumnIndices = refAndCount.localRealm.get().schema.columnIndices;\n+            }\n+            // This is the first instance in current thread, increase the global count.\n+            refAndCount.globalCount++;\n+        }\n+        refAndCount.localCount.set(refCount + 1);\n+\n+        return (E) refAndCount.localRealm.get();\n+    }\n+\n+    /**\n+     * Releases a given {@link Realm} or {@link DynamicRealm} from cache. The instance will be closed by this function\n+     * if there is no more local reference to this Realm instance in current Thread.\n+     *\n+     * @param realm Realm instance to be released from cache.\n+     */\n+    static synchronized void release(BaseRealm realm) {\n+        String canonicalPath = realm.getPath();\n+        RealmCache cache = cachesMap.get(canonicalPath);\n+        Integer refCount = null;\n+        RefAndCount refAndCount = null;\n+\n+        if (cache != null) {\n+            refAndCount = cache.refAndCountMap.get(RealmCacheType.valueOf(realm.getClass()));\n+            refCount = refAndCount.localCount.get();\n+        }\n+        if (refCount == null) {\n+            refCount = 0;\n+        }\n+\n+        if (refCount <= 0) {\n+            RealmLog.w(\"Realm \" + canonicalPath + \" has been closed already.\");\n+            return;\n+        }\n+\n+        // Decrease the local counter.\n+        refCount -= 1;\n+\n+        if (refCount == 0) {\n+            // The last instance in this thread.\n+            // Clear local ref & counter\n+            refAndCount.localCount.set(null);\n+            refAndCount.localRealm.set(null);\n+\n+            // Clear global counter\n+            refAndCount.globalCount--;\n+            if (refAndCount.globalCount < 0) {\n+                // Should never happen.\n+                throw new IllegalStateException(\"Global reference counter of Realm\" + canonicalPath +\n+                        \" got corrupted.\");\n+            }\n+\n+            // Clear the column indices cache if needed\n+            if (realm instanceof Realm && refAndCount.globalCount == 0) {\n+                // All typed Realm instances of this file are cleared from cache\n+                cache.typedColumnIndices = null;\n+            }\n+\n+            int totalRefCount = 0;\n+            for (RealmCacheType type : RealmCacheType.values()) {\n+                totalRefCount += cache.refAndCountMap.get(type).globalCount;\n+            }\n+            // No more instance of typed Realm and dynamic Realm. Remove the configuration from cache.\n+            if (totalRefCount == 0) {\n+                cachesMap.remove(canonicalPath);\n+            }\n+        } else {\n+            refAndCount.localCount.set(refCount);\n+        }\n+\n+        // No more local reference to this Realm in current thread.\n+        if (refCount == 0) {\n+            realm.doClose();\n+        }\n+    }\n+\n+    /**\n+     * Make sure that the new configuration doesn't clash with any existing configurations for the\n+     * Realm.\n+     *\n+     * @throws IllegalArgumentException If the new configuration isn't valid.\n+     */\n+    private void validateConfiguration(RealmConfiguration newConfiguration) {\n+        // != takes no time, check it first\n+        if (newConfiguration == configuration || newConfiguration.hashCode() == configuration.hashCode()) {","path":"realm/realm-library/src/main/java/io/realm/RealmCache.java","position":null,"original_position":219,"commit_id":"30af52f7b41c3e691292b1dcc296fb77a6cf31d7","original_commit_id":"1be80ef84c149b7173f2bac46bd5eeb93ba0e2b5","user":{"login":"beeender","id":449296,"avatar_url":"https://avatars.githubusercontent.com/u/449296?v=3","gravatar_id":"","url":"https://api.github.com/users/beeender","html_url":"https://github.com/beeender","followers_url":"https://api.github.com/users/beeender/followers","following_url":"https://api.github.com/users/beeender/following{/other_user}","gists_url":"https://api.github.com/users/beeender/gists{/gist_id}","starred_url":"https://api.github.com/users/beeender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beeender/subscriptions","organizations_url":"https://api.github.com/users/beeender/orgs","repos_url":"https://api.github.com/users/beeender/repos","events_url":"https://api.github.com/users/beeender/events{/privacy}","received_events_url":"https://api.github.com/users/beeender/received_events","type":"User","site_admin":false},"body":"`if (newConfiguration == configuration)` is checked in the `equals`. And the point of below is just about to send the right exception message :)","created_at":"2015-11-23T07:57:03Z","updated_at":"2015-11-23T07:57:03Z","html_url":"https://github.com/realm/realm-java/pull/1790#discussion_r45578000","pull_request_url":"https://api.github.com/repos/realm/realm-java/pulls/1790","_links":{"self":{"href":"https://api.github.com/repos/realm/realm-java/pulls/comments/45578000"},"html":{"href":"https://github.com/realm/realm-java/pull/1790#discussion_r45578000"},"pull_request":{"href":"https://api.github.com/repos/realm/realm-java/pulls/1790"}}},"pull_request":{"url":"https://api.github.com/repos/realm/realm-java/pulls/1790","id":50938729,"html_url":"https://github.com/realm/realm-java/pull/1790","diff_url":"https://github.com/realm/realm-java/pull/1790.diff","patch_url":"https://github.com/realm/realm-java/pull/1790.patch","issue_url":"https://api.github.com/repos/realm/realm-java/issues/1790","number":1790,"state":"open","locked":false,"title":"RealmCache to decouple some logic from BaseRealm","user":{"login":"beeender","id":449296,"avatar_url":"https://avatars.githubusercontent.com/u/449296?v=3","gravatar_id":"","url":"https://api.github.com/users/beeender","html_url":"https://github.com/beeender","followers_url":"https://api.github.com/users/beeender/followers","following_url":"https://api.github.com/users/beeender/following{/other_user}","gists_url":"https://api.github.com/users/beeender/gists{/gist_id}","starred_url":"https://api.github.com/users/beeender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beeender/subscriptions","organizations_url":"https://api.github.com/users/beeender/orgs","repos_url":"https://api.github.com/users/beeender/repos","events_url":"https://api.github.com/users/beeender/events{/privacy}","received_events_url":"https://api.github.com/users/beeender/received_events","type":"User","site_admin":false},"body":"* Add RealmCache class to cache Realm instances and related resources.\r\n* Move cache related logic from BaseRealm, Realm, DynamicRealm to\r\n  RealmCache.\r\n* Move some test cases to RealmCacheTest.\r\n* Fix test cases.\r\n\r\nClose #1735","created_at":"2015-11-17T12:08:11Z","updated_at":"2015-11-23T07:57:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bba472cf8fbd770df7f7d6f7f61029387df172b7","assignee":{"login":"beeender","id":449296,"avatar_url":"https://avatars.githubusercontent.com/u/449296?v=3","gravatar_id":"","url":"https://api.github.com/users/beeender","html_url":"https://github.com/beeender","followers_url":"https://api.github.com/users/beeender/followers","following_url":"https://api.github.com/users/beeender/following{/other_user}","gists_url":"https://api.github.com/users/beeender/gists{/gist_id}","starred_url":"https://api.github.com/users/beeender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beeender/subscriptions","organizations_url":"https://api.github.com/users/beeender/orgs","repos_url":"https://api.github.com/users/beeender/repos","events_url":"https://api.github.com/users/beeender/events{/privacy}","received_events_url":"https://api.github.com/users/beeender/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/realm/realm-java/pulls/1790/commits","review_comments_url":"https://api.github.com/repos/realm/realm-java/pulls/1790/comments","review_comment_url":"https://api.github.com/repos/realm/realm-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/1790/comments","statuses_url":"https://api.github.com/repos/realm/realm-java/statuses/30af52f7b41c3e691292b1dcc296fb77a6cf31d7","head":{"label":"realm:mc/realm-cache-a","ref":"mc/realm-cache-a","sha":"30af52f7b41c3e691292b1dcc296fb77a6cf31d7","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":4084908,"name":"realm-java","full_name":"realm/realm-java","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-java","description":"Realm is a mobile database: a replacement for SQLite & ORMs","fork":false,"url":"https://api.github.com/repos/realm/realm-java","forks_url":"https://api.github.com/repos/realm/realm-java/forks","keys_url":"https://api.github.com/repos/realm/realm-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-java/teams","hooks_url":"https://api.github.com/repos/realm/realm-java/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-java/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-java/events","assignees_url":"https://api.github.com/repos/realm/realm-java/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-java/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-java/tags","blobs_url":"https://api.github.com/repos/realm/realm-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-java/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-java/languages","stargazers_url":"https://api.github.com/repos/realm/realm-java/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-java/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-java/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-java/subscription","commits_url":"https://api.github.com/repos/realm/realm-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/realm-java/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-java/merges","archive_url":"https://api.github.com/repos/realm/realm-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-java/downloads","issues_url":"https://api.github.com/repos/realm/realm-java/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-java/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-java/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-java/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-java/releases{/id}","created_at":"2012-04-20T09:18:42Z","updated_at":"2015-11-23T07:09:37Z","pushed_at":"2015-11-23T07:55:04Z","git_url":"git://github.com/realm/realm-java.git","ssh_url":"git@github.com:realm/realm-java.git","clone_url":"https://github.com/realm/realm-java.git","svn_url":"https://github.com/realm/realm-java","homepage":"http://realm.io","size":42347,"stargazers_count":2919,"watchers_count":2919,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":314,"mirror_url":null,"open_issues_count":184,"forks":314,"open_issues":184,"watchers":2919,"default_branch":"master"}},"base":{"label":"realm:cm-feature-dynamic-migration-api","ref":"cm-feature-dynamic-migration-api","sha":"233eacba6f0c2689f39cc2d6ce67daf92daff27a","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":4084908,"name":"realm-java","full_name":"realm/realm-java","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-java","description":"Realm is a mobile database: a replacement for SQLite & ORMs","fork":false,"url":"https://api.github.com/repos/realm/realm-java","forks_url":"https://api.github.com/repos/realm/realm-java/forks","keys_url":"https://api.github.com/repos/realm/realm-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-java/teams","hooks_url":"https://api.github.com/repos/realm/realm-java/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-java/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-java/events","assignees_url":"https://api.github.com/repos/realm/realm-java/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-java/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-java/tags","blobs_url":"https://api.github.com/repos/realm/realm-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-java/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-java/languages","stargazers_url":"https://api.github.com/repos/realm/realm-java/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-java/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-java/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-java/subscription","commits_url":"https://api.github.com/repos/realm/realm-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/realm-java/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-java/merges","archive_url":"https://api.github.com/repos/realm/realm-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-java/downloads","issues_url":"https://api.github.com/repos/realm/realm-java/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-java/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-java/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-java/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-java/releases{/id}","created_at":"2012-04-20T09:18:42Z","updated_at":"2015-11-23T07:09:37Z","pushed_at":"2015-11-23T07:55:04Z","git_url":"git://github.com/realm/realm-java.git","ssh_url":"git@github.com:realm/realm-java.git","clone_url":"https://github.com/realm/realm-java.git","svn_url":"https://github.com/realm/realm-java","homepage":"http://realm.io","size":42347,"stargazers_count":2919,"watchers_count":2919,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":314,"mirror_url":null,"open_issues_count":184,"forks":314,"open_issues":184,"watchers":2919,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/realm-java/pulls/1790"},"html":{"href":"https://github.com/realm/realm-java/pull/1790"},"issue":{"href":"https://api.github.com/repos/realm/realm-java/issues/1790"},"comments":{"href":"https://api.github.com/repos/realm/realm-java/issues/1790/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/realm-java/pulls/1790/comments"},"review_comment":{"href":"https://api.github.com/repos/realm/realm-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/realm/realm-java/pulls/1790/commits"},"statuses":{"href":"https://api.github.com/repos/realm/realm-java/statuses/30af52f7b41c3e691292b1dcc296fb77a6cf31d7"}}}}