Skip to content

Commit ac8db66

Browse files
cleanup javadocs, unused imports, and some coding style changes (#134)
* cleanup javadocs, unused imports, and some coding style changes * update changelog to use sentences. D16999
1 parent 7aa2e07 commit ac8db66

File tree

12 files changed

+33
-23
lines changed

12 files changed

+33
-23
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
# Optimizely Android X SDK Changelog
2+
### 1.4.0-beta-RC1
3+
August 2, 2017
4+
5+
- Release candidate for 1.4.0
6+
7+
*Bug Fixes*
8+
9+
- Better javadocs.
10+
- Cleanup any resource leaks.
11+
- Better exception handling to avoid any crashes.
12+
- Fix proguard rules.
13+
- Fix logger issue.
14+
- Allow EventRescheduler to work with wifi change intent filter (you don't have to include that intent filter).
15+
- Remove unused imports.
16+
17+
*Breaking Changes*
18+
19+
- Must include intent filter for EventRescheduler and DatafileRescheduler in the application manifest if the developer wants to use them (see the test-app manifest for an example).
20+
- Pass context into OptimizelyManager.Builder.
21+
- UserProfileService added.
22+
- Background processes are not running by default.
23+
- Various handlers (EventHandler, DatafileHandler, ErrorHandler) can be overridden.
24+
225
### 1.4.0-alpha-RC1
326
July 26, 2017
427

android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class OptimizelyClient {
4747
private final Logger logger;
4848

4949
@Nullable private Optimizely optimizely;
50-
@NonNull private Map<String, String> defaultAttributes;
50+
@NonNull private Map<String, String> defaultAttributes = new HashMap<>();
5151

5252
OptimizelyClient(@Nullable Optimizely optimizely, @NonNull Logger logger) {
5353
this.optimizely = optimizely;
@@ -59,7 +59,6 @@ public class OptimizelyClient {
5959
the public methods here were called before initialize.
6060
So, we start with an empty map of default attributes until the manager is initialized.
6161
*/
62-
defaultAttributes = Collections.EMPTY_MAP;
6362
}
6463

6564
/**

android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class OptimizelyManager {
6161
private final long datafileDownloadInterval;
6262
private final long eventDispatchInterval;
6363
@Nullable private EventHandler eventHandler = null;
64-
@NonNull private ErrorHandler errorHandler;
64+
@Nullable private ErrorHandler errorHandler;
6565
@NonNull private Logger logger;
6666
@NonNull private final String projectId;
6767
@NonNull private UserProfileService userProfileService;

datafile-handler/src/main/java/com/optimizely/ab/android/datafile_handler/BackgroundWatchersCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class BackgroundWatchersCache {
5454
}
5555

5656
/**
57-
* Set the watching flag for the proejct id.
57+
* Set the watching flag for the project id.
5858
* @param projectId project id to set watching.
5959
* @param watching flag to signify if the project is running in the background.
6060
* @return boolean indicating whether the set succeed or not

datafile-handler/src/main/java/com/optimizely/ab/android/datafile_handler/DatafileCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.slf4j.Logger;
2828

2929
/**
30-
* Abstracts the actual data "file" {@link java.io.File}. to a cached file
30+
* Abstracts the actual datafile to a cached file containing the JSONObject as a string.
3131
*/
3232
public class DatafileCache {
3333

@@ -76,7 +76,7 @@ public String getFileName() {
7676

7777
/**
7878
* Loads the datafile from cache into a JSONObject
79-
* @return JSONObject if exists or nulll if it doesn't or there was a problem
79+
* @return JSONObject if exists or null if it doesn't or there was a problem
8080
*/
8181
@Nullable
8282
public JSONObject load() {

datafile-handler/src/main/java/com/optimizely/ab/android/datafile_handler/DatafileClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import org.slf4j.Logger;
2525

26-
import java.io.IOException;
2726
import java.net.HttpURLConnection;
2827
import java.net.URL;
2928

datafile-handler/src/main/java/com/optimizely/ab/android/datafile_handler/DatafileLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ private static class LoadDatafileFromCacheTask extends AsyncTask<Void, Void, JSO
9696

9797
LoadDatafileFromCacheTask(@NonNull DatafileCache datafileCache,
9898
@NonNull DatafileLoader datafileLoader,
99-
@Nullable DatafileLoadedListener dataFileLoadedListner) {
99+
@Nullable DatafileLoadedListener dataFileLoadedListener) {
100100
this.datafileCache = datafileCache;
101101
this.datafileLoader = datafileLoader;
102-
this.datafileLoadedListener = dataFileLoadedListner;
102+
this.datafileLoadedListener = dataFileLoadedListener;
103103
}
104104

105105
@Override

event-handler/src/main/java/com/optimizely/ab/android/event_handler/EventDispatcher.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.optimizely.ab.android.event_handler;
1818

19-
import android.app.AlarmManager;
2019
import android.content.Context;
2120
import android.content.Intent;
2221
import android.support.annotation.NonNull;

event-handler/src/main/java/com/optimizely/ab/android/event_handler/EventRescheduler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import android.content.BroadcastReceiver;
2121
import android.content.Context;
2222
import android.content.Intent;
23-
import android.net.NetworkInfo;
2423
import android.net.wifi.WifiManager;
2524
import android.support.annotation.NonNull;
2625

shared/src/main/java/com/optimizely/ab/android/shared/Cache.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.io.BufferedReader;
2626
import java.io.FileInputStream;
2727
import java.io.FileOutputStream;
28-
import java.io.IOException;
2928
import java.io.InputStreamReader;
3029
import java.util.Arrays;
3130

0 commit comments

Comments
 (0)