GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Define new enum ClassAccessibility by Chessray · Pull Request #4071 · mapstruct/mapstruct

Conversation

@Chessray

@Chessray Chessray commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Define new enum ClassAccessibility for controlling generated Mappers' declared accessibility.

Fixes #2513.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Chessray added 3 commits June 13, 2026 15:48
@Chessray
Define new enum ClassAccessibility for controlling generated Mappers'…
38df79f
… declared accessibility.
@Chessray
Define new enum ClassAccessibility for controlling generated Mappers'…
c0784ac
… declared accessibility.
@Chessray
Merge remote-tracking branch 'origin/main'
cad76eb
hduelme
hduelme requested changes Jun 19, 2026
View reviewed changes

@hduelme hduelme left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Chessray, left a few small comments, implementation looks good overall. Could you also add the tests for @MapperConfig?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread core/src/main/java/org/mapstruct/ClassAccessibility.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread core/src/main/java/org/mapstruct/ClassAccessibility.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread processor/src/main/java/org/mapstruct/ap/internal/gem/ClassAccessibilityGem.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Chessray
Fix typos, improve wording, and add missing tests.
5f9a034
@Chessray
Chessray requested a review from hduelme June 19, 2026 20:29
Chessray added 2 commits June 19, 2026 21:50
@Chessray
Checkstyle
5ae77ce
@Chessray
Merge branch 'mapstruct:main' into main
0d4ec31
@Chessray

Chessray commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Hi @Chessray, left a few small comments, implementation looks good overall. Could you also add the tests for @MapperConfig?

Thanks @hduelme, I hope I've got them all. Could you please check again?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hduelme
hduelme approved these changes Jun 22, 2026
View reviewed changes

@hduelme hduelme left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chessray thanks for the adjustments.

One last thought: currently, DEFAULT is used to represent package-private visibility. Would something like PACKAGE_PRIVATE be more intuitive and make the intent clearer? Let me know what you think.

Out of curiosity, are you planning to use this feature mapstruct-spring-extensions?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Chessray

Chessray commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@Chessray thanks for the adjustments.

One last thought: currently, DEFAULT is used to represent package-private visibility. Would something like PACKAGE_PRIVATE be more intuitive and make the intent clearer? Let me know what you think.

I had this exact mental discussion and ended up with DEFAULT because of the same terminology being used in Accessibility.java. I find PACKAGE_PRIVATE more descriptive myself. Maybe we can rename both places? Does @filiphr want to chime in here?

Out of curiosity, are you planning to use this feature mapstruct-spring-extensions?

I don't really see how. This influences the Mapper generation, not the Adapter.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@filiphr

filiphr commented Jun 22, 2026

Copy link
Copy Markdown
Member

Nice addition @Chessray. From the point of our API, I personally find the LIKE_ABSTRACTION a bit strange. What I would propose is to use DEFAULT for the mapstruct default (i.e. The current like abstraction) and use PACKAGE_PROTECTED for package protected.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hduelme

hduelme commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

I had this exact mental discussion and ended up with DEFAULT because of the same terminology being used in Accessibility.java. I find PACKAGE_PRIVATE more descriptive myself

@Chessray Good point. I think we should rename Accessibility.java too. DEFAULT doesn't really fit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hduelme

hduelme commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

I don't really see how. This influences the Mapper generation, not the Adapter.

Makes sense. Do you think we should adjust the examples in the extension? My thoughts were based on the original issue mentioning Spring.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Chessray
Rename accessibility options as discussed.
4514a92
@Chessray

Chessray commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks guys, this should be it now. @hduelme I'll take a look at the Spring Extension examples separately. Maybe I'll only mention it in the documentation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hduelme
hduelme requested changes Jun 23, 2026
View reviewed changes

@hduelme hduelme left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chessray thanks for adjusting. The naming looks good to me now.
It seems like we currently don't enforce consistent enum formatting.

@filiphr I think the preferred formatting is to have spaces before and after enum constant parameters (e.g. PUBLIC( "public" )). Do you agree? Maybe we could add this rule to our Checkstyle configuration.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread processor/src/main/java/org/mapstruct/ap/internal/model/common/Accessibility.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Chessray
Formatting
9af8669
@Chessray
Chessray requested a review from hduelme June 23, 2026 19:30
hduelme
hduelme approved these changes Jun 24, 2026
View reviewed changes
@hduelme
hduelme merged commit f5253e8 into mapstruct:main Jun 24, 2026
9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@hduelme

hduelme commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@Chessray Nice one. Thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hduelme hduelme mentioned this pull request Jun 24, 2026
enforce ParenPad for ENUM_CONSTANT_DEF #4075
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hduelme hduelme hduelme approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Generated mappers for Spring can be package-private

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Chessray @filiphr @hduelme
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.