javapathfinder / jpf-core

JPF is an extensible software analysis framework for Java bytecode. jpf-core is the basis for all JPF projects; you always need to install it. It contains the basic VM and model checking infrastructure, and can be used to check for concurrency defects like deadlocks, and unhandled exceptions like NullPointerExceptions and AssertionErrors.
527 stars 334 forks source link

Modify Types.instanceOf to take a ClassInfo as LHS #410

Closed zhangwen0411 closed 1 year ago

zhangwen0411 commented 1 year ago

This PR is a port of #388 to the java-10-gradle branch.

I omitted a test case (https://github.com/javapathfinder/jpf-core/pull/388/commits/f5755041fbbe4ea9bc8fedce8fd65781dbac87aa) that depends on the ASM framework, a dependency added to the master branch in #203 but not present in the java-10-gradle branch. I'd be happy to add the dependency and the test case if that's preferred!

pparizek commented 1 year ago

Maybe the relevant classes (example.MyClass1, example.MyClass2) can be added in the form of real class files as resources for tests, instead of generating them at runtime with ASM.

cyrille-artho commented 1 year ago

Yes, I think that would be best. I'll create an issue for that.

On Wed, Aug 16, 2023 at 2:02 PM Pavel Parizek @.***> wrote:

Maybe the relevant classes (example.MyClass1, example.MyClass2) can be added in the form of real class files as resources for tests, instead of generating them at runtime with ASM.

— Reply to this email directly, view it on GitHub https://github.com/javapathfinder/jpf-core/pull/410#issuecomment-1680476008, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXV4R7GEVDR4S7WK3ELPGTXVSZGRANCNFSM6AAAAAA3QGOZOI . You are receiving this because you commented.Message ID: @.***>

-- Regards, Cyrille Artho

cyrille-artho commented 1 year ago

@zhangwen0411 , can you please add two empty classes with suitable package names to src/tests and check if the additional test works like that (without the code that manually builds the corresponding bytecode)? See issue #411.

cyrille-artho commented 1 year ago

I see. In that case, I think it's best to add the extra test as is now, and we can see later if the test can be rewritten later.

cyrille-artho commented 1 year ago

Subsumed by PR #415 (which we wanted to merge now as some other patches depend on it). Thank you for providing this PR, which served us as a template.