List of usage examples for org.springframework.http.client ClientHttpRequest getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.tasktop.c2c.server.common.service.tests.http.MultiUserClientHttpRequestFactoryTest.java
private HttpClient getHttpClient(ClientHttpRequest request) { Class<?> clazz = request.getClass(); while (clazz != Object.class) { for (Field field : clazz.getDeclaredFields()) { if (HttpClient.class.isAssignableFrom(field.getType())) { field.setAccessible(true); try { return (HttpClient) field.get(request); } catch (Exception e) { throw new IllegalStateException(e); }// w w w . j av a 2 s . c o m } } clazz = clazz.getSuperclass(); } throw new IllegalStateException(); }