处理 SonarQube 问题:
双重检查锁方式实现的单例,改为使用静态内部类方式
This commit is contained in:
@ -211,7 +211,7 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
|
||||
}
|
||||
|
||||
public void getCommentNum() {
|
||||
RetrofitManager.getInstance(getContext()).getApi()
|
||||
RetrofitManager.getInstance().getApi()
|
||||
.getNewsCommentnum(newsId, Utils.getTime(getContext()))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@ -232,7 +232,7 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
|
||||
}
|
||||
|
||||
private void getConcernDigest() {
|
||||
RetrofitManager.getInstance(getContext()).getApi().getNewsRichDigest(newsId)
|
||||
RetrofitManager.getInstance().getApi().getNewsRichDigest(newsId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Response<ConcernEntity>() {
|
||||
@ -263,7 +263,7 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
|
||||
}
|
||||
|
||||
private void getNewsViews() {
|
||||
RetrofitManager.getInstance(getContext()).getApi()
|
||||
RetrofitManager.getInstance().getApi()
|
||||
.getArticlesVisits(UrlFilterUtils.getFilterQuery("article_ids", newsId))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
Reference in New Issue
Block a user