Skip to content

Allow package-private mapper #1365

Description

@gervaisb

To limit visibility, we have a package-private mapper interface. While the compilation pass without any problems, the tests reveals that the mapper impl cannot be created:

Caused by: java.lang.IllegalAccessException: Class org.mapstruct.factory.Mappers can not access a member of class com.acme.PackagePrivateMapperImpl with modifiers ""
  at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
  at java.lang.Class.newInstance(Class.java:436)
  at org.mapstruct.factory.Mappers.doGetMapper(Mappers.java:99)

Having package-private classes (and mappers) help to expose clean interfaces outside a package without exposing the plumbing.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions