Skip to content

Accessing Invocation context, from a mocked constructor results in IllegalAccessError #609

@svaens

Description

@svaens

Accessing Invocation context, from a mocked constructor results in IllegalAccessError

JMockit versions 1.35 - 1.46 (inclusive)

The functionality, as documented here:
https://jmockit.github.io/tutorial/Faking.html#invocation

causes

java.lang.IllegalAccessError: tried to access method mockit.internal.faking.FakeInvocation.shouldProceedIntoConstructor()Z from class

Version 1.34 seems not be effected by this particular bug.

Tested this using both:

Java 1.8 Oracle (1.8.0_201)
and
openjdk 1.8_202-b08 (https://adoptopenjdk.net)

with
junit-4.12
hamcrest-core-1.3


test classes attached!

src.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions