You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/StructureGenerator.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -138,7 +138,7 @@ class StructureGenerator(
138
138
write("var result = #1L#2L", memberNameSymbolIndex[sortedMembers[0]]!!.first, selectHashFunctionForShape(sortedMembers[0]))
139
139
if (sortedMembers.size >1) {
140
140
sortedMembers.drop(1).forEach { memberShape ->
141
-
write("result = 31 * result + (this.#1L#2L)", memberNameSymbolIndex[memberShape]!!.first, selectHashFunctionForShape(memberShape))
141
+
write("result = 31 * result + (#1L#2L)", memberNameSymbolIndex[memberShape]!!.first, selectHashFunctionForShape(memberShape))
Copy file name to clipboardExpand all lines: codegen/smithy-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/rendering/StructureGeneratorTest.kt
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -134,14 +134,14 @@ class StructureGeneratorTest {
134
134
val expected ="""
135
135
override fun hashCode(): kotlin.Int {
136
136
var result = bar
137
-
result = 31 * result + (this.baz ?: 0)
138
-
result = 31 * result + (this.byteValue?.toInt() ?: 0)
139
-
result = 31 * result + (this.defaultString.hashCode())
140
-
result = 31 * result + (this.foo?.hashCode() ?: 0)
141
-
result = 31 * result + (this.`object`?.hashCode() ?: 0)
142
-
result = 31 * result + (this.quux?.hashCode() ?: 0)
143
-
result = 31 * result + (this.requiredInt)
144
-
result = 31 * result + (this.requiredIntButNullable ?: 0)
137
+
result = 31 * result + (baz ?: 0)
138
+
result = 31 * result + (byteValue?.toInt() ?: 0)
139
+
result = 31 * result + (defaultString.hashCode())
140
+
result = 31 * result + (foo?.hashCode() ?: 0)
141
+
result = 31 * result + (`object`?.hashCode() ?: 0)
142
+
result = 31 * result + (quux?.hashCode() ?: 0)
143
+
result = 31 * result + (requiredInt)
144
+
result = 31 * result + (requiredIntButNullable ?: 0)
145
145
return result
146
146
}
147
147
""".formatForTest()
@@ -474,7 +474,7 @@ class StructureGeneratorTest {
474
474
val expectedHashCodeContent ="""
475
475
override fun hashCode(): kotlin.Int {
476
476
var result = bar?.hashCode() ?: 0
477
-
result = 31 * result + (this.foo?.contentHashCode() ?: 0)
477
+
result = 31 * result + (foo?.contentHashCode() ?: 0)
478
478
return result
479
479
}
480
480
""".formatForTest()
@@ -784,7 +784,7 @@ class StructureGeneratorTest {
0 commit comments