Skip to content

Improve bytecode version diff#491

Open
Goooler wants to merge 6 commits intoJakeWharton:trunkfrom
Goooler:improve-bytecode-version-diff
Open

Improve bytecode version diff#491
Goooler wants to merge 6 commits intoJakeWharton:trunkfrom
Goooler:improve-bytecode-version-diff

Conversation

@Goooler
Copy link
Copy Markdown
Contributor

@Goooler Goooler commented Mar 20, 2026

OLD: old.jar
NEW: new.jar

 JAR   │ old      │ new      │ diff   
───────┼──────────┼──────────┼────────
 class │ 1.19 KiB │ 1.35 KiB │ +166 B 
 other │     72 B │     72 B │    0 B 
───────┼──────────┼──────────┼────────
 total │ 1.26 KiB │ 1.42 KiB │ +166 B 

 CLASSES │ old │ new │ diff       
─────────┼─────┼─────┼────────────
 classes │   1 │   1 │  0 (+0 -0) 
 methods │   4 │   5 │ +1 (+1 -0) 
  fields │   1 │   1 │  0 (+0 -0) 

=================
====   JAR   ====
=================

 size     │ diff   │ path                       
──────────┼────────┼────────────────────────────
 1.35 KiB │ +166 B │ ∆ org/example/MainKt.class 
──────────┼────────┼────────────────────────────
 1.35 KiB │ +166 B │ (total)                    


=====================
====   CLASSES   ====
=====================

BYTECODE VERSIONS:

   version │ old │ new │ diff
  ─────────┼─────┼─────┼────────────
        65 │   1 │   0 │ -1 (+0 -1)
        69 │   0 │   1 │ +1 (+1 -0)

  org.example.MainKt: 65 → 69


METHODS:

   old │ new │ diff       
  ─────┼─────┼────────────
   4   │ 5   │ +1 (+1 -0) 
  
  + org.example.MainKt main2()

Closes #490.

val newCount = newVersionMap.values.count { it == version }
BytecodeVersionDiff.Count(oldCount) to BytecodeVersionDiff.Count(newCount)
}
.filter { (_, counts) -> counts.first != counts.second }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too sure about this behavior. I'm tempted to say that if we show the diff at all, we want to show all counts just for the clarity of it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Comment on lines +256 to +257
// Classes shifted versions but net counts per version stayed same.
// Table is hidden, but class list is shown.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this test fail with the filter removed? I would have expected the chart here now...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

versionCounts is emptyMap in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bytecode version diff should use a different rendering

2 participants