Skip to content

Commit 0b734c0

Browse files
committed
Merge pull request rengwuxian#6 from troyliu0105/master
UPDATE: singleton pattern
2 parents d5d24c2 + 864272f commit 0b734c0

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎app/src/main/java/com/rengwuxian/rxjavasamples/module/cache_6/data/Database.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ public class Database {
2424
File dataFile = new File(App.getInstance().getFilesDir(), DATA_FILE_NAME);
2525
Gson gson = new Gson();
2626

27+
private Database() {
28+
}
29+
2730
public static Database getInstance() {
2831
if (INSTANCE == null) {
2932
INSTANCE = new Database();

‎app/src/main/java/com/rengwuxian/rxjavasamples/util/GankBeautyResultToItemsMapper.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
public class GankBeautyResultToItemsMapper implements Func1<GankBeautyResult, List<Item>> {
1818
private static GankBeautyResultToItemsMapper INSTANCE = new GankBeautyResultToItemsMapper();
1919

20-
public GankBeautyResultToItemsMapper() {
20+
private GankBeautyResultToItemsMapper() {
2121
}
2222

2323
public static GankBeautyResultToItemsMapper getInstance() {

0 commit comments

Comments
 (0)