yyqdbngt opened a new pull request, #2970:
URL: https://github.com/apache/rocketmq-dashboard/pull/2970
## Summary
`InstanceProviderRegistry.forVendor` and `catalogFor` looked the vendor up
directly in an `EnumMap`. `EnumMap.get(null)` throws NPE, so a null vendor
crashed with a raw NullPointerException instead of the same 501
"No ... provider registered for vendor" that an unregistered vendor already
produces. Both lookups now map a null vendor onto the existing missing-entry
code path.
## Why
The registry is the single lookup SPI for vendor-scoped providers; current
call sites normalize a null `InstanceVO.vendor` to APACHE first, but the SPI
contract ("unknown vendor -> 501") should hold for null too, so a future
caller passing a raw persisted vendor cannot 500 the request with an NPE.
## Testing
```
cd server && mvn -Dtest="InstanceProviderRegistryTest" test
```
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
New regression tests `forVendorShouldReportNullVendorAsMissingTest` and
`catalogForShouldReportNullVendorAsMissingTest` assert the 501
BusinessException
(message "No ... provider registered for vendor null") instead of an NPE.
--
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]