Closed bbura closed 1 year ago
Describe the problem Here is a double and unnecessary check for null.
In which lesson and step of the codelab can this issue be found? https://developer.android.com/codelabs/android-training-livedata-viewmodel?authuser=0#6
Ex: 5.1.4
public static WordRoomDatabase getDatabase(final Context context) { if (INSTANCE == null) { synchronized (WordRoomDatabase.class) { if (INSTANCE == null) { // Create database here } } } return INSTANCE; }
Describe the problem Here is a double and unnecessary check for null.
In which lesson and step of the codelab can this issue be found? https://developer.android.com/codelabs/android-training-livedata-viewmodel?authuser=0#6
Ex: 5.1.4
public static WordRoomDatabase getDatabase(final Context context) { if (INSTANCE == null) { synchronized (WordRoomDatabase.class) { if (INSTANCE == null) { // Create database here } } } return INSTANCE; }