danfickle / danfickle/openhtmltopdf

Consider getting rid of assert and fix to BoxBuilder.doBidi when prevSplit is actually null

Open
#311 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.2k
Forks
423
PR merge metrics
No merged PRs in 30d

Description

I don't think java assertion is turned on by default. So using assert for code logic might not be wise in this project. I ran into it specifically in BoxBuilder:

` BidiTextRun prevSplit = para.prevSplit(startIndex); // Get directional run at or before startIndex.
if (prevSplit==null)
{
// new code here
return doFakeBidi(c, textNode, parent, parentStyle, previousIB, children);
}

assert(prevSplit != null); // There should always be a split at zero (start of paragraph) to fall back on.
assert(prevSplit.getStart() <= startIndex); // Split should always be before or at the start of this text node.
`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.