Skip to content

Commit a02100c

Browse files
daphnis.chevretonrobinlefever
daphnis.chevreton
authored andcommitted
Fix potential access issues when backporting
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.
1 parent 38a0e49 commit a02100c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

base/src/main/java/proguard/backport/Backporter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ public void execute(AppView appView) throws IOException
314314
appView.programClassPool.classesAccept(new ClassVersionSetter(targetClassVersion));
315315
}
316316

317+
// Backporting may introduce access issues, for example related to nest members/host.
318+
if (configuration.allowAccessModification)
319+
{
320+
appView.programClassPool.classesAccept(new AccessFixer());
321+
}
322+
317323
logger.info(" Number of converted string concatenations: {}", replacedStringConcatCounter.getCount());
318324
logger.info(" Number of converted lambda expressions: {}", lambdaExpressionCounter.getCount());
319325
logger.info(" Number of converted static interface methods: {}", staticInterfaceMethodCounter.getCount());

docs/md/manual/releasenotes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Version 7.4.2
2+
3+
### Bugfixes
4+
5+
- Fix potential access issues when backporting.
6+
17
## Version 7.4.1
28

39
### Bugfixes

0 commit comments

Comments
 (0)