3

私は次の設定をしています。

Table<Integer, Integer, Float> store = HashBasedTable.create();

int i = 0, j = 0;

for (List<String> stack_i : stacks) {
  j = 0;

  for (String entry_j : stack_i) {
    Float alpha = doSomeMagic(entry_j, token);
    if (alpha != null)
      store.put(i, j, alpha);
    j++;
  }
  i++;
}

if (store.cellSet().size() > 0) {
  for (Table.Cell<Integer, Integer, Float> cell : store.cellSet()) {
    if (cell.getValue() > max) {
      max = cell.getValue();
      maxchainIndex = cell.getRowKey();
    }
  }
}

私が直面している問題は、次の JVM エラーが発生することです。

SEVERE: java.lang.IllegalAccessError: メソッド com.google.common.collect.Iterators.emptyModifiableIterator()Ljava/util/Iterator; にアクセスしようとしました。クラス com.google.common.collect.StandardTable$CellIterator から com.google.common.collect.StandardTable$CellIterator.(StandardTable.java:310) で com.google.common.collect.StandardTable$CellIterator.(StandardTable.java :306) com.google.common.collect.StandardTable$CellSet.iterator(StandardTable.java:280) で

行でエラーが発生します

for(Table.Cell<Integer,Integer,Float> cell:store.cellSet())

ここで何が間違っているのかわかりません。確認したところ、ストアには少なくとも 1 つのアイテムがあります。

4

1 に答える 1

0

私には問題ないように見えますが、以下を正常に実行できます。for ループに関係のないおかしな作業を排除するために、追加要素なしで実行できますか?

Table<Integer, Integer, Double> abc = HashBasedTable.create();
abc.put(1, 1, 10d);
for (Table.Cell<Integer, Integer, Double> x : abc.cellSet()) {
    System.out.println(x.toString());
}
于 2013-04-08T14:36:11.183 に答える