Skip to content

Cascading: ClassCastException from generic method whose return type uses two type parameters #158

@rliesenfeld

Description

@rliesenfeld

The following example test fails with a CCE:

    public interface GenericInterface<T> { <S extends T> S save(S entity); }
    public interface ConcreteInterface extends GenericInterface<String> {}

    @Test
    public void cascadingFromGenericMethodWhoseTypeParameterExtendsAnother(@Mocked ConcreteInterface mock)
    {
        String value = "test";

        String saved = mock.save(value);

        assertNull(saved);
    }    

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions