|
8 | 8 |
|
9 | 9 | import android.annotation.SuppressLint;
|
10 | 10 |
|
11 |
| -import android.util.Base64; |
12 | 11 | import android.util.Log;
|
13 | 12 |
|
14 | 13 | import java.io.File;
|
| 14 | + |
15 | 15 | import java.lang.IllegalArgumentException;
|
16 | 16 | import java.lang.Number;
|
17 |
| -import java.util.concurrent.ConcurrentHashMap; |
| 17 | + |
| 18 | +import java.util.Map; |
18 | 19 | import java.util.concurrent.BlockingQueue;
|
| 20 | +import java.util.concurrent.ConcurrentHashMap; |
19 | 21 | import java.util.concurrent.LinkedBlockingQueue;
|
| 22 | + |
20 | 23 | import java.util.regex.Matcher;
|
21 | 24 | import java.util.regex.Pattern;
|
22 | 25 |
|
|
27 | 30 | import org.json.JSONException;
|
28 | 31 | import org.json.JSONObject;
|
29 | 32 |
|
30 |
| -import java.io.FileOutputStream; |
31 |
| -import java.io.InputStream; |
32 |
| -import java.io.OutputStream; |
33 |
| -import java.io.IOException; |
34 |
| - |
35 | 33 | public class SQLitePlugin extends CordovaPlugin {
|
36 | 34 |
|
37 | 35 | /**
|
38 | 36 | * Multiple database runner map (static).
|
39 |
| - * NOTE: no public static accessor to db (runner) map since it would not work with db threading. |
40 |
| - * FUTURE put DBRunner into a public class that can provide external accessor. |
| 37 | + * |
| 38 | + * NOTE: no public static accessor to db (runner) map since it is not |
| 39 | + * expected to work properly with db threading. |
| 40 | + * |
| 41 | + * FUTURE TBD put DBRunner into a public class that can provide external accessor. |
| 42 | + * |
| 43 | + * ADDITIONAL NOTE: Storing as Map<String, DBRunner> to avoid portabiity issue |
| 44 | + * between Java 6/7/8 as discussed in: |
| 45 | + * https://gist.github.com/AlainODea/1375759b8720a3f9f094 |
| 46 | + * |
| 47 | + * THANKS to @NeoLSN (Jason Yang/楊朝傑) for giving the pointer in: |
| 48 | + * https://github.com/litehelpers/Cordova-sqlite-storage/issues/727 |
41 | 49 | */
|
42 |
| - static ConcurrentHashMap<String, DBRunner> dbrmap = new ConcurrentHashMap<String, DBRunner>(); |
| 50 | + static Map<String, DBRunner> dbrmap = new ConcurrentHashMap<String, DBRunner>(); |
43 | 51 |
|
44 | 52 | /**
|
45 | 53 | * NOTE: Using default constructor, no explicit constructor.
|
|
0 commit comments