Skip to content

Commit 06cee5c

Browse files
committed
http service provider singleton 변경
1 parent b23b0c4 commit 06cee5c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

logcat/src/main/java/com/android/logcat/http/HttpServiceProvider.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
public class HttpServiceProvider {
44
private HttpServiceProvider() {} // 인스턴스 생성 X
55

6-
private static HttpService provider;
6+
private static class Singleton {
7+
private static final HttpService provider = new HttpService();
8+
}
79

810
public static HttpService getInstance() {
9-
if (provider == null) {
10-
provider = new HttpService();
11-
}
12-
13-
return provider;
11+
return Singleton.provider;
1412
}
1513
}

0 commit comments

Comments
 (0)