Martin Mirchev created PDFBOX-6312:
--------------------------------------

             Summary: PDMarkInfo.setSuspect() ignores its parameter and always 
writes false
                 Key: PDFBOX-6312
                 URL: https://issues.apache.org/jira/browse/PDFBOX-6312
             Project: PDFBox
          Issue Type: Bug
          Components: PDModel
    Affects Versions: 4.0.0, 3.0.8 PDFBox
            Reporter: Martin Mirchev


{{PDMarkInfo.setSuspect(boolean)}} always stores {{false}}, whatever value is 
passed:

{code:java}
public void setSuspect( boolean suspect )
{
    dictionary.setBoolean( "Suspects", false );
}
{code}

So {{/Suspects true}} can never be written through the API:

{code:java}
PDMarkInfo mi = new PDMarkInfo();
mi.setSuspect(true);
mi.isSuspect();          // false
mi.getCOSObject();       // COSDictionary{COSName{Suspects}:false;}
{code}

Checked on trunk (bd0c9c0); the same line is on the 3.0 and 2.0 branches. The 
fix is to pass the parameter: {{dictionary.setBoolean( "Suspects", suspect 
);}}. (PDFBOX-6276 fixed a different misuse of {{setSuspect}} in 
{{mergeMarkInfo}}.)

This issue was found by an LLM-assisted tool and verified manually.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to