-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request #5 Kotlin 1.0.2 Code cleanup
- Loading branch information
Showing
13 changed files
with
105 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 8 additions & 9 deletions
17
src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/GithubDatabind1005Test.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
package com.fasterxml.jackson.module.kotlin.test | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator | ||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import com.fasterxml.jackson.module.kotlin.readValue | ||
import com.fasterxml.jackson.annotation.* | ||
import org.junit.Ignore | ||
import org.junit.Test | ||
|
||
public class TestHiddenKotlinThings { | ||
class TestHiddenKotlinThings { | ||
|
||
// make a class seem kinda like a Java class, but with a second generated constructor | ||
// this is Ugly Kotlin but is making it easier for Java people to see and debug. | ||
class Something @JsonCreator constructor (@JsonProperty("name") name: String, | ||
@JsonProperty("age") age: Int = 0) { // default value causes synthetic constructor to be generated | ||
public val name: String = name | ||
public val age: Int = age | ||
class Something @JsonCreator constructor(@JsonProperty("name") name: String, | ||
@JsonProperty("age") age: Int = 0) { // default value causes synthetic constructor to be generated | ||
val name: String = name | ||
val age: Int = age | ||
} | ||
|
||
@Test public fun testSyntheticGeneratedConstructorIsIgnored() { | ||
val thing: Something = ObjectMapper().readValue("""{"name":"fred","age":99}""") | ||
@Test fun testSyntheticGeneratedConstructorIsIgnored() { | ||
val thing: Something = ObjectMapper().readValue("""{"name":"fred","age":99}""") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.