Skip to content

Commit

Permalink
Fix potential access issues when backporting
Browse files Browse the repository at this point in the history
Backporting nest host/members is not supported and can therefore introduce access issue.
Running the access fixer if `-allowaccessmodification` is set solves this issue by setting appropriate visibility.
  • Loading branch information
daphnis.chevreton authored and robinlefever committed Nov 29, 2023
1 parent 38a0e49 commit a02100c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/src/main/java/proguard/backport/Backporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ public void execute(AppView appView) throws IOException
appView.programClassPool.classesAccept(new ClassVersionSetter(targetClassVersion));
}

// Backporting may introduce access issues, for example related to nest members/host.
if (configuration.allowAccessModification)
{
appView.programClassPool.classesAccept(new AccessFixer());
}

logger.info(" Number of converted string concatenations: {}", replacedStringConcatCounter.getCount());
logger.info(" Number of converted lambda expressions: {}", lambdaExpressionCounter.getCount());
logger.info(" Number of converted static interface methods: {}", staticInterfaceMethodCounter.getCount());
Expand Down
6 changes: 6 additions & 0 deletions docs/md/manual/releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Version 7.4.2

### Bugfixes

- Fix potential access issues when backporting.

## Version 7.4.1

### Bugfixes
Expand Down

0 comments on commit a02100c

Please sign in to comment.