Skip to content

Commit 0016270

Browse files
committed
more detailed docu
1 parent fb6ab69 commit 0016270

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/main/java/org/htmlunit/cyberneko/HTMLScanner.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,16 @@ public class HTMLScanner implements XMLDocumentSource, XMLLocator, HTMLComponent
511511

512512
private final XMLString fScanLiteral = new XMLString();
513513

514-
/** Single boolean array. */
515-
final boolean[] fSingleBoolean = {false};
514+
/**
515+
* Reusable single-element boolean array used as an out-parameter.
516+
* <p>
517+
* Performance optimization: This array is reused across method calls to avoid
518+
* allocating a new single-element array on every invocation of methods like
519+
* {@code scanStartElement} and {@code scanAttribute}. The array is reset before
520+
* each use to ensure correctness.
521+
* <p>
522+
* Thread safety: Safe because scanner instances are single-threaded.
523+
*/ final boolean[] fSingleBoolean = {false};
516524

517525
final HTMLConfiguration htmlConfiguration_;
518526

0 commit comments

Comments
 (0)