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 12:53:39 UTC

[PR] Stop locking on exposed objects in table styles, dsig and HSLF [poi]

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

   These are the rest of the SpotBugs US_OBJECT findings, following #1376.
   
   - **`XSSFBuiltinTableStyle.init()`** was `static synchronized` on the enum class, and `getStyle()` calls it every time. So every built-in style lookup took the class lock.
     - It now uses a private lock and a `volatile` initialised flag, so once the styles are loaded `getStyle()` takes no lock.
     - The flag is only set after a complete load. Previously, if loading failed partway through, the half-filled map made every later `init()` return early, and the remaining styles stayed missing for good. Now a later call retries.
   - **`RelationshipTransformService.registerDsigProvider()`**: uses a private lock instead of the class.
   - **`HSLFSlideShowImpl.appendRootLevelRecord`**: `synchronized` is removed. It was the only locked method in a class whose other methods update `_records` without a lock, so it protected nothing.
   - **`SignatureConfig`**: `addCachedCertificate` locks the keystore, but `getCachedCertificateByPrinicipal` read it unlocked (`// TODO: add synchronized`). The lookup now takes the same lock.
     - The lock stays on the `KeyStore` object rather than a private one. `getKeyStore()` exposes that object, so callers can coordinate with POI by locking it. SpotBugs will still flag this one.
   
   Tests: the XSSF table and built-in style tests, `TestSignatureConfig`/`TestSignatureInfo`, and the HSLF slideshow, adding-slides and picture tests all pass.
   
   🤖 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] Stop locking on exposed objects in table styles, dsig and HSLF [poi]

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


-- 
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