gnodet-bot commented on code in PR #29972:
URL: https://github.com/apache/camel/pull/29972#discussion_r4575441562
##########
components/camel-pdf/src/main/java/org/apache/camel/component/pdf/PdfHeaderConstants.java:
##########
@@ -35,8 +35,14 @@ public final class PdfHeaderConstants {
@Metadata(description = """
Expected type is
https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/DecryptionMaterial.html[DecryptionMaterial].
- *Mandatory* header if PDF document is encrypted.""",
- javaType =
"org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial")
+ *Deprecated.* This header has never been read by the component.
+ PDFBox 2+ decrypts documents at load time (via the password
argument to `Loader.loadPDF`);
+ by the time the producer receives a `PDDocument`, decryption has
already occurred or failed.
+ Use `Loader.loadPDF(bytes, password)` in a type converter or a
`Processor` before the PDF endpoint instead.""",
+ javaType =
"org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial",
+ deprecationNote = "Never read by the component: PDDocument is
decrypted when it is loaded, and the byte[]"
+ + " converter loads it without a password")
Review Comment:
💡 **Wording + duplication fix** (echoing davsclaus's review)
Two issues here:
1. `"never read"` → `"no longer read"` — the header was read in Camel ≤ 2.20
(PDFBox 1.x via `document.openProtection`)
2. The `description` text already explains the deprecation; the generator
then appends `Deprecation note: <deprecationNote>` automatically → the catalog
shows the reason 3 times. Keep description short.
```suggestion
@Metadata(description = """
Expected type is
https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/DecryptionMaterial.html[DecryptionMaterial].
No longer read by the component (deprecated since Camel
2.21).""",
javaType =
"org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial",
deprecationNote = "No longer read by the component since Camel
2.21: PDFBox 2 decrypts at load time"
+ " via Loader.loadPDF(bytes, password). The
byte[] converter loads without a password."
+ " Decrypt in a Processor before the PDF
endpoint instead.")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]