Skip to content

Commit 559f880

Browse files
committed
Merge remote-tracking branch 'upstream/2.1-dev' into 2.1-dev
# Conflicts: # build.gradle
2 parents 769141f + ee6ea5a commit 559f880

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ apply plugin: 'kotlin'
2020
apply plugin: 'org.jetbrains.intellij'
2121

2222
group 'wu.seal'
23-
version '2.1.1'
23+
version '2.1.2'
2424

2525
intellij {
2626
updateSinceUntilBuild false

src/main/kotlin/wu/seal/jsontokotlin/utils/classblockparse/ClassCodeParser.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ class ClassCodeParser(private val classBlockString: String) {
104104

105105
private fun getPropertyType(propertyLine: String, isLastLine: Boolean): String {
106106
val deleteCommentPropertyLine = propertyLine.substringBefore("//")
107-
if (deleteCommentPropertyLine.contains("=")) {
108-
return deleteCommentPropertyLine.substringAfter(":").split("=")[0].trim()
107+
val typeAndValueBlock = deleteCommentPropertyLine.substringAfterLast(":")
108+
if (typeAndValueBlock.contains("=")) {
109+
return typeAndValueBlock.split("=")[0].trim()
109110
} else {
110-
val substringBefore = deleteCommentPropertyLine.substringAfter(":").substringBefore("//")
111+
val substringBefore = typeAndValueBlock
111112
return if (isLastLine)
112113
substringBefore.trim()
113114
else
@@ -117,8 +118,9 @@ class ClassCodeParser(private val classBlockString: String) {
117118

118119
private fun getPropertyValue(propertyLine: String, isLastLine: Boolean): String {
119120
val deleteCommentPropertyLine = propertyLine.substringBefore("//")
120-
if (deleteCommentPropertyLine.contains("=")) {
121-
val propertyValuePre = deleteCommentPropertyLine.substringAfter(":").split("=")[1]
121+
val typeAndValueBlock = deleteCommentPropertyLine.substringAfterLast(":")
122+
if (typeAndValueBlock.contains("=")) {
123+
val propertyValuePre = typeAndValueBlock.split("=")[1]
122124
return if (isLastLine) {
123125
propertyValuePre.trim()
124126
} else {

0 commit comments

Comments
 (0)