jvm-abi-gen: Add test to check the declaration order in interface jars
This commit is contained in:
committed by
Alexander Udalov
parent
b8625cd233
commit
05695761ec
+5
-2
@@ -12,7 +12,8 @@ class BytecodeListingTextCollectingVisitor(
|
||||
val filter: Filter,
|
||||
val withSignatures: Boolean,
|
||||
api: Int = Opcodes.API_VERSION,
|
||||
val withAnnotations: Boolean = true
|
||||
val withAnnotations: Boolean = true,
|
||||
val sortDeclarations: Boolean = true,
|
||||
) : ClassVisitor(api) {
|
||||
companion object {
|
||||
@JvmOverloads
|
||||
@@ -150,7 +151,9 @@ class BytecodeListingTextCollectingVisitor(
|
||||
append(className)
|
||||
if (declarationsInsideClass.isNotEmpty()) {
|
||||
append(" {\n")
|
||||
for (declaration in declarationsInsideClass.sortedBy { it.text }) {
|
||||
val orderedDeclarations =
|
||||
if (sortDeclarations) declarationsInsideClass.sortedBy { it.text } else declarationsInsideClass
|
||||
for (declaration in orderedDeclarations) {
|
||||
append(" ").append(declaration.annotations.joinToString("")).append(declaration.text).append("\n")
|
||||
}
|
||||
append("}")
|
||||
|
||||
Reference in New Issue
Block a user