Skip to content

Commit 8221a4a

Browse files
cbosbaywet
authored andcommitted
Remove usage of generics
1 parent 6ede082 commit 8221a4a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/com/microsoft/graph/core/BaseClient.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static Builder<OkHttpClient, Request> builder() {
138138
* @return builder to start configuring the client
139139
*/
140140
@Nonnull
141-
public static <nativeClient extends Call.Factory, nativeRequest> Builder<nativeClient, nativeRequest> builder(@Nonnull final Class<nativeClient> nativeClientClass, @Nonnull final Class<nativeRequest> nativeRequestClass) {
141+
public static <nativeClient, nativeRequest> Builder<nativeClient, nativeRequest> builder(@Nonnull final Class<nativeClient> nativeClientClass, @Nonnull final Class<nativeRequest> nativeRequestClass) {
142142
return new Builder<>();
143143
}
144144

@@ -147,7 +147,7 @@ public static <nativeClient extends Call.Factory, nativeRequest> Builder<nativeC
147147
* @param <httpClientType> type of the native http library client
148148
* @param <nativeRequestType> type of a request for the native http client
149149
*/
150-
public static class Builder<httpClientType extends Call.Factory, nativeRequestType> {
150+
public static class Builder<httpClientType, nativeRequestType> {
151151
private ISerializer serializer;
152152
private IHttpProvider<nativeRequestType> httpProvider;
153153
private ILogger logger;
@@ -175,17 +175,18 @@ private ISerializer getSerializer() {
175175
return serializer;
176176
}
177177
}
178-
private Call.Factory getHttpClient() {
178+
@SuppressWarnings("unchecked")
179+
private httpClientType getHttpClient() {
179180
if(httpClient == null) {
180-
return HttpClients.createDefault(getAuthenticationProvider());
181+
return (httpClientType)HttpClients.createDefault(getAuthenticationProvider());
181182
} else {
182183
return httpClient;
183184
}
184185
}
185186
@SuppressWarnings("unchecked")
186187
private IHttpProvider<nativeRequestType> getHttpProvider() {
187188
if(httpProvider == null) {
188-
return (IHttpProvider<nativeRequestType>)new CoreHttpProvider(getSerializer(), getLogger(), getHttpClient());
189+
return (IHttpProvider<nativeRequestType>)new CoreHttpProvider(getSerializer(), getLogger(), (Call.Factory) getHttpClient());
189190
} else {
190191
return httpProvider;
191192
}

0 commit comments

Comments
 (0)