Skip to content

Commit 7e36431

Browse files
committed
Update DHttpApi.java
1 parent 920a8a1 commit 7e36431

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

http-client/src/main/java/io/avaje/http/client/DHttpApi.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class DHttpApi {
2727
@SuppressWarnings("rawtypes")
2828
void init() {
2929
for (final HttpApiProvider apiProvider : ServiceLoader.load(HttpApiProvider.class)) {
30-
providerMap.put(apiProvider.type(), apiProvider);
30+
addProvider(apiProvider);
3131
}
3232

3333
for (final GeneratedComponent apiProvider : ServiceLoader.load(GeneratedComponent.class)) {
@@ -37,6 +37,10 @@ void init() {
3737
log.log(DEBUG, "providers for {0}", providerMap.keySet());
3838
}
3939

40+
void addProvider(HttpApiProvider<?> apiProvider) {
41+
providerMap.put(apiProvider.type(), apiProvider);
42+
}
43+
4044
@SuppressWarnings("unchecked")
4145
private <T> HttpApiProvider<T> lookup(Class<T> type) {
4246
return (HttpApiProvider<T>) providerMap.get(type);

0 commit comments

Comments
 (0)