Details about the known misuse from the MUBench dataset.
Description:
The method PdfLayer.getAsString() is invoked and the result is immediately converted toUnicodeString(), without checking whether it is null. From the documentation og getAsString() we take that this is unsafe:
"Returns a PdfObject as a PdfString, resolving indirect references. The object associated with the PdfName given is retrieved and resolved to a direct object. If it is a PdfString, it is cast down and returned as such. Otherwise null is returned."
Fix Description:
Violation Types:
missing/condition/value_or_state
In File:
com/itextpdf/text/pdf/PdfLayer.java
In Method:
addChild(PdfLayer)
Code with Misuse:
classPdfLayer{
/**
* Adds a child layer. Nested layers can only have one parent.