Java lang IllegalAccess on collecting Guava Immutable Table via HashBasedTable accumulator

后端 未结 3 714
轮回少年
轮回少年 2020-12-04 01:18

Error while executing below code,

Caused by: java.lang.IllegalAccessError: tried to access class com.google.common.collect.AbstractTable from class

3条回答
  •  温柔的废话
    2020-12-04 01:56

    Interesting, i replaced method references with Lambda expression and it worked.

        ImmutableTable.copyOf(itemList.parallelStream()
                        .map(item ->
                                ProcessorInstanceProvider.get()
                                .buildImmutableTable(item))
                        .collect(() -> HashBasedTable.create(),
                                (a, b) -> a.putAll(b),
                                (a, b) -> a.putAll(b))
                        );
    

提交回复
热议问题