jmockit / jmockit1

Advanced Java library for integration testing, mocking, faking, and code coverage
Other
458 stars 238 forks source link

Horrible implementation of stack variation and more #735

Open 0x3C50 opened 1 year ago

0x3C50 commented 1 year ago

https://github.com/jmockit/jmockit1/blob/5c6a2dfc6042ebf8d99770a7e9167bf3c26149e8/main/src/mockit/asm/jvmConstants/JVMInstruction.java#L15-L19

This might save some space when writing, but the readability is horrible. "How much stack does this specific instruction modify?"

A better way to do it would be to make an enum with all relevant instructions, store them by index, and put the info in their params.

Col-E commented 1 year ago

JMockit's asm package is based on an old release of Objectweb's ASM version 5. This existed upstream in ASM at the time.