GeezerVison is showing github.com — BoxStore: make setSyncClient() package private · a200332/objectbox-java@e108fd0
File tree
Expand file treeCollapse file tree
Open diff view settings
objectbox-java/src/main/java/io/objectbox
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/BoxStore.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1178,7 +1178,7 @@ public SyncClient getSyncClient() { |
1178 | 1178 | return syncClient; |
1179 | 1179 | } |
1180 | 1180 |
|
1181 | | - public void setSyncClient(@Nullable SyncClient syncClient) { |
| 1181 | + void setSyncClient(@Nullable SyncClient syncClient) { |
1182 | 1182 | this.syncClient = syncClient; |
1183 | 1183 | } |
1184 | 1184 | } |
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/InternalAccess.java +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
17 | 17 | package io.objectbox; |
18 | 18 |
|
19 | 19 | import io.objectbox.annotation.apihint.Internal; |
| 20 | +import io.objectbox.sync.SyncClient; |
20 | 21 |
|
21 | 22 | @Internal |
22 | 23 | public class InternalAccess { |
@@ -36,6 +37,10 @@ public static long getHandle(Transaction tx) { |
36 | 37 | return tx.internalHandle(); |
37 | 38 | } |
38 | 39 |
|
| 40 | + public static void setSyncClient(BoxStore boxStore, SyncClient syncClient) { |
| 41 | + boxStore.setSyncClient(syncClient); |
| 42 | + } |
| 43 | + |
39 | 44 | public static <T> void releaseReader(Box<T> box, Cursor<T> reader) { |
40 | 45 | box.releaseReader(reader); |
41 | 46 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/sync/SyncClientImpl.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -63,7 +63,7 @@ public class SyncClientImpl implements SyncClient { |
63 | 63 | setLoginCredentials(builder.credentials); |
64 | 64 |
|
65 | 65 | // If created successfully, let store keep a reference so the caller does not have to. |
66 | | - builder.boxStore.setSyncClient(this); |
| 66 | + InternalAccess.setSyncClient(builder.boxStore, this); |
67 | 67 |
|
68 | 68 | if (!builder.manualStart) { |
69 | 69 | start(); |
@@ -169,7 +169,7 @@ public void close() { |
169 | 169 | if (boxStore != null) { |
170 | 170 | SyncClient syncClient = boxStore.getSyncClient(); |
171 | 171 | if (syncClient == this) { |
172 | | - boxStore.setSyncClient(null); |
| 172 | + InternalAccess.setSyncClient(boxStore, null); |
173 | 173 | } |
174 | 174 | this.boxStore = null; |
175 | 175 | } |
|