Skip to content

Commit b62b61b

Browse files
Box: annotate varargs methods as safe.
1 parent 7554c98 commit b62b61b

File tree

1 file changed

+4
-2
lines changed
  • objectbox-java/src/main/java/io/objectbox

1 file changed

+4
-2
lines changed

objectbox-java/src/main/java/io/objectbox/Box.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ public long put(T entity) {
339339
/**
340340
* Puts the given entities in a box using a single transaction.
341341
*/
342-
public void put(@Nullable T... entities) {
342+
@SafeVarargs // Not using T... as Object[], no ClassCastException expected.
343+
public final void put(@Nullable T... entities) {
343344
if (entities == null || entities.length == 0) {
344345
return;
345346
}
@@ -488,8 +489,9 @@ public boolean remove(T object) {
488489
/**
489490
* Removes (deletes) the given Objects in a single transaction.
490491
*/
492+
@SafeVarargs // Not using T... as Object[], no ClassCastException expected.
491493
@SuppressWarnings("Duplicates") // Detected duplicate has different type
492-
public void remove(@Nullable T... objects) {
494+
public final void remove(@Nullable T... objects) {
493495
if (objects == null || objects.length == 0) {
494496
return;
495497
}

0 commit comments

Comments
 (0)