Skip to content

"GenericArrayTypeImpl cannot be cast to Class" when MockUp<GENERIC_AS_SUPER> #347

@YangZhong

Description

@YangZhong

Please provide the following information:

  • Version of JMockit that was used:
    1.28 1.27 1.26 1.25
    Java "1.8.0_102"
  • Description of the problem or enhancement request:
    "java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl cannot be cast to java.lang.Class" when MockUp<GENERIC_AS_SUPER>.
    That's a regression because 1.24 works perfectly.

public class GENERIC_AS_SUPER extends SUPER<GENERIC>
{...}
public class TEST extends Assert
{

@BeforeClass  //  jUnit 4.12
static public void SET_UP() throws Exception
{
    new MockUp<GENERIC_AS_SUPER>()
    {
        @Mock
        void $init()
        {}
        ...
    };
}
...

}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions