Skip to content

Commit 4cf5af1

Browse files
greenrobot-teamgreenrobot
authored andcommitted
Spotbugs: copy array to prevent modification.
1 parent db8a98d commit 4cf5af1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

objectbox-java/src/main/java/io/objectbox/sync/SyncBuilder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.objectbox.sync;
22

3+
import java.util.Arrays;
4+
35
import javax.annotation.Nullable;
46

57
import io.objectbox.BoxStore;
@@ -86,7 +88,8 @@ public SyncBuilder(BoxStore boxStore, String url, SyncCredentials credentials) {
8688
* the certificate authorities trusted by the host platform.
8789
*/
8890
public SyncBuilder trustedCertificates(String[] paths) {
89-
this.trustedCertPaths = paths;
91+
// Copy to prevent external modification.
92+
this.trustedCertPaths = Arrays.copyOf(paths, paths.length);
9093
return this;
9194
}
9295

0 commit comments

Comments
 (0)