Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
*/
package com.kucoin.sdk.rest.impl.retrofit;

import java.lang.reflect.ParameterizedType;

import com.kucoin.sdk.factory.RetrofitFactory;

import java.lang.reflect.ParameterizedType;

/**
* Created by chenshiwei on 2019/1/10.
*/
public class AuthRetrofitAPIImpl<T> extends AbstractRetrofitAPIImpl<T> {

private volatile boolean inited;
private T apiImpl;
private volatile T apiImpl;

@Override
public T getAPIImpl() {
if (inited)
if (apiImpl != null)
return apiImpl;
synchronized (getClass()) {
if (inited)
if (apiImpl != null)
return apiImpl;
@SuppressWarnings("unchecked")
Class<T> tClass = (Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
*/
package com.kucoin.sdk.rest.impl.retrofit;

import java.lang.reflect.ParameterizedType;

import com.kucoin.sdk.factory.RetrofitFactory;

import java.lang.reflect.ParameterizedType;

/**
* Created by chenshiwei on 2019/1/10.
*/
public class PublicRetrofitAPIImpl<T> extends AbstractRetrofitAPIImpl<T> {

private volatile boolean inited;
private T apiImpl;
private volatile T apiImpl;

@Override
public T getAPIImpl() {
if (inited)
if (apiImpl != null)
return apiImpl;
synchronized (getClass()) {
if (inited)
if (apiImpl != null)
return apiImpl;
@SuppressWarnings("unchecked")
Class<T> tClass = (Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass())
Expand All @@ -30,4 +29,4 @@ public T getAPIImpl() {
return t;
}
}
}
}