Skip to content

Commit cb77d11

Browse files
committed
Fixed to not use javaPrimitiveType
The result is the same as a call to java, but there is an overhead.
1 parent e02c9b1 commit cb77d11

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/ClosedRangeSupport.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ internal object ClosedRangeResolver : SimpleAbstractTypeResolver() {
5555
}
5656

5757
fun findClosedFloatingPointRangeRef(contentType: Class<*>): Class<*>? = when (contentType) {
58-
Double::class.javaPrimitiveType, Double::class.javaObjectType -> closedDoubleRangeRef
59-
Float::class.javaPrimitiveType, Float::class.javaObjectType -> closedFloatRangeRef
58+
Double::class.java, Double::class.javaObjectType -> closedDoubleRangeRef
59+
Float::class.java, Float::class.javaObjectType -> closedFloatRangeRef
6060
else -> null
6161
}
6262

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/InternalCommons.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ internal fun Class<*>.isUnboxableValueClass() = this.isAnnotationPresent(JvmInli
2424
internal fun JmClass.wrapsNullValueClass() = inlineClassUnderlyingType!!.isNullable
2525

2626
private val primitiveClassToDesc = mapOf(
27-
Byte::class.javaPrimitiveType to 'B',
28-
Char::class.javaPrimitiveType to 'C',
29-
Double::class.javaPrimitiveType to 'D',
30-
Float::class.javaPrimitiveType to 'F',
31-
Int::class.javaPrimitiveType to 'I',
32-
Long::class.javaPrimitiveType to 'J',
33-
Short::class.javaPrimitiveType to 'S',
34-
Boolean::class.javaPrimitiveType to 'Z',
35-
Void::class.javaPrimitiveType to 'V'
27+
Byte::class.java to 'B',
28+
Char::class.java to 'C',
29+
Double::class.java to 'D',
30+
Float::class.java to 'F',
31+
Int::class.java to 'I',
32+
Long::class.java to 'J',
33+
Short::class.java to 'S',
34+
Boolean::class.java to 'Z',
35+
Void.TYPE to 'V'
3636
)
3737

3838
// -> this.name.replace(".", "/")

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/deser/valueInstantiator/creator/ConstructorValueCreator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ internal class ConstructorValueCreator<T : Any>(
4545
val parameterSize = it.size
4646
val temp = it.copyOf(parameterSize + maskSize + 1)
4747
for (i in 0 until maskSize) {
48-
temp[it.size + i] = Int::class.javaPrimitiveType
48+
temp[it.size + i] = Int::class.java
4949
}
5050
temp[parameterSize + maskSize] = defaultConstructorMarker
5151

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/deser/valueInstantiator/creator/MethodValueCreator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ internal class MethodValueCreator<T>(
5050
temp[0] = companionObjectClass // companion object
5151
parameterTypes.copyInto(temp, 1) // parameter types
5252
for (i in (valueParameterSize + 1)..(valueParameterSize + maskSize)) { // masks
53-
temp[i] = Int::class.javaPrimitiveType
53+
temp[i] = Int::class.java
5454
}
5555
temp[valueParameterSize + maskSize + 1] = Object::class.java // maker
5656
temp

0 commit comments

Comments
 (0)