mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
CORDA-2227 Emit java.lang.Object, not *, in TypeNotation (#4387)
This commit is contained in:
parent
b020e602ba
commit
c554b33ff6
@ -47,7 +47,7 @@ object AMQPTypeIdentifiers {
|
||||
is TypeIdentifier.Erased -> typeIdentifier.name
|
||||
is TypeIdentifier.Unparameterised -> primitiveTypeNamesByName[typeIdentifier] ?: typeIdentifier.name
|
||||
is TypeIdentifier.UnknownType -> "?"
|
||||
is TypeIdentifier.TopType -> TypeIdentifier.TopType.name
|
||||
is TypeIdentifier.TopType -> Any::class.java.name
|
||||
is TypeIdentifier.ArrayOf ->
|
||||
if (typeIdentifier == primitiveByteArrayType) "binary"
|
||||
else nameForType(typeIdentifier.componentType) +
|
||||
|
@ -45,10 +45,10 @@ class AMQPRemoteTypeModelTests {
|
||||
@Test
|
||||
fun `round-trip some types through AMQP serialisations`() {
|
||||
arrayOf("").assertRemoteType("String[]")
|
||||
listOf(1).assertRemoteType("List<*>")
|
||||
listOf(1).assertRemoteType("List<Object>")
|
||||
arrayOf(listOf(1)).assertRemoteType("List[]")
|
||||
Enum.BAZ.assertRemoteType("Enum(FOO|BAR|BAZ)")
|
||||
mapOf("string" to 1).assertRemoteType("Map<*, *>")
|
||||
mapOf("string" to 1).assertRemoteType("Map<Object, Object>")
|
||||
arrayOf(byteArrayOf(1, 2, 3)).assertRemoteType("byte[][]")
|
||||
|
||||
SimpleClass(1, 2.0, null, byteArrayOf(1, 2, 3), byteArrayOf(4, 5, 6))
|
||||
@ -63,11 +63,11 @@ class AMQPRemoteTypeModelTests {
|
||||
|
||||
C(arrayOf("a", "b"), listOf(UUID.randomUUID()), mapOf(UUID.randomUUID() to intArrayOf(1, 2, 3)), Enum.BAZ)
|
||||
.assertRemoteType("""
|
||||
C: Interface<String, UUID, *>
|
||||
C: Interface<String, UUID, Object>
|
||||
array: String[]
|
||||
enum: Enum(FOO|BAR|BAZ)
|
||||
list: List<UUID>
|
||||
map: Map<UUID, *>
|
||||
map: Map<UUID, Object>
|
||||
""")
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ class AMQPTypeIdentifierParserTests {
|
||||
assertParsesCompatibly<IntArray>()
|
||||
assertParsesCompatibly<Array<Int>>()
|
||||
assertParsesCompatibly<List<Int>>()
|
||||
assertParsesCompatibly<WithParameter<*>>()
|
||||
assertParsesTo<WithParameter<*>>("WithParameter<Object>")
|
||||
assertParsesCompatibly<WithParameter<Int>>()
|
||||
assertParsesCompatibly<Array<out WithParameter<Int>>>()
|
||||
assertParsesCompatibly<WithParameters<IntArray, WithParameter<Array<WithParameters<Array<Array<Date>>, UUID>>>>>()
|
||||
|
Loading…
Reference in New Issue
Block a user