Am I missing something, or do varargs break Arrays.asList?

前端 未结 2 1352
眼角桃花
眼角桃花 2021-01-20 18:50
  private void activateRecords(long[] stuff) {
    ...
    api.activateRecords(Arrays.asList(specIdsToActivate));
  }

Shouldn\'t this call to Array

2条回答
  •  孤街浪徒
    2021-01-20 19:37

    That's because long[] and Long[] are different types.

    In the first case T is long[], in the second T is Long.

    How to fix this? Don't use long[] in the first place?

提交回复
热议问题