Skip to content

Commit bb80c2c

Browse files
committed
Disabled types auto-boxing when working with Java primitives
1 parent a69d999 commit bb80c2c

File tree

1 file changed

+2
-2
lines changed
  • core/src/main/java/eth/likespro/lpfcp

1 file changed

+2
-2
lines changed

core/src/main/java/eth/likespro/lpfcp/LPFCP.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ object LPFCP {
123123
functionArgs.toMap().forEach { (argName, argValue) ->
124124
function.parameters.find { it.name == argName || it.index.toString() == argName }?.let { param ->
125125
try {
126-
args[param] = (argValue as String).decodeObject(param.type.javaType.boxed()) // We need to make .boxed() due to bug in `commons` reflection lib, which doesn't correctly handle Java primitive types
126+
args[param] = (argValue as String).decodeObject(param.type.javaType)
127127
} catch (_: Exception) { }
128128
}
129129
}
@@ -180,7 +180,7 @@ object LPFCP {
180180
* @return A proxy instance of the specified interface.
181181
*/
182182
inline fun <reified Interface> getProcessor(processorLPFCP: URI) = getProcessor<Interface> { request, type ->
183-
(processorLPFCP.post(request.toString()).decodeObject(EncodableResult::class.java.getParametrizedType(type.boxed())) as EncodableResult<*>).getOrThrow()
183+
(processorLPFCP.post(request.toString()).decodeObject(EncodableResult::class.java.getParametrizedType(type)) as EncodableResult<*>).getOrThrow()
184184
}
185185

186186
/**

0 commit comments

Comments
 (0)