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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]