You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/10/11 10:30:35 UTC

[PR] Fix SpotBugs inconsistent-synchronization warnings [poi]

pjfanning opened a new pull request, #1370:
URL: https://github.com/apache/poi/pull/1370

   SpotBugs reports IS2_INCONSISTENT_SYNC for DocumentInputStream, CellDateFormatter and ClassIDPredefined.
   
   - `ClassIDPredefined.getClassID()`: the return read `classId` outside the lock; it now reads it inside the lock.
   - `CellDateFormatter`: `sFmt`, `amPmUpper`, `showM` and `showAmPm` were written by the inner `DatePartHandler` during construction and read in the synchronized `formatValue`. The handler is now a static nested class that keeps its own parse state, and the constructor copies that state into `final` fields.
   - `DocumentInputStream`: only `mark`/`reset` were `synchronized`, while `read*`/`skip` changed the same fields without a lock. The stream isn't thread-safe, so the two `synchronized` modifiers are removed rather than adding locking to every read.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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: dev-unsubscribe@poi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: [PR] Fix SpotBugs warnings; DocumentInputStream skip/read allocations [poi]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #1370:
URL: https://github.com/apache/poi/pull/1370


-- 
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: dev-unsubscribe@poi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org