Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactoring: convert DebugUtils to kt - [merged] #47

Closed
ininmm opened this issue Dec 8, 2020 · 10 comments
Closed

refactoring: convert DebugUtils to kt - [merged] #47

ininmm opened this issue Dec 8, 2020 · 10 comments

Comments

@ininmm
Copy link
Collaborator

ininmm commented Dec 8, 2020

In GitLab by @HsuHsiaoHsuan on Nov 15, 2020, 11:26

Merges refactoring/utils -> dev

#8

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @in_in_mm on Nov 15, 2020, 14:36

Commented on app/src/main/java/tw/y_studio/ptt/Utils/OkHttpUtils.kt line 51

好奇問一下,這邊為什麼會有 null 的情況呢?

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @HsuHsiaoHsuan on Nov 15, 2020, 21:02

Commented on app/src/main/java/tw/y_studio/ptt/Utils/OkHttpUtils.kt line 51

因為 return 的是一個 soft reference ~~~
呼叫 get 的時候有可能會因為被 gc 掉了,所以是會有 null 可能的。

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @HsuHsiaoHsuan on Nov 15, 2020, 21:02

resolved all threads

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @in_in_mm on Nov 16, 2020, 00:02

Commented on app/src/main/java/tw/y_studio/ptt/Utils/OkHttpUtils.kt line 51

我明白這邊會 null 是因為 Soft Reference 造成的,但是照我們在 #6 討論得內容來說,OkHttpClient 可能不會有 null 的情況。

所以我當初把 context 拿掉的時候有刻意讓 OkHttpClient 是 non-null 的。

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @in_in_mm on Nov 16, 2020, 00:03

Merge Conflict.

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @HsuHsiaoHsuan on Nov 20, 2020, 14:50

added 7 commits

  • ceafb6da...cbb835e3 - 6 commits from branch kenhuang1120:dev
  • 834f5f10 - refactoring: convert DebugUtils to kt

Compare with previous version

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @HsuHsiaoHsuan on Nov 20, 2020, 14:52

fix! 抱歉最近被工作卡太緊 orz

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @HsuHsiaoHsuan on Nov 20, 2020, 14:56

Commented on app/src/main/java/tw/y_studio/ptt/Utils/OkHttpUtils.kt line 51

但 ~ 因為目前寫法是回傳 SoftReference.get() 是 nullable,所以一定會強制要求加上一個? :(

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @HsuHsiaoHsuan on Nov 20, 2020, 15:23

added 1 commit

  • d71752f - refactoring: convert DebugUtils to kt

Compare with previous version

@ininmm
Copy link
Collaborator Author

ininmm commented Dec 8, 2020

In GitLab by @in_in_mm on Nov 20, 2020, 19:46

mentioned in commit b993e72

@ininmm ininmm closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant