Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update R8/ProGuard rules to avoid crash in release #443

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

rzimmer
Copy link
Contributor

@rzimmer rzimmer commented Sep 19, 2022

The following exception in PDFMergerUtility happened without the additional keep-rule:

java.io.IOException: Error while trying to create value in number tree:com.tom_roush.pdfbox.pdmodel.documentinterchange.logicalstructure.PDParentTreeValue.<init> [class com.tom_roush.pdfbox.cos.COSArray]
     at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:20)
     at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:189)
     at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:18)
Caused by: java.lang.NoSuchMethodException: com.tom_roush.pdfbox.pdmodel.documentinterchange.logicalstructure.PDParentTreeValue.<init> [class com.tom_roush.pdfbox.cos.COSArray]
     at java.lang.Class.getConstructor0(Class.java:2332)
     at java.lang.Class.getDeclaredConstructor(Class.java:2170)
     at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:16)

@TomRoush TomRoush added the type: bug Existing feature doesn't work correctly label Oct 20, 2022
@TomRoush
Copy link
Owner

Hi @rzimmer thanks for contributing, this looks great, Do you have an example PDF and/or R8 rules you can share that demonstrate the issue you were having?
If not that's fine, it looks like I should be able to find a test PDF that will work and I'll assume that this will show up with the default R8 release profile

@TomRoush TomRoush added this to the v2.0.26.0 milestone Nov 30, 2022
The following exception in `PDFMergerUtility` happened without the additional keep-rule:

```
java.io.IOException: Error while trying to create value in number tree:com.tom_roush.pdfbox.pdmodel.documentinterchange.logicalstructure.PDParentTreeValue.<init> [class com.tom_roush.pdfbox.cos.COSArray]
     at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:20)
     at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:189)
     at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:18)
Caused by: java.lang.NoSuchMethodException: com.tom_roush.pdfbox.pdmodel.documentinterchange.logicalstructure.PDParentTreeValue.<init> [class com.tom_roush.pdfbox.cos.COSArray]
     at java.lang.Class.getConstructor0(Class.java:2332)
     at java.lang.Class.getDeclaredConstructor(Class.java:2170)
     at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:16)
```
@TomRoush TomRoush enabled auto-merge (squash) November 30, 2022 23:23
@TomRoush TomRoush merged commit d80b396 into TomRoush:master Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Existing feature doesn't work correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants