{"action":"created","comment":{"url":"https://api.github.com/repos/jdbi/jdbi/pulls/comments/42429303","id":42429303,"diff_hunk":"@@ -0,0 +1,66 @@\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 org.jdbi.v3.sqlobject;\n+\n+import static org.junit.Assert.assertEquals;\n+\n+import org.jdbi.v3.H2DatabaseRule;\n+import org.jdbi.v3.Something;\n+import org.jdbi.v3.sqlobject.customizers.Mapper;\n+import org.jdbi.v3.sqlobject.mixins.CloseMe;\n+import org.junit.Rule;\n+import org.junit.Test;\n+\n+@SuppressWarnings(\"resource\")\n+public class TestDefaultMethods\n+{\n+    @Rule\n+    public H2DatabaseRule db = new H2DatabaseRule();\n+\n+    @Test\n+    public void testDefaultMethod() throws Exception {\n+        Spiffy dao = SqlObjectBuilder.onDemand(db.getDbi(), Spiffy.class);\n+        Something test = dao.insertAndReturn(3, \"test\");\n+        assertEquals(3, test.getId());\n+        assertEquals(\"test\", test.getName());\n+    }\n+\n+    @Test\n+    public void testOverride() throws Exception {\n+        SpiffyOverride dao = SqlObjectBuilder.onDemand(db.getDbi(), SpiffyOverride.class);\n+        assertEquals(null, dao.insertAndReturn(123, \"fake\"));\n+    }","path":"sqlobject/src/test/java/org/jdbi/v3/sqlobject/TestDefaultMethods.java","position":43,"original_position":43,"commit_id":"44108694d7861bcb356aed536f1e7888026460d5","original_commit_id":"a179d6884c4b326897e6e25d7b03b8eed068f526","user":{"login":"stevenschlansker","id":129097,"avatar_url":"https://avatars.githubusercontent.com/u/129097?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenschlansker","html_url":"https://github.com/stevenschlansker","followers_url":"https://api.github.com/users/stevenschlansker/followers","following_url":"https://api.github.com/users/stevenschlansker/following{/other_user}","gists_url":"https://api.github.com/users/stevenschlansker/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenschlansker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenschlansker/subscriptions","organizations_url":"https://api.github.com/users/stevenschlansker/orgs","repos_url":"https://api.github.com/users/stevenschlansker/repos","events_url":"https://api.github.com/users/stevenschlansker/events{/privacy}","received_events_url":"https://api.github.com/users/stevenschlansker/received_events","type":"User","site_admin":false},"body":"Isn't that exactly the case of the `SpiffyOverride` below?  Or am I misunderstanding?\r\nThe default method should always lose in case there is any other reasonable action to take.","created_at":"2015-10-19T21:37:30Z","updated_at":"2015-10-19T21:37:30Z","html_url":"https://github.com/jdbi/jdbi/pull/190#discussion_r42429303","pull_request_url":"https://api.github.com/repos/jdbi/jdbi/pulls/190","_links":{"self":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/comments/42429303"},"html":{"href":"https://github.com/jdbi/jdbi/pull/190#discussion_r42429303"},"pull_request":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/jdbi/jdbi/pulls/190","id":48110824,"html_url":"https://github.com/jdbi/jdbi/pull/190","diff_url":"https://github.com/jdbi/jdbi/pull/190.diff","patch_url":"https://github.com/jdbi/jdbi/pull/190.patch","issue_url":"https://api.github.com/repos/jdbi/jdbi/issues/190","number":190,"state":"open","locked":false,"title":"SqlObject now supports default methods","user":{"login":"stevenschlansker","id":129097,"avatar_url":"https://avatars.githubusercontent.com/u/129097?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenschlansker","html_url":"https://github.com/stevenschlansker","followers_url":"https://api.github.com/users/stevenschlansker/followers","following_url":"https://api.github.com/users/stevenschlansker/following{/other_user}","gists_url":"https://api.github.com/users/stevenschlansker/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenschlansker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenschlansker/subscriptions","organizations_url":"https://api.github.com/users/stevenschlansker/orgs","repos_url":"https://api.github.com/users/stevenschlansker/repos","events_url":"https://api.github.com/users/stevenschlansker/events{/privacy}","received_events_url":"https://api.github.com/users/stevenschlansker/received_events","type":"User","site_admin":false},"body":"tag @qualidafial so that approach you linked doesn't seem to work:\r\n```\r\njava.lang.RuntimeException: java.lang.IllegalAccessException: no private access for invokespecial: interface org.jdbi.v3.sqlobject.TestJava8Features$Spiffy, from org.jdbi.v3.sqlobject.TestJava8Features$Spiffy/package\r\n\tat com.google.common.base.Throwables.propagate(Throwables.java:160)\r\n\tat org.jdbi.v3.sqlobject.PassThroughHandler.invokeDefault(PassThroughHandler.java:71)\r\n\tat org.jdbi.v3.sqlobject.PassThroughHandler.invoke(PassThroughHandler.java:41)\r\n\tat org.jdbi.v3.sqlobject.SqlObject.invoke(SqlObject.java:173)\r\n\tat org.jdbi.v3.sqlobject.SqlObject$1.intercept(SqlObject.java:73)\r\n\tat org.jdbi.v3.sqlobject.CloseInternalDoNotUseThisClass$$EnhancerByCGLIB$$bc09080d.insertAndReturn(<generated>)\r\n\tat org.jdbi.v3.sqlobject.TestJava8Features.testDefaultMethod(TestJava8Features.java:34)\r\nCaused by: java.lang.IllegalAccessException: no private access for invokespecial: interface org.jdbi.v3.sqlobject.TestJava8Features$Spiffy, from org.jdbi.v3.sqlobject.TestJava8Features$Spiffy/package\r\n\tat java.lang.invoke.MemberName.makeAccessException(MemberName.java:855)\r\n\tat java.lang.invoke.MethodHandles$Lookup.checkSpecialCaller(MethodHandles.java:1565)\r\n\tat java.lang.invoke.MethodHandles$Lookup.unreflectSpecial(MethodHandles.java:1224)\r\n\tat org.jdbi.v3.sqlobject.PassThroughHandler.invokeDefault(PassThroughHandler.java:67)\r\n\t... 30 more\r\n```\r\n\r\nbut I think I got it working!","created_at":"2015-10-19T18:53:35Z","updated_at":"2015-10-19T21:37:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac1e2da117ac166f3b9cd66097c25c067e00c6af","assignee":{"login":"stevenschlansker","id":129097,"avatar_url":"https://avatars.githubusercontent.com/u/129097?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenschlansker","html_url":"https://github.com/stevenschlansker","followers_url":"https://api.github.com/users/stevenschlansker/followers","following_url":"https://api.github.com/users/stevenschlansker/following{/other_user}","gists_url":"https://api.github.com/users/stevenschlansker/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenschlansker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenschlansker/subscriptions","organizations_url":"https://api.github.com/users/stevenschlansker/orgs","repos_url":"https://api.github.com/users/stevenschlansker/repos","events_url":"https://api.github.com/users/stevenschlansker/events{/privacy}","received_events_url":"https://api.github.com/users/stevenschlansker/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/jdbi/jdbi/milestones/2","html_url":"https://github.com/jdbi/jdbi/milestones/JDBI%203%20Requests","labels_url":"https://api.github.com/repos/jdbi/jdbi/milestones/2/labels","id":382959,"number":2,"title":"JDBI 3 Requests","description":"Bucket for issues that should be in JDBI 3","creator":{"login":"stevenschlansker","id":129097,"avatar_url":"https://avatars.githubusercontent.com/u/129097?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenschlansker","html_url":"https://github.com/stevenschlansker","followers_url":"https://api.github.com/users/stevenschlansker/followers","following_url":"https://api.github.com/users/stevenschlansker/following{/other_user}","gists_url":"https://api.github.com/users/stevenschlansker/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenschlansker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenschlansker/subscriptions","organizations_url":"https://api.github.com/users/stevenschlansker/orgs","repos_url":"https://api.github.com/users/stevenschlansker/repos","events_url":"https://api.github.com/users/stevenschlansker/events{/privacy}","received_events_url":"https://api.github.com/users/stevenschlansker/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":1,"state":"open","created_at":"2013-07-20T23:48:16Z","updated_at":"2015-10-19T20:38:11Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/jdbi/jdbi/pulls/190/commits","review_comments_url":"https://api.github.com/repos/jdbi/jdbi/pulls/190/comments","review_comment_url":"https://api.github.com/repos/jdbi/jdbi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jdbi/jdbi/issues/190/comments","statuses_url":"https://api.github.com/repos/jdbi/jdbi/statuses/44108694d7861bcb356aed536f1e7888026460d5","head":{"label":"stevenschlansker:sqlobject-default-method","ref":"sqlobject-default-method","sha":"44108694d7861bcb356aed536f1e7888026460d5","user":{"login":"stevenschlansker","id":129097,"avatar_url":"https://avatars.githubusercontent.com/u/129097?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenschlansker","html_url":"https://github.com/stevenschlansker","followers_url":"https://api.github.com/users/stevenschlansker/followers","following_url":"https://api.github.com/users/stevenschlansker/following{/other_user}","gists_url":"https://api.github.com/users/stevenschlansker/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenschlansker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenschlansker/subscriptions","organizations_url":"https://api.github.com/users/stevenschlansker/orgs","repos_url":"https://api.github.com/users/stevenschlansker/repos","events_url":"https://api.github.com/users/stevenschlansker/events{/privacy}","received_events_url":"https://api.github.com/users/stevenschlansker/received_events","type":"User","site_admin":false},"repo":{"id":3213293,"name":"jdbi","full_name":"stevenschlansker/jdbi","owner":{"login":"stevenschlansker","id":129097,"avatar_url":"https://avatars.githubusercontent.com/u/129097?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenschlansker","html_url":"https://github.com/stevenschlansker","followers_url":"https://api.github.com/users/stevenschlansker/followers","following_url":"https://api.github.com/users/stevenschlansker/following{/other_user}","gists_url":"https://api.github.com/users/stevenschlansker/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenschlansker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenschlansker/subscriptions","organizations_url":"https://api.github.com/users/stevenschlansker/orgs","repos_url":"https://api.github.com/users/stevenschlansker/repos","events_url":"https://api.github.com/users/stevenschlansker/events{/privacy}","received_events_url":"https://api.github.com/users/stevenschlansker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevenschlansker/jdbi","description":"jDBI is designed to provide convenient tabular data access in Java(tm). It uses the Java collections framework for query results, provides a convenient means of externalizing sql statements, and provides named parameter support for any database being used.","fork":true,"url":"https://api.github.com/repos/stevenschlansker/jdbi","forks_url":"https://api.github.com/repos/stevenschlansker/jdbi/forks","keys_url":"https://api.github.com/repos/stevenschlansker/jdbi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevenschlansker/jdbi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevenschlansker/jdbi/teams","hooks_url":"https://api.github.com/repos/stevenschlansker/jdbi/hooks","issue_events_url":"https://api.github.com/repos/stevenschlansker/jdbi/issues/events{/number}","events_url":"https://api.github.com/repos/stevenschlansker/jdbi/events","assignees_url":"https://api.github.com/repos/stevenschlansker/jdbi/assignees{/user}","branches_url":"https://api.github.com/repos/stevenschlansker/jdbi/branches{/branch}","tags_url":"https://api.github.com/repos/stevenschlansker/jdbi/tags","blobs_url":"https://api.github.com/repos/stevenschlansker/jdbi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevenschlansker/jdbi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevenschlansker/jdbi/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevenschlansker/jdbi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevenschlansker/jdbi/statuses/{sha}","languages_url":"https://api.github.com/repos/stevenschlansker/jdbi/languages","stargazers_url":"https://api.github.com/repos/stevenschlansker/jdbi/stargazers","contributors_url":"https://api.github.com/repos/stevenschlansker/jdbi/contributors","subscribers_url":"https://api.github.com/repos/stevenschlansker/jdbi/subscribers","subscription_url":"https://api.github.com/repos/stevenschlansker/jdbi/subscription","commits_url":"https://api.github.com/repos/stevenschlansker/jdbi/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevenschlansker/jdbi/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevenschlansker/jdbi/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevenschlansker/jdbi/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevenschlansker/jdbi/contents/{+path}","compare_url":"https://api.github.com/repos/stevenschlansker/jdbi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevenschlansker/jdbi/merges","archive_url":"https://api.github.com/repos/stevenschlansker/jdbi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevenschlansker/jdbi/downloads","issues_url":"https://api.github.com/repos/stevenschlansker/jdbi/issues{/number}","pulls_url":"https://api.github.com/repos/stevenschlansker/jdbi/pulls{/number}","milestones_url":"https://api.github.com/repos/stevenschlansker/jdbi/milestones{/number}","notifications_url":"https://api.github.com/repos/stevenschlansker/jdbi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevenschlansker/jdbi/labels{/name}","releases_url":"https://api.github.com/repos/stevenschlansker/jdbi/releases{/id}","created_at":"2012-01-18T22:52:48Z","updated_at":"2015-06-16T01:37:43Z","pushed_at":"2015-10-19T21:34:26Z","git_url":"git://github.com/stevenschlansker/jdbi.git","ssh_url":"git@github.com:stevenschlansker/jdbi.git","clone_url":"https://github.com/stevenschlansker/jdbi.git","svn_url":"https://github.com/stevenschlansker/jdbi","homepage":"http://jdbi.org/","size":12561,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"jdbi:jdbi3","ref":"jdbi3","sha":"ad6f0d19798cab583b11d06e654ecbbaed28e071","user":{"login":"jdbi","id":9668860,"avatar_url":"https://avatars.githubusercontent.com/u/9668860?v=3","gravatar_id":"","url":"https://api.github.com/users/jdbi","html_url":"https://github.com/jdbi","followers_url":"https://api.github.com/users/jdbi/followers","following_url":"https://api.github.com/users/jdbi/following{/other_user}","gists_url":"https://api.github.com/users/jdbi/gists{/gist_id}","starred_url":"https://api.github.com/users/jdbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdbi/subscriptions","organizations_url":"https://api.github.com/users/jdbi/orgs","repos_url":"https://api.github.com/users/jdbi/repos","events_url":"https://api.github.com/users/jdbi/events{/privacy}","received_events_url":"https://api.github.com/users/jdbi/received_events","type":"Organization","site_admin":false},"repo":{"id":229738,"name":"jdbi","full_name":"jdbi/jdbi","owner":{"login":"jdbi","id":9668860,"avatar_url":"https://avatars.githubusercontent.com/u/9668860?v=3","gravatar_id":"","url":"https://api.github.com/users/jdbi","html_url":"https://github.com/jdbi","followers_url":"https://api.github.com/users/jdbi/followers","following_url":"https://api.github.com/users/jdbi/following{/other_user}","gists_url":"https://api.github.com/users/jdbi/gists{/gist_id}","starred_url":"https://api.github.com/users/jdbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdbi/subscriptions","organizations_url":"https://api.github.com/users/jdbi/orgs","repos_url":"https://api.github.com/users/jdbi/repos","events_url":"https://api.github.com/users/jdbi/events{/privacy}","received_events_url":"https://api.github.com/users/jdbi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jdbi/jdbi","description":"jDBI is designed to provide convenient tabular data access in Java(tm). It uses the Java collections framework for query results, provides a convenient means of externalizing sql statements, and provides named parameter support for any database being used.","fork":false,"url":"https://api.github.com/repos/jdbi/jdbi","forks_url":"https://api.github.com/repos/jdbi/jdbi/forks","keys_url":"https://api.github.com/repos/jdbi/jdbi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdbi/jdbi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdbi/jdbi/teams","hooks_url":"https://api.github.com/repos/jdbi/jdbi/hooks","issue_events_url":"https://api.github.com/repos/jdbi/jdbi/issues/events{/number}","events_url":"https://api.github.com/repos/jdbi/jdbi/events","assignees_url":"https://api.github.com/repos/jdbi/jdbi/assignees{/user}","branches_url":"https://api.github.com/repos/jdbi/jdbi/branches{/branch}","tags_url":"https://api.github.com/repos/jdbi/jdbi/tags","blobs_url":"https://api.github.com/repos/jdbi/jdbi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdbi/jdbi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdbi/jdbi/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdbi/jdbi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdbi/jdbi/statuses/{sha}","languages_url":"https://api.github.com/repos/jdbi/jdbi/languages","stargazers_url":"https://api.github.com/repos/jdbi/jdbi/stargazers","contributors_url":"https://api.github.com/repos/jdbi/jdbi/contributors","subscribers_url":"https://api.github.com/repos/jdbi/jdbi/subscribers","subscription_url":"https://api.github.com/repos/jdbi/jdbi/subscription","commits_url":"https://api.github.com/repos/jdbi/jdbi/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdbi/jdbi/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdbi/jdbi/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdbi/jdbi/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdbi/jdbi/contents/{+path}","compare_url":"https://api.github.com/repos/jdbi/jdbi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdbi/jdbi/merges","archive_url":"https://api.github.com/repos/jdbi/jdbi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdbi/jdbi/downloads","issues_url":"https://api.github.com/repos/jdbi/jdbi/issues{/number}","pulls_url":"https://api.github.com/repos/jdbi/jdbi/pulls{/number}","milestones_url":"https://api.github.com/repos/jdbi/jdbi/milestones{/number}","notifications_url":"https://api.github.com/repos/jdbi/jdbi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdbi/jdbi/labels{/name}","releases_url":"https://api.github.com/repos/jdbi/jdbi/releases{/id}","created_at":"2009-06-17T16:36:36Z","updated_at":"2015-10-15T14:54:59Z","pushed_at":"2015-10-19T21:34:27Z","git_url":"git://github.com/jdbi/jdbi.git","ssh_url":"git@github.com:jdbi/jdbi.git","clone_url":"https://github.com/jdbi/jdbi.git","svn_url":"https://github.com/jdbi/jdbi","homepage":"http://jdbi.org/","size":17199,"stargazers_count":526,"watchers_count":526,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":121,"mirror_url":null,"open_issues_count":28,"forks":121,"open_issues":28,"watchers":526,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/190"},"html":{"href":"https://github.com/jdbi/jdbi/pull/190"},"issue":{"href":"https://api.github.com/repos/jdbi/jdbi/issues/190"},"comments":{"href":"https://api.github.com/repos/jdbi/jdbi/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/jdbi/jdbi/statuses/44108694d7861bcb356aed536f1e7888026460d5"}}}}