Skip to content

Conversation

@acidbluebriggs
Copy link
Contributor

@acidbluebriggs acidbluebriggs commented Mar 24, 2017

Here are the fixes.

Fixed a failure when attempting to find the appropriate resolver for properties on data classes that have a return type of java.lang.Boolean. The java.lang.Boolean is not assignable to kotlin.Boolean::class.java. Kotlin's java platform types map to the primitive types, i.e. 'boolean'. In this case, we now check for 'boolean' as the class name. If there is a better way to do this, I'm not immediately aware. Added a test case to cover the Boolean case.

Another failure occurred when assuming a Boolean|boolean value on a class used the 'is' prefix. This is a Java convention and is not enforced. Kotlin does not generate 'is' properties when declaring Boolean properties as it generates a 'get' prefix on vals/vars. Kotlin Boolean values would therefore fail the method lookup. Now first trying an 'is' then, if a boolean, trying the 'is' prefix as a last resort.

Marc Miller added 2 commits March 24, 2017 10:20
…properties on data classes that have a return type of java.lang.Boolean. The java.lang.Boolean is not assignable to kotlin.Boolean::class.java. Kotlin's java platform types map to the primitive types, i.e. 'boolean'. In this case, we now check for 'boolean' as the class name. If there is a better way to do this, I'm not immediately aware. Added a test case to cover the Boolean case. Another failure occurred when assuming a Boolean|boolean value on a class used the 'is' prefix. This is a Java convention and is not enforced. Kotlin does not generate 'is' properties when declaring Boolean properties as it generates a 'get' prefix on vals/vars. Kotlin Boolean values would therefore fail the method lookup. Now first trying an 'is' then, if a boolean, trying the 'is' prefix as a last resort.
…properties on data classes that have a return type of java.lang.Boolean. The java.lang.Boolean is not assignable to kotlin.Boolean::class.java. Kotlin's java platform types map to the primitive types, i.e. 'boolean'. In this case, we now check for 'boolean' as the class name. If there is a better way to do this, I'm not immediately aware. Added a test case to cover the Boolean case. Another failure occurred when assuming a Boolean|boolean value on a class used the 'is' prefix. This is a Java convention and is not enforced. Kotlin does not generate 'is' properties when declaring Boolean properties as it generates a 'get' prefix on vals/vars. Kotlin Boolean values would therefore fail the method lookup. Now first trying an 'is' then, if a boolean, trying the 'is' prefix as a last resort.
@apottere
Copy link
Collaborator

Seems like checking the class name is a good workaround, thanks!

I'll merge it in once Travis gets its act together.

@apottere apottere merged commit b1080b9 into graphql-java-kickstart:master Mar 24, 2017
@acidbluebriggs
Copy link
Contributor Author

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants